:root {
  --bg: #f6f4f0; --surface: #ffffff; --surface-2: #f0ede7; --border: #e4e0d8;
  --text: #211d17; --text-dim: #6b6255; --text-faint: #9a9182;
  --accent: #ff7a45; --accent-ink: #1a1206; --danger: #d9503f; --success: #3f9d5f;
  --radius-lg: 18px; --radius-md: 12px; --radius-sm: 8px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-body); }
body { padding-bottom: env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
a { color: var(--accent); }

/* ---- login ---- */
.login-screen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px 28px; width: 100%; max-width: 360px; text-align: center; box-shadow: 0 10px 30px rgba(20,15,5,0.06); }
.login-card .brand-mark { width: 200px; height: auto; margin: 0 auto 10px; animation: brandIn 0.6s cubic-bezier(0.2, 0.85, 0.25, 1); }
@keyframes brandIn { from { opacity: 0; transform: translateY(-8px) scale(0.92); } to { opacity: 1; transform: translateY(0) scale(1); } }
.login-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.login-card p { color: var(--text-dim); font-size: 0.88rem; margin: 0 0 20px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-error, .unlock-error { color: var(--danger); font-size: 0.85rem; min-height: 1.2em; }
.field-error { color: var(--danger); }
.next-day-badge {
  display: inline-block; margin-top: 6px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, #d97706 16%, transparent); color: #b45309;
}
.price-unlock-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700;
  background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success);
  padding: 6px 12px; border-radius: 999px; margin-left: 10px;
}

/* ---- shared form controls ---- */
label { font-size: 0.8rem; font-weight: 700; color: var(--text-dim); display: block; margin-bottom: 5px; text-align: left; }
.field { margin-bottom: 14px; }
input[type=text], input[type=number], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=time], input[type=date], textarea, select {
  width: 100%; padding: 11px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 0.92rem;
}
textarea { min-height: 70px; resize: vertical; }
input[type=color] { width: 52px; height: 38px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }

button { cursor: pointer; }
.btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { background: #fbe9e6; color: var(--danger); border-color: transparent; }
.btn.subtle { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.block { width: 100%; }

.toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 0.85rem; font-weight: 600; color: var(--text-dim); }
.toggle input { position: absolute; opacity: 0; }
.toggle .track { width: 38px; height: 22px; border-radius: 999px; background: var(--border); position: relative; transition: background 0.15s; flex: none; }
.toggle .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle input:checked + .track { background: var(--success); }
.toggle input:checked + .track::after { transform: translateX(16px); }

/* ---- shell ---- */
.shell { display: flex; min-height: 100dvh; }
.sidebar {
  width: 220px; flex: none; background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
}
.sidebar .brand { padding: 6px 10px 18px; }
.sidebar .brand img { width: 100%; max-width: 150px; height: auto; }
.sidebar button {
  text-align: left; background: none; border: none; padding: 11px 12px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem; color: var(--text-dim);
}
.sidebar button.active { background: var(--surface-2); color: var(--text); }
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 0.7rem; font-weight: 800; vertical-align: middle;
}
.sidebar .spacer { flex: 1; }
.sidebar .live-link { font-size: 0.78rem; color: var(--text-faint); padding: 10px 12px; }

.main { flex: 1; min-width: 0; padding: 26px 30px 80px; }
.main > header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.main > header h2 { font-size: 1.4rem; }
.main > header p { color: var(--text-dim); font-size: 0.88rem; margin: 4px 0 0; }

/* mobile: bottom tab bar instead of sidebar */
.mobile-tabs { display: none; }
@media (max-width: 780px) {
  .shell { flex-direction: column; }
  .sidebar { display: none; }
  .main { padding: 18px 16px 90px; }
  .mobile-tabs {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface);
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 30;
    overflow-x: auto; scrollbar-width: none;
  }
  .mobile-tabs::-webkit-scrollbar { display: none; }
  .mobile-tabs button { flex: 0 0 auto; min-width: 68px; background: none; border: none; padding: 12px 6px 10px; font-size: 0.7rem; font-weight: 700; color: var(--text-faint); white-space: nowrap; }
  .mobile-tabs button.active { color: var(--accent); }
}

