/* Extracted workbench/date/photo/role polish layer from styles.css. Keep this file loaded after styles.css. */

/* Linear-inspired workbench polish: calmer panels, compact expandable rows */
.is-hidden, .hidden { display: none !important; }
.dashboard-workspaces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.workspace-card { position: relative; overflow: hidden; display: grid; gap: 12px; align-content: start; min-height: 260px; padding: 18px; border: 1px solid rgba(143,79,95,.18); border-radius: 24px; background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(255,248,248,.88)); box-shadow: 0 18px 45px rgba(42,31,34,.08); }
.workspace-card::after { content: ''; position: absolute; inset: auto -30px -46px auto; width: 150px; height: 150px; border-radius: 999px; background: rgba(143,79,95,.10); }
.workspace-card h2 { font-size: 30px; letter-spacing: 0; }
.workspace-card > b { font-size: 42px; line-height: .95; color: var(--brand); }
.workspace-card.sales-workspace { border-color: rgba(143,72,80,.24); background: linear-gradient(145deg, #fffdfb, var(--sales-bg)); }
.workspace-card.store-workspace { border-color: rgba(122,98,82,.24); background: linear-gradient(145deg, #fffdfb, var(--store-bg)); }
.workspace-card.system-workspace { border-color: rgba(118,85,100,.24); background: linear-gradient(145deg, #fffdfb, var(--system-bg)); }
.workspace-card.sales-workspace > b { color: var(--sales); }
.workspace-card.store-workspace > b { color: var(--store); }
.workspace-card.system-workspace > b { color: var(--system); }
.workspace-card small { color: var(--muted); font-weight: 800; }
.workspace-actions { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.system-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.system-metrics span { display: grid; gap: 3px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.72); color: var(--muted); font-size: 12px; font-weight: 800; }
.system-metrics b { color: var(--ink); font-size: 20px; }
.ops-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); margin: 14px 0; }
.ops-toolbar p { margin: 0; }
.cs-filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 200px minmax(310px, 1fr); }
.compact-table table { min-width: 980px; }
.compact-table th,
.compact-table td {
  padding: 9px 10px;
}
.summary-row td, .audit-summary-row td { vertical-align: middle; }
.details-row td, .audit-detail-row td { background: #fffafb; padding: 0; }
.detail-panel { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 14px; padding: 14px; min-width: 0; max-width: 100%; overflow: hidden; border-radius: 16px; background: #fffdfb; }
.record-detail-text, .full-record { min-width: 0; max-width: 100%; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.record-detail-list { display: grid; gap: 8px; min-width: 0; max-width: 100%; margin: 0; padding: 0; overflow: hidden; }
.detail-item { display: grid; grid-template-columns: minmax(112px, .34fr) minmax(0, 1fr); align-items: start; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.82); min-width: 0; }
.detail-item dt { color: var(--muted); font-size: 11px; font-weight: 950; text-transform: none; letter-spacing: 0; }
.detail-item dd { margin: 0; min-width: 0; overflow-wrap: anywhere; word-break: break-word; font-weight: 750; }
.detail-item-payment-row dd { white-space: normal; }
.split-records .detail-panel, .cs-card .detail-panel { grid-template-columns: 1fr; }
.split-records .detail-item, .cs-card .detail-item { grid-template-columns: 1fr; gap: 4px; }
.empty-detail { padding: 14px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); background: rgba(255,255,255,.78); }
.photo-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; background: var(--photo-bg); color: var(--photo); font-size: 12px; font-weight: 900; }
.payment-style-pill { display: inline-flex; align-items: center; width: max-content; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 950; }
.payment-style-card { background: var(--qr-bg); color: var(--qr); }
.payment-style-cash { background: var(--store-bg); color: var(--store); }
.payment-style-transfer { background: var(--payment-bg); color: var(--payment); }
.payment-style-other { background: var(--system-bg); color: var(--system); }
.amount-cell { display: grid; gap: 2px; min-width: 118px; line-height: 1.2; }
.amount-cell b { color: var(--ink); font-size: 13px; white-space: nowrap; }
.amount-cell small { color: var(--muted); font-size: 11px; font-weight: 850; white-space: nowrap; }
.amount-cell-payment small:first-of-type { color: var(--payment); }
.document-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 1px 2px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 950;
  text-align: left;
  line-height: 1.2;
  cursor: pointer;
}
.document-link:hover,
.document-link:focus-visible {
  background: #fff2f5;
  color: var(--sales);
  outline: 2px solid rgba(143,79,95,.16);
  outline-offset: 2px;
}
.qr-scan-card { max-width: 760px; }
.qr-scan-form { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 12px; align-items: end; }
.qr-scan-form .field { margin: 0; }
.qr-scan-form .btn { min-height: 46px; }
.qr-image-tools { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 12px; align-items: end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.qr-image-tools .field { margin: 0; }
.qr-image-tools input[type="file"] { min-height: 44px; padding-top: 11px; }
.qr-image-tools .btn { min-height: 46px; }
.operation-type-pill { display: inline-flex; align-items: center; width: max-content; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 950; background: var(--store-bg); color: var(--store); }
.operation-type-delivery { background: var(--task-bg); color: var(--task); }
.operation-type-customer-return { background: #fff0e8; color: #b5532d; }
.operation-type-supplier-return { background: var(--system-bg); color: var(--system); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; align-content: start; }
.photo-thumb { margin: 0; min-height: 112px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 8px 22px rgba(42,31,34,.06); }
button.photo-thumb { width: 100%; padding: 0; color: inherit; text-align: left; cursor: zoom-in; }
button.photo-thumb:hover { border-color: var(--photo); box-shadow: 0 10px 28px rgba(176,71,126,.16); transform: translateY(-1px); }
button.photo-thumb[data-photo-error="1"] { border-color: rgba(190,42,42,.42); background: #fff7f7; box-shadow: none; }
button.photo-thumb[data-photo-error="1"]::after { content: ''; display: block; height: 3px; margin: 0 8px 8px; border-radius: 999px; background: var(--danger); opacity: .72; }
.photo-thumb img { width: 100%; height: 92px; object-fit: cover; display: block; background: #f3f0f1; }
.photo-thumb.placeholder { display: grid; place-items: center; text-align: center; padding-top: 14px; }
.photo-thumb.placeholder span { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: white; font-weight: 900; font-size: 12px; }
.photo-thumb figcaption, .photo-thumb > span, .photo-thumb small { padding: 7px 8px; color: var(--muted); font-size: 11px; font-weight: 800; word-break: break-word; }
.empty-photo { padding: 14px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.audit-detail-row pre { margin: 0; padding: 14px; white-space: pre-wrap; color: var(--ink); font-size: 12px; }
.staff-name-note {
  appearance: none;
  display: inline;
  margin: 0;
  padding: 1px 3px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: inherit;
  cursor: pointer;
}
.staff-name-note:hover,
.staff-name-note:focus-visible {
  background: #fff2f5;
  color: var(--brand);
  outline: none;
}
.staff-note-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding: 3px 7px;
  border: 1px solid #eadbdd;
  border-radius: 999px;
  background: #fff8fb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  vertical-align: middle;
  white-space: nowrap;
}
.staff-note-inline b {
  color: var(--brand);
  font-size: 11px;
}
.staff-note-inline small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.staff-note-tooltip {
  position: fixed;
  z-index: 120;
  display: grid;
  gap: 3px;
  min-width: 160px;
  max-width: min(260px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid #d8c6cc;
  border-radius: 10px;
  background: #fffdfb;
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(42,31,34,.18);
  font-size: 12px;
  line-height: 1.25;
}
.staff-note-tooltip::before {
  content: '';
  position: absolute;
  left: 16px;
  top: -6px;
  width: 10px;
  height: 10px;
  border-left: 1px solid #d8c6cc;
  border-top: 1px solid #d8c6cc;
  background: #fffdfb;
  transform: rotate(45deg);
}
.staff-note-tooltip b {
  color: var(--brand);
  font-size: 12px;
}
.staff-note-tooltip span {
  color: var(--muted);
  font-weight: 850;
}
.readonly-name-field {
  min-height: 46px;
  display: flex;
  align-items: center;
}
@media (max-width: 1100px) { .dashboard-workspaces { grid-template-columns: 1fr; } .cs-filter-bar { grid-template-columns: 1fr; } .detail-panel { grid-template-columns: 1fr; } .task-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.nav-section { display: grid; gap: 4px; padding: 6px 0; border-top: 1px solid var(--line); }
.nav-section-title { color: var(--brand); font-size: 10px; font-weight: 950; letter-spacing: 0; text-transform: none; padding: 3px 10px; }
.secure-login-card { max-width: 980px; }
.secure-login-note { display: grid; gap: 12px; align-content: center; min-height: 330px; padding: 28px; border: 1px solid rgba(255,255,255,.28); border-radius: 26px; background: linear-gradient(145deg, rgba(143,79,95,.96), rgba(192,138,150,.78)); color: #fff; overflow: hidden; position: relative; }
.secure-login-note::after { content: ''; position: absolute; width: 210px; height: 210px; border-radius: 50%; right: -60px; top: -70px; background: rgba(255,255,255,.16); }
.secure-login-note .badge { width: fit-content; background: rgba(255,255,255,.22); color: #fff; }
.secure-login-note h2 { position: relative; z-index: 1; font-size: clamp(34px, 5vw, 58px); line-height: .98; letter-spacing: 0; }
.secure-login-note p { position: relative; z-index: 1; max-width: 560px; margin: 0; color: rgba(255,255,255,.88); font-weight: 700; }
.secure-login-note .login-trust-row { position: relative; z-index: 1; }

.task-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.task-card { position: relative; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.82); padding: 14px; box-shadow: 0 10px 28px rgba(42,31,34,.06); }
.task-card.task-store { border-left: 5px solid var(--store); background: linear-gradient(145deg, #ffffff, var(--store-bg)); }
.task-card.task-sales { border-left: 5px solid var(--sales); background: linear-gradient(145deg, #ffffff, var(--sales-bg)); }
.task-card.task-completed, .task-card.is-completed { border-left-color: var(--ok); background: linear-gradient(145deg, #ffffff, #edf8f0); }
.task-card h3 { margin: 0; }
.task-card p { margin: 0; }
.task-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-card-select + div .task-card-head,
.task-card-select + div h3 {
  padding-right: 42px;
}
.task-summary-list { display: grid; gap: 7px; margin: 10px 0 0; }
.task-summary-list div { display: grid; grid-template-columns: 95px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-top: 1px solid #f1e7ea; }
.task-summary-list dt { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: none; }
.task-summary-list dd { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.payment-approval-main div:nth-child(5) dd,
.payment-approval-main div:nth-child(6) dd {
  color: var(--brand);
}
.task-view-details {
  margin-top: 10px;
  border: 1px solid #f1e7ea;
  border-radius: 16px;
  background: rgba(255,255,255,.66);
  overflow: hidden;
}
.task-view-details > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--brand);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}
.task-view-details > summary::-webkit-details-marker {
  display: none;
}
.task-view-details > summary::after {
  content: '▾';
  font-size: 11px;
}
.task-view-details:not([open]) > summary::after {
  transform: rotate(-90deg);
}
.task-view-details .task-summary-list {
  margin: 0 10px 10px;
}
.task-view-details .photo-grid,
.task-view-details .completion-proof,
.task-view-details .task-qr-actions {
  margin: 10px;
}
.payment-approval-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px dashed var(--brand-2);
  border-radius: 14px;
  background: rgba(255,248,248,.86);
}
.payment-approval-panel.is-hidden {
  display: none;
}
.payment-approval-panel .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.payment-approval-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, .45fr);
  gap: 8px;
  margin: 0;
}

.task-filters { display: grid; grid-template-columns: minmax(220px, 1fr) 220px minmax(240px, .8fr); gap: 10px; margin: 14px 0; }
.task-section { display: grid; gap: 10px; margin-top: 14px; }
.task-section > h3 { font-size: 16px; color: var(--brand); }
.completed-task-section { border-top: 1px dashed var(--line); padding-top: 14px; }
.task-card.is-completed { opacity: .88; background: rgba(248,241,243,.86); }
.complete-proof-field { padding: 10px; border: 1px dashed var(--brand-2); border-radius: 14px; background: rgba(255,248,248,.7); }
.task-qr-actions { display: grid; justify-items: center; gap: 9px; margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 14px; background: rgba(255,255,255,.72); }
.task-qr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.task-qr-actions p, .task-qr-actions small { margin: 0; color: var(--muted); font-size: 12px; font-weight: 750; }
.qr-code-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.qr-code-card { margin: 0; display: grid; justify-items: center; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: #fff; min-width: 0; }
.qr-code-zoom { display: grid; place-items: center; padding: 0; background: transparent; border: 0; border-radius: 12px; cursor: zoom-in; }
.qr-code-card img { width: 132px; height: 132px; border-radius: 10px; image-rendering: pixelated; background: #fff; }
.qr-code-card figcaption { display: grid; gap: 3px; width: 100%; min-width: 0; text-align: center; }
.qr-code-card b { color: var(--brand); font-size: 12px; }
.qr-preview-modal .modal-card { max-width: 94vw; }
.qr-preview-card { width: min(520px, 94vw); }
.qr-preview-body { display: grid; place-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.qr-preview-body img { width: min(420px, 78vw); height: min(420px, 78vw); image-rendering: pixelated; }
.qr-token-list { display: grid; gap: 6px; }
.qr-token-pill { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 7px; align-items: center; padding: 7px 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.qr-token-pill b { color: var(--brand); font-size: 12px; }
.qr-token-pill em { color: var(--muted); font-size: 11px; font-style: normal; overflow-wrap: anywhere; }
.task-card .tabs.task-action-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 9px; align-items: stretch; margin: 12px 0 0; }
.task-action-panel .btn { width: 100%; min-height: 46px; justify-content: center; border-radius: 14px; }
.task-primary-action { font-size: 13px; }
.task-danger-zone { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px; align-items: end; padding: 9px; border: 1px solid #f0d5d1; border-radius: 16px; background: #fff8f6; }
.task-danger-zone .field { margin: 0; }
.task-delete-reason textarea { min-height: 72px; }
.task-danger-zone .btn.danger { width: auto; min-width: 90px; }
.completion-proof { display: grid; gap: 8px; margin-top: 10px; }
@media (max-width: 760px) { .task-filters { grid-template-columns: 1fr; } .task-board, .date-range-control { grid-template-columns: 1fr; } .range-arrow { padding-bottom: 0; text-align: center; } }


.date-range-control { display: grid; grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr); align-items: end; gap: 7px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.hotel-date-range label { display: grid; gap: 4px; }
.date-range-control input { padding: 8px; min-width: 0; }
.range-start, .range-end { width: max-content; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 950; color: #fff; }
.range-start { background: #765564; }
.range-end { background: var(--brand); }
.range-arrow { color: var(--brand); font-weight: 950; padding-bottom: 9px; }
.calendar .day { text-align: left; border: 1px solid var(--line); }
.calendar .day.selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(155,100,112,.16); background: #fff8fb; }
.calendar-day-panel { margin: 12px 0 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.82); padding: 14px; }
.calendar-day-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px dashed var(--line); }
.calendar-day-counts { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 850; }
.calendar-day-counts b { color: var(--brand); font-size: 28px; line-height: 1; }
.calendar-day-counts em { border-radius: 999px; padding: 5px 8px; background: #f1e7ea; color: var(--brand); font-style: normal; font-weight: 900; }
.calendar-day-list { display: grid; gap: 8px; }
.calendar-day-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.calendar-day-copy { display: grid; gap: 3px; min-width: 0; }
.calendar-day-copy small { color: var(--muted); font-weight: 800; }
.calendar-day-item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.calendar-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.calendar-plus-btn { width: 42px; height: 42px; border-radius: 999px; justify-content: center; font-size: 22px; line-height: 1; padding: 0; }
.calendar-event-form { margin: 12px 0 14px; padding: 12px; border: 1px dashed var(--line); border-radius: 16px; background: rgba(255,255,255,.72); }
.more-events { color: var(--brand); font-weight: 900; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.form-collapse-icon { min-width: 88px; }
.photo-uploader { display: grid; gap: 8px; }
.photo-uploader[aria-disabled="true"] { opacity: .72; cursor: not-allowed; }
.photo-uploader[aria-disabled="true"] .photo-add-card,
.photo-uploader[aria-disabled="true"] .photo-source-btn { background: #f6eef1; color: var(--muted); cursor: not-allowed; }
.photo-uploader[aria-disabled="true"] input[type="file"] { pointer-events: none; }
.photo-upload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.photo-choice { min-width: 0; display: grid; gap: 6px; padding: 10px; border: 1px dashed var(--line); border-radius: 14px; background: #fff; }
.photo-choice span { color: var(--brand); font-size: 12px; font-weight: 900; }
.photo-choice input { padding: 8px; }
.completion-remark { margin: 0; font-size: 13px; }

/* Hotel-style date range picker + Document Database cards */
.date-range-control { position: relative; display: block; padding: 0; background: transparent; border: 0; }
.range-summary { width: 100%; display: grid; grid-template-columns: auto 1fr auto auto 1fr; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 15px; background: #fff; color: var(--ink); text-align: left; }
.range-summary b { font-size: 13px; }
.range-calendar-panel { position: absolute; z-index: 30; right: 0; top: calc(100% + 8px); width: min(390px, 92vw); padding: 12px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(42,31,34,.2); }
.range-calendar-head { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 8px; margin-bottom: 10px; text-align: center; }
.range-weekdays, .range-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.range-weekdays span { text-align: center; color: var(--muted); font-size: 12px; font-weight: 800; padding: 5px 0; }
.range-day { position: relative; min-height: 42px; border-radius: 0; background: #fff; color: var(--ink); font-weight: 850; display: grid; place-items: center; gap: 1px; }
.range-day.is-blank { min-height: 42px; }
.range-day.range-in-between { background: var(--soft-accent-bg); }
.range-day.range-selected { background: var(--soft-accent); color: #fff; border-radius: 999px; }
.range-day.range-start-cell { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.range-day.range-end-cell { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.range-event-dot { width: 5px; height: 5px; border-radius: 999px; background: #f2a000; display: block; }
.range-selected .range-event-dot { background: #fff; }
.range-day:hover { background: #f5cbd4; }
.range-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.cs-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cs-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.86); box-shadow: 0 10px 28px rgba(42,31,34,.06); }
.cs-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 850; }
.cs-card h3 { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 0; }
.doc-badge { display: inline-flex; border-radius: 999px; padding: 7px 10px; background: #f1e7ea; color: var(--brand); font-size: 12px; font-weight: 950; }
.gr-badge { background: #fff1d8; color: #8a5a00; }
.cs-card-details { border-top: 1px dashed var(--line); padding-top: 10px; max-height: min(520px, 70vh); overflow: auto; min-width: 0; }
@media (max-width: 1100px) { .cs-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .range-summary { grid-template-columns: 1fr; } .range-calendar-panel { position: fixed; left: 10px; right: 10px; top: 70px; width: auto; } .range-footer, .cs-card-grid { grid-template-columns: 1fr; } }

/* clearer permission cards */
.permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.permission-group-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.78); }
.permission-group-card h3 { color: var(--brand); font-size: 15px; }
.permission-save-bar { position: sticky; bottom: 10px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,248,248,.96); box-shadow: 0 14px 35px rgba(42,31,34,.10); }
.permission-save-bar span { color: var(--muted); font-weight: 800; font-size: 13px; }
@media (max-width: 1100px) { .permission-grid { grid-template-columns: 1fr; } }

.uploaded-photo-queue { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.uploaded-photo-icon { display: inline-grid; grid-template-columns: auto minmax(0, 90px) auto; gap: 5px; align-items: center; max-width: 150px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 11px; font-weight: 850; }
.uploaded-photo-icon b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploaded-photo-icon em { color: var(--danger); font-style: normal; font-weight: 950; }

/* Card-style photo uploader: one obvious add card + queued photo cards */
.photo-card-uploader { gap: 10px; }
.photo-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 10px; align-items: stretch; }
.photo-add-card, .photo-preview-card { min-height: 122px; border: 1px dashed var(--brand-2); border-radius: 18px; background: rgba(255,255,255,.86); color: var(--ink); display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; padding: 12px; box-shadow: 0 8px 22px rgba(42,31,34,.06); }
.photo-add-card { cursor: pointer; }
.photo-add-card:hover { background: #fff8fb; border-color: var(--soft-accent); }
.photo-add-card input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.photo-add-icon { width: 42px; height: 42px; border: 0; padding: 0; border-radius: 16px; display: grid; place-items: center; background: var(--soft-accent-bg); color: var(--brand); font-size: 26px; font-weight: 950; cursor: pointer; }
.photo-add-icon:hover,
.photo-add-icon:focus-visible { background: #f2d7df; outline: 2px solid rgba(157,79,104,.22); outline-offset: 2px; }
.photo-add-card b, .photo-preview-card b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.photo-add-card em, .photo-preview-card em { color: var(--muted); font-style: normal; font-size: 11px; font-weight: 850; }
.photo-preview-card { position: relative; border-style: solid; overflow: hidden; cursor: pointer; }
.photo-preview-card img { width: 100%; height: 76px; object-fit: cover; border-radius: 12px; background: #f3f0f1; }
.photo-preview-card:hover em { color: var(--danger); }
.photo-preview-icon { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: #f7eef1; font-size: 24px; }


/* Daily workbench, stable statuses, and phone-first record entry */
.today-workbench { display: grid; gap: 14px; margin-bottom: 14px; }
.workbench-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, #fffdfb, #f8eef1); box-shadow: 0 12px 35px rgba(42,31,34,.07); }
.workbench-hero h2 { font-size: clamp(28px, 4vw, 46px); letter-spacing: 0; }
.workbench-date { display: grid; justify-items: end; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); }
.workbench-date b { color: var(--brand); }
.today-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.today-summary-card { text-align: left; display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.86); color: var(--ink); box-shadow: 0 8px 22px rgba(42,31,34,.05); }
.today-summary-card span { font-size: 24px; }
.today-summary-card b { font-size: 30px; color: var(--brand); }
.today-summary-card em { color: var(--muted); font-style: normal; font-weight: 900; }
.need-action-list { display: grid; gap: 8px; }
.need-action-list button { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 10px; align-items: center; text-align: left; padding: 10px; border-radius: 14px; background: #fff; color: var(--ink); border: 1px solid var(--line); }
.need-action-list b { color: var(--brand); font-size: 22px; }
.status-badge { display: inline-flex; align-items: center; width: max-content; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 950; background: #f1e7ea; color: var(--brand); }
.status-badge::before { content: ''; width: 7px; height: 7px; border-radius: 999px; margin-right: 6px; background: currentColor; box-shadow: 0 0 0 2px rgba(255,255,255,.78); }
.status-pending { background: var(--warning-bg); color: #8a5a00; }
.status-active { background: #eaf7ed; color: #287640; }
.status-accepted { background: var(--qr-bg); color: var(--qr); }
.status-available { background: var(--store-bg); color: var(--ok); }
.status-partially-confirmed { background: #fff4d6; color: #9a5c00; }
.status-completed { background: var(--store-bg); color: var(--ok); }
.status-discontinued { background: #ece8e7; color: #786568; }
.status-deleted { background: #ffe4df; color: var(--danger); }
.status-edited { background: var(--task-bg); color: var(--task); }
.status-record { background: var(--system-bg); color: var(--system); }
.status-abandoned { background: #f3f0f1; color: #6d5960; }
.status-edited, .status-record { background: var(--system-bg); color: var(--system); }
.status-photo, .status-no-photo { background: var(--photo-bg); color: var(--photo); }
.record-status-line { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.step-form { display: grid; gap: 12px; }
.record-step-card { position: relative; display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); }
.record-step-card h3 { padding-left: 34px; color: var(--brand); font-size: 15px; }
.step-number { position: absolute; left: 14px; top: 13px; width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 12px; font-weight: 950; }
@media (max-width: 760px) { .today-summary-grid, .workbench-hero { grid-template-columns: 1fr; display: grid; } .workbench-date { justify-items: start; } .record-step-card { padding: 16px 12px; border-radius: 16px; } .record-step-card .grid-2, .record-step-card .grid-3, .record-step-card .grid-4 { grid-template-columns: 1fr; } .nav-btn { min-height: 42px; } .calendar-day-item { grid-template-columns: 1fr; } }

.duplicate-invoice-alert { display: inline-flex; margin-top: 6px; padding: 8px 10px; border-radius: 12px; border: 1px solid #f0c36d; background: #fff8e6; color: #875400; font-weight: 900; }
.duplicate-invoice-alert::before { content: '⚠️'; margin-right: 6px; }
.duplicate-invoice-alert.duplicate-blocked { border-color: #df9aa5; background: #fff1f3; color: #8f4f5f; }

.repeated-invoice-badge { display: inline-flex; align-items: center; width: max-content; margin-top: 5px; padding: 5px 9px; border-radius: 999px; background: #ffe08a; color: #6f4000; border: 2px solid #e3a51b; font-size: 11px; font-weight: 1000; box-shadow: 0 2px 8px rgba(138,90,0,.14); cursor: pointer; appearance: none; }
.repeated-invoice-badge:hover { background: #ffd765; transform: translateY(-1px); }


/* 2026-05 layout fixes: permission matrix, modal checkbox, and range summary */
.permission-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.permission-group-card { min-width: 0; max-width: 100%; overflow: hidden; }
.permission-row { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: start; width: 100%; min-width: 0; padding: 12px; }
.permission-row > b { min-width: 0; font-size: 16px; line-height: 1.2; }
.permission-toggles { display: grid; grid-template-columns: repeat(auto-fit, minmax(102px, 1fr)); gap: 8px; min-width: 0; }
.permission-toggle { min-width: 0; padding: 8px 9px; border: 1px solid #f1e7ea; border-radius: 12px; background: #fffdfb; }
.permission-toggle span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; overflow-wrap: normal; word-break: keep-all; }
.active-toggle { width: max-content; max-width: 100%; white-space: nowrap; margin: 18px 0 8px; padding: 8px 2px; }
.active-toggle span { white-space: nowrap; }
.range-summary { grid-template-columns: minmax(164px, 1fr) auto minmax(164px, 1fr); gap: 10px; }
.range-boundary { display: grid; grid-template-columns: 1fr; gap: 4px; min-width: 0; padding: 10px 12px; border-radius: 14px; background: #f7f3f3; color: var(--ink); text-align: left; }
.range-boundary.active { box-shadow: 0 0 0 2px rgba(155,100,112,.22); background: #fff8fb; }
.range-boundary span { width: max-content; max-width: 100%; }
.range-boundary strong { display: block; min-width: 0; }
.range-boundary b { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; color: var(--ink); }
@media (max-width: 760px) { .permission-grid { grid-template-columns: 1fr; } .range-summary { grid-template-columns: 1fr; } .range-arrow { display: none; } }


/* Compact inline filter bars: date range sits beside search/select to save vertical space */
.cs-filter-bar { grid-template-columns: minmax(210px, 1fr) minmax(126px, .34fr) minmax(145px, .40fr) minmax(116px, .32fr) minmax(260px, .62fr); align-items: stretch; }
.task-filters { grid-template-columns: minmax(220px, 1fr) minmax(170px, .40fr) minmax(260px, .62fr); align-items: stretch; }


/* 2026-05 compact calendar trigger + optimized permission groups */
.date-range-control { position: relative; }
.range-trigger { width: 100%; min-height: 48px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); text-align: left; box-shadow: 0 8px 22px rgba(42,31,34,.05); }
.calendar-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 12px; background: var(--soft-accent-bg); color: var(--brand); font-size: 18px; }
.range-picker-label { display: grid; gap: 2px; min-width: 0; }
.range-picker-label small { color: var(--muted); font-size: 10px; font-weight: 950; text-transform: none; letter-spacing: 0; }
.range-picker-label b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.range-trigger-caret { color: var(--brand); font-weight: 950; }
.range-calendar-panel { position: fixed; top: 84px; right: clamp(16px, 3vw, 44px); width: min(430px, 92vw); padding: 14px; max-height: calc(100vh - 108px); overflow-y: auto; overscroll-behavior: contain; }
.range-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.range-boundary { display: grid; gap: 3px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: #f8f4f4; color: var(--ink); text-align: left; }
.range-boundary.active { border-color: var(--brand); background: #fff8fb; box-shadow: 0 0 0 3px rgba(155,100,112,.14); }
.range-boundary span { color: var(--muted); font-size: 11px; font-weight: 950; text-transform: none; }
.range-boundary b { white-space: nowrap; font-size: 13px; }
.range-calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 14px; }
.range-month-label { background: transparent; color: var(--ink); font-size: 18px; font-weight: 950; padding: 4px 0; }
.range-month-actions { display: flex; align-items: center; gap: 18px; }
.range-nav { width: 36px; height: 36px; display: grid; place-items: center; background: transparent; color: var(--ink); font-size: 32px; line-height: 1; }
.range-weekdays span { font-size: 13px; color: var(--ink); font-weight: 950; }
.range-calendar-grid { gap: 5px; }
.range-day { min-height: 38px; border-radius: 10px; font-size: 16px; }
.range-day.range-out { color: #9b9093; }
.range-day.range-selected { background: var(--brand); color: #fff; border-radius: 8px; box-shadow: inset 0 0 0 3px rgba(143,79,95,.28); }
.range-day.range-in-between { background: var(--soft-accent-bg); color: var(--brand); }
.range-footer { display: flex; justify-content: space-between; align-items: center; border-top: 0; margin-top: 12px; padding-top: 4px; }
.range-footer button { background: transparent; color: var(--brand); font-size: 16px; font-weight: 850; padding: 8px 4px; }
.permission-shell { overflow: visible; }
.permission-page-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); gap: 14px; align-items: start; margin-bottom: 14px; }
.permission-role-select { margin: 0; }
.permission-grid { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: stretch; }
.permission-group-card { display: grid; gap: 10px; padding: 14px; overflow: visible; }
.permission-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.permission-group-head span { color: var(--muted); font-size: 12px; font-weight: 900; }
.permission-card-list { display: grid; gap: 8px; }
.permission-row { grid-template-columns: minmax(170px, .26fr) minmax(0, 1fr); align-items: center; gap: 12px; }
.permission-module-title { display: grid; gap: 3px; min-width: 0; }
.permission-module-title b { font-size: 15px; }
.permission-module-title small { color: var(--muted); font-weight: 850; }
.permission-toggles { grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)); }
.permission-toggle { padding: 8px 10px; }
.audit-log-card > p { margin-top: 0; font-size: 16px; }
@media (max-width: 760px) { .permission-page-head, .permission-row { grid-template-columns: 1fr; } .range-calendar-panel { position: fixed; left: 10px; right: 10px; top: 70px; width: auto; } }


/* Denser Role Permission: full-width groups but shorter rows and tighter pills */
.permission-group-card { padding: 10px; gap: 7px; }
.permission-group-head { padding-bottom: 6px; }
.permission-group-head h3 { font-size: 14px; }
.permission-card-list { gap: 6px; }
.permission-row { grid-template-columns: minmax(130px, .20fr) minmax(0, 1fr); gap: 8px; padding: 6px 8px; border-radius: 12px; }
.permission-module-title b { font-size: 13px; }
.permission-module-title small { font-size: 10px; }
.permission-toggles { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 5px; }
.permission-toggle { min-height: 30px; padding: 5px 7px; gap: 4px; font-size: 11px; border-radius: 10px; }
.permission-toggle input { width: 14px; height: 14px; }
.permission-save-bar { padding: 9px 10px; margin-top: 10px; }
@media (max-width: 1120px) { .cs-filter-bar, .task-filters { grid-template-columns: 1fr 1fr; } .cs-filter-bar .date-range-control, .task-filters .date-range-control { grid-column: auto; } }
@media (max-width: 760px) { .cs-filter-bar, .task-filters { grid-template-columns: 1fr; } .cs-filter-bar .date-range-control, .task-filters .date-range-control { grid-column: auto; } }


/* Document Database Scheme I: date-window range heatmap */
.cs-heatmap-shell { display: grid; gap: 12px; margin-top: 14px; }
.cs-heatmap-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); }
.cs-heatmap-title h3 { margin-top: 6px; }
.cs-heatmap-title p { margin: 4px 0 0; }
.cs-heatmap-count { display: grid; justify-items: end; color: var(--muted); font-size: 12px; font-weight: 850; }
.cs-heatmap-count b { color: var(--brand); font-size: 26px; line-height: 1; }
.cs-heatmap { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); gap: 8px; }
.cs-date-lane { min-width: 0; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,251,.9); overflow: hidden; }
.cs-date-lane.no-data { background: rgba(250,247,246,.8); }
.cs-date-head { display: grid; gap: 2px; padding: 10px; border-bottom: 1px solid var(--line); background: #fff8fb; }
.cs-date-head span { color: var(--brand); font-size: 11px; font-weight: 950; text-transform: none; letter-spacing: 0; }
.cs-date-head b { font-size: 13px; }
.cs-date-head em { color: var(--muted); font-size: 11px; font-style: normal; font-weight: 850; }
.cs-heat-cells { display: grid; gap: 7px; padding: 9px; align-content: start; min-height: 104px; }
.cs-heat-tile { width: 100%; display: grid; gap: 2px; text-align: left; padding: 9px; border: 1px solid rgba(143,79,95,.18); border-radius: 13px; background: var(--soft-accent-bg); color: var(--brand); box-shadow: inset 4px 0 rgba(143,79,95,.4); }
.cs-heat-tile.hot { background: #fff; }
.cs-heat-tile.warm { background: #fff8ef; }
.cs-heat-tile.selected { background: var(--brand); color: #fff; box-shadow: 0 0 0 3px rgba(143,79,95,.18); }
.cs-heat-tile b { font-size: 13px; overflow-wrap: anywhere; }
.cs-heat-tile span { font-size: 11px; font-weight: 850; opacity: .85; }
.cs-heat-empty { display: grid; place-items: center; min-height: 64px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); font-size: 12px; font-weight: 850; text-align: center; padding: 8px; }
.cs-document-panel { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.82); }
.cs-document-panel.empty-detail { display: grid; gap: 4px; color: var(--muted); }
.cs-document-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.cs-document-head h3 { font-size: 24px; color: var(--brand); }
.cs-document-records { display: grid; gap: 12px; }
.cs-card-open .detail-panel { margin-top: 10px; }
@media (max-width: 1180px) { .cs-filter-bar { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .cs-heatmap { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); } }
@media (max-width: 760px) { .cs-heatmap-title, .cs-document-head { align-items: stretch; flex-direction: column; } .cs-heatmap-count { justify-items: start; } }


/* Compact CS document details: grouped module rows with delivery content included */
.cs-document-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 7px; margin: 8px 0 10px; }
.cs-document-summary span { display: grid; gap: 2px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 13px; background: #fff8fb; color: var(--muted); font-size: 11px; font-weight: 850; }
.cs-document-summary b { color: var(--brand); font-size: 14px; }
.cs-doc-groups { display: grid; gap: 9px; }
.cs-doc-group { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.74); overflow: hidden; }
.cs-doc-group-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; background: #fff8ef; border-bottom: 1px solid var(--line); }
.cs-doc-group-head b { color: var(--brand); }
.cs-doc-group-head span { color: var(--muted); font-size: 12px; font-weight: 850; }
.cs-compact-row { display: grid; grid-template-columns: minmax(165px, .26fr) minmax(0, 1fr) minmax(110px, .20fr); gap: 8px; align-items: start; padding: 8px 10px; border-top: 1px solid #f5ecef; }
.cs-compact-row:first-of-type { border-top: 0; }
.cs-compact-main { display: grid; gap: 5px; min-width: 0; }
.cs-compact-main strong { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.cs-mini-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 5px; min-width: 0; }
.cs-mini-details span { min-width: 0; padding: 6px 7px; border: 1px solid #f1e7ea; border-radius: 10px; background: #fff; }
.cs-mini-details em { display: block; color: var(--muted); font-size: 10px; font-style: normal; font-weight: 950; text-transform: none; letter-spacing: 0; }
.cs-mini-details b { display: block; margin-top: 1px; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.cs-photo-strip { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.cs-photo-pill { max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 999px; padding: 5px 7px; background: var(--soft-accent-bg); color: var(--brand); font-size: 11px; font-weight: 850; }
.cs-detail-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.cs-document-timeline { display: grid; gap: 7px; margin: 8px 0 10px; padding: 9px; border: 1px solid #f1e4e8; border-radius: 15px; background: #fffdfd; }
.cs-document-timeline summary { cursor: pointer; color: var(--brand); font-size: 13px; font-weight: 950; }
.cs-document-timeline h4 { margin: 0; color: var(--brand); font-size: 13px; }
.cs-timeline-item { display: grid; grid-template-columns: minmax(120px, .3fr) minmax(110px, .25fr) minmax(0, 1fr); gap: 7px; align-items: center; padding: 7px 8px; border-radius: 11px; background: #fff8fb; font-size: 12px; }
.cs-timeline-item time { color: var(--brand); font-weight: 900; overflow-wrap: anywhere; }
.cs-timeline-item span { color: var(--muted); font-weight: 850; }
.cs-timeline-item b { min-width: 0; overflow-wrap: anywhere; }
.cs-audit-inline { margin-top: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.photo-preview-modal .modal-card { width: min(860px, calc(100vw - 32px)); max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
.photo-preview-dialog { overflow: auto; }
.photo-preview-body { display: grid; place-items: center; padding: 10px; background: #171112; border-radius: 16px; max-height: min(66vh, 620px); overflow: hidden; }
.photo-preview-body img { display: block; width: auto; height: auto; max-width: 100%; max-height: min(62vh, 560px); object-fit: contain; border-radius: 12px; background: #fff; }
.photo-preview-placeholder { width: min(420px, 100%); min-height: 220px; display: grid; place-items: center; gap: 6px; padding: 18px; border: 1px dashed rgba(255,255,255,.38); border-radius: 15px; color: #fff; text-align: center; }
.photo-preview-placeholder img { width: min(260px, 100%); aspect-ratio: 1; object-fit: cover; border-radius: 16px; background: #fff; opacity: .92; }
.photo-preview-placeholder small { color: rgba(255,255,255,.68); }
@media (max-width: 980px) { .cs-compact-row { grid-template-columns: 1fr; } .cs-photo-strip { justify-content: flex-start; } .cs-timeline-item { grid-template-columns: 1fr; } }

/* Broad UI/UX polish: keep content inside frames, compact routine buttons, center scan-focused areas */
.ui-polish-scope, .ui-polish-scope * { min-width: 0; }
.ui-polish-scope .card, .ui-polish-scope .task-card, .ui-polish-scope .workspace-card, .ui-polish-scope .cs-document-panel, .ui-polish-scope .permission-group-card { max-width: 100%; overflow: hidden; }
.ui-polish-scope p, .ui-polish-scope dd, .ui-polish-scope td, .ui-polish-scope th, .ui-polish-scope span, .ui-polish-scope b, .ui-polish-scope strong { overflow-wrap: anywhere; }
.ui-polish-scope .card-head, .ui-polish-scope .task-card-head, .ui-polish-scope .topbar, .ui-polish-scope .modal-head, .ui-polish-scope .calendar-head, .ui-polish-scope .cs-document-head { flex-wrap: wrap; }
.compact-table td:last-child, .compact-table th:last-child { width: 1%; white-space: nowrap; }
.compact-table .tabs { margin: 0; gap: 5px; justify-content: center; }
.compact-table .btn { padding: 6px 8px; font-size: 12px; min-height: 32px; border-radius: 10px; }
.record-action-cell {
  white-space: normal !important;
}
.record-action-cell .record-icon-action {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  min-height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 2px;
  border-radius: 11px;
  font-size: 15px;
  line-height: 1;
}
.record-action-cell .record-transfer-status-icon {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  min-height: 34px;
  padding: 0;
  justify-content: center;
  border-radius: 11px;
  font-size: 15px;
  line-height: 1;
}
.record-action-cell .record-transfer-status,
.record-action-cell .deleted-record-date,
.record-action-cell .record-policy-hint {
  white-space: normal;
  display: inline-flex;
  max-width: 150px;
  vertical-align: middle;
}
.record-action-cell .record-transfer-status-icon {
  max-width: 34px;
  white-space: nowrap;
}
.record-action-cell .record-policy-hint-icon {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  min-height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff6cf;
  color: #8a5a00;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}
.workspace-actions { justify-content: center; }
.workspace-actions .btn { padding: 8px 10px; min-height: 36px; font-size: 12px; }
.today-summary-card { min-height: 112px; align-content: center; text-align: center; }
.need-action-list button { min-height: 52px; }
.task-card .tabs.task-action-panel { align-items: center; }
.task-action-panel .btn { min-height: 38px; padding: 8px 10px; font-size: 12px; }
.task-danger-zone { align-items: center; }
.task-danger-zone .btn.danger { justify-self: center; min-height: 38px; }
.task-qr-actions { width: 100%; }
.task-qr-head { width: 100%; justify-content: center; }
.qr-code-grid { width: min(190px, 100%); grid-template-columns: 1fr; }
.empty, .empty-detail { display: grid; place-items: center; text-align: center; }
.photo-card-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.cs-photo-strip { justify-content: center; }
.modal-actions { gap: 8px; }
@media (max-width: 640px) {
  .btn { width: auto; }
  .topbar-actions { grid-template-columns: 1fr 1fr; justify-content: stretch; }
  .topbar-actions .admin-switcher { grid-column: 1 / -1; }
  .today-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-danger-zone { grid-template-columns: 1fr; }
  .task-danger-zone .btn.danger { width: 100%; }
  .record-bulk-toolbar { width: 100%; }
  .record-bulk-toolbar > summary { width: 100%; justify-content: space-between; }
  .record-bulk-popover { width: 100%; }
  .payment-approval-actions { grid-template-columns: 1fr; }
  .compact-table td:last-child, .compact-table th:last-child { white-space: normal; }
  .compact-table .tabs { justify-content: flex-start; }
}
