<style>
  @import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

  :root {
    --bg: #0f0f11;
    --surface: #17171a;
    --surface2: #1e1e23;
    --surface3: #25252c;
    --border: #2a2a35;
    --border2: #35353f;
    --text: #e8e8f0;
    --text2: #9090a8;
    --text3: #60607a;
    --accent: #7c6af7;
    --accent2: #5d4fd6;
    --accent-soft: rgba(124,106,247,0.12);
    --green: #34d399;
    --green-soft: rgba(52,211,153,0.12);
    --red: #f87171;
    --red-soft: rgba(248,113,113,0.12);
    --amber: #fbbf24;
    --amber-soft: rgba(251,191,36,0.12);
    --blue: #60a5fa;
    --blue-soft: rgba(96,165,250,0.12);
    --pink: #f472b6;
    --sidebar-w: 240px;
    --header-h: 52px;
    --radius: 8px;
    --radius-lg: 12px;
  }

  body.light {
    --bg: #f0f0f5;
    --surface: #ffffff;
    --surface2: #f5f5fa;
    --surface3: #ebebf2;
    --border: #e0e0ea;
    --border2: #d0d0de;
    --text: #111118;
    --text2: #4a4a62;
    --text3: #9090aa;
    --accent: #6b58e8;
    --accent2: #5244c4;
    --accent-soft: rgba(107,88,232,0.10);
    --green: #059669;
    --green-soft: rgba(5,150,105,0.10);
    --red: #dc2626;
    --red-soft: rgba(220,38,38,0.10);
    --amber: #d97706;
    --amber-soft: rgba(217,119,6,0.10);
    --blue: #2563eb;
    --blue-soft: rgba(37,99,235,0.10);
  }

  /* smooth transition when toggling */
  body { transition: background 0.25s, color 0.25s; }
  .sidebar, .header, .card, .table-wrap, .calendar-wrap,
  .modal, .pos-right, .pos-left { transition: background 0.25s, border-color 0.25s; }

  /* Theme toggle widget */
  .theme-toggle {
    display: flex; align-items: center; gap: 7px;
    padding: 4px 10px 4px 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
  }
  .theme-toggle:hover { border-color: var(--accent); }
  .toggle-track {
    width: 30px; height: 17px;
    background: var(--surface3);
    border-radius: 9px;
    position: relative;
    transition: background 0.25s;
    border: 1px solid var(--border2);
    flex-shrink: 0;
  }
  .toggle-track.on { background: var(--accent); border-color: var(--accent); }
  .toggle-thumb {
    position: absolute;
    top: 2px; left: 2px;
    width: 11px; height: 11px;
    background: white;
    border-radius: 50%;
    transition: left 0.22s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
  .toggle-track.on .toggle-thumb { left: 15px; }
  .toggle-icon { font-size: 13px; line-height: 1; }
  .toggle-label { font-size: 11.5px; color: var(--text2); font-weight: 500; white-space: nowrap; }

  /* BELL / NOTIFICATIONS */
  .bell-btn {
    position: relative;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
  }
  .bell-btn:hover { border-color: var(--accent); background: var(--surface3); }
  .bell-badge {
    position: absolute;
    top: 3px; right: 3px;
    width: 8px; height: 8px;
    background: #f43f5e;
    border-radius: 50%;
    border: 1.5px solid var(--bg);
    display: none;
  }
  .bell-badge.has-unread { display: block; }

  .notif-panel {
    position: fixed;
    top: 56px; right: 16px;
    width: 340px;
    max-height: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: notifFadeIn 0.15s ease;
  }
  .notif-panel.open { display: flex; }
  @keyframes notifFadeIn {
    from { opacity:0; transform: translateY(-6px) scale(0.98); }
    to   { opacity:1; transform: translateY(0) scale(1); }
  }
  .notif-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .notif-header-title {
    font-size: 13px; font-weight: 700; color: var(--text);
  }
  .notif-header-actions { display: flex; gap: 6px; align-items: center; }
  .notif-mark-all {
    font-size: 11px; color: var(--accent); cursor: pointer;
    padding: 2px 6px; border-radius: 4px;
    transition: background 0.12s;
  }
  .notif-mark-all:hover { background: var(--accent-soft); }
  .notif-close {
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; cursor: pointer;
    color: var(--text3); font-size: 13px;
    transition: background 0.12s, color 0.12s;
  }
  .notif-close:hover { background: var(--surface3); color: var(--text); }
  .notif-list {
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border2) transparent;
  }
  .notif-item {
    display: flex; gap: 11px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
    position: relative;
  }
  .notif-item:last-child { border-bottom: none; }
  .notif-item:hover { background: var(--surface2); }
  .notif-item.unread { background: var(--accent-soft); }
  .notif-item.unread:hover { background: var(--surface3); }
  .notif-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
  }
  .notif-body { flex: 1; min-width: 0; }
  .notif-msg {
    font-size: 12.5px; color: var(--text);
    line-height: 1.45;
    font-weight: 500;
  }
  .notif-item:not(.unread) .notif-msg { font-weight: 400; color: var(--text2); }
  .notif-time {
    font-size: 10.5px; color: var(--text3);
    margin-top: 3px;
    font-family: 'DM Mono', monospace;
  }
  .notif-dismiss {
    opacity: 0; width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 11px; color: var(--text3);
    transition: opacity 0.12s, background 0.12s;
    flex-shrink: 0; align-self: center;
  }
  .notif-item:hover .notif-dismiss { opacity: 1; }
  .notif-dismiss:hover { background: var(--surface3); color: var(--text); }
  .notif-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text3);
    font-size: 13px;
  }
  .notif-empty-icon { font-size: 32px; margin-bottom: 10px; }
  .notif-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    flex-shrink: 0;
  }
  .notif-footer-link {
    font-size: 12px; color: var(--accent); cursor: pointer;
  }
  .notif-footer-link:hover { text-decoration: underline; }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  
  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
  }

  /* LAYOUT */
  .app { display: flex; height: 100vh; }

  /* SIDEBAR */
  .sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
  }

  .sidebar-logo {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
  }
  .logo-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.3px;
  }
  .logo-sub {
    font-size: 11px;
    color: var(--text3);
    margin-top: 1px;
  }
  [data-theme="dark"] .sidebar-logo img {
    filter: invert(1) brightness(1.8);
  }

  .sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    scrollbar-width: none;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }

  .nav-section {
    padding: 16px 10px 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text3);
    letter-spacing: 0.8px;
    text-transform: uppercase;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin: 1px 6px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text2);
    font-size: 12.5px;
    transition: all 0.15s;
    user-select: none;
    position: relative;
  }
  .nav-item:hover { background: var(--surface2); color: var(--text); }
  .nav-item.active { background: var(--accent-soft); color: var(--accent); }
  .nav-item.active .nav-icon { color: var(--accent); }
  .nav-icon { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
  .nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
  }
  .nav-sub {
    padding-left: 18px;
  }
  .nav-sub .nav-item {
    font-size: 12px;
    color: var(--text3);
    padding: 5px 10px;
  }
  .nav-sub .nav-item:hover { color: var(--text2); }
  .nav-sub .nav-item.active { color: var(--accent); }
  .nav-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin: 1px 6px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text2);
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.15s;
    user-select: none;
  }
  .nav-group-header:hover { background: var(--surface2); color: var(--text); }
  .nav-group-header.active { color: var(--accent); }
  .nav-chevron { margin-left: auto; font-size: 10px; transition: transform 0.2s; }
  .nav-chevron.open { transform: rotate(90deg); }

  .sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .avatar {
    width: 28px; height: 28px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; color: white;
    flex-shrink: 0;
  }
  .avatar-info { flex: 1; min-width: 0; }
  .avatar-name { font-size: 12px; font-weight: 500; color: var(--text); }
  .avatar-role { font-size: 10px; color: var(--text3); }

  /* ── SIDEBAR COLLAPSE ─────────────────────────────────────── */
  .sidebar {
    transition: width 0.24s cubic-bezier(.4,0,.2,1);
  }

  /* Top bar that always sits at the very top of the sidebar */
  /* Toggle button */
  .sidebar-toggle {
    width: 28px; height: 28px;
    border-radius: 7px;
    background: transparent;
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text2);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
    flex-shrink: 0;
  }
  .sidebar-toggle:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
  }
  .sidebar-toggle svg {
    width: 14px; height: 14px;
    transition: transform 0.24s cubic-bezier(.4,0,.2,1);
  }

  /* Collapsed state — narrow strip */
  .sidebar.collapsed { width: 52px; }

  /* Flip arrow and centre the button when collapsed */
  .sidebar.collapsed .sidebar-toggle { margin: 0 auto; }
  .sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

  /* Hide logo / subtitle when collapsed */
  .sidebar.collapsed .sidebar-logo { display: none; }

  /* Show a small branded icon instead */
  .sidebar-icon {
    display: none;
    width: 28px; height: 28px;
    border-radius: 7px;
    background: var(--accent);
    color: white;
    font-size: 13px;
    font-weight: 800;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.5px;
    flex-shrink: 0;
  }
  .sidebar.collapsed .sidebar-icon { display: flex; }

  /* Hide ALL text labels, badges, chevrons, sub-items in collapsed mode */
  .sidebar.collapsed .nav-item span:not(.nav-icon),
  .sidebar.collapsed .nav-group-header span:not(.nav-icon),
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-badge,
  .sidebar.collapsed .nav-chevron,
  .sidebar.collapsed .avatar-info { display: none; }

  /* Hide section titles (Tienda, Documentos, etc.) */
  .sidebar.collapsed .nav-section { display: none; }

  /* Hide sub-items entirely in collapsed mode — only group headers visible */
  .sidebar.collapsed .nav-sub { display: none !important; }

  /* Standalone nav-items in collapsed mode — show only icon, centred */
  .sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px 0;
    margin: 1px 4px;
    border-radius: 8px;
    position: relative;
  }
  .sidebar.collapsed .nav-item .nav-icon { font-size: 20px; }

  /* Collapsed group headers — centre the icon */
  .sidebar.collapsed .nav-group-header {
    justify-content: center;
    padding: 10px 0;
    margin: 1px 4px;
    border-radius: 8px;
    position: relative;
  }
  .sidebar.collapsed .nav-group-header .nav-icon { width: auto; font-size: 20px; }

  /* Tooltip on hover when collapsed — all nav items and group headers */
  .sidebar.collapsed .nav-group-header[data-label]:hover::after,
  .sidebar.collapsed .nav-item[data-label]:hover::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--text);
    color: var(--surface);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 9px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  }

  /* Collapsed footer: centre avatar, show tooltip */
  .sidebar.collapsed .sidebar-footer {
    justify-content: center;
    padding: 10px 0;
  }
  .sidebar.collapsed .sidebar-footer .avatar {
    width: 32px; height: 32px;
    font-size: 13px;
    cursor: default;
    position: relative;
  }
  .sidebar.collapsed .sidebar-footer .avatar:hover::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--text);
    color: var(--surface);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 9px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  }

  /* UPCOMING APPOINTMENTS PANEL */
  .upcoming-panel {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 8px;
    flex-shrink: 0;
  }
  .upcoming-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text3);
    margin-bottom: 8px;
  }
  .upcoming-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .upcoming-list::-webkit-scrollbar { height: 4px; }
  .upcoming-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
  .upcoming-card {
    display: flex;
    align-items: stretch;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    min-width: 200px;
    max-width: 220px;
    flex-shrink: 0;
    cursor: pointer;
    transition: box-shadow .15s, transform .1s;
  }
  .upcoming-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.1); transform: translateY(-1px); }
  .upcoming-card-stripe {
    width: 5px;
    flex-shrink: 0;
  }
  .upcoming-card-body {
    padding: 8px 10px;
    flex: 1;
    min-width: 0;
  }
  .upcoming-card-time {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 2px;
  }
  .upcoming-card-date {
    font-size: 10px;
    color: var(--text3);
    margin-bottom: 4px;
  }
  .upcoming-card-client {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .upcoming-card-svc {
    font-size: 10px;
    color: var(--text2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
  }
  .upcoming-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    font-size: 10px;
    color: var(--text3);
  }
  .upcoming-card-staff-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .upcoming-status-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: auto;
    flex-shrink: 0;
  }
  .upcoming-status-badge.confirmada { background: #dcfce7; color: #166534; }
  .upcoming-status-badge.programada { background: #dbeafe; color: #1e40af; }
  .upcoming-status-badge.pendiente  { background: #fee2e2; color: #991b1b; }
  .dark .upcoming-status-badge.confirmada { background: #14532d; color: #86efac; }
  .dark .upcoming-status-badge.programada { background: #1e3a5f; color: #93c5fd; }
  .dark .upcoming-status-badge.pendiente  { background: #450a0a; color: #fca5a5; }
  .dark .upcoming-status-badge.pendiente  { background: #450a0a; color: #fca5a5; }
  .upcoming-empty {
    font-size: 12px;
    color: var(--text3);
    padding: 6px 2px;
    font-style: italic;
  }

  /* MAIN */
  .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

  /* OFFLINE BANNER */
  .offline-banner {
    background: linear-gradient(90deg, #7c2d12, #92400e);
    color: #fde68a;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    display: none;
  }
  .offline-banner.show { display: flex; }

  /* HEADER */
  .header {
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    flex-shrink: 0;
  }
  .header-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    letter-spacing: -0.3px;
  }
  .header-actions { display: flex; gap: 8px; align-items: center; }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    font-family: inherit;
  }
  .btn-primary { background: var(--accent); color: white; }
  .btn-primary:hover { background: var(--accent2); }
  .btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
  .btn-ghost:hover { background: var(--surface2); color: var(--text); }
  .btn-danger { background: var(--red-soft); color: var(--red); border: 1px solid transparent; }
  .btn-danger:hover { background: var(--red); color: white; }
  .btn-sm { padding: 4px 10px; font-size: 11.5px; }
  .btn-icon { padding: 6px; width: 32px; justify-content: center; }

  /* CONTENT */
  .content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--border2) transparent;
  }
  /* Calendar pages need the full viewport — no outer scroll, no padding */
  .content.cal-mode {
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
  }

  /* SEARCH BAR */
  .search-bar {
    display: flex;
    align-items: center;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 10px;
    gap: 8px;
    height: 34px;
    min-width: 200px;
  }
  .search-bar input {
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 12.5px;
    font-family: inherit;
    width: 100%;
  }
  .search-bar input::placeholder { color: var(--text3); }
  .search-icon { color: var(--text3); font-size: 13px; }

  /* TABLE */
  .table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
  table { width: 100%; border-collapse: collapse; }
  thead tr { border-bottom: 1px solid var(--border); }
  th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text3);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
  }
  td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text2);
    vertical-align: middle;
  }
  tbody tr:last-child td { border-bottom: none; }
  tbody tr:hover td { background: var(--surface2); cursor: pointer; }
  .td-bold { color: var(--text); font-weight: 500; }

  /* BADGES */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
  }
  .badge-green { background: var(--green-soft); color: var(--green); }
  .badge-red { background: var(--red-soft); color: var(--red); }
  .badge-amber { background: var(--amber-soft); color: var(--amber); }
  .badge-blue { background: var(--blue-soft); color: var(--blue); }
  .badge-purple { background: var(--accent-soft); color: var(--accent); }
  .badge-gray { background: var(--surface3); color: var(--text2); }
  .badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

  /* CARDS */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
  }
  .card-title { font-size: 12px; color: var(--text3); font-weight: 500; margin-bottom: 6px; }
  .card-value { font-size: 24px; font-weight: 600; color: var(--text); letter-spacing: -0.5px; }
  .card-sub { font-size: 11px; color: var(--text3); margin-top: 4px; }

  /* GRID */
  .grid { display: grid; gap: 12px; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }

  /* FILTER ROW */
  .filter-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
  }
  .filter-row .search-bar { flex: 1; min-width: 200px; max-width: 320px; }
  .select-filter {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text2);
    font-size: 12px;
    font-family: inherit;
    padding: 0 10px;
    height: 34px;
    outline: none;
    cursor: pointer;
  }

  /* MODAL */
  .modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    display: none;
  }
  .modal-backdrop.show { display: flex; }
  .modal {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    width: 480px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  }
  .modal-header {
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .modal-title { font-size: 14px; font-weight: 600; color: var(--text); }
  .modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
  .modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
  }
  .btn-close {
    background: none; border: none; color: var(--text3);
    font-size: 16px; cursor: pointer; padding: 2px; line-height: 1;
  }
  .btn-close:hover { color: var(--text); }

  /* FORM */
  .form-group { display: flex; flex-direction: column; gap: 5px; }
  .form-label { font-size: 11.5px; font-weight: 500; color: var(--text2); }
  .form-input, .form-select, .form-textarea {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    padding: 8px 10px;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
  }
  .form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--accent);
  }
  .form-input::placeholder { color: var(--text3); }
  .form-textarea { resize: vertical; min-height: 70px; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

  /* CALENDAR */
  .calendar-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;         /* fill cal-mode content area */
  }
  .cal-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
  }
  .cal-nav-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
  }
  .cal-nav-btn:hover { background: var(--surface3); color: var(--text); }
  .cal-title { 
    font-size: 13px; font-weight: 600; color: var(--text); margin: 0 8px; 
    cursor: pointer; display: flex; align-items: center; gap: 6px;
    padding: 4px 8px; border-radius: 6px; transition: background 0.15s;
    user-select: none;
  }
  .cal-title:hover { background: var(--surface2); color: var(--accent); }
  .cal-title::after { content: '▾'; font-size: 10px; opacity: 0.5; margin-top: 1px; }

  /* Date Picker Popover */
  .cal-date-picker-popover {
    position: absolute;
    z-index: 3000;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
    padding: 12px;
    width: 260px;
    display: none;
    margin-top: 4px;
    animation: pickerOpen 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes pickerOpen {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  .picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
  }
  .picker-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
  }
  .picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
  }
  .picker-day-name {
    font-size: 10px;
    font-weight: 700;
    color: var(--text3);
    text-align: center;
    padding: 4px 0;
    text-transform: uppercase;
  }
  .picker-day {
    font-size: 11.5px;
    text-align: center;
    padding: 7px 0;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text2);
    transition: all 0.1s;
  }
  .picker-day:hover { background: var(--surface2); color: var(--text); }
  .picker-day.other { opacity: 0.25; }
  .picker-day.selected { background: var(--accent); color: white; font-weight: 700; }
  .picker-day.today { color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1px var(--accent-soft); }
  .picker-day.today.selected { color: white; }
  .cal-view-tabs {
    display: flex;
    gap: 0;
    margin-left: auto;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 2px;
  }
  .cal-view-tab {
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text3);
    border: 1px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
    user-select: none;
  }
  .cal-view-tab:hover:not(.active) { color: var(--text2); background: var(--surface3); }
  .cal-view-tab.active {
    background: var(--surface);
    color: var(--accent);
    border-color: var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-weight: 600;
  }

  .cal-grid {
    display: grid;
    overflow: hidden;
  }
  .cal-day-header {
    flex: 1;
    padding: 9px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text3);
    border-right: 1px solid var(--border);
    text-align: center;
    background: var(--surface2);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cal-day-header:last-child { border-right: none; }
  .cal-time-col {
    width: 52px;
    flex-shrink: 0;
  }
  .cal-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border2) transparent;
  }
  .time-labels {
    width: 52px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
  }
  .time-label {
    height: 80px;        /* 4 × 20px slots per hour */
    padding: 4px 6px;
    font-size: 10px;
    font-family: 'DM Mono', monospace;
    color: var(--text3);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    position: relative;
  }
  .staff-cols {
    flex: 1;
    display: flex;
  }
  .staff-col {
    flex: 1;
    border-right: 1px solid var(--border);
    position: relative;
    min-width: 0;
  }
  .staff-col:last-child { border-right: none; }
  .hour-row {
    height: 80px;        /* 4 slots × 20px */
    border-bottom: 1px solid var(--border);
    position: relative;
  }
  /* 15-min slot dividers inside each hour */
  .quarter-line {
    position: absolute;
    left: 0; right: 0;
    border-top: 1px solid rgba(255,255,255,0.05);
  }
  body.light .quarter-line { border-top-color: rgba(0,0,0,0.07); }
  .quarter-line:nth-child(1) { top: 20px; }   /* :15 */
  .quarter-line:nth-child(2) { top: 40px; }   /* :30 */
  .quarter-line:nth-child(3) { top: 60px; }   /* :45 */

  .appt-block {
    position: absolute;
    left: 3px; right: 3px;
    border-radius: 8px;
    padding: 6px 8px 18px;
    font-size: 11.5px;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    transition: opacity 0.15s, box-shadow 0.15s;
    z-index: 2;
    background: #e8faf0;
    border: 1.5px solid #a3e8be;
    border-left: 3px solid #2dba6d;
    color: #1a3a28;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  }
  .appt-block:active { cursor: grabbing !important; }
  .appt-block:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.13); border-color: #2dba6d; }
  .appt-block.dragging-ghost {
    opacity: 0.38 !important;
    pointer-events: none;
  }
  .appt-block.drag-preview {
    background: #d0f5e3 !important;
    border: 2px dashed #2dba6d !important;
    border-left: 3px dashed #2dba6d !important;
    opacity: 0.85 !important;
    box-shadow: 0 4px 16px rgba(45,186,109,0.18);
    pointer-events: none;
    z-index: 10;
  }
  .appt-name   { font-weight: 700; color: #1db954; font-size: 11.5px; margin-bottom:1px; }
  .appt-service{ color: #1a3a28; font-size: 11px; font-weight: 500; margin-bottom:1px; }
  .appt-time   { color: #3a6650; font-size: 10.5px; margin-bottom:1px; }
  .appt-client { color: #1a3a28; font-size: 11px; margin-bottom:1px; }
  .appt-cabin  { color: #5a8a72; font-size: 10px; display:flex; align-items:center; gap:4px; }
  .appt-cabin-pin { font-size:10px; }
  .appt-resize-handle {
    position: absolute; bottom: 0; left: 0; right: 0; height: 9px;
    cursor: s-resize !important;
    border-radius: 0 0 6px 6px;
    display: flex; align-items: center; justify-content: center;
  }
  .appt-resize-handle::after {
    content:''; width:22px; height:2px;
    background: rgba(45,186,109,0.4); border-radius:1px;
  }
  .appt-resize-handle:hover::after { background: #2dba6d; }
  /* Break block */
  .break-block { user-select: none; }
  .break-block:hover { border-color: #64748b !important; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
  .break-resize-handle::after { background: rgba(100,116,139,0.5) !important; }
  .break-resize-handle:hover::after { background: #64748b !important; }
  .dark .break-block { background: #1e293b !important; border-color: #475569 !important; color: #94a3b8 !important; }
  .staff-col { cursor: cell; }

  /* Drag time tooltip */
  .drag-time-badge {
    position: fixed;
    background: #1e293b;
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 10px;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    display: none;
    text-align: center;
    line-height: 1.5;
  }
  .resize-time-badge {
    position: absolute;
    bottom: 14px; right: 8px;
    background: #2dba6d;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    pointer-events: none;
    z-index: 5;
    white-space: nowrap;
    display: none;
  }

  /* POS */
  .pos-layout { display: flex; gap: 0; height: calc(100vh - var(--header-h) - 40px); overflow: hidden; }
  .pos-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
  }
  .pos-tabs {
    display: flex;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
  }
  .pos-tab {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text3);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
  }
  .pos-tab:hover { color: var(--text2); }
  .pos-tab.active { color: var(--accent); border-color: var(--accent); }
  .pos-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: var(--border2) transparent;
  }
  .pos-item-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 12px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .pos-item-card:hover { border-color: var(--accent); background: var(--accent-soft); }
  .pos-item-name { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
  .pos-item-sub { font-size: 11px; color: var(--text3); }
  .pos-item-price { font-size: 16px; font-weight: 600; color: var(--accent); margin-top: 8px; }

  .pos-right {
    width: 300px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
  }
  .pos-ticket-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
  }
  .pos-client-select {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
  }
  .pos-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border2) transparent;
  }
  .pos-line {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    gap: 10px;
  }
  .pos-line-info { flex: 1; min-width: 0; }
  .pos-line-name { font-size: 12.5px; color: var(--text); font-weight: 500; }
  .pos-line-price { font-size: 11.5px; color: var(--text3); }
  .pos-line-total { font-size: 13px; font-weight: 600; color: var(--text); }
  .pos-qty { display: flex; align-items: center; gap: 6px; }
  .qty-btn {
    width: 22px; height: 22px;
    background: var(--surface3);
    border: none; border-radius: 4px;
    color: var(--text2); cursor: pointer;
    font-size: 14px; display: flex; align-items: center; justify-content: center;
  }
  .qty-btn:hover { background: var(--border2); }
  .qty-val { font-size: 12px; font-weight: 500; color: var(--text); min-width: 16px; text-align: center; }
  .pos-empty { padding: 30px 16px; text-align: center; color: var(--text3); font-size: 12px; }

  .pos-footer {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .pos-discount-row { display: flex; align-items: center; gap: 8px; }
  .pos-discount-label { font-size: 12px; color: var(--text3); }
  .pos-discount-val { font-size: 12px; font-weight: 500; color: var(--text2); }
  .pos-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid var(--border);
  }
  .pos-total-label { font-size: 14px; font-weight: 600; color: var(--text); }
  .pos-total-amount { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
  .payment-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .pay-method {
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 7px;
    padding: 0;
    aspect-ratio: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 11px;
    color: var(--text2);
    gap: 4px;
  }
  .pay-method:hover { border-color: var(--accent); color: var(--accent); }
  .pay-method.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
  .pay-method-icon { font-size: 20px; line-height: 1; }
  .pay-method-label { font-size: 10.5px; font-weight: 600; line-height: 1.2; padding: 0 4px; }
  .pay-method-sin { /* full-width flat button for Sin pago */
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 7px;
    padding: 8px 12px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer; transition: all 0.15s;
    font-size: 11.5px; font-weight: 600; color: var(--text3);
  }
  .pay-method-sin:hover { border-color: var(--border2); color: var(--text2); }
  .pay-method-sin.selected { border-color: var(--text3); background: var(--surface3); color: var(--text2); }
  .coupon-row { display: flex; gap: 6px; }
  .coupon-input {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 5px;
    color: var(--text);
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    padding: 6px 10px;
    outline: none;
  }
  /* ── Sortable table headers ── */
  .th-sort {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    position: relative;
  }
  .th-sort:hover { color: var(--accent); }
  .th-sort .sort-icon {
    display: inline-block;
    margin-left: 5px;
    font-size: 10px;
    opacity: 0.4;
    vertical-align: middle;
    transition: opacity 0.15s;
  }
  .th-sort.asc  .sort-icon,
  .th-sort.desc .sort-icon { opacity: 1; color: var(--accent); }
  .th-sort.asc  .sort-icon::after { content: '▲'; }
  .th-sort.desc .sort-icon::after { content: '▼'; }
  .th-sort:not(.asc):not(.desc) .sort-icon::after { content: '⇅'; }

  .cobrar-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 7px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
  }
  .cobrar-btn:hover { background: var(--accent2); }

  /* DASHBOARD STATS */
  .stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
    overflow: hidden;
  }
  .stat-label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }
  .stat-value { font-size: 28px; font-weight: 700; color: var(--text); margin: 6px 0 4px; letter-spacing: -1px; }
  .stat-change { font-size: 11px; }
  .stat-change.up { color: var(--green); }
  .stat-change.down { color: var(--red); }
  .stat-icon {
    position: absolute;
    right: 16px; top: 16px;
    font-size: 22px;
    opacity: 0.3;
  }

  /* SECTION TITLE */
  .section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
    margin-top: 20px;
  }
  .section-title:first-child { margin-top: 0; }

  /* SYNC STATUS */
  .sync-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text3);
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--surface2);
    border: 1px solid var(--border);
  }
  .sync-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s infinite;
  }
  .sync-dot.offline { background: var(--red); animation: none; }
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
  }

  /* HIDDEN */
  .page { display: none; }
  .page.active { display: block; }

  /* SCROLLBAR */
  ::-webkit-scrollbar { width: 4px; height: 4px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

  /* EMPTY STATE */
  .empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text3);
  }
  .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
  .empty-text { font-size: 14px; color: var(--text2); margin-bottom: 4px; }
  .empty-sub { font-size: 12px; }

  /* WHATSAPP */
  .wa-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px;
    background: rgba(37,211,102,0.12);
    color: #25d366;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.15s;
  }
  .wa-btn:hover { background: rgba(37,211,102,0.25); }

  /* Appointment modal WA button override */
  #apptWaBox .wa-btn {
    background: #25D366;
    color: white;
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 7px;
    font-weight: 600;
  }
  #apptWaBox .wa-btn:hover { background: #1ebe5d; }

  /* Appt service blocks */
  .appt-svc-block { transition: opacity 0.15s, transform 0.15s; }

  /* LOGS */
  .log-entry {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
  }
  .log-entry:last-child { border-bottom: none; }
  .log-time {
    font-family: 'DM Mono', monospace;
    font-size: 10.5px;
    color: var(--text3);
    white-space: nowrap;
    padding-top: 1px;
  }
  .log-level {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    align-self: flex-start;
  }
  .log-level.info { background: var(--blue-soft); color: var(--blue); }
  .log-level.success { background: var(--green-soft); color: var(--green); }
  .log-level.warn { background: var(--amber-soft); color: var(--amber); }
  .log-level.error { background: var(--red-soft); color: var(--red); }
  .log-msg { font-size: 12px; color: var(--text2); flex: 1; }

  /* MONTH CALENDAR */
  .month-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* grid-template-rows set dynamically per month */
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
    min-height: 0;
  }
  .month-dow {
    padding: 8px;
    text-align: center;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text3);
    background: var(--surface2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .month-day {
    background: var(--surface);
    padding: 5px;
    min-height: 0;    /* let grid-auto-rows control height */
    cursor: pointer;
    transition: background 0.1s;
    vertical-align: top;
    overflow: hidden;
  }
  .month-day:hover { background: var(--surface2); }
  .month-day.other-month { opacity: 0.35; }
  .month-day.today .day-num {
    background: var(--accent);
    color: white;
    border-radius: 50%;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
  }
  .day-num { font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 3px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
  .day-appt {
    font-size: 10px;
    border-radius: 3px;
    padding: 1px 5px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    line-height: 1.5;
    border-left: 2.5px solid transparent;
  }
  /* Week view */
  /* ── Week view: full-height flex layout ── */
  .week-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: 1px solid var(--border);
  }
  .week-header-row {
    display: flex;
    flex-shrink: 0;
    border-bottom: 2px solid var(--border);
    background: var(--surface2);
  }
  .week-gutter-header {
    width: 46px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
  }
  .week-day-header {
    flex: 1;
    padding: 7px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text3);
    border-right: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
  }
  .week-day-header:last-child { border-right: none; }
  .week-day-header:hover { background: var(--surface3); color: var(--text); }
  .week-day-header.today-col { color: var(--accent); background: var(--accent-soft); }
  .week-body {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border2) transparent;
  }
  .week-time-col {
    width: 46px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: var(--surface2);
    position: relative;
  }
  .week-time-inner {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
  }
  .week-time-label {
    flex: 1;
    font-size: 9px;
    color: var(--text3);
    text-align: right;
    padding-right: 5px;
    padding-top: 2px;
    border-bottom: 1px solid var(--border);
    box-sizing: border-box;
    min-height: 0;
  }
  .week-cols {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
  }
  .week-day-col {
    flex: 1;
    position: relative;
    border-right: 1px solid var(--border);
    min-width: 0;
  }
  .week-day-col:last-child { border-right: none; }
  .week-day-col.today-col { background: color-mix(in srgb, var(--accent) 3%, var(--surface)); }
  .week-day-inner {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
  }
  .week-hour-line {
    position: absolute;
    left: 0; right: 0;
    border-bottom: 1px solid var(--border);
    pointer-events: none;
  }
  .week-hour-line.half {
    border-bottom-style: dotted;
    opacity: 0.45;
  }
  .week-appt {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 10px;
    font-weight: 600;
    overflow: hidden;
    cursor: pointer;
    border-left: 3px solid transparent;
    line-height: 1.3;
    z-index: 2;
    transition: opacity 0.12s, box-shadow 0.12s;
    box-sizing: border-box;
  }
  .week-appt:hover { opacity: 0.88; z-index: 3; box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
  .week-appt-svc { font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .week-appt-time { font-size: 9px; opacity: 0.75; margin-top: 1px; }

  /* CLIENTS */
  .client-detail {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: flex-start;
  }
  .client-avatar-lg {
    width: 48px; height: 48px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 600; color: white;
    flex-shrink: 0;
  }
  .client-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin: 0 -20px; padding: 0 20px; }
  .client-tab {
    padding: 8px 14px;
    font-size: 12.5px;
    cursor: pointer;
    color: var(--text3);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
    font-weight: 500;
  }
  .client-tab:hover { color: var(--text2); }
  .client-tab.active { color: var(--accent); border-color: var(--accent); }
  .client-stats { display: flex; gap: 20px; margin: 12px 0; }
  .client-stat-val { font-size: 20px; font-weight: 700; color: var(--text); }
  .client-stat-label { font-size: 10px; color: var(--text3); }

  .page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
  .page-header-title { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.4px; flex: 1; }

  /* TRANSITIONS */
  .fade-in { animation: fadeIn 0.2s ease; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
  @keyframes slideUp { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }

  /* RESPONSIVE PAYMENT METHODS */

  /* Bono cards */
  .bono-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.15s;
  }
  .bono-card:hover { border-color: var(--accent); }
  .bono-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
  .bono-client { font-size: 14px; font-weight: 600; color: var(--text); }
  .bono-service { font-size: 12px; color: var(--text3); margin-top: 2px; }
  .bono-progress { height: 4px; background: var(--surface3); border-radius: 2px; margin: 10px 0; overflow: hidden; }
  .bono-progress-bar { height: 100%; background: var(--accent); border-radius: 2px; }
  .bono-counts { display: flex; justify-content: space-between; font-size: 11px; color: var(--text3); }
  .bono-total { font-size: 12px; color: var(--text3); }
  .bono-use-btn {
    display: flex; align-items: center; gap: 6px;
    margin-top: 12px;
    font-size: 12px; color: var(--text2);
    background: none; border: none; cursor: pointer; font-family: inherit;
    padding: 4px 0;
  }
  .bono-use-btn:hover { color: var(--accent); }

  /* ---- CABIN VIEW HEADER ALIGNMENT ---- */
  .cabin-header-row {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .cabin-header-gutter {
    width: 52px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: var(--surface2);
  }
  /* This flex container must mirror exactly the staff-cols flex layout */
  .cabin-header-cells {
    flex: 1;
    display: flex;
    min-width: 0;
  }
  /* Each header cell stretches identically to its matching .cabin-col */
  .cabin-header-cell {
    flex: 1;
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    border-right: 1px solid var(--border);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
  }
  .cabin-header-cell:last-child { border-right: none; }
  body.light .cabin-header-cell { color: var(--text2); }

  /* REMINDER CARDS */
  .reminder-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: box-shadow 0.15s;
  }
  .reminder-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.18); }
  .reminder-card-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  }
  .reminder-msg-wrap {
    margin: 12px 0 0;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
  }
  .reminder-msg-wrap:hover { border-color: var(--accent); background: var(--surface3); }
  .reminder-msg-wrap.copied { border-color: var(--green); }
  .reminder-msg {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text2);
    white-space: pre-wrap;
    user-select: none;
  }
  .reminder-copy-hint {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text3);
    text-align: right;
  }
  .reminder-actions {
    display: flex; align-items: center; gap: 8px;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--border);
  }
  .reminder-actions .wa-btn {
    font-size: 12px; padding: 6px 14px;
    text-decoration: none;
  }

  /* TABS SYSTEM (REUSABLE) */
  .tabs-container {
    display: flex;
    gap: 4px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 3px;
    width: fit-content;
  }
  .tab-btn {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text3);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: inherit;
  }
  .tab-btn:hover:not(.active) {
    color: var(--text);
    background: var(--surface3);
  }
  .tab-btn.active {
    background: var(--surface);
    color: var(--accent);