/* ---- category / items ---- */
.tile-in { animation: tileIn 0.45s cubic-bezier(0.2, 0.85, 0.25, 1) backwards; animation-delay: var(--d, 0ms); }
@keyframes tileIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.category-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 18px; overflow: hidden; }
.category-block .cat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--surface-2); }
.category-block .cat-head h3 { font-size: 1.05rem; }
.category-block .cat-head .cat-actions { display: flex; gap: 6px; }
.category-block .cat-head .cat-actions button { background: none; border: none; color: var(--text-faint); font-size: 0.85rem; padding: 4px 8px; }
.category-block .cat-head .cat-actions .cat-move { font-size: 1rem; color: var(--text); }
.category-block .cat-head .cat-actions .cat-move:disabled { opacity: 0.25; cursor: default; }
.category-block .cat-head .cat-title { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.cat-drag { cursor: grab; touch-action: none; user-select: none; font-size: 1.3rem; line-height: 1; padding: 4px 6px; color: var(--text-faint); }
.cat-dragging .category-block .item-list, .cat-dragging .category-block .add-item-btn, .cat-dragging .category-block .limited-sub { display: none; }
.cat-dragging .category-block { transition: none; }
.category-block.is-dragging { outline: 2px solid var(--accent, #e8552b); box-shadow: 0 8px 24px rgba(0,0,0,.18); opacity: .95; }
.item-drag { cursor: grab; touch-action: none; user-select: none; font-size: 1.2rem; line-height: 1; padding: 4px 2px; color: var(--text-faint); flex: none; }
.admin-item-row.is-dragging { outline: 2px solid var(--accent, #e8552b); outline-offset: 2px; position: relative; z-index: 2; transition: none; }
.category-block.is-dragging .cat-drag { cursor: grabbing; }
.limited-badge {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 8px;
  border-radius: 999px; background: rgba(251, 191, 36, 0.18); color: #d97706; vertical-align: middle; margin-left: 4px;
}
.limited-sub { margin: 2px 0 0; font-size: 0.78rem; color: var(--text-dim); }
.limited-sub.inactive { color: var(--danger); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.item-list { padding: 10px 14px 16px; display: flex; flex-direction: column; gap: 10px; }

.admin-item-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-md); background: var(--bg); }
.admin-item-row .thumb { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; background: var(--surface-2); flex: none; }
.admin-item-row .thumb.empty { display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 0.7rem; }
.admin-item-row .info { flex: 1; min-width: 0; }
.admin-item-row .info .n { font-weight: 700; font-size: 0.92rem; }
.admin-item-row .info .p { font-size: 0.82rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.admin-item-row.unavailable .info .n { color: var(--text-faint); }
.admin-item-row .row-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.admin-item-row .row-actions button { background: none; border: none; color: var(--text-faint); font-size: 0.85rem; padding: 6px; }

.add-item-btn { border: 1.5px dashed var(--border); background: transparent; color: var(--text-dim); border-radius: var(--radius-md); padding: 12px; font-weight: 700; font-size: 0.85rem; margin: 4px 14px 14px; }
.add-category-row { margin-bottom: 18px; }

/* ---- modal ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,15,5,0.4); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; width: 100%; max-width: 460px; max-height: 90dvh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; }
.modal .btn-row { display: flex; gap: 10px; margin-top: 18px; }
.modal .btn-row .btn { flex: 1; }

.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius-md); padding: 14px; text-align: center;
  cursor: pointer; color: var(--text-faint); font-size: 0.82rem; position: relative; overflow: hidden;
}
.dropzone img { max-height: 120px; border-radius: 8px; margin-bottom: 6px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---- tables/qr ---- */
.subtab-row { display: flex; gap: 8px; margin: 16px 0 4px; border-bottom: 1px solid var(--border); }
.subtab-btn {
  background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-dim);
  font-weight: 700; font-size: 0.88rem; padding: 10px 4px; cursor: pointer; margin-bottom: -1px;
}
.subtab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 16px; }
.qr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; text-align: center; }
.qr-card img { width: 100%; border-radius: 6px; margin-bottom: 8px; }
.qr-card .t { font-weight: 700; margin-bottom: 8px; }
.qr-card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; }
.qr-card a { font-size: 0.78rem; font-weight: 700; text-decoration: none; }
.qr-card .regen-link { background: none; border: none; font-size: 0.78rem; font-weight: 700; color: var(--text-faint); cursor: pointer; padding: 0; }
.qr-card .regen-link:hover { color: var(--danger); }

.settings-form { max-width: 480px; }
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 18px; }
.settings-section h3 { font-size: 1rem; margin-bottom: 14px; }
.inline-fields { display: flex; gap: 12px; }
.inline-fields .field { flex: 1; }
.help-text { font-size: 0.78rem; color: var(--text-faint); margin-top: 4px; }

