:root {
  font-family: "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1f2937;
  background: var(--app-bg, #f9f7f7);
  --accent: #dca9a9;
  --accent-dark: #b97f83;
  --accent-text: #17131f;
  --sidebar: #17131f;
  --app-bg: #f9f7f7;
  --accent-soft: #ede9fe;
  --line: #e5e7eb;
  --muted: #6b7280;
  --card: #fff;
  --success: #047857;
  --danger: #b91c1c;
  --warning: #c2410c;
  --radius: 10px;
  --radius-sm: 8px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--app-bg); }
button, input, select, textarea { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .icon-btn:focus-visible, .quick-action:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 65%, #6366f1);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; opacity: .45; }

.auth-pending { background: #F5F2EA; --accent: #C9A66B; --accent-dark: #1A3644; --accent-text: #1A3644; }
.auth-pending .app-shell { display: none; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: var(--space-3); }
.auth-screen[hidden] { display: none; }
.auth-card { width: min(100%, 420px); padding: var(--space-3); border: 1px solid #e7e1d4; border-radius: var(--radius); background: #fff; }
.auth-logo { display: block; width: min(320px, 88%); height: auto; max-height: 200px; margin: 0 auto 8px; object-fit: contain; object-position: center; background: transparent; image-rendering: auto; }
.auth-copyright { margin: 10px 0 0; color: #9ca3af; font-size: 11px; text-align: center; }
.auth-version { margin: 4px 0 0; color: #c4c4c4; font-size: 10px; text-align: center; font-weight: 700; }
.report-donut-wrap { display: grid; gap: 12px; justify-items: center; margin-bottom: 12px; }
.report-donut { width: 140px; height: 140px; border-radius: 50%; border: 8px solid #fff; box-shadow: inset 0 0 0 1px #e5e7eb; }
.report-donut-legend { display: grid; gap: 6px; width: 100%; font-size: 12px; }
.report-donut-legend span { display: flex; align-items: center; gap: 8px; }
.report-donut-legend i { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.agenda-month-day-btn { border: 0; background: transparent; padding: 0; cursor: pointer; display: flex; justify-content: space-between; width: 100%; align-items: center; }
body.printing-report .report-donut, body.printing-report .trend-chart, body.printing-report .report-bar-track { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.auth-heading { text-align: center; }
.auth-heading h1 { margin: 8px 0; color: #17131f; font-size: clamp(28px, 5vw, 36px); letter-spacing: -.03em; }
.auth-heading p { margin: 0 auto 16px; max-width: 320px; color: var(--muted); line-height: 1.5; }
.access-kind { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.access-kind[hidden] { display: none; }
.access-kind button { display: grid; gap: 3px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: #4b5563; cursor: pointer; text-align: left; min-height: 44px; }
.access-kind button strong { color: #1f2937; }
.access-kind button small { color: var(--muted); }
.access-kind button.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, white); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: var(--radius); background: #f3f4f6; }
.auth-tabs button { padding: 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: #6b7280; cursor: pointer; font-weight: 800; min-height: 44px; }
.auth-tabs button.active { background: #fff; color: #17131f; box-shadow: 0 2px 10px #11182712; }
.auth-form, .auth-signup-fields { display: grid; gap: 13px; }
.auth-signup-fields[hidden],
.auth-form[hidden],
.auth-tabs[hidden],
#access-kind[hidden],
#employee-activation-fields[hidden],
#employee-password-confirm-field[hidden] { display: none; }
.auth-form label { display: grid; gap: 6px; color: #374151; font-size: 13px; font-weight: 800; }
.auth-form input { width: 100%; padding: 12px 13px; border: 1px solid #d1d5db; border-radius: var(--radius-sm); background: #fff; color: #111827; }
.consent-check { display: flex !important; align-items: flex-start; gap: 10px; font-weight: 600 !important; color: #4b5563 !important; }
.consent-check input { width: auto !important; margin-top: 3px; flex: 0 0 auto; }
.consent-check a { color: #1A3644; }
.auth-submit { width: 100%; min-height: 46px; margin-top: 2px; }
.text-button { border: 0; background: transparent; color: var(--accent-dark); cursor: pointer; font-weight: 800; min-height: 44px; }
.auth-message { min-height: 20px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; text-align: center; }
.auth-message.error { color: var(--danger); }
.auth-message.success { color: var(--success); }
.auth-footnote { margin: 16px 0 0; color: #9ca3af; font-size: 11px; line-height: 1.45; text-align: center; }
.auth-footnote a { color: #1A3644; font-weight: 700; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); width: 100%; max-width: 100vw; min-height: 100vh; transition: grid-template-columns .14s ease; }
.app-shell.sidebar-collapsed { grid-template-columns: 84px minmax(0, 1fr); }
.sidebar { background: var(--sidebar); color: #fff; padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30; width: auto; min-width: 0; }
.sidebar-top { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px 16px; flex: 1; min-width: 0; }
.brand-mark {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #ffffff12;
  overflow: hidden;
  flex: 0 0 auto;
  padding: 4px;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  -ms-interpolation-mode: bicubic;
}
.brand strong, .brand small { display: block; }
.brand small { opacity: .62; margin-top: 2px; }
.brand-copy { min-width: 0; }
.brand-copy strong, .brand-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav { display: grid; gap: 6px; }
nav { scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav button { border: 0; background: transparent; color: #c9c3d4; text-align: left; padding: 11px 12px; border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 44px; border-left: 3px solid transparent; }
nav button.active, nav button:hover { background: #2a2335; color: #fff; }
nav button.active { border-left-color: var(--accent); background: #322b40; }
.nav-icon { flex: 0 0 auto; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: inherit; cursor: pointer; padding: 0; }
.sidebar .icon-btn { color: #fff; border-color: #ffffff22; }
.sidebar-close { display: none; }
.sidebar-collapse { margin-left: auto; display: none; }
.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-label { display: none; }
.app-shell.sidebar-collapsed nav button { justify-content: center; padding-inline: 10px; }
/* Escritorio: expandir menú al hover sin sacar el sidebar del flujo (evita romper el layout). */
@media (min-width: 821px) {
  .app-shell.sidebar-collapsed:has(.sidebar:hover) {
    grid-template-columns: 248px minmax(0, 1fr);
  }
  .app-shell.sidebar-collapsed .sidebar:hover .brand-copy,
  .app-shell.sidebar-collapsed .sidebar:hover .nav-label { display: block; }
  .app-shell.sidebar-collapsed .sidebar:hover nav button { justify-content: flex-start; padding-inline: 12px; }
}
.nav-overlay { display: none; }
.mobile-menu-btn { display: none; color: #1f2937; border-color: var(--line); background: #fff; }

.main { padding: 0; min-width: 0; width: 100%; display: flex; flex-direction: column; min-height: 100vh; background: var(--app-bg, #f9f7f7); overflow-x: clip; }
.topbar {
  display: flex; justify-content: space-between; gap: var(--space-2); align-items: center;
  padding: 18px 22px; margin: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fbfafa 100%);
  border-bottom: 1px solid #e8e4e8;
  box-shadow: 0 1px 0 rgba(255,255,255,.8), 0 8px 24px rgba(23, 19, 31, .04);
  position: sticky; top: 0; z-index: 20;
}
.topbar-start { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -.02em; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
#content { padding: var(--space-3); flex: 1; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; }

.ghost, .primary, .danger, .small-btn { border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 700; cursor: pointer; transition: transform .12s ease, background .12s ease; min-height: 44px; }
.ghost:active, .primary:active, .danger:active, .small-btn:active { transform: translateY(1px); }
.ghost { background: #fff; border: 1px solid var(--line); color: #292334; }
.ghost:hover { background: #fafafa; }
.primary { background: var(--accent); border: 1px solid var(--accent); color: var(--accent-text); }
.primary:hover { background: var(--accent-dark); }
.danger { background: #fff; border: 1px solid #fecaca; color: var(--danger); }
.small-btn { padding: 8px 10px; border: 1px solid var(--line); background: #fff; color: #292334; min-height: 36px; }
.search { min-width: min(340px, 70vw); font-weight: 400; }

.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: var(--space-2); margin-top: var(--space-2); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 2px #11182708; }
.card-title { margin: 0 0 14px; font-size: 18px; }
.metric .label { color: var(--muted); font-size: 14px; }
.metric .value { font-size: clamp(24px, 3vw, 30px); font-weight: 800; margin-top: 8px; line-height: 1.2; }
.metric .hint { font-size: 12px; color: var(--success); margin-top: 5px; }
.metric .hint.warning { color: var(--warning); }

.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .group { display: flex; gap: 8px; flex-wrap: wrap; }
.no-margin { margin: 0 !important; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 700; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, #payment { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #1f2937; }
.field textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafafa; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge.ok { background: #ecfdf5; color: var(--success); }
.badge.warn { background: #fff7ed; color: var(--warning); }
.badge.info { background: #eef2ff; color: #4338ca; }
.badge.muted { background: #f3f4f6; color: #4b5563; }

.agenda-grid { display: grid; grid-template-columns: 90px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.time { padding: 18px 12px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 13px; }
.slot { padding: 10px 12px; border-bottom: 1px solid var(--line); min-height: 58px; }
.appointment { padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); border-left: 4px solid var(--accent); display: flex; justify-content: space-between; gap: 8px; }
.appointment + .appointment { margin-top: 7px; }
.appointment strong, .appointment small { display: block; }
.appointment small { color: var(--muted); margin-top: 3px; }

.list { display: grid; gap: 0; }
.list-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.empty.compact { padding: 18px; }
.muted { color: var(--muted); }

dialog { border: 0; border-radius: 18px; padding: 0; width: min(640px, 92vw); max-height: 90vh; overflow: auto; box-shadow: 0 24px 70px #0004; }
dialog::backdrop { background: #111827aa; backdrop-filter: blur(2px); }
.modal-pad { padding: 22px; }
.modal-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 21px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.notice { padding: 12px 14px; border-radius: 12px; background: #f5f3ff; color: #5b21b6; font-size: 13px; margin-bottom: 14px; }
.scanner { border: 1px dashed #c4b5fd; border-radius: 12px; padding: 14px; text-align: center; background: #fafafa; }
.scanner video { width: 100%; max-height: 280px; object-fit: cover; border-radius: 10px; background: #111; margin-top: 12px; }
.scanner-status { margin-top: 10px; min-height: 20px; }
.scanner-manual { margin-top: 14px; }

.sale-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; }
.checkout { align-self: start; position: sticky; top: 24px; }
.cart-row { display: grid; grid-template-columns: minmax(140px, 1fr) 75px 105px auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qty { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 9px; }
.cart-price { text-align: right; font-variant-numeric: tabular-nums; }
.total-label { margin-top: 18px; }
.total { font-size: 30px; font-weight: 800; }
.full-button { width: 100%; margin-top: 18px; }
.recent-sales { margin-top: 16px; }

.toast { position: fixed; z-index: 10050; right: 24px; bottom: 24px; max-width: min(380px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; background: #064e3b; color: #fff; box-shadow: 0 12px 36px #0004; font-weight: 700; }
.modal-inline-error { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; font-weight: 700; font-size: 13px; }
.modal-inline-error.is-warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.modal-inline-error[hidden] { display: none; }
.appt-dynamic-fields.contents { display: contents; }
.agenda-day-event.is-cancelled, .appointment.is-cancelled, .agenda-list-item.is-cancelled { opacity: .55; text-decoration: line-through; }
.agenda-day-event.is-cancelled { text-decoration: none; }
.agenda-day-event.is-cancelled strong, .agenda-day-event.is-cancelled small { text-decoration: line-through; }
.badge.danger { background: #fee2e2; color: #991b1b; }
dialog { z-index: 1000; }
.agenda-day-timeline { position: relative; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; --hour-h: 72px; }
.agenda-day-hours { display: grid; }
.agenda-day-hour-row { display: grid; grid-template-columns: 64px 1fr; min-height: var(--hour-h); border-bottom: 1px solid var(--line); }
.agenda-day-hour-row .time { padding: 8px; font-size: 12px; font-weight: 800; color: var(--muted); border-right: 1px solid var(--line); background: #fafafa; }
.agenda-day-hour-row .lane { position: relative; }
.agenda-day-events { position: absolute; left: 64px; right: 0; top: 0; bottom: 0; pointer-events: none; }
.agenda-day-event { position: absolute; left: 8px; right: 8px; pointer-events: auto; border-radius: 10px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 14%, #fff); box-shadow: 0 4px 12px #0001; overflow: hidden; z-index: 2; cursor: pointer; text-align: left; }
.agenda-day-event.is-blocked { border-color: #fca5a5; background: #fef2f2; }
.agenda-day-event.is-cancelled { border-color: #d1d5db; background: #f3f4f6; }
.agenda-day-event strong, .agenda-day-event small { display: block; }
.agenda-month-cell { position: relative; }
.agenda-month-previews { display: grid; gap: 2px; margin-top: 4px; }
.agenda-month-chip { display: block; width: 100%; text-align: left; border: 0; border-radius: 6px; padding: 2px 5px; font-size: 10px; font-weight: 700; background: color-mix(in srgb, var(--accent) 18%, #fff); color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-month-chip.is-blocked { background: #fee2e2; }
.agenda-month-tooltip { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% - 4px); padding: 8px; border-radius: 10px; background: #111827; color: #fff; font-size: 11px; line-height: 1.35; box-shadow: 0 10px 24px #0005; display: none; pointer-events: none; }
.agenda-month-cell:hover .agenda-month-tooltip, .agenda-month-cell:focus-within .agenda-month-tooltip { display: block; }
.sensitive-btn, .quick-action-tile, .segment, .agenda-month-cell, .agenda-day-event, .primary, .ghost { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.bank-combo { display: grid; gap: 8px; }
.version-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #f3f4f6; color: var(--muted); font-size: 12px; font-weight: 800; }
.about-version { display: grid; gap: 6px; }
.toast.error { background: #991b1b; }
.toast[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.top-context { display: flex; gap: 10px; align-items: center; }
.context-label { display: grid; gap: 3px; font-size: 10px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.context-label select { max-width: 190px; padding: 7px 30px 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #1f2937; font-size: 13px; font-weight: 700; }
.cloud-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.cloud-chip i { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.cloud-chip.online { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.cloud-chip.online i { background: #10b981; }
.cloud-chip.syncing { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.cloud-chip.syncing i { background: #f59e0b; animation: cloud-pulse 1s infinite alternate; }
.cloud-chip.offline, .cloud-chip.error { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.cloud-chip.offline i, .cloud-chip.error i { background: #ef4444; }
@keyframes cloud-pulse { to { opacity: .3; transform: scale(.75); } }
.user-chip { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: #4b5563; font-size: 12px; }
.metric-button { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.metric-button:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 24px #11182712; }
.field-spaced { margin: 12px 0; }
.sales-summary { display: flex; align-items: baseline; gap: 12px; padding: 10px 2px 16px; }
.sales-summary strong { font-size: 24px; }
.sales-summary span { color: var(--muted); }
.table-actions { display: flex; gap: 6px; }

.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.role-card { display: grid; gap: 7px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.role-card small { color: var(--muted); line-height: 1.45; }
.role-level { width: max-content; padding: 4px 7px; border-radius: 999px; background: var(--accent-soft); color: #4c1d95; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.employee-number { padding: 5px 8px; border-radius: 8px; background: #f3f4f6; color: #312e81; font-size: 12px; font-weight: 900; letter-spacing: .04em; white-space: nowrap; }
.employee-id-card { display: grid; gap: 4px; margin-bottom: 16px; padding: 16px; border: 1px solid #c7d2fe; border-radius: 14px; background: #eef2ff; }
.employee-id-card span, .employee-id-card small { color: #6366f1; font-size: 12px; }
.employee-id-card strong { color: #312e81; font-size: 24px; letter-spacing: .07em; }
.access-handoff > p { color: var(--muted); line-height: 1.55; }
.access-code-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.access-code-grid > div { display: grid; gap: 7px; padding: 18px; border: 1px solid #c7d2fe; border-radius: 14px; background: #eef2ff; }
.access-code-grid span { color: #6366f1; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.access-code-grid strong { color: #312e81; font-size: clamp(19px, 4vw, 27px); letter-spacing: .06em; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-card { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.check-card span, .check-card strong, .check-card small { display: block; }
.check-card small { color: var(--muted); margin-top: 2px; }
.toggle { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; user-select: none; }
.toggle span { flex: 1; line-height: 1.35; }
.toggle input[type="checkbox"] {
  -webkit-appearance: checkbox;
  appearance: auto;
  width: 1.2rem;
  height: 1.2rem;
  min-width: 1.2rem;
  min-height: 1.2rem;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #1A3644;
  cursor: pointer;
  position: relative;
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
}
.toggle:has(input:checked) {
  border-color: #93c5a4;
  background: #f0fdf4;
}
.branch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.branch-card { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.branch-card h2 { margin: 12px 0 6px; font-size: 19px; }
.branch-card p { margin: 4px 0; }

.settings-layout { display: grid; gap: 16px; max-width: 1040px; margin: 0 auto; }
.settings-section { padding: 22px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 3px 0 0; font-size: 20px; }
.eyebrow { color: var(--accent-dark); font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.step-badge { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-weight: 900; }
.logo-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.upload-card { position: relative; display: grid; place-items: center; gap: 6px; min-height: 220px; padding: 18px; border: 1px dashed #c4b5fd; border-radius: 14px; background: #fafafa; cursor: pointer; text-align: center; overflow: hidden; }
.upload-card:hover { border-color: var(--accent); background: #fff; }
.upload-card img { width: 100%; height: 148px; object-fit: contain; image-rendering: auto; }
.upload-card img.monochrome { filter: grayscale(1) contrast(1.2); }
.upload-card span { color: var(--muted); font-size: 12px; }
.upload-card input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.color-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.color-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.color-grid input { width: 100%; height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.status-banner { display: flex; gap: 12px; align-items: center; padding: 14px; margin-bottom: 14px; border-radius: 12px; background: #fff7ed; color: #9a3412; }
.status-banner strong, .status-banner small { display: block; }
.status-banner small { margin-top: 3px; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: #f97316; box-shadow: 0 0 0 5px #fed7aa; }
.token-help { margin-top: 12px; color: var(--muted); font-size: 12px; }
.token-help code { padding: 3px 5px; border-radius: 5px; background: #f3f4f6; color: #374151; }
.settings-save { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fffffff2; backdrop-filter: blur(8px); box-shadow: 0 10px 30px #11182718; }
.onboarding-form { display: grid; gap: 16px; }
.onboarding-heading { padding: 4px 2px 6px; text-align: center; }
.onboarding-heading h2 { margin: 6px 0; font-size: clamp(25px, 4vw, 34px); }
.onboarding-heading p { max-width: 560px; margin: 0 auto; color: var(--muted); line-height: 1.5; }
.onboarding-step { display: flex; gap: 11px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.onboarding-step > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-weight: 900; }
.onboarding-step strong, .onboarding-step small { display: block; }
.onboarding-step small { margin-top: 2px; color: var(--muted); }
dialog:has(.onboarding-form) { width: min(820px, 94vw); }

.receipt-preview { padding: 22px; border-radius: 14px; background: #ececec; overflow: auto; }
.receipt { width: min(100%, var(--receipt-width)); margin: 0 auto; padding: 18px 14px; background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif; font-size: 11px; line-height: 1.3; box-shadow: 0 8px 30px #0002; }
.receipt-logo { display: block; width: 88%; max-height: 74px; margin: 0 auto 8px; object-fit: contain; filter: grayscale(1) contrast(1.35); }
.receipt h2, .receipt h3, .receipt-thanks { margin: 5px 0; text-align: center; }
.receipt h2 { font-size: 17px; }
.receipt h3 { margin-top: 12px; font-size: 14px; }
.receipt > div:not(.receipt-line, .receipt-rule, .receipt-meta, .receipt-total, .receipt-payment, .receipt-client) { text-align: center; }
.receipt-rule { margin: 8px 0; border-top: 1px dashed #111; }
.receipt-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; }
.receipt-client { margin-top: 5px; }
.receipt-line { display: grid; grid-template-columns: minmax(0, 1fr) 34px 62px; gap: 5px; align-items: start; padding: 4px 0; }
.receipt-line span:nth-child(2), .receipt-line span:nth-child(3) { text-align: right; }
.receipt-line small { display: block; color: #555; }
.receipt-heading { padding-bottom: 5px; border-bottom: 1px solid #111; font-weight: 700; }
.receipt-total { display: flex; justify-content: flex-end; gap: 20px; align-items: baseline; font-size: 14px; }
.receipt-payment { margin-top: 9px; text-align: right; }
.receipt-thanks { margin-top: 12px !important; font-weight: 800; }

.report-controls { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 16px; }
.report-filter-grid { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 10px; }
.report-filter-grid .field { min-width: 155px; }
.report-filter-grid .field > span { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.report-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.report-print-area { display: grid; gap: 16px; }
.report-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 6px 2px; }
.report-heading h2 { margin: 4px 0; font-size: 25px; }
.report-heading p, .report-generated { margin: 0; color: var(--muted); font-size: 12px; }
.report-generated { text-align: right; }
.report-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.report-kpi { display: grid; align-content: start; gap: 6px; min-height: 125px; padding: 17px; }
.report-kpi > span { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.report-kpi > strong { color: #17131f; font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -.025em; }
.report-kpi > small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.report-grid-wide { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); gap: 16px; }
.report-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.report-card { min-width: 0; }
.report-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.report-card-head h3 { margin: 0; color: #17131f; font-size: 17px; }
.report-card-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.report-card-head > strong { color: #17131f; font-size: 18px; }
.trend-scroll { padding-bottom: 5px; overflow-x: auto; }
.trend-chart { display: grid; grid-template-columns: repeat(var(--trend-columns), minmax(16px, 1fr)); align-items: end; gap: 3px; min-width: max(100%, calc(var(--trend-columns) * 19px)); height: 225px; padding: 25px 4px 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 49px, #e5e7eb 50px); }
.trend-column { position: relative; display: grid; grid-template-rows: 1fr 17px; align-items: end; height: 100%; text-align: center; }
.trend-column > span { position: absolute; top: -19px; left: 50%; color: var(--muted); font-size: 8px; white-space: nowrap; transform: translateX(-50%) rotate(-35deg); transform-origin: center; }
.trend-column > i { display: block; width: min(78%, 30px); min-height: 2px; margin: 0 auto; border-radius: 5px 5px 1px 1px; background: linear-gradient(180deg, var(--accent), var(--accent-dark)); }
.trend-column > small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.report-bar-list { display: grid; gap: 13px; }
.report-bar-row { display: grid; gap: 6px; }
.report-bar-label { display: flex; justify-content: space-between; gap: 12px; color: #374151; font-size: 12px; }
.report-bar-label span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-bar-track { height: 7px; overflow: hidden; border-radius: 99px; background: #f3f4f6; }
.report-bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent-dark); }
.report-ranking { display: grid; gap: 4px; }
.report-ranking > div { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px 0; border-bottom: 1px solid #f1f2f4; }
.report-ranking > div:last-child { border-bottom: 0; }
.report-ranking b { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 11px; }
.report-ranking span strong, .report-ranking span small { display: block; }
.report-ranking span strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.report-ranking span small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.report-ranking em { font-size: 12px; font-style: normal; font-weight: 900; }
.appointment-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.appointment-report-grid > div { display: grid; gap: 2px; padding: 12px; border-radius: 11px; background: #f9fafb; }
.appointment-report-grid strong { color: #17131f; font-size: 20px; }
.appointment-report-grid span { color: var(--muted); font-size: 10px; }
.inventory-report-values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.inventory-report-values > div { display: grid; gap: 4px; padding: 12px; border-radius: 11px; background: #f9fafb; }
.inventory-report-values span { color: var(--muted); font-size: 10px; }
.inventory-report-values strong { font-size: 15px; }
.low-stock-report { display: grid; gap: 7px; }
.low-stock-report > div { display: flex; justify-content: space-between; gap: 9px; padding-bottom: 7px; border-bottom: 1px solid #f1f2f4; font-size: 11px; }
.low-stock-report b { color: var(--warning); white-space: nowrap; }
.report-detail .table-wrap { border-radius: 10px; }
.report-note { margin: 0 0 25px; color: var(--muted); font-size: 11px; text-align: center; }

@media print {
  @page { margin: 4mm; }
  body.printing-receipt * { visibility: hidden !important; }
  body.printing-receipt #receipt-print, body.printing-receipt #receipt-print * { visibility: visible !important; }
  body.printing-receipt #receipt-print { position: fixed; inset: 0 auto auto 0; width: var(--receipt-width); max-width: 100%; margin: 0; padding: 0; box-shadow: none; }
  body.printing-invoice * { visibility: hidden !important; }
  body.printing-invoice #invoice-print, body.printing-invoice #invoice-print * { visibility: visible !important; }
  body.printing-invoice #invoice-print { position: fixed; inset: 0; width: 100%; max-width: 210mm; margin: 0 auto; padding: 12mm; box-shadow: none; background: #fff; }
  body.printing-report * { visibility: hidden !important; }
  body.printing-report #report-print-area, body.printing-report #report-print-area * { visibility: visible !important; }
  body.printing-report #report-print-area { position: absolute; inset: 0; display: block; width: 100%; color: #000; }
  body.printing-report .card { break-inside: avoid; margin-bottom: 10px; border: 1px solid #bbb; box-shadow: none; }
  body.printing-report .report-kpis { grid-template-columns: repeat(3, 1fr); }
  body.printing-report .report-grid-wide, body.printing-report .report-grid-3 { display: block; }
  body.printing-report .trend-scroll { overflow: visible; }
  body.printing-report .trend-chart { min-width: 100%; }
}

@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .sale-layout { grid-template-columns: 1fr; }
  .checkout { position: static; }
  .role-grid, .branch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .mobile-menu-btn { display: inline-grid; }
  .sidebar-collapse { display: none; }
  .sidebar-close { display: inline-grid; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 88vw); height: 100vh;
    transform: translateX(-105%); transition: transform .22s ease; box-shadow: 16px 0 40px #0003;
  }
  .app-shell.mobile-nav-open .sidebar { transform: translateX(0); }
  .nav-overlay {
    display: block; position: fixed; inset: 0; background: #0f172a99; z-index: 25; opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .app-shell.mobile-nav-open .nav-overlay { opacity: 1; pointer-events: auto; }
  .brand { padding: 4px 6px 12px; }
  .main { padding: 0; }
  .topbar { padding: 14px 16px; }
  #content { padding: 18px; }
  .top-context { margin-left: auto; }
  .user-chip { max-width: 160px; }
  .color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-controls { align-items: stretch; flex-direction: column; }
  .report-actions { justify-content: flex-end; }
  .report-grid-wide, .report-grid-3 { grid-template-columns: 1fr; }
  .welcome-kpis, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .auth-screen { padding: 12px; }
  .auth-card { padding: 22px 18px; border-radius: 18px; }
  .access-kind button { padding: 10px; }
  .main { padding: 0; }
  #content { padding: 14px; }
  .topbar { align-items: flex-start; padding: 12px 14px; }
  .topbar h1 { font-size: 24px; }
  .avatar { display: none; }
  .top-actions { width: 100%; justify-content: stretch; }
  .top-context { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .top-context .context-label { flex: 1 1 165px; }
  .top-context .context-label select { width: 100%; max-width: none; }
  .cloud-chip { max-width: 125px; overflow: hidden; text-overflow: ellipsis; }
  .topbar { flex-wrap: wrap; }
  .context-label select { max-width: 160px; }
  .grid-4, .form-grid { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .agenda-grid { grid-template-columns: 66px minmax(0, 1fr); }
  .appointment { align-items: flex-start; flex-direction: column; }
  .cart-row { grid-template-columns: minmax(120px, 1fr) 60px auto; }
  .cart-price { grid-column: 1 / 3; text-align: left; }
  .search { min-width: 100%; }
  .toolbar .group { width: 100%; }
  .toolbar .group .search { flex: 1 1 100%; }
  .modal-actions > * { flex: 1; }
  .toast { right: 16px; bottom: 16px; }
  .role-grid, .branch-grid, .logo-upload-grid, .color-grid, .check-grid { grid-template-columns: 1fr; }
  .access-code-grid { grid-template-columns: 1fr; }
  .settings-section { padding: 16px; }
  .receipt-preview { padding: 10px; }
  .table-actions { flex-direction: column; }
  .report-filter-grid { display: grid; grid-template-columns: 1fr 1fr; }
  .report-filter-grid .field { min-width: 0; }
  .report-actions > button { flex: 1; }
  .report-heading { align-items: flex-start; flex-direction: column; }
  .report-generated { text-align: left; }
  .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-kpi { min-height: 112px; padding: 14px; }
  .report-kpi > strong { font-size: 20px; }
  .trend-chart { height: 190px; }
}

.cash-bar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; padding: 14px 16px; }
.cash-bar strong { display: block; margin: 4px 0; }
.cash-tender { display: grid; gap: 10px; margin: 10px 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafafa; }
.cash-tender[hidden] { display: none !important; }
.danger-zone { border-color: #fecaca; background: #fff7f7; }
.danger-zone .section-head h2 { color: #991b1b; }
.danger-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.cash-change { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.cash-change strong { font-size: 22px; }
.compact-note { margin: 0; font-size: 12px; line-height: 1.4; }
.denom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 12px 0; }
.denom-cell { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 12px; font-weight: 700; }
.denom-cell input { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.cash-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.cash-summary-grid > div { padding: 12px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line); }
.cash-summary-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.product-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: block; }
.product-thumb.empty { background: #f3f4f6; }
.product-photo-card { min-height: 180px; }
.catalog-heading { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.catalog-heading img { width: 56px; height: 56px; object-fit: contain; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.catalog-card { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.catalog-card img, .catalog-placeholder { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; background: #f3f4f6; }
.catalog-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.catalog-card em { font-style: normal; font-weight: 800; }
body.printing-catalog .app-shell,
body.printing-catalog #auth-screen,
body.printing-catalog #toast { display: none !important; }
body.printing-catalog #modal { position: static; border: 0; width: auto; max-width: none; background: #fff; }
body.printing-catalog #modal::backdrop { display: none; }
body.printing-catalog .modal-head,
body.printing-catalog .toolbar { display: none !important; }
body.printing-catalog .catalog-print-area { display: block !important; }
@media (max-width: 720px) {
  .cash-bar { flex-direction: column; align-items: stretch; }
  .cash-summary-grid { grid-template-columns: 1fr; }
}

.segmented { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; touch-action: manipulation; }
.segmented .segment { border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; min-height: 40px; touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; }
.segmented .segment.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.agenda-view-tabs .segment { min-width: 64px; }
.agenda-view-tabs .segment.active { background: var(--accent); color: var(--accent-text); }
.appt-new-client-fields { margin-top: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; background: #fafafa; }
.appt-contact-grid { align-items: start; }
.appt-contact-grid .field { min-height: 108px; }
.field-hint { display: block; min-height: 16px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.appointment.is-blocked { border-color: #fca5a5; background: #fef2f2; }
.appointment-continue { opacity: .75; padding: 6px 10px; border-style: dashed; }
.agenda-week-head { width: 100%; text-align: left; cursor: pointer; border: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 800; background: #fafafa; border-radius: 12px 12px 0 0; text-transform: capitalize; }
.agenda-slot-add { margin-top: 6px; width: 100%; justify-content: center; }
.agenda-month-add { font-size: 16px; color: var(--accent); font-weight: 800; }
.promo-chip { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: #ecfdf5; color: #047857; font-size: 11px; font-weight: 700; }
.promo-banner { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.price-was { text-decoration: line-through; color: var(--muted); font-weight: 500; margin-right: 4px; font-size: .92em; }
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.idea-card { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; align-content: start; }
.idea-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; margin: 8px 0 14px; max-height: 180px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; }

.empty-state { display: grid; gap: 12px; justify-items: start; padding: 8px 0; }
.empty-state p { margin: 0; color: var(--muted); }
.input-with-action { display: flex; gap: 8px; align-items: stretch; }
.input-with-action input { flex: 1; min-width: 0; }
.compact-btn { padding: 8px 12px; min-height: 40px; white-space: nowrap; }
.barcode-preview-code { display: inline-block; padding: 8px 12px; border-radius: 8px; background: #111827; color: #f9fafb; font-size: 14px; letter-spacing: .04em; }
.import-guide { margin: 12px 0 16px; }
.card-soft { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafafa; }
.import-upload { margin-top: 8px; }
.compact-table { font-size: 13px; }
.compact-note { margin: 6px 0 0; font-size: 12px; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.dashboard-quick { margin-bottom: 16px; }
.quick-action { display: flex; align-items: center; gap: 10px; justify-content: flex-start; min-height: 48px; }
.quick-action-tile {
  padding: 14px 16px;
  border: 2px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, #fff) 0%, #fff 100%);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.quick-action-tile:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 18%, transparent);
}
.quick-action-tile:active { transform: translateY(0); }
.quick-action-tile svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--accent); }
.inicio-quick { margin-bottom: 20px; padding: 4px 0; }
.import-products-btn { white-space: nowrap; }
.whatsapp-preview {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #14532d;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 14px;
}
.mt-card { margin-top: 16px; }
.platform-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.platform-actions .small-btn { white-space: nowrap; }
.danger-text { color: #991b1b; }
.support-banner {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: #1A3644; color: #f8fafc; z-index: 40;
}
.support-banner-copy { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.support-banner-copy strong { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.9; }
.support-banner-copy em { font-style: normal; font-weight: 700; }
.support-banner .ghost {
  color: #fff; border: 1px solid rgba(255,255,255,0.45); background: transparent;
  padding: 8px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap;
}
.support-banner .ghost:hover { background: rgba(255,255,255,0.12); }
.support-chip { background: #1A3644; color: #fff; border-color: #1A3644; }
body.support-mode .app-shell { grid-template-rows: auto minmax(0, 1fr); }
body.support-mode .app-shell > .sidebar,
body.support-mode .app-shell > .main { min-height: 0; height: auto; }
body.support-mode .app-shell > .sidebar { height: calc(100vh - 52px); }
.platform-detail-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 12px 0 16px;
}
.platform-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.platform-detail-section { margin: 14px 0; }
.platform-detail-section h3 { margin: 0 0 8px; font-size: 15px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plain-list li { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.platform-note-form { display: grid; gap: 8px; margin-bottom: 10px; }
.platform-note-form textarea { width: 100%; min-height: 72px; resize: vertical; }
.support-note .text-button { margin-left: 8px; }
.agenda-toolbar { align-items: flex-start; }
.agenda-nav { align-items: center; }
.agenda-period-label { min-width: 180px; text-transform: capitalize; }
.agenda-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.agenda-week-col { border: 1px solid var(--line); border-radius: 12px; background: #fff; min-height: 180px; display: flex; flex-direction: column; }
.agenda-week-col.is-today-col { border-color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.agenda-week-body { padding: 10px; display: grid; gap: 8px; align-content: start; }
.appointment.compact { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; cursor: pointer; }
.appointment.compact small { display: block; color: var(--muted); margin-top: 2px; }
.agenda-month { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; margin-bottom: 16px; }
.agenda-month-weekdays, .agenda-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.agenda-month-weekdays span { padding: 10px; text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); background: #fafafa; border-bottom: 1px solid var(--line); }
.agenda-month-grid { gap: 1px; background: var(--line); }
.agenda-month-cell { min-height: 96px; padding: 8px; border: 0; background: #fff; text-align: left; display: flex; flex-direction: column; gap: 4px; position: relative; }
.agenda-month-cell.empty { cursor: default; background: #fcfcfc; }
.agenda-month-cell.is-today { background: color-mix(in srgb, var(--accent) 8%, #fff); }
.agenda-month-day { font-weight: 800; }
.agenda-month-count { font-size: 11px; color: var(--accent); font-weight: 700; }
.agenda-month-list, .agenda-year-list { margin-top: 8px; }
.agenda-list-item { align-items: center; }
.agenda-list-actions { display: flex; gap: 8px; align-items: center; }
.agenda-year-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.agenda-year-month { display: grid; gap: 4px; text-align: left; cursor: pointer; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.agenda-year-month:hover { border-color: var(--accent); }
@media (max-width: 900px) {
  .agenda-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda-period-label { min-width: 0; width: 100%; }
}
.welcome-hero { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
@media (max-width: 820px) {
  .welcome-hero { flex-direction: column; align-items: stretch; }
  .welcome-hero-actions { justify-content: flex-start; }
}
.welcome-hero-brand { display: flex; gap: 16px; align-items: center; min-width: 0; }
.hero-logo { width: 84px; height: 84px; object-fit: contain; flex: 0 0 auto; background: transparent; image-rendering: auto; }
.welcome-hero h2 { margin: 4px 0; font-size: 28px; letter-spacing: -.02em; }
.welcome-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.value-sm { font-size: clamp(18px, 3vw, 24px); line-height: 1.2; word-break: break-word; }
.nav-locked .nav-label { opacity: .85; }
.nav-lock { margin-left: auto; font-size: 11px; color: #d97706; font-weight: 800; }
.premium-list { margin: 12px 0 16px 18px; line-height: 1.6; }
.premium-list li { margin-bottom: 6px; }
.client-picker-row { display: flex; gap: 8px; align-items: center; }
.client-picker-row input { flex: 1; min-width: 0; }
.client-picker .small-btn { flex: 0 0 auto; white-space: nowrap; }
.copyright-notice { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.5; }
.billing-toggle { margin: 8px 0 12px; }
.invoice-panel { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
#billing-fields { margin-top: 8px; }
#invoice-fields { display: grid; gap: 10px; margin-top: 10px; }
.invoice-doc { background: #fff; color: #111; padding: 18px; border: 1px solid var(--line); border-radius: 12px; max-width: 820px; margin: 0 auto; }
.invoice-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.invoice-logo { max-height: 56px; max-width: 160px; object-fit: contain; margin-bottom: 8px; }
.invoice-head h2 { margin: 0 0 6px; font-size: 22px; }
.invoice-head p, .invoice-parties p, .invoice-foot p { margin: 2px 0; font-size: 13px; line-height: 1.4; }
.invoice-meta-box { min-width: 200px; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px; background: #f9fafb; }
.invoice-meta-box strong { display: block; font-size: 20px; margin: 4px 0 8px; }
.invoice-parties { margin-bottom: 14px; padding: 12px; border-radius: 10px; background: #fafafa; border: 1px solid var(--line); }
.invoice-parties strong { display: block; margin: 4px 0 6px; }
.invoice-table-wrap { margin: 0 0 14px; }
.invoice-table { min-width: 0 !important; }
.invoice-totals { display: grid; gap: 6px; max-width: 280px; margin-left: auto; }
.invoice-totals > div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.invoice-grand { margin-top: 4px; padding-top: 8px; border-top: 2px solid #111; font-size: 18px; }
.invoice-foot { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line); }
.invoice-modal .receipt-preview { max-height: min(70vh, 720px); overflow: auto; }
.next-appt { display: flex; align-items: center; gap: 12px; }
.avatar-soft { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; flex: 0 0 auto; }
.metric-head { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.metric-button.metric-action { border-color: #fdba74; background: #fff7ed; }
.metric-button.metric-action .value { color: var(--warning); }
.sparkline { display: flex; align-items: end; gap: 6px; height: 120px; padding-top: 8px; }
.sparkline i { flex: 1; display: block; min-width: 8px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent), var(--accent-dark)); }
.list-button { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; }
.form-hint { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.req { color: var(--danger); font-weight: 800; }
.field-error { display: block; margin-top: 6px; color: var(--danger); font-size: 12px; font-weight: 700; }
.field-error[hidden] { display: none; }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: #fca5a5; background: #fff8f8; }
.stock-ok { color: var(--success); }
.stock-low { color: var(--warning); }
.stock-critical { color: var(--danger); }
.badge.danger { background: #fee2e2; color: #991b1b; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, #f3f4f6, #e5e7eb, #f3f4f6); background-size: 200% 100%; animation: skeleton 1.2s ease infinite; min-height: 72px; }
@keyframes skeleton { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.commission-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.commission-summary .metric { padding: 14px 16px; }
.commission-summary .metric strong { display: block; font-size: 1.35rem; margin: 4px 0; }
.commission-toolbar { flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.commission-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.compact-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--muted); }
.compact-field input, .compact-field select { min-width: 130px; }
.commission-admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.commission-admin-actions input { flex: 1; min-width: 180px; }
.data-table tr.is-paid { opacity: 0.82; }
@media (max-width: 760px) {
  .commission-summary { grid-template-columns: 1fr; }
}

.staff-notifications-host { display: flex; align-items: center; }
.notification-bell { position: relative; }
.notification-bell .nav-icon { width: 22px; height: 22px; }
.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.staff-notif-item.is-unread { border-left: 3px solid var(--primary); padding-left: 10px; }
.staff-notif-message { margin: 6px 0 0; font-size: 0.92rem; }
.staff-notif-card .list-item { align-items: flex-start; }
.compact-actions { margin-bottom: 8px; justify-content: flex-end; }
.staff-notif-list { max-height: min(60vh, 520px); overflow: auto; }