.flagged-section { border: 1.5px solid color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.activity-list { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; }
.activity-row {
  display: flex; justify-content: space-between; gap: 14px; padding: 10px 4px; font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.activity-row:last-child { border-bottom: none; }
.activity-row.flagged { color: var(--danger); font-weight: 600; }
.activity-time { flex: none; color: var(--text-faint); font-size: 0.78rem; white-space: nowrap; }
.activity-row-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.dismiss-btn {
  flex: none; width: 22px; height: 22px; border-radius: 999px; border: none;
  background: var(--surface-2); color: var(--text-faint); font-size: 0.68rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background 0.15s, color 0.15s;
}
.dismiss-btn:hover { background: var(--danger); color: #fff; }
.order-status-chip {
  display: inline-block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; padding: 1px 7px;
  border-radius: 999px; background: var(--surface-2); color: var(--text-dim); margin-left: 6px;
}
.order-status-chip.served { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.order-status-chip.cancelled { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.test-chip {
  display: inline-block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; padding: 1px 7px;
  border-radius: 999px; background: color-mix(in srgb, #d97706 18%, transparent); color: #b45309; margin-left: 6px;
}
.refund-chip {
  display: inline-block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; padding: 1px 7px;
  border-radius: 999px; background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); margin-left: 6px;
}
.duration-chip {
  display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 6px;
  font-variant-numeric: tabular-nums;
}
.duration-chip.good { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.duration-chip.warning { background: rgba(217, 119, 6, 0.16); color: #b45309; }
.duration-chip.critical { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }

.revenue-summary h3 { margin-bottom: 12px; }
.revenue-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.revenue-stat { display: flex; flex-direction: column; gap: 2px; }
.revenue-figure { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.revenue-figure.dim { color: var(--text-dim); }
.revenue-label { font-size: 0.78rem; color: var(--text-faint); }

.orders-header-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.orders-header-row h3 { flex: 1; }
.orders-header-row .row-label { flex: 1; font-weight: 600; font-size: 0.9rem; }
.date-filter-input { padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.85rem; }

/* The same rounded prev/next-arrows-plus-calendar-button date picker used
   on the staff board's History tab, ported here so Reports and Roster
   look and behave exactly the same way when picking a day. */
.date-nav { display: flex; align-items: center; gap: 6px; position: relative; flex: none; margin-left: auto; }
.date-arrow {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim); font-size: 1.1rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex: none;
}
.date-arrow:disabled { opacity: 0.35; cursor: default; }
.date-label-btn {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: 7px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; flex: none;
}
.date-label-btn svg { width: 15px; height: 15px; color: var(--text-faint); flex: none; }
@media (max-width: 420px) {
  .date-label-btn { padding: 7px 10px; font-size: 0.78rem; }
  .date-arrow { width: 26px; height: 26px; font-size: 1rem; }
}

.activity-list.wide { max-height: none; }
.date-group-header {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 14px 4px 6px; font-family: var(--font-display); font-size: 1rem; font-weight: 600;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.date-group-header .date-group-summary { font-family: var(--font-body); font-size: 0.76rem; font-weight: 600; color: var(--text-faint); }
.activity-row.clickable { cursor: pointer; transition: background 0.15s; border-radius: 8px; }
.activity-row.clickable:hover { background: var(--surface-2); }

.order-detail-modal { max-width: 480px; }
.edit-item-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.edit-item-row .edit-item-name { flex: 1; min-width: 0; }
.edit-item-row .edit-item-qty { width: 56px; flex: none; }
.edit-item-row .edit-item-price { width: 76px; flex: none; }
.edit-item-row .remove-item-row-btn { flex: none; padding: 8px 11px; }
.detail-timeline { background: var(--surface-2); border-radius: var(--radius-md); padding: 12px 14px; margin: 10px 0; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.85rem; padding: 5px 0; color: var(--text-dim); }
.detail-row span:first-child { font-weight: 600; color: var(--text); flex: none; }
.detail-row span:last-child { text-align: right; }
.toast-admin {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 0.85rem; z-index: 60;
}

.busy-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 13, 20, 0.72); backdrop-filter: blur(3px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.busy-spin { position: relative; width: 92px; height: 92px; display: flex; align-items: center; justify-content: center; }
.busy-spin img { width: 52px; height: 52px; }
.busy-ring { position: absolute; inset: 0; width: 92px; height: 92px; animation: busyRotate 1.1s linear infinite; }
.busy-ring circle { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 70 200; transform-origin: 50% 50%; }
@keyframes busyRotate { to { transform: rotate(360deg); } }
.busy-label { color: #fff; font-size: 0.85rem; font-weight: 600; }

/* A bigger, more deliberate version for a whole-app state change (like
   switching testing mode) rather than a routine save. */
.busy-overlay.big .busy-spin, .busy-overlay.big .busy-ring { width: 128px; height: 128px; }
.busy-overlay.big .busy-spin img { width: 72px; height: 72px; }
.busy-overlay.big .busy-label { font-size: 1.15rem; max-width: 320px; text-align: center; }

/* ---------- testing mode ---------- */

.testing-mode-section { border: 1.5px solid color-mix(in srgb, #d97706 45%, transparent); background: color-mix(in srgb, #d97706 7%, var(--surface)); }
.testing-mode-section h3 { margin: 0; }
.testing-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 150; height: 38px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  background: #d97706; color: #fff; text-align: center; font-size: 0.8rem; font-weight: 700;
  padding: 0 18px; letter-spacing: 0.01em;
}
body.testing-mode-active .shell { padding-top: 38px; }

/* ---------- reports: donut charts ---------- */

.report-chart-row { display: flex; }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut-chart { flex: none; }
.donut-seg { transition: stroke-dasharray 0.9s cubic-bezier(0.22, 0.8, 0.2, 1); }
.donut-empty { display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 0.85rem; border: 1.5px dashed var(--border); border-radius: 50%; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; min-width: 160px; flex: 1; }
.donut-legend-row { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; }
.donut-swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.donut-legend-label { flex: 1; color: var(--text-dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend-value { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }

.item-table { display: flex; flex-direction: column; margin-top: 16px; }
.item-table-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 4px; font-size: 0.86rem;
  border-bottom: 1px solid var(--border);
}
.item-table-row:last-child { border-bottom: none; }
.item-rank { flex: none; width: 20px; color: var(--text-faint); font-weight: 700; font-size: 0.78rem; }
.item-table-name { flex: 1; font-weight: 600; min-width: 0; }
.item-table-qty { flex: none; color: var(--text-faint); font-size: 0.78rem; }
.item-table-revenue { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }

/* ---------- roster ---------- */

.shift-staff-list { display: flex; flex-direction: column; gap: 2px; }
.shift-staff-row { padding: 10px 4px; border-bottom: 1px solid var(--border); }
.shift-staff-row:last-child { border-bottom: none; }
.shift-staff-head { display: flex; align-items: center; gap: 10px; }
.shift-staff-name { font-size: 0.9rem; font-weight: 600; }
.shift-time-range { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px 48px; }
.shift-time-input { width: auto; max-width: 130px; padding: 8px 10px; font-size: 0.85rem; }
.shift-time-sep { color: var(--text-faint); flex: none; }
@media (max-width: 480px) {
  .shift-time-range { margin-left: 0; }
}

.collapsible-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  background: none; border: none; padding: 0; cursor: pointer; text-align: left;
}
.collapsible-header h3 { margin-bottom: 2px; }
.collapsible-header .help-text { margin: 0; }
.collapsible-chevron { flex: none; font-size: 1.2rem; color: var(--text-faint); transition: transform 0.2s; }
.collapsible-header[aria-expanded="true"] .collapsible-chevron { transform: rotate(90deg); }

/* ---------- timesheets: side-by-side clock photo review + pay ---------- */

.link-btn {
  background: none; border: none; padding: 0; color: var(--accent); font-weight: 700;
  font-size: 0.78rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}

.ts-list { display: flex; flex-direction: column; gap: 14px; }
.ts-row { background: var(--bg); border-radius: var(--radius-md); padding: 12px; }
.ts-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ts-name { font-weight: 700; font-size: 0.92rem; }
.ts-scheduled { font-weight: 500; font-size: 0.78rem; color: var(--text-faint); }
.ts-rate { flex: none; font-size: 0.82rem; color: var(--text-dim); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }

.ts-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ts-photo-slot {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--surface-2); border-radius: 12px; padding: 10px; text-align: center;
}
.ts-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; background: var(--surface); }
.ts-photo-slot.empty .ts-photo-placeholder, .ts-photo-slot.reviewed .ts-photo-placeholder {
  width: 100%; aspect-ratio: 1; border-radius: 9px; background: var(--surface); display: flex;
  align-items: center; justify-content: center; font-size: 1.6rem; color: var(--text-faint);
}
.ts-photo-slot.reviewed .ts-photo-placeholder { color: #4ade80; }
.ts-photo-slot.rejected { outline: 2px solid var(--danger); }
.ts-photo-flag {
  position: absolute; top: 8px; right: 8px; background: var(--danger); color: #fff; font-size: 0.68rem;
  font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.ts-photo-label { font-size: 0.76rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.ts-summary { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 0.85rem; color: var(--text-dim); }
.ts-pay { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ts-actions { margin-top: 10px; }

@media (max-width: 480px) {
  .ts-photos { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .sidebar, .mobile-tabs, .main > header, .no-print { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .qr-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Ask Tau's computer (public/js/assistant.js) ---------- */

.ai-head-btns { display: flex; gap: 8px; }
.ai-panel { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); height: calc(100dvh - 190px); min-height: 420px; overflow: hidden; }
.ai-off { padding: 18px; color: var(--text-dim); }
.ai-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 0.92rem; line-height: 1.45; overflow-wrap: anywhere; animation: aiIn 0.25s ease-out; }
.ai-msg p { margin: 0 0 6px; } .ai-msg p:last-child { margin: 0; }
.ai-msg ul { margin: 4px 0; padding-left: 18px; }
.ai-msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.ai-msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.ai-note { align-self: center; font-size: 0.8rem; color: var(--text-dim); background: var(--bg); border-radius: 999px; padding: 6px 12px; text-align: center; animation: aiIn 0.25s ease-out; }
.ai-note.ok { color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--surface)); }
.ai-note.bad { color: var(--danger); background: #fbe9e6; }
.ai-undo { margin-left: 6px; border: 0; background: transparent; color: var(--text-dim); text-decoration: underline; font-weight: 700; font-size: 0.8rem; cursor: pointer; }
.ai-empty { margin: auto; text-align: center; color: var(--text-dim); max-width: 440px; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.chip-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 12px; font-size: 0.82rem; font-weight: 600; color: var(--text); cursor: pointer; }
.ai-compose { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.ai-compose textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; font-size: 0.95rem; background: var(--bg); color: var(--text); }
.ai-confirm { margin: 0 12px 12px; padding: 16px; border: 1.5px solid var(--accent); border-radius: var(--radius-md); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); animation: aiIn 0.25s ease-out; max-height: 55%; overflow-y: auto; }
.ai-confirm h3 { font-size: 1.05rem; margin-bottom: 8px; }
.ai-confirm .btn-row { display: flex; gap: 10px; margin-top: 12px; }
.ai-confirm .btn-row .btn { flex: 1; padding: 12px; }
.ai-actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.ai-actions details { margin-top: 4px; }
.ai-actions summary { font-size: 0.78rem; color: var(--text-dim); cursor: pointer; }
.ai-actions pre { white-space: pre-wrap; font-size: 0.74rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; max-height: 220px; overflow: auto; margin: 6px 0 0; }
.ai-kind { display: inline-block; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; padding: 2px 7px; border-radius: 999px; margin-right: 4px; background: var(--surface-2); color: var(--text-dim); }
.ai-kind.code { background: #efe7ff; color: #6b3fd1; }
.ai-loading { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(2px); animation: aiFade 0.2s ease-out; }
.ai-loading-card { background: #121620; color: #fff; border-radius: var(--radius-lg); padding: 26px 30px; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: 0 16px 40px rgba(10,13,20,0.3); max-width: 300px; text-align: center; }
.ai-loading-text { margin: 4px 0 0; font-weight: 700; font-size: 0.95rem; }
.ai-loading-hint { margin: 0; font-size: 0.76rem; color: rgba(255,255,255,0.6); }
.ai-dots { display: flex; gap: 6px; }
.ai-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: aiDot 1.2s infinite ease-in-out; }
.ai-dots span:nth-child(2) { animation-delay: 0.15s; } .ai-dots span:nth-child(3) { animation-delay: 0.3s; }
.ai-change-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; font-size: 0.85rem; }
.ai-change-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.ai-change-list .dim { color: var(--text-faint); font-size: 0.75rem; }
.ai-tag { font-size: 0.72rem; font-weight: 700; color: var(--text-dim); white-space: nowrap; } .ai-tag.bad { color: var(--danger); }
@keyframes aiIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes aiFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes aiDot { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }
@media (max-width: 780px) {
  .ai-panel { height: calc(100dvh - 230px); border-radius: var(--radius-md); }
  .ai-msg { max-width: 90%; }
}
.ai-loading-card .busy-spin img { filter: invert(1) brightness(1.6); }

/* ---------- settings > payments ---------- */
.pay-back { display: inline-block; margin-bottom: 8px; text-decoration: none; font-size: 0.85rem; }
.pay-pill {
  display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-dim); white-space: nowrap;
}
.pay-pill.on { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.pay-pill.ready { background: color-mix(in srgb, var(--accent) 14%, transparent); color: #b4501f; }
.pay-pill.warn { background: color-mix(in srgb, #d97706 16%, transparent); color: #b45309; }
.pay-note { margin: -6px 0 14px; line-height: 1.45; }
.pay-live-note { color: var(--danger); font-weight: 700; margin: 0 0 10px; }
.pay-seg { display: flex; background: var(--surface-2); border-radius: 999px; padding: 3px; margin-bottom: 14px; }
.pay-seg-opt { flex: 1; margin: 0; text-align: center; cursor: pointer; }
.pay-seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pay-seg-opt span { display: block; padding: 8px 6px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; color: var(--text-dim); white-space: nowrap; }
.pay-seg-opt.checked span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(20,15,5,0.12); }
.pay-seg-opt input:focus-visible + span { outline: 2px solid var(--accent); }
.secret-saved { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.secret-saved code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; line-height: 1.6; }
.pay-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pay-result { font-size: 0.82rem; font-weight: 600; margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); line-height: 1.4; }
.pay-result.ok { background: color-mix(in srgb, var(--success) 12%, transparent); color: #2c7446; }
.pay-result.bad { background: #fbe9e6; color: var(--danger); }
.pay-tests { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.pay-tests-title { font-size: 0.75rem; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 4px; }
.pay-test-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 0.82rem; padding: 6px 0; }
.pay-test-row > span:first-child { flex: 1; min-width: 120px; }
.pay-test-status { font-weight: 700; color: var(--text-dim); }
.pay-test-status.ok { color: var(--success); }
.pay-steps { margin-top: 14px; font-size: 0.84rem; color: var(--text-dim); }
.pay-steps summary { cursor: pointer; font-weight: 700; color: var(--text); padding: 4px 0; }
.pay-steps ol { padding-left: 20px; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; line-height: 1.45; }
.pay-steps code { font-size: 0.78rem; word-break: break-all; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.pay-choices { display: flex; flex-direction: column; gap: 8px; }
.pay-choice { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; }
.pay-choice input { margin-top: 3px; accent-color: var(--accent); flex: none; }
.pay-choice span { display: flex; flex-direction: column; gap: 2px; }
.pay-choice strong { color: var(--text); font-size: 0.9rem; }
.pay-choice small { font-weight: 500; color: var(--text-faint); font-size: 0.78rem; }
.pay-choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.pay-choice.disabled { opacity: 0.55; cursor: default; }

/* Payments: the step-by-step picture guides (pay-guides.css), in this app's colours */
.pg-ov, .pay-guide-entry {
  --pg-surface: var(--surface); --pg-ink: var(--text); --pg-ink2: var(--text-dim); --pg-line: var(--border); --pg-soft: var(--surface-2);
  --pg-accent: var(--accent); --pg-on-accent: var(--accent-ink); --pg-hi: #2457d6; --pg-on-hi: #fff; --pg-radius: var(--radius-lg); --pg-font: var(--font-body);
}
.pay-guide-entry { margin: 14px 0 4px; }
.pay-guide-entry .pg-open { color: #b4501f; border-color: var(--accent); }


/* ---------- settings > loyverse ---------- */
.lv-page .lv-dim { opacity: 0.6; }
.lv-two { flex-wrap: wrap; }
.lv-two .field { min-width: 150px; }
.lv-row { margin-top: 12px; gap: 12px; }
.lv-row .row-label { line-height: 1.35; }
.lv-last { font-size: 0.84rem; color: var(--text-dim); margin: 6px 0 10px; line-height: 1.45; }
.lv-note { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text-dim); line-height: 1.45; }
.lv-sub { margin-top: 18px; }
.lv-counts { font-size: 0.78rem; color: var(--text-faint); font-weight: 600; }
.lv-plan { margin: 14px 0 4px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; background: var(--bg); }
.lv-plan-head { margin: 0 0 8px; font-size: 0.88rem; }
.lv-plan-list { margin: 6px 0; font-size: 0.84rem; }
.lv-plan-list summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.lv-plan-list.warn summary { color: #b45309; }
.lv-plan-list ul { margin: 4px 0 6px; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; color: var(--text-dim); line-height: 1.4; overflow-wrap: anywhere; }
.lv-jobs { display: flex; flex-direction: column; gap: 10px; }
.lv-job { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.lv-job.failed { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.lv-job > div { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 0.86rem; }
.lv-job-state { font-size: 0.75rem; font-weight: 700; color: #b45309; }
.lv-job.failed .lv-job-state { color: var(--danger); }
.lv-job-err { margin: 0; font-size: 0.8rem; color: var(--text-dim); line-height: 1.4; overflow-wrap: anywhere; }
.lv-check-list { margin: 6px 0 0; padding-left: 18px; font-weight: 500; }
.lv-badge { display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 4px; white-space: nowrap; vertical-align: 1px; }
.lv-badge.sent { background: color-mix(in srgb, var(--success) 14%, transparent); color: #2c7446; }
.lv-badge.pending { background: color-mix(in srgb, #d97706 16%, transparent); color: #b45309; }
.lv-badge.failed { background: #fbe9e6; color: var(--danger); }
.lv-badge.skipped { background: var(--surface-2); color: var(--text-dim); }
.lv-detail { margin: 12px 0 4px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.lv-detail .lv-badge { white-space: normal; margin-left: 0; font-size: 0.78rem; padding: 6px 10px; border-radius: var(--radius-sm); line-height: 1.4; overflow-wrap: anywhere; }
.lv-locked-note { font-size: 0.8rem; background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 11px; color: var(--text-dim); margin: 0 0 12px; line-height: 1.45; }
.lv-tag { font-size: 0.66rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-dim); margin-left: 4px; }
.lv-tag.off { background: #fbe9e6; color: var(--danger); }
.line-mods { color: var(--text-faint); }
/* order detail lines: name left, amount right (these rows had no layout here before) */
.order-detail-modal .confirm-line, .order-detail-modal .confirm-breakdown .row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 0.9rem; }
.order-detail-modal .confirm-line span:last-child, .order-detail-modal .confirm-breakdown .row span:last-child { flex: none; font-variant-numeric: tabular-nums; }
.order-detail-modal .confirm-breakdown { border-top: 1px solid var(--border); padding-top: 8px; margin-bottom: 8px; }
.order-detail-modal .confirm-breakdown .row.dim { color: var(--text-faint); font-size: 0.8rem; }
.order-detail-modal .confirm-breakdown .row.total { font-weight: 700; }

/* menu: rows the Loyverse sync archived, collapsed at the bottom */
.lv-archived { opacity: 0.85; padding: 14px 18px; }
.lv-archived > summary { cursor: pointer; padding: 4px 0 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.lv-archived > summary .help-text { margin: 0; }

/* icon set (js/icons.js): lines take the text colour, the soft fill --icon-2 */
svg.i { width: 1em; height: 1em; display: inline-block; vertical-align: -.14em; flex: none; overflow: visible; --icon-2: color-mix(in srgb, currentColor 18%, transparent); }
