/* =====================================================================
       1. TOKENS — Pastel Pink + Be Vietnam Pro (Optical Alignment &
          Balanced Symmetrical Bento Rhythm on PC & Mobile)
       ===================================================================== */
    :root {
      color-scheme: light;
      --bg: #FFF7FA; --surface: #FFFFFF; --soft: #FFF0F6; --soft2: #FDF2F8;
      --line: #F5DDE8; --line2: #FAEEF3; --ctl: #EBCFDC;
      --text: #2A1220; --muted: #7A5266; --faint: #A07D8E;
      --pink: #EC4899; --pink2: #DB2777; --pink-ink: #9D174D; --pink-soft: #FCE7F3;
      --grad: linear-gradient(135deg, #F472B6 0%, #DB2777 100%);
      --violet: #8B5CF6; --violet-soft: #EDE9FE; --violet-ink: #5B21B6;
      --sky: #0EA5E9; --sky-soft: #E0F2FE; --sky-ink: #075985;
      --green: #16A34A; --green-soft: #DCFCE7; --green-ink: #14532D;
      --amber: #D97706; --amber-soft: #FEF3C7; --amber-ink: #78350F;
      --red: #E11D48; --red-soft: #FFE4E6; --red-ink: #881337;
      --shadow: 0 1px 2px rgba(42,18,32,.04), 0 8px 24px rgba(219,39,119,.06);
      --shadow-lg: 0 24px 56px rgba(42,18,32,.18);
      --r: 18px; --r-sm: 12px;
      --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
      --font-serif: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
      --font: var(--font-sans);
      --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      --ease: cubic-bezier(.23,1,.32,1);
      --safe-top: env(safe-area-inset-top, 0px);
      --safe-bottom: env(safe-area-inset-bottom, 0px);
      --safe-left: env(safe-area-inset-left, 0px);
      --safe-right: env(safe-area-inset-right, 0px);
    }
    * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
    html { background: var(--surface); color-scheme: light; }
    html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 13.5px; line-height: 1.48; letter-spacing: -.005em; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1, "kern" 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
    button, input, select, textarea { font-family: var(--font-sans); color: inherit; letter-spacing: inherit; font-variant-numeric: lining-nums tabular-nums; touch-action: manipulation; }
    ::placeholder { font-family: var(--font-sans); font-size: 11.5px; color: #94A3B8; font-weight: 400; opacity: 1; }
    select { font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: var(--text); }
    :focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
    .num { font-family: var(--font-sans); font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
    .mono { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
    .muted { color: var(--muted); }
    [hidden], .hidden { display: none !important; }
    .affiliate-sync-panel { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft2); }
    .affiliate-sync-panel > div { flex: 1 1 240px; min-width: 0; }
    #affiliateSyncResult { flex-basis: 100%; overflow-wrap: anywhere; }
    #affiliateSyncResult:empty { display: none; }
    .affiliate-caption { font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
    .order-sync-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 0; padding: 12px; border: 1px solid var(--line2); border-radius: 14px; background: var(--surface); font-size: 12px; }
    .order-sync-bar [data-order-sync-status] { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
    .order-sync-bar .btn { flex-shrink: 0; }
    .order-view-status { margin: -4px 0 12px; font-size: 11.5px; line-height: 1.5; overflow-wrap: anywhere; }
    .order-view-status:empty { display: none; }
    .storage-provider { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
    .card.storage-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; margin-bottom: 14px; }
    .storage-toolbar #stUsageStatus { grid-column: 1 / -1; min-height: 18px; font-size: 11px; overflow-wrap: anywhere; }
    @media (max-width: 560px) { .card.storage-toolbar { grid-template-columns: 1fr; } .storage-toolbar #stUsageStatus { grid-column: 1; } .storage-toolbar .btn { width: 100%; } }
    .storage-provider .card-h { flex-wrap: wrap; gap: 8px; margin: 0; }
    .storage-metric { display: grid; gap: 4px; }
    .storage-metric-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; }
    .storage-metric-row .num { font-weight: 700; }
    .storage-metric-note { font-size: 10.5px; }
    .storage-provider-status { align-self: start; font-size: 10.5px; }
    .storage-provider-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 10px; margin-top: auto; border-top: 1px dashed var(--line); font-size: 10.5px; }
    .storage-config { font-size: 11px; overflow-wrap: anywhere; }
    .storage-config summary { cursor: pointer; color: var(--muted); }
    .storage-config p { margin-top: 8px; }
    .storage-management-grid { display: grid; grid-template-columns: minmax(0,1.06fr) minmax(320px,.94fr); gap: 14px; margin-top: 14px; align-items: start; }
    .storage-side-stack { display: grid; gap: 14px; min-width: 0; }
    .storage-cleanup-card, .storage-settings-card, .storage-history-card { min-width: 0; }
    .storage-cleanup-list { display: grid; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
    .storage-cleanup-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 11px 12px; border-bottom: 1px solid var(--line2); }
    .storage-cleanup-row:last-child { border-bottom: 0; }
    .storage-cleanup-copy { display: grid; gap: 3px; min-width: 0; }
    .storage-cleanup-copy > strong { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .storage-cleanup-copy small { color: var(--muted); overflow-wrap: anywhere; }
    .storage-cleanup-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
    .storage-range { display: grid; gap: 6px; margin-top: 14px; }
    .storage-range > span, .storage-range small { display: flex; justify-content: space-between; gap: 12px; }
    .storage-range b { color: var(--pink2); }
    .storage-range input { width: 100%; accent-color: var(--pink2); }
    .storage-range small { color: var(--muted); font-size: 10px; }
    .storage-auto-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft2); }
    .storage-auto-row > span { display: grid; gap: 2px; }
    .storage-auto-row small { color: var(--muted); line-height: 1.45; }
    .storage-settings-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
    .storage-history { display: grid; margin-top: 12px; border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; }
    .storage-history-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line2); }
    .storage-history-row:last-child { border-bottom: 0; }
    .storage-history-row small { display: block; color: var(--muted); margin-top: 2px; }
    @media (max-width: 900px) { .storage-management-grid { grid-template-columns: 1fr; } }
    @media (max-width: 560px) {
      .storage-management-grid { gap: 10px; margin-top: 10px; }
      .storage-cleanup-card .card-h { align-items: stretch; }
      .storage-cleanup-card .sel, .storage-cleanup-foot .btn { width: 100%; }
      .storage-cleanup-row, .storage-history-row { grid-template-columns: 1fr; }
      .storage-cleanup-row > .num, .storage-history-row > .pill { justify-self: start; }
    }
    .storage-setup { padding: 12px; background: var(--soft2); border-radius: 12px; overflow-wrap: anywhere; }
    .storage-links { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: auto; }
    .storage-links .btn { text-decoration: none; }
    .api-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
    .api-sync-date-pill {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      height: 36px;
      padding: 0 14px;
      border-radius: 999px;
      background: #ffffff;
      border: 1.5px solid #efc9da;
      box-shadow: 0 2px 6px rgba(225, 29, 72, 0.05);
      font-family: var(--font-sans);
      font-size: 12.5px;
      font-weight: 700;
      color: var(--pink-ink);
      cursor: pointer;
      transition: all 160ms var(--ease);
      white-space: nowrap;
    }
    .api-sync-date-pill:hover {
      background: var(--pink-soft);
      border-color: var(--pink);
      box-shadow: 0 4px 14px rgba(236, 72, 153, 0.16);
      transform: translateY(-1px);
    }
    .api-sync-date-pill:active { transform: scale(0.98); }
    .api-sync-date-pill i { color: var(--pink); flex-shrink: 0; }
    .api-sync-feedback-box {
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding: 12px 14px;
      background: var(--soft2);
      border: 1px solid var(--line2);
      border-radius: 12px;
      margin-bottom: 12px;
    }
    .api-feedback-row {
      display: flex;
      align-items: baseline;
      gap: 8px;
      font-size: 12px;
      line-height: 1.5;
      flex-wrap: wrap;
    }
    .api-feedback-row .dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--pink);
      flex-shrink: 0;
      margin-top: 5px;
    }
    .api-feedback-row strong {
      color: var(--text);
      font-size: 12px;
      flex-shrink: 0;
    }
    .api-feedback-row p {
      margin: 0;
      flex: 1;
      min-width: 200px;
      overflow-wrap: anywhere;
    }
    .api-connection-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .api-more-actions { position: relative; }
    .api-more-actions summary, .api-connection summary, .api-secondary-sync summary { list-style: none; cursor: pointer; }
    .api-more-actions summary::-webkit-details-marker, .api-connection summary::-webkit-details-marker, .api-secondary-sync summary::-webkit-details-marker { display: none; }
    .api-more-menu { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
    .api-more-actions[open] { flex-basis: 100%; }
    .api-secondary-sync { margin-bottom: 12px; border: 1px solid var(--line2); border-radius: 14px; background: var(--surface); }
    .api-section-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 8px 12px; color: var(--text); font-size: 12px; font-weight: 700; }
    .api-section-summary small { color: var(--muted); font-size: 10.5px; font-weight: 500; }
    .api-secondary-sync[open] .api-section-summary { border-bottom: 1px solid var(--line2); }
    .api-secondary-content { padding: 8px; }
    .api-automation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
    .api-automation-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft2); }
    .api-automation-copy { display: grid; gap: 4px; min-width: 0; }
    .api-automation-copy strong { font-size: 13px; }
    .api-automation-copy span, .api-automation-copy small { color: var(--muted); font-size: 10.5px; line-height: 1.5; overflow-wrap: anywhere; }
    .api-automation-copy small { color: var(--green-ink); font-weight: 700; }
    .api-toggle { position: relative; width: 44px; height: 24px; flex: 0 0 44px; cursor: pointer; }
    .api-toggle input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .api-toggle span { position: absolute; inset: 0; border: 1px solid var(--ctl); border-radius: 999px; background: var(--surface); transition: background-color 160ms var(--ease), border-color 160ms var(--ease); }
    .api-toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 999px; background: var(--faint); transition: transform 160ms var(--ease), background-color 160ms var(--ease); }
    .api-toggle input:checked + span { border-color: var(--pink); background: var(--pink-soft); }
    .api-toggle input:checked + span::after { background: var(--pink2); transform: translateX(20px); }
    .api-toggle input:focus-visible + span { outline: 2px solid var(--pink); outline-offset: 2px; }
    #TAB_TIKTOK_API #apiStatusGrid .kpi { padding: 12px; gap: 4px; }
    #TAB_TIKTOK_API #apiStatusGrid .kpi-v { font-size: 16px; }
    .api-connection { padding: 0; overflow: hidden; background: var(--soft2); }
    .api-connection > .card-h { margin: 0; padding: 12px; }
    .api-connection[open] > .card-h { border-bottom: 1px solid var(--line2); }
    .api-connection-body { display: flex; flex-direction: column; gap: 8px; padding: 12px; font-size: 12px; }
    @media (max-width: 700px) {
      .api-header-actions, .api-header-actions > .btn, .api-more-actions, .api-sync-date-pill { width: 100%; }
      .api-header-actions > .btn, .api-more-actions > summary, .order-sync-bar .btn, .affiliate-sync-panel .btn, .api-sync-date-pill { justify-content: center; width: 100%; }
      .api-feedback-row { flex-direction: column; gap: 2px; }
      .api-feedback-row p { min-width: 100%; }
      .api-connection-actions { width: 100%; justify-content: flex-end; }
      .api-more-menu { display: grid; grid-template-columns: 1fr 1fr; }
      .api-more-menu .btn { width: 100%; min-width: 0; white-space: normal; }
      .api-automation-grid { grid-template-columns: 1fr; }
      .api-automation-card { padding: 10px 12px; }
      .api-automation-copy > span { display: none; }
      #TAB_TIKTOK_API #apiStatusGrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
      #TAB_TIKTOK_API #apiStatusGrid .kpi:last-child { grid-column: 1 / -1; }
    }
    #liveSyncResult { margin-bottom: 8px; line-height: 1.6; overflow-wrap: anywhere; }
    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-thumb { background: #EFC9DA; border-radius: 99px; }
    svg.ic { flex-shrink: 0; display: block; }

    /* Unified Be Vietnam Pro Headings */
    .brand-t, .hdr-title h1, .h-title, .login-card h2, .gate h2, .alert-h {
      font-family: var(--font-sans);
      font-weight: 800;
      letter-spacing: -.015em;
      font-variant-numeric: lining-nums tabular-nums;
    }

    /* =====================================================================
       2. APP SHELL + SIDEBAR (Báo cáo / Công cụ / Quản trị)
       ===================================================================== */
    .app { display: flex; height: 100dvh; overflow: hidden; }
    .sidebar { width: 260px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line2); display: flex; flex-direction: column; padding: 16px 12px; overflow-y: auto; z-index: 80; }
    body.sb-collapsed .sidebar { display: none; }
    .brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--line2); }
    .brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff; font-family: var(--font-serif); font-size: 15px; display: grid; place-items: center; font-weight: 800; box-shadow: 0 8px 18px rgba(236,72,153,.35); flex-shrink: 0; }
    .brand-image { display: block; object-fit: contain; background: var(--bg); box-shadow: none; }
    .brand-logo { display: block; width: 192px; flex-shrink: 0; }
    .brand-logo img { display: block; width: 100%; height: auto; object-fit: contain; }
    .brand-t { font-size: 15.5px; line-height: 1.22; color: var(--pink-ink); }
    .brand-s { font-family: var(--font-sans); font-size: 11px; color: var(--muted); margin-top: 2px; }
    .nav-group { margin-top: 10px; }
    .nav-label { font-family: var(--font-sans); font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 4px 10px 6px; display: flex; justify-content: space-between; align-items: center; }
    .nav-btn { width: 100%; height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-family: var(--font-sans); font-size: 13px; font-weight: 500; line-height: 1; cursor: pointer; text-align: left; transition: background-color 160ms var(--ease), color 160ms var(--ease); }
    .nav-btn > span:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .nav-btn.active { background: var(--pink-soft); color: var(--pink-ink); font-weight: 700; }
    .nav-btn.active svg { color: var(--pink2); }
    .nav-count { font-family: var(--font-sans); font-size: 10.5px; font-weight: 700; line-height: 1; height: 20px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 99px; background: var(--soft); color: var(--muted); }
    .nav-btn.active .nav-count { background: #fff; color: var(--pink-ink); }
    .nav-count.alert { background: var(--red-soft); color: var(--red-ink); }
    .sb-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line2); }
    .quota-mini { background: var(--soft2); border: 1px solid var(--line); border-radius: 14px; padding: 11px; font-size: 11.5px; cursor: pointer; }
    .scrim { position: fixed; inset: 0; background: rgba(42,18,32,.35); opacity: 0; pointer-events: none; transition: opacity 220ms var(--ease); z-index: 75; }
    .scrim.show { opacity: 1; pointer-events: auto; }
    .sidebar .sidebar-close { display: none; }

    /* =====================================================================
       3. PREMIUM HEADER (hamburger, search, bell badge, avatar online dot)
       ===================================================================== */
    .main { flex: 1; min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
    .hdr { position: relative; margin: 12px 16px 0; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 10px 14px; display: flex; align-items: center; gap: 12px; z-index: 30; }
    .icon-btn { width: 42px; height: 42px; border-radius: 13px; border: 0; background: #F8F1F5; color: var(--text); display: grid; place-items: center; cursor: pointer; position: relative; flex-shrink: 0; transition: transform 120ms var(--ease), background-color 160ms var(--ease); }
    .icon-btn:active, .btn:active, .dock-btn:active, .pg:active { transform: scale(.96); }
    .icon-btn.grad { background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(236,72,153,.35); }
    .badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-family: var(--font-sans); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
    .hdr-title { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; }
    .hdr-title h1 { font-size: 18px; line-height: 1.24; padding-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hdr-title p { font-family: var(--font-sans); font-size: 11.5px; line-height: 1.3; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hdr-search { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; border-radius: 10px; background: #F8F1F5; width: 220px; border: 1px solid #F2D3E1; }
    .hdr-search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 11.5px; font-family: var(--font-sans); color: var(--text); }
    .hdr-search input::placeholder { font-size: 11.5px; color: #94A3B8; font-weight: 400; }
    .hdr-search svg, .hdr-search i { width: 14px; height: 14px; color: var(--pink2); flex-shrink: 0; }
    .avatar-btn { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid #fff; background: linear-gradient(135deg, #FB923C, #EC4899); color: #fff; font-family: var(--font-sans); font-weight: 800; font-size: 13px; display: grid; place-items: center; cursor: pointer; position: relative; box-shadow: 0 1px 3px rgba(15,23,42,.12); flex-shrink: 0; }
    .online { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: #22C55E; border: 2px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.12); z-index: 2; }
    .dropdown { position: absolute; right: 12px; top: 64px; width: 350px; max-width: calc(100vw - 24px); background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line2); padding: 8px; display: none; z-index: 90; }
    .dropdown.show { display: block; animation: pop 220ms cubic-bezier(0.16, 1, 0.3, 1); }
    @keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.96); } to { opacity: 1; transform: none; } }
    .dd-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; cursor: pointer; }
    .dd-item:hover { background: var(--soft2); }
    .dd-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }

    /* =====================================================================
       4. FILTER TOOLBAR (Hôm nay / 7 ngày / 30 Ngày / Chọn ngày)
       ===================================================================== */
    .toolbar { margin: 10px 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; transition: all 240ms cubic-bezier(0.16, 1, 0.3, 1); }
    .tb-expanded { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; width: 100%; animation: tabEnter 220ms cubic-bezier(0.16, 1, 0.3, 1) both; }
    .tb-collapsed { display: none; align-items: center; justify-content: space-between; gap: 10px; width: 100%; animation: tabEnter 220ms cubic-bezier(0.16, 1, 0.3, 1) both; background: #fff; border: 1px solid var(--line2); border-radius: 16px; padding: 7px 12px; box-shadow: var(--shadow-sm); }
    .toolbar.is-collapsed .tb-expanded { display: none !important; }
    .toolbar.is-collapsed .tb-collapsed { display: flex !important; }
    .tb-summary-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
    .tb-sum-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft2); border: 1px solid var(--line); border-radius: 11px; padding: 5px 10px; font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; }
    .tb-sum-chip svg { color: var(--pink2); flex-shrink: 0; }
    .tb-sum-chip.staff svg { color: var(--violet); }
    .tb-collapse-btn { display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 12px; border-radius: 12px; font-size: 12px; font-weight: 700; color: var(--muted); background: #fff; border: 1px solid var(--ctl); cursor: pointer; transition: all 160ms var(--ease); white-space: nowrap; }
    .tb-collapse-btn:hover { background: var(--pink-soft); border-color: var(--pink); color: var(--pink2); }
    .tb-edit-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 11px; font-size: 12px; font-weight: 800; cursor: pointer; flex-shrink: 0; }

    /* Session Staff Assignment Collapsed & Edit */
    .assign-done-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #FAF5F8; border: 1px solid #F3DBE7; border-radius: 12px; padding: 6px 9px; transition: all 180ms var(--ease); min-width: 175px; }
    .assign-done-box:hover { border-color: #F472B6; background: #FFF9FC; }
    .assign-done-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
    .assign-done-row { display: flex; align-items: center; gap: 5px; font-size: 11.5px; line-height: 1.25; }
    .assign-done-row.host strong { color: var(--pink2); }
    .assign-done-row.op strong { color: var(--violet); }
    .assign-done-row .tag { font-size: 10px; font-weight: 700; color: var(--muted); min-width: 38px; }
    .btn-edit-assign { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 9px; font-size: 11px; font-weight: 800; color: var(--pink-ink); background: #fff; border: 1px solid var(--line); cursor: pointer; flex-shrink: 0; transition: all 160ms var(--ease); }
    .btn-edit-assign:hover { background: var(--pink-soft); border-color: var(--pink); color: var(--pink2); transform: translateY(-1px); }
    .assign-edit-form { display: flex; flex-direction: column; gap: 5px; min-width: 175px; background: #FFFDFE; border: 1.5px solid var(--pink); border-radius: 12px; padding: 7px 8px; box-shadow: 0 4px 14px rgba(236,72,153,.12); animation: tabEnter 200ms cubic-bezier(0.16, 1, 0.3, 1) both; }
    .assign-edit-foot { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding-top: 4px; border-top: 1px dashed #F8D5E5; }
    .btn-done-assign { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 8px; font-size: 10.5px; font-weight: 800; color: #fff; background: var(--grad); border: 0; cursor: pointer; }

    /* Shift Report Modal & Mini Components */
    .shift-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
    .shift-stat { background: #FCF8FA; border: 1px solid var(--line2); border-radius: 14px; padding: 10px 12px; }
    .shift-stat .lbl { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
    .shift-stat .val { font-size: 14px; font-weight: 800; }
    .shift-row-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--line2); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; transition: all 160ms ease; }
    .shift-row-card:hover { border-color: var(--pink); box-shadow: 0 4px 12px rgba(236,72,153,.08); }
    .shift-add-box { background: #FCF8FA; border: 1.5px dashed #F2CFE0; border-radius: 16px; padding: 14px; margin-top: 14px; }
    .shift-mini-tags { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
    .shift-tag { font-size: 11px; color: var(--text); display: inline-flex; align-items: center; gap: 4px; line-height: 1.25; }
    .shift-tag strong { color: var(--pink2); font-weight: 700; }
    .shift-tag.op strong { color: var(--violet); }
    .shift-tag .num { color: var(--muted); font-size: 10.5px; }

    /* Shift Picker & Master Schedule Drawer */
    .btn-shift-chip { display: inline-flex; align-items: center; gap: 4px; background: #FFF0F5; border: 1px solid #FBCFE8; color: var(--pink-ink); font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: all 140ms ease; font-family: var(--font-sans); }
    .btn-shift-chip:hover { background: #FCE7F3; border-color: var(--pink); transform: translateY(-1px); }
    .btn-shift-chip.active { background: var(--pink2); color: #fff; border-color: var(--pink2); box-shadow: 0 2px 6px rgba(236,72,153,.25); }
    .btn-shift-day-pill { display: inline-flex; align-items: center; justify-content: center; padding: 3px 9px; border-radius: 8px; font-size: 11px; font-weight: 700; background: #fff; border: 1px solid var(--line2); color: var(--muted); cursor: pointer; transition: all 140ms ease; font-family: var(--font-sans); }
    .btn-shift-day-pill:hover { border-color: var(--pink); color: var(--pink-ink); }
    .btn-shift-day-pill.active { background: var(--pink2); border-color: var(--pink2); color: #fff; }
    .shift-drawer { background: #FFFDFE; border: 1.5px solid #FAD3E5; border-radius: 14px; padding: 12px; margin: 10px 0; box-shadow: 0 4px 14px rgba(236,72,153,.07); animation: tabEnter 180ms ease both; }

    /* Account Presence & Online Indicators */
    .online-indicator { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; vertical-align: middle; }
    .online-indicator.online { background: #10B981; }
    .online-indicator.offline { background: #94A3B8; }
    @keyframes pulseTimer {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.82; transform: scale(0.97); }
    }
    @keyframes spinTimer {
      from { transform: rotate(0deg); }
      to { transform: rotate(360deg); }
    }
    .seg { display: inline-flex; align-items: center; gap: 4px; background: #fff; border-radius: 14px; padding: 4px; box-shadow: var(--shadow); }
    .seg button { height: 34px; padding: 0 13px; border: 1px solid transparent; border-radius: 10px; background: transparent; font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; line-height: 1; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }
    .seg button.active { background: var(--pink-soft); border-color: #F6C2DA; color: var(--pink-ink); font-weight: 700; }
    .range-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); font-family: var(--font-sans); font-size: 12px; font-weight: 600; line-height: 1; color: var(--pink-ink); cursor: pointer; border: 0; }
    .sel, .inp { height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--ctl); background: #fff; font-family: var(--font-sans); font-size: 12px; font-weight: 500; outline: none; color: var(--text); }
    .sel:focus, .inp:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(236,72,153,.15); }
    .sel.sm, .inp.sm { height: 28px; font-size: 11px; font-weight: 500; border-radius: 8px; padding: 0 8px; }

    /* =====================================================================
       5. BUTTONS, PILLS, CARDS (Symmetrical Equal-Height Bento Grids)
       ===================================================================== */
    .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 12px; border: 1px solid transparent; font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; line-height: 1; cursor: pointer; white-space: nowrap; transition: transform 120ms var(--ease), box-shadow 160ms var(--ease), background-color 160ms var(--ease); }
    .btn.sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 10px; }
    .btn-grad { background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(236,72,153,.32); }
    .btn-danger { background: linear-gradient(135deg, #FB7185, #E11D48); color: #fff; box-shadow: 0 8px 18px rgba(225,29,72,.3); }
    .btn-ghost { background: #fff; border-color: var(--ctl); color: var(--text); }
    .btn-soft { background: var(--pink-soft); color: var(--pink-ink); }
    .btn-link { background: transparent; border: 0; color: var(--muted); font-family: var(--font-sans); font-weight: 600; cursor: pointer; font-size: 12.5px; }
    .btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
    .pill { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px; font-family: var(--font-sans); font-size: 11px; font-weight: 600; line-height: 1; letter-spacing: 0; white-space: nowrap; vertical-align: middle; }
    .pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
    .p-pink { background: var(--pink-soft); color: var(--pink-ink); }
    .p-violet { background: var(--violet-soft); color: var(--violet-ink); }
    .p-sky { background: var(--sky-soft); color: var(--sky-ink); }
    .p-green { background: var(--green-soft); color: var(--green-ink); }
    .p-amber { background: var(--amber-soft); color: var(--amber-ink); }
    .p-red { background: var(--red-soft); color: var(--red-ink); }
    .p-gray { background: #F3EEF1; color: #6B5560; }
    .badge-reconciled { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 99px; font-family: var(--font-sans); font-size: 11px; font-weight: 800; line-height: 1; letter-spacing: 0; white-space: nowrap; vertical-align: middle; background: #ECFDF5; border: 1.5px solid #10B981; color: #047857; box-shadow: 0 1px 3px rgba(16,185,129,0.18); }
    .badge-reconciled-val { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 7px; background: #ECFDF5; border: 1.5px solid #10B981; color: #047857; font-weight: 800; font-size: 13px; box-shadow: 0 1px 2px rgba(16,185,129,0.12); }
    .row-reconciled { border-left: 4px solid #10B981 !important; background: linear-gradient(90deg, rgba(16,185,129,0.06) 0%, rgba(255,255,255,0.7) 35%) !important; }
    .row-reconciled:hover { background: linear-gradient(90deg, rgba(16,185,129,0.1) 0%, rgba(248,250,252,0.95) 35%) !important; }
    .row-pending { border-left: 4px solid #F59E0B !important; background: rgba(245,158,11,0.015); }
    .card-reconciled {
      position: relative;
      border-left: 1px solid rgba(16,185,129,0.4) !important;
      background: linear-gradient(180deg, rgba(16,185,129,0.04) 0%, #FFFFFF 60%) !important;
      box-shadow: 0 2px 8px rgba(16,185,129,0.08) !important;
    }
    .card-reconciled::before {
      content: '';
      position: absolute;
      top: 10px;
      bottom: 10px;
      left: 0;
      width: 4px;
      border-radius: 0 4px 4px 0;
      background: #10B981;
    }
    .card-pending {
      position: relative;
      border-left: 1px solid rgba(245,158,11,0.4) !important;
      background: linear-gradient(180deg, rgba(254,243,199,0.12) 0%, #FFFFFF 60%) !important;
    }
    .card-pending::before {
      content: '';
      position: absolute;
      top: 10px;
      bottom: 10px;
      left: 0;
      width: 4px;
      border-radius: 0 4px 4px 0;
      background: #F59E0B;
    }
    .view { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 110px; scroll-behavior: smooth; }
    .wrap { max-width: 1440px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
    .tab { display: none; flex-direction: column; gap: 14px; }
    .tab.active { display: flex; animation: tabEnter 360ms cubic-bezier(0.16, 1, 0.3, 1) both; }
    @keyframes tabEnter {
      0% { opacity: 0; transform: translateY(12px) scale(0.995); }
      100% { opacity: 1; transform: translateY(0) scale(1); }
    }
    .tab.active > .card,
    .tab.active > .kpis,
    .tab.active > .grid-2,
    .tab.active > .grid-3,
    .tab.active > .grid-ov,
    .tab.active > .note {
      animation: tabChildCascade 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
    }
    .tab.active > *:nth-child(1) { animation-delay: 15ms; }
    .tab.active > *:nth-child(2) { animation-delay: 45ms; }
    .tab.active > *:nth-child(3) { animation-delay: 85ms; }
    .tab.active > *:nth-child(4) { animation-delay: 125ms; }
    .tab.active > *:nth-child(5) { animation-delay: 165ms; }
    .tab.active > *:nth-child(6) { animation-delay: 205ms; }
    @keyframes tabChildCascade {
      0% { opacity: 0; transform: translateY(10px); }
      100% { opacity: 1; transform: translateY(0); }
    }
    .card { background: #fff; border-radius: var(--r); border: 1px solid var(--line2); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; }
    .card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
    .card-h-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
    .card-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--pink-soft); color: var(--pink2); display: grid; place-items: center; flex-shrink: 0; }
    .card-ic.violet { background: var(--violet-soft); color: var(--violet); }
    .card-ic.sky { background: var(--sky-soft); color: var(--sky); }
    .card-ic.green { background: var(--green-soft); color: var(--green); }
    .card-ic.amber { background: var(--amber-soft); color: var(--amber); }
    .h-title { font-size: 16.5px; line-height: 1.24; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text); }
    .h-sub { font-family: var(--font-sans); font-size: 12px; line-height: 1.4; color: var(--muted); margin-top: 2px; }
    .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
    .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
    .grid-ov { display: grid; grid-template-columns: 1.08fr 1fr; gap: 14px; align-items: stretch; }
    .kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
    .kpis.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .kpi { background: #fff; border-radius: var(--r); border: 1px solid var(--line2); box-shadow: var(--shadow); padding: 15px 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; height: 100%; }
    .kpi.hl { background: linear-gradient(180deg, #fff 0%, #FFF1F7 100%); border-color: #F7C6DC; }
    .kpi-top { display: flex; align-items: center; gap: 10px; min-height: 36px; }
    .kpi-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
    .kpi-l { font-family: var(--font-sans); font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.28; }
    .kpi-v { font-family: var(--font-sans); font-size: 21px; font-weight: 700; line-height: 1.18; letter-spacing: -.022em; font-variant-numeric: lining-nums tabular-nums; }
    .kpi-s { font-family: var(--font-sans); font-size: 11px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-top: 8px; margin-top: auto; border-top: 1px dashed var(--line); flex-wrap: wrap; }
    .note { display: flex; gap: 10px; align-items: center; background: var(--soft2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-family: var(--font-sans); font-size: 12px; line-height: 1.45; }
    .page-guide-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
    .page-guide-bar > span:not(.pill) { margin-right: auto; }
    .page-guide-link { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--pink-ink); font-family: var(--font-sans); font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer; white-space: nowrap; }
    .page-guide-link:hover, .page-guide-link:focus-visible { border-color: var(--pink); background: var(--pink-soft); outline: none; }
    .page-guide-link:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
    .guide-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
    .guide-index { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
    .guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .guide-section { scroll-margin-top: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; }
    .guide-section:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
    .guide-section summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; color: var(--text); font-size: 12px; font-weight: 700; cursor: pointer; list-style: none; }
    .guide-section summary::-webkit-details-marker { display: none; }
    .guide-section summary > span { display: inline-flex; align-items: center; gap: 8px; }
    .guide-section summary > svg:last-child { color: var(--muted); transition: transform 160ms ease; }
    .guide-section[open] summary { background: var(--soft2); color: var(--pink-ink); border-bottom: 1px solid var(--line2); }
    .guide-section[open] summary > svg:last-child { transform: rotate(90deg); }
    .guide-body { padding: 12px 16px 16px; color: var(--muted); font-size: 11px; line-height: 1.6; }
    .guide-body ul { margin: 0; padding-left: 18px; }
    .guide-body li + li { margin-top: 6px; }


    /* =====================================================================
       6. PREMIUM TABLE + PAGINATION + LIST UI
       ===================================================================== */
    .t-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
    .t-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
    .t-search { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid #F2D3E1; background: #fff; min-width: 240px; flex: 0 1 360px; box-shadow: 0 2px 8px rgba(236,72,153,.04); }
    .t-search input { border: 0; outline: none; background: transparent; width: 100%; font-size: 11.5px; font-family: var(--font-sans); color: var(--text); }
    .t-search input::placeholder { font-size: 11.5px; color: #94A3B8; font-family: var(--font-sans); font-weight: 400; }
    .t-search svg, .t-search i { width: 14px; height: 14px; color: var(--pink2); flex-shrink: 0; }
    .tbl-wrap { width: 100%; overflow-x: auto; }
    table.pt { width: 100%; border-collapse: separate; border-spacing: 0; }
    table.pt thead th { background: var(--grad); color: #fff; font-size: 11.5px; font-weight: 700; text-align: left; padding: 12px; white-space: nowrap; }
    table.pt thead th:first-child { border-radius: 12px 0 0 12px; }
    table.pt thead th:last-child { border-radius: 0 12px 12px 0; }
    table.pt td { padding: 12px; border-bottom: 1px solid var(--line2); font-size: 12.5px; vertical-align: middle; }
    table.pt tbody tr { transition: background-color 140ms var(--ease); }
    table.pt tbody tr:hover { background: #FFF8FB; }
    table.pt tbody tr.clickable { cursor: pointer; }
    table.pt .r { text-align: right; }
    .who { display: flex; align-items: center; gap: 11px; min-width: 0; }
    .who-n { font-weight: 700; }
    .who-e { font-size: 11.5px; color: var(--muted); }
    .ava { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; flex-shrink: 0; box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgba(15,23,42,.12); position: relative; overflow: hidden; }
    .ava img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; -webkit-mask-image: -webkit-radial-gradient(white, black); transform: translateZ(0); object-fit: cover; display: block; }
    .avatar-btn img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; -webkit-mask-image: -webkit-radial-gradient(white, black); transform: translateZ(0); object-fit: cover; object-position: center; display: block; }
    .ava.op { background: linear-gradient(135deg, #A78BFA, #7C3AED); box-shadow: 0 1px 2px rgba(15,23,42,.08), 0 0 0 1px rgba(124,58,237,.15); }
    .ava.ad { background: linear-gradient(135deg, #FB923C, #EA580C); box-shadow: 0 1px 2px rgba(15,23,42,.08), 0 0 0 1px rgba(234,88,12,.15); }
    .ava.pd { background: linear-gradient(135deg, #E5E7EB, #9CA3AF); box-shadow: 0 1px 2px rgba(15,23,42,.08), 0 0 0 1px rgba(15,23,42,.05); }
    .ava.sm { width: 30px; height: 30px; font-size: 10.5px; }
    .ava-ring { padding: 2px; border-radius: 50%; border: 2px solid #F472B6; position: relative; flex-shrink: 0; }
    .ava-ring.op { border-color: #A78BFA; }
    .ava-ring .online { right: 1px; bottom: 1px; }

    /* Crisp avatar presence indicator and mobile account rows */
    .ava-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
    .ava-wrap .online-indicator { position: absolute; bottom: 0; right: 0; width: 9px; height: 9px; border: 2px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.12); z-index: 2; box-sizing: content-box; }
    /* SkillUI User Mobile Bento Card with full 4 rounded corners */
    .user-mobile-card {
      position: relative;
      background: #FFFFFF;
      border: 1px solid var(--line);
      border-radius: 16px;
      padding: 12px 14px;
      margin-bottom: 10px;
      box-shadow: 0 1px 3px rgba(42, 18, 32, 0.04);
      transition: transform 140ms ease, box-shadow 140ms ease;
      overflow: hidden;
    }
    .user-mobile-card.admin {
      border: 1px solid #DDD6FE;
      background: linear-gradient(180deg, rgba(245, 243, 255, 0.45) 0%, #FFFFFF 100%);
      box-shadow: 0 1px 4px rgba(109, 40, 217, 0.05);
    }
    .user-mobile-card:last-child { margin-bottom: 0; }
    .acc-row { padding: 10px 4px; transition: background 120ms ease; }
    .acc-row:hover { background: rgba(248, 250, 252, 0.7); }
    #accAdminMobile, #accMobile { gap: 0; }
    .dots-btn { width: 34px; height: 34px; border-radius: 10px; border: 0; background: #F8F1F5; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; }
    .t-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
    .pager { display: inline-flex; align-items: center; gap: 4px; background: #fff; border-radius: 99px; box-shadow: 0 6px 20px rgba(42,18,32,.07); padding: 5px 8px; flex-wrap: wrap; }
    .pg { min-width: 34px; height: 34px; padding: 0 6px; border-radius: 99px; border: 0; background: transparent; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text); }
    .pg:hover:not(.active):not(:disabled) { background: var(--soft); }
    .pg.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(236,72,153,.42); }
    .pg:disabled { opacity: .35; cursor: not-allowed; }
    .pg-gap { padding: 0 4px; color: var(--faint); }
    .pg-size { height: 32px; border-radius: 99px; border: 1px solid var(--line); background: #FCF8FA; padding: 0 10px; font-size: 12px; margin-left: 4px; }
    .pg-go { width: 46px; height: 32px; border-radius: 99px; border: 1px solid var(--line); background: #FCF8FA; text-align: center; font-size: 12px; }
    .plist { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; border: 1px solid var(--line2); }
    .pli { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line2); position: relative; cursor: pointer; background: #fff; transition: background-color 140ms var(--ease); }
    .pli:last-child { border-bottom: 0; }
    .pli:hover { background: #FFF9FC; }
    .pli.active { background: #FFF6FA; }
    .pli.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pink2); }
    .pli-main { flex: 1; min-width: 0; }
    .pli-name { font-weight: 800; font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .pli-role { font-size: 11.5px; font-weight: 700; color: var(--pink2); }
    .pli-role.op { color: var(--violet); }
    .pli-sub { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
    .pli-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
    .m-list { display: none; flex-direction: column; gap: 10px; }
    .m-card { background: #fff; border: 1px solid var(--line2); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
    .m-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .m-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--muted); }
    /* Refined Mobile Session Card (skillui / interface design) */
    .session-mobile-card {
      position: relative;
      background: #FFFFFF;
      border: 1px solid var(--line);
      border-radius: 16px;
      padding: 12px 13px;
      display: flex;
      flex-direction: column;
      gap: 9px;
      box-shadow: 0 1px 3px rgba(42, 18, 32, 0.03), 0 6px 16px rgba(219, 39, 119, 0.03);
      transition: all 180ms var(--ease);
      overflow: hidden;
    }
    .session-card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .session-card-badges {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 4px 6px;
    }
    .session-card-time-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: wrap;
    }
    .session-card-title strong {
      font-size: 13px;
      font-weight: 800;
      color: var(--text);
      line-height: 1.35;
      overflow-wrap: anywhere;
    }
    .session-dur-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 8px;
      border-radius: 99px;
      background: var(--soft);
      color: var(--pink-ink);
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
    }
    
    .session-staff-preview {
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding: 8px 10px;
      background: #FAF7F9;
      border: 1px solid #F1E5EC;
      border-radius: 12px;
    }
    .staff-chips-wrap {
      display: flex;
      align-items: center;
      gap: 6px 10px;
      flex-wrap: wrap;
    }
    .staff-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: #FFFFFF;
      padding: 3px 8px;
      border-radius: 8px;
      border: 1px solid #EDE2EA;
      font-size: 11px;
    }
    .staff-chip .chip-role {
      font-weight: 700;
      font-size: 10px;
    }
    .staff-chip.host .chip-role { color: var(--pink2); }
    .staff-chip.op .chip-role { color: var(--violet-ink); }
    .staff-chip strong {
      font-weight: 700;
      color: var(--text);
    }
    .staff-chip .chip-comm {
      font-size: 10px;
      color: var(--muted);
      font-weight: 600;
    }
    .session-staff-preview.unassigned {
      background: #FFFBEB;
      border-color: #FDE68A;
      cursor: pointer;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
    }
    .pill-live-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 7px;
      border-radius: 99px;
      background: #FEE2E2;
      color: #DC2626;
      border: 1px solid #FCA5A5;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.02em;
    }
    .dot-live {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #EF4444;
      animation: livePulse 1.2s infinite;
    }
    @keyframes livePulse {
      0% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.4; transform: scale(1.3); }
      100% { opacity: 1; transform: scale(1); }
    }

    .session-btn-detail {
      height: 26px !important;
      padding: 0 8px !important;
      font-size: 11px !important;
      border-radius: 8px !important;
      gap: 3px !important;
    }

    /* Bento Grid for Session Metrics */
    .session-bento-grid {
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 7px !important;
      background: transparent !important;
      border: none !important;
      padding: 0 !important;
    }
    .bento-tile {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 3px;
      padding: 8px 10px;
      border-radius: 12px;
      transition: all 150ms var(--ease);
    }
    .bento-tile .k {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-transform: uppercase;
      line-height: 1.2;
    }
    .bento-tile .v {
      font-size: 14px;
      font-weight: 800;
      line-height: 1.25;
      font-variant-numeric: tabular-nums;
    }
    .bento-k-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 4px;
    }
    .bento-tag {
      font-size: 9px;
      font-weight: 700;
      padding: 1px 5px;
      border-radius: 99px;
      line-height: 1.2;
    }

    
    .bento-total {
      background: #FFF5F8;
      border: 1px solid #FBCFE8;
    }
    .bento-total .k { color: #BE185D; }
    .bento-total .v { color: #9D174D; }

    .bento-live {
      background: #FAF6F8;
      border: 1px solid #F3DBE7;
    }
    .bento-live .k { color: var(--muted); }
    .bento-live .v { color: var(--text); }

    .bento-aff {
      background: #F0F9FF;
      border: 1px solid #BAE6FD;
    }
    .bento-aff .k { color: #0284C7; }
    .bento-aff .v { color: #0369A1; }

    .bento-kpi.is-pend {
      background: #FFFBEB;
      border: 1px solid #FDE68A;
    }
    .bento-kpi.is-pend .k { color: #B45309; }
    .bento-kpi.is-pend .v { color: #D97706; }
    .bento-kpi.is-pend .bento-tag { background: #FEF3C7; color: #92400E; }

    .bento-kpi.is-rec {
      background: #F0FDF4;
      border: 1px solid #BBF7D0;
    }
    .bento-kpi.is-rec .k { color: #15803D; }
    .bento-kpi.is-rec .v { color: #16A34A; }
    .bento-kpi.is-rec .bento-tag { background: #DCFCE7; color: #166534; }

    .bento-refund {
      background: #FFF1F2;
      border: 1px solid #FECDD3;
    }
    .bento-refund .k { color: #BE123C; }
    .bento-refund .v { color: #E11D48; }

    /* Session Card Controls Accordion */
    .session-card-controls {
      margin-top: 2px;
      border-top: 1px solid var(--line2);
      padding-top: 6px;
    }
    .session-card-controls > summary {
      min-height: 34px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      list-style: none;
      cursor: pointer;
      padding: 6px 10px;
      border-radius: 10px;
      background: #FCF8FA;
      border: 1px solid var(--line2);
      transition: background 150ms ease;
    }
    .session-card-controls > summary:hover {
      background: var(--soft2);
    }
    .session-card-controls > summary::-webkit-details-marker { display: none; }
    .session-accordion-arrow {
      display: flex;
      align-items: center;
      color: var(--muted);
      transition: transform 180ms ease;
    }
    .session-card-controls[open] .session-accordion-arrow {
      transform: rotate(90deg);
    }
    .session-card-controls-body { display: grid; gap: 8px; padding-top: 8px; }
    .session-manual-kpi { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; }
    .session-manual-kpi .chk { width: 20px; height: 20px; }
    .session-card-controls-body > .sel { width: 100%; min-height: 30px; height: 30px; font-size: 11.5px; font-weight: 500; border-color: var(--pink); }

    /* =====================================================================
       7. PROGRESS WIDGETS (Goal ring, weekly bars, quota bars)
       ===================================================================== */
    .goal { flex: 1; display: grid; grid-template-columns: 170px 1fr; gap: 18px; align-items: center; }
    .ring { position: relative; width: 170px; height: 170px; margin: 0 auto; }
    .ring svg { transform: rotate(-90deg); display: block; }
    .ring circle.ring-fill { transition: stroke-dashoffset 900ms cubic-bezier(0.16, 1, 0.3, 1); will-change: stroke-dashoffset; }
    .ring-c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
    .ring-v { font-family: var(--font-serif); font-size: 31px; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
    .ring-l { font-family: var(--font-sans); font-size: 11.5px; color: var(--pink2); font-weight: 700; margin-top: 2px; }
    .goal-stats { display: flex; flex-direction: column; gap: 9px; }
    .gs { display: flex; align-items: center; gap: 11px; background: #FCF8FA; border: 1px solid var(--line2); border-radius: 13px; padding: 9px 12px; }
    .gs-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
    .gs-l { font-family: var(--font-sans); font-size: 11.5px; color: var(--muted); line-height: 1.25; }
    .gs-v { font-family: var(--font-sans); font-weight: 700; font-size: 13.5px; line-height: 1.3; margin-top: 1px; }
    .bars { flex: 1; display: flex; align-items: flex-end; gap: 10px; min-height: 176px; padding-top: 6px; }
    .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
    .bar-v { font-family: var(--font-sans); font-size: 10.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
    .bar-track { width: 100%; max-width: 28px; flex: 1; background: #F7EDF2; border-radius: 9px; position: relative; overflow: hidden; }
    .bar-fill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 9px; background: linear-gradient(180deg, #F9A8D4, #DB2777); transition: height 800ms cubic-bezier(0.16, 1, 0.3, 1); will-change: height; }
    .bar-col.peak .bar-fill { background: linear-gradient(180deg, #C4B5FD, #7C3AED); }
    .bar-col.peak .bar-v { color: var(--violet); font-weight: 800; }
    .bar-d { font-family: var(--font-sans); font-size: 11px; color: var(--muted); white-space: nowrap; }
    .prog { height: 9px; border-radius: 99px; background: #F3E8EE; overflow: hidden; }
    .prog > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #F9A8D4, #DB2777); transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1); will-change: width; }
    .prog.warn > span { background: linear-gradient(90deg, #FCD34D, #F59E0B); }
    .prog.crit > span { background: linear-gradient(90deg, #FB7185, #E11D48); }
    .prog.ok > span { background: linear-gradient(90deg, #86EFAC, #16A34A); }

    /* =====================================================================
       8. ORDER TRACKING TIMELINE + SYSTEM ALERT WIDGET + CHECKBOX
       ===================================================================== */
    .tl { display: flex; flex-direction: column; }
    .tl-i { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; position: relative; padding-bottom: 20px; align-items: start; }
    .tl-i:last-child { padding-bottom: 0; }
    .tl-i:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: #EBD5E0; }
    .tl-i.done:not(:last-child)::before { background: var(--pink); }
    .tl-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #E9D3DE; background: #fff; color: #fff; z-index: 1; }
    .tl-i.done .tl-dot { background: var(--grad); border-color: transparent; }
    .tl-i.live .tl-dot { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(236,72,153,.15); }
    .tl-i.bad .tl-dot { background: linear-gradient(135deg, #FB7185, #E11D48); border-color: transparent; }
    .tl-t { font-family: var(--font-sans); font-weight: 700; }
    .tl-i.done .tl-t { color: var(--green); }
    .tl-i.bad .tl-t { color: var(--red); }
    .tl-s { font-family: var(--font-sans); font-size: 11.5px; color: var(--muted); }
    .alert-w { background: #fff; border-radius: 22px; border: 1px solid #FBD5DD; box-shadow: 0 14px 36px rgba(225,29,72,.10); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
    .alert-w.warn { border-color: #FDE3A7; box-shadow: 0 14px 36px rgba(217,119,6,.10); }
    .alert-top { display: flex; gap: 16px; align-items: flex-start; }
    .alert-ic { width: 58px; height: 58px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: grid; place-items: center; box-shadow: 0 0 0 8px #FFF3F5; flex-shrink: 0; }
    .alert-w.warn .alert-ic { background: var(--amber-soft); color: var(--amber); box-shadow: 0 0 0 8px #FFFAEB; }
    .alert-k { font-family: var(--font-sans); font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--red); }
    .alert-w.warn .alert-k { color: var(--amber); }
    .alert-h { font-size: 20px; line-height: 1.24; }
    .alert-box { background: #FCFAFB; border: 1px solid var(--line2); border-radius: 16px; padding: 14px; }
    .alert-rec { display: flex; align-items: center; gap: 12px; background: #FFF7F8; border: 1px solid #FDE2E7; border-radius: 16px; padding: 12px 14px; cursor: pointer; }
    .alert-w.warn .alert-rec { background: #FFFCF2; border-color: #FDECC0; }
    .chk { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border: 2px solid #E3B6CB; border-radius: 7px; background: #fff; display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: background-color 140ms var(--ease), border-color 140ms var(--ease); }
    .chk:checked { background: var(--grad); border-color: transparent; }
    .chk:checked::after { content: ''; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
    .chk:indeterminate { background: var(--grad); border-color: transparent; }
    .chk:indeterminate::after { content: ''; width: 10px; height: 2.5px; background: #fff; border-radius: 2px; }
    .chk:disabled { background: #F6F1F3; border-color: #E9DEE3; cursor: not-allowed; }
    .chk-box { border: 1.5px solid #F2CFE0; border-radius: 20px; padding: 6px 16px; background: #fff; }
    .chk-all { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
    .chk-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--line2); }
    .chk-row:last-child { border-bottom: 0; }
    .chk-row.locked { opacity: .72; }

    /* =====================================================================
       9. SOCIAL LOGIN, PENDING GATE, MODAL, DATE RANGE, DOCK, TOAST
       ===================================================================== */
    .login { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 40px 24px; background: radial-gradient(ellipse at top left, var(--pink-soft), transparent 65%), var(--bg); overflow-y: auto; }
    .login-wrap { width: min(440px, 100%); text-align: center; }
    .login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; text-align: left; }
    .login-brand-title { color: var(--pink-ink); font-size: 16px; font-weight: 800; line-height: 1.25; }
    .login-brand-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
    .login-top-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 10px; border-radius: 999px; background: var(--pink-soft); color: var(--pink-ink); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
    .login-card { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 32px 28px 24px; text-align: center; }
    .shield-badge { width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 18px; background: #F8F9FE; color: #4F46E5; display: grid; place-items: center; box-shadow: 0 0 0 7px #EFF2FE, 0 10px 24px rgba(99, 102, 241, 0.14); }
    .login .shield-badge { width: 64px; height: 64px; margin-bottom: 16px; background: var(--pink-soft); color: var(--pink2); box-shadow: 0 0 0 6px var(--soft), 0 8px 18px rgba(236,72,153,.18); }
    .alert-badge-danger { width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 18px; background: #FFF1F2; color: #E11D48; display: grid; place-items: center; box-shadow: 0 0 0 7px #FFE4E6, 0 10px 24px rgba(225, 29, 72, 0.16); }
    .alert-badge-success { width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 18px; background: #ECFDF5; color: #059669; display: grid; place-items: center; box-shadow: 0 0 0 7px #D1FAE5, 0 10px 24px rgba(16, 185, 129, 0.16); }
    .alert-badge-amber { width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 18px; background: #FFFBEB; color: #D97706; display: grid; place-items: center; box-shadow: 0 0 0 7px #FEF3C7, 0 10px 24px rgba(217, 119, 6, 0.16); }
    .role-opt-card { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1.5px solid var(--line2); border-radius: 14px; background: #FFFFFF; cursor: pointer; transition: all 160ms var(--ease); margin-bottom: 8px; text-align: left; position: relative; }
    .role-opt-card:hover { border-color: var(--pink); background: #FFF9FC; }
    .role-opt-card.selected { border-color: var(--pink2); background: #FFF5F9; box-shadow: 0 4px 14px rgba(236,72,153,.12); }
    .role-opt-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #CBD5E1; display: grid; place-items: center; flex-shrink: 0; transition: all 140ms ease; }
    .role-opt-card.selected .role-opt-radio { border-color: var(--pink2); background: var(--pink2); }
    .role-opt-card.selected .role-opt-radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
    .login-card h2 { font-size: 27px; font-weight: 800; color: var(--text); letter-spacing: -.02em; margin-bottom: 4px; }
    .login-card .login-sub { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 24px; }
    .login-providers { display: grid; gap: 8px; }
    .soc-btn { width: 100%; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font-family: var(--font-sans); cursor: pointer; transition: all 160ms var(--ease); }
    .soc-btn:hover { border-color: var(--pink); background: var(--soft2); box-shadow: 0 8px 24px rgba(219,39,119,.12); transform: translateY(-1px); }
    .soc-btn:active { transform: scale(0.99); }
    .soc-btn:disabled { cursor: wait; opacity: .72; transform: none; box-shadow: none; }
    .soc-btn:disabled:hover { border-color: var(--line); background: var(--surface); transform: none; box-shadow: none; }
    .soc-btn:disabled:hover .soc-arrow { border-color: var(--line); color: var(--muted); transform: none; }
    [data-auth-action="logout"][aria-disabled="true"] { pointer-events: none; cursor: wait; opacity: .58; }
    .soc-l { display: flex; align-items: center; gap: 14px; }
    .soc-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
    .soc-t { font-size: 14px; font-weight: 700; color: var(--text); }
    .soc-arrow { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); transition: all 160ms ease; }
    .soc-btn:hover .soc-arrow { border-color: var(--pink); color: var(--pink2); transform: translateX(2px); }
    .login-note { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line2); color: var(--muted); font-size: 11.5px; line-height: 1.5; }
    .login-layout { width: min(400px, 100%); margin: 0 auto; display: block; text-align: center; }
    .login-layout .login-brand { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
    .login-layout .brand-logo { width: 140px; height: auto; display: block; margin: 0 auto; }
    .login-layout .brand-logo img { width: 100%; height: auto; object-fit: contain; }
    .login-layout .login-card { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 36px 28px 24px; text-align: center; }
    .login-layout .login-card h2 { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.02em; margin-bottom: 6px; }
    .login-layout .login-sub { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 24px; }
    .login-layout .soc-btn { border-color: var(--ctl); border-radius: 12px; box-shadow: none; padding: 0 12px; height: 52px; }
    .login-layout .soc-l { gap: 12px; }
    .login-layout .soc-t { font-size: 13.5px; font-weight: 600; }
    .login-layout .soc-ic { width: 28px; height: 28px; }
    .login-layout .soc-arrow { border: 0; width: 24px; height: 24px; border-radius: 0; }
    .login-layout .soc-btn:disabled { opacity: 1; color: var(--muted); background: var(--soft2); }
    .login-layout .login-note { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line2); color: var(--muted); font-size: 11.5px; line-height: 1.5; }
    .login-layout .login-note svg { flex-shrink: 0; }
    .login-footnote { margin-top: 16px; color: var(--muted); font-size: 10.5px; text-align: center; }
    .boot-screen { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px; background: var(--bg); }
    .boot-content { max-width: 400px; display: flex; flex-direction: column; align-items: center; text-align: center; }
    .boot-content .brand-mark { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; box-shadow: var(--shadow); }
    .boot-brand { margin-top: 16px; color: var(--pink-ink); font-weight: 700; font-size: 14px; }
    .boot-spinner { width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--pink2); border-radius: 50%; animation: boot-spin .8s linear infinite; margin: 32px 0 20px; }
    .boot-content h1 { font-size: 20px; line-height: 1.5; font-weight: 600; }
    .boot-content p { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 12px 0 24px; }
    @keyframes boot-spin { to { transform: rotate(360deg); } }
    @media (max-width: 860px) {
      .login-layout { max-width: 400px; }
      .login-layout .login-card { padding: 28px 20px 20px; }
    }
    @media (max-width: 380px) {
      .login-layout .brand-logo { width: 120px; }
      .login-layout .login-card { padding: 24px 16px 18px; }
    }
    @media (prefers-reduced-motion: reduce) { .boot-spinner { animation: none; } }
    .gate { max-width: 560px; margin: 30px auto; text-align: center; }
    body.pending-account .sidebar,
    body.pending-account .hdr,
    body.pending-account .toolbar,
    body.pending-account .dock,
    body.pending-account .scrim { display: none !important; }
    body.pending-account .main { height: 100dvh; min-height: 100dvh; }
    body.pending-account .view { display: grid; place-items: center; padding: calc(24px + var(--safe-top)) max(16px, var(--safe-right)) calc(24px + var(--safe-bottom)) max(16px, var(--safe-left)); }
    body.pending-account #pendingGate { width: min(560px, 100%); margin: 0; padding: 28px; border-color: var(--line); }
    body.pending-account #pendingGate .shield-badge { background: var(--amber-soft); box-shadow: 0 0 0 7px #FFFAEB, 0 10px 24px rgba(217,119,6,.16); }
    body.pending-account #pendingGate .pending-status { display: flex; width: fit-content; max-width: 100%; margin-inline: auto; padding-inline: 12px; }
    .modal { position: fixed; inset: 0; z-index: 150; background: rgba(30,10,22,.48); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; padding: 14px; opacity: 0; }
    .modal.show { display: flex; opacity: 1; animation: modalFadeIn 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
    .modal.show .modal-card { animation: modalSpringUp 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
    .modal.closing { animation: modalFadeOut 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
    .modal.closing .modal-card { animation: modalDropOut 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
    .modal-card { width: min(560px, 100%); max-height: calc(100dvh - 28px); overflow-y: auto; background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg); padding: 20px; will-change: transform, opacity; }
    .modal-card.wide { width: min(860px, 100%); }
    .order-detail { display: grid; gap: 16px; }
    .order-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
    .order-detail-eyebrow { display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
    .order-detail h2 { margin: 0; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
    .order-detail-product { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--soft2); border: 1px solid var(--line2); border-radius: 14px; }
    .order-detail-product > div { min-width: 0; display: grid; gap: 3px; }
    .order-detail-product strong { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
    .order-detail-product span:last-child { color: var(--muted); font-size: 11.5px; }
    .order-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 0; }
    .order-detail-grid > div { min-width: 0; padding: 10px 12px; background: #fff; border: 1px solid var(--line2); border-radius: 12px; }
    .order-detail-grid .order-detail-wide { grid-column: 1/-1; }
    .order-detail-grid dt { color: var(--muted); font-size: 10.5px; font-weight: 600; }
    .order-detail-grid dd { margin: 3px 0 0; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
    .order-detail-note { padding: 10px 12px; border: 1px solid var(--line2); border-radius: 12px; color: var(--muted); font-size: 11.5px; }
    .order-detail-note summary { cursor: pointer; color: var(--text); font-weight: 700; }
    .order-detail-note p { margin: 8px 0 0; line-height: 1.55; }
    .order-detail-refs { display: grid; gap: 8px; margin-top: 8px; }
    .order-detail-refs > div { display: grid; gap: 2px; }
    .order-detail-refs span { font-size: 10.5px; }
    .order-detail-refs strong { color: var(--text); font-size: 11.5px; overflow-wrap: anywhere; }
    .order-detail-actions { display: flex; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--line2); }

    @keyframes modalFadeIn {
      from { opacity: 0; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); }
      to { opacity: 1; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
    }
    @keyframes modalFadeOut {
      from { opacity: 1; }
      to { opacity: 0; }
    }
    @keyframes modalSpringUp {
      0% { opacity: 0; transform: translateY(22px) scale(0.96); }
      100% { opacity: 1; transform: translateY(0) scale(1); }
    }
    @keyframes modalDropOut {
      0% { opacity: 1; transform: translateY(0) scale(1); }
      100% { opacity: 0; transform: translateY(18px) scale(0.97); }
    }
    /* Popup vinh danh hoàn thành Target LUÔN LUÔN Ở CHÍNH GIỮA MÀN HÌNH (Cả Desktop & Mobile) */
    #mdTargetCelebration {
      display: none;
      align-items: center !important;
      justify-content: center !important;
      padding: 16px !important;
      z-index: 180 !important;
    }
    #mdTargetCelebration.show {
      display: flex !important;
    }
    #mdTargetCelebration .modal-card {
      width: min(560px, calc(100vw - 32px)) !important;
      max-height: min(88dvh, 760px) !important;
      border-radius: 24px !important;
      margin: auto !important;
      animation: modalCelebrationPop 350ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    }
    #mdTargetCelebration.closing .modal-card {
      animation: modalCelebrationDrop 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    }
    @keyframes modalCelebrationPop {
      0% { opacity: 0; transform: scale(0.85) translateY(20px); }
      100% { opacity: 1; transform: scale(1) translateY(0); }
    }
    @keyframes modalCelebrationDrop {
      0% { opacity: 1; transform: scale(1) translateY(0); }
      100% { opacity: 0; transform: scale(0.9) translateY(20px); }
    }
    .dr { display: grid; grid-template-columns: 220px 1fr; gap: 14px; background: #FCF8FA; border: 1px solid var(--line2); border-radius: 18px; padding: 14px; }
    .dr-sel { background: #fff; border: 1px solid var(--line2); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px 10px; text-align: center; }
    .dr-cal { background: #fff; border: 1px solid var(--line2); border-radius: 16px; padding: 12px; }
    .dr-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
    .dr-month { flex: 1; height: 38px; border-radius: 12px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-size: 15px; font-weight: 700; }
    .dr-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; }
    .dr-wd { text-align: center; font-size: 11px; color: var(--faint); font-weight: 700; padding: 4px 0; }
    .dr-d { height: 38px; border: 0; background: transparent; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text); }
    .dr-d.out { color: #D8C6CF; }
    .dr-d.in { background: var(--pink-soft); color: var(--pink-ink); }
    .dr-d.start, .dr-d.end { background: var(--grad); color: #fff; }
    .dr-d.start { border-radius: 99px 0 0 99px; }
    .dr-d.end { border-radius: 0 99px 99px 0; }
    .dr-d.start.end { border-radius: 99px; }
    .dr-d.today { box-shadow: inset 0 0 0 1.5px var(--pink); border-radius: 99px; }
    .dr-d:disabled { color: #E5D8DE; cursor: not-allowed; }
    .dock { display: none; background: var(--surface); z-index: 60; }
    .dock-btn { min-width: 58px; height: 50px; padding: 4px 8px; border-radius: 16px; border: 0; background: transparent; color: #6B5560; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative; cursor: pointer; transition: background-color 180ms var(--ease), color 180ms var(--ease); }
    .dock-lbl { font-family: var(--font-sans); font-size: 10px; font-weight: 700; line-height: 1.1; white-space: nowrap; letter-spacing: -.01em; }
    .dock-btn.active { color: var(--pink2); background: var(--soft2); }
    .dock-btn.active::after { content: ""; position: absolute; top: 0; left: 12px; right: 12px; height: 3px; border-radius: 0 0 4px 4px; background: currentColor; }
    .dock-btn .badge { top: -2px; right: 2px; }
    .mob-filter-btn { display: none; }
    .mob-alert-bar { display: none; }
    .m-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: #FCF7FA; border: 1px solid var(--line2); border-radius: 12px; padding: 7px 8px; font-size: 11px; }
    .m-grid4 > div { display: flex; flex-direction: column; gap: 1px; }
    .m-grid4 .k { color: var(--muted); font-size: 10px; }
    .m-grid4 .v { font-weight: 800; font-size: 11.5px; }
    .m-assign { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--line2); }
    @media (hover: hover) and (pointer: fine) {
      .dock-btn[data-tip]:hover::before { content: attr(data-tip); position: absolute; bottom: 60px; background: #1F1420; color: #fff; padding: 6px 11px; border-radius: 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
      .icon-btn:hover { background: #F3E6EE; }
      .btn-grad:hover { box-shadow: 0 10px 24px rgba(236,72,153,.42); }
      .btn-ghost:hover { background: var(--soft2); }
    }
    .toast { position: fixed; left: 50%; bottom: 86px; transform: translate(-50%, 14px) scale(0.95); background: #2A1220; color: #fff; padding: 11px 18px; border-radius: 16px; font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 240ms cubic-bezier(0.16, 1, 0.3, 1), transform 240ms cubic-bezier(0.16, 1, 0.3, 1); z-index: 300; max-width: calc(100vw - 24px); text-align: center; box-shadow: 0 10px 30px rgba(42,18,32,.25); }
    .toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

    /* =====================================================================
       10. RESPONSIVE — PC & ĐIỆN THOẠI (SYMMETRICAL BENTO & ERGONOMIC MOBILE)
       ===================================================================== */
    @media (max-width: 1280px) and (min-width: 861px) {
      #kpiGrid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
      #kpiGrid > .kpi:nth-child(-n+3) { grid-column: span 2; }
      #kpiGrid > .kpi:nth-child(n+4) { grid-column: span 3; }
      #ordKpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
      .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .grid-3 > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
      .hdr-search { width: 180px; }
    }
    @media (max-width: 1024px) { .grid-2, .grid-ov { grid-template-columns: 1fr; } }
    @media (max-width: 860px) {
      /* The header stays in layout; the five-item dock spans the full mobile width. */
      .app { flex-direction: column; }
      .main { flex: 1; min-height: 0; height: auto; overflow: hidden; }
      .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(320px, calc(100vw - 48px)); padding: calc(16px + var(--safe-top)) 12px calc(16px + var(--safe-bottom)) max(12px, var(--safe-left)); transform: translateX(-105%); transition: transform 280ms var(--ease); box-shadow: var(--shadow-lg); display: flex !important; overscroll-behavior: contain; }
      .sidebar.open { transform: none; }
      .sidebar .brand { position: relative; padding-right: 44px; }
      .sidebar .sidebar-close { display: grid; position: absolute; right: 0; top: 0; width: 44px; height: 44px; }
      .dock {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        padding: 4px max(8px, var(--safe-right)) calc(4px + var(--safe-bottom)) max(8px, var(--safe-left));
        border: 0;
        border-top: 1px solid var(--line);
        border-radius: 0;
        box-shadow: var(--shadow-lg);
      }
      .dock-btn { flex: 1 1 20%; min-width: 0; height: 64px; padding: 8px 2px; gap: 4px; border-radius: 0; }
      .dock-btn svg { width: 24px; height: 24px; }
      .dock-lbl { font-size: 10px; line-height: 1.4; }
      .dock-btn.active { background: transparent; }
      .dock-btn.active::after { top: auto; right: auto; bottom: 1px; left: 50%; width: 4px; height: 4px; border-radius: 99px; transform: translateX(-50%); }
      .toast { bottom: calc(88px + var(--safe-bottom)); }
      .desk { display: none !important; }
      .m-list { display: flex; gap: 9px; }
      .m-card { padding: 11px 12px; border-radius: 16px; gap: 7px; overflow: hidden; word-break: break-word; }
      .m-row { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; }
      .m-row > *:first-child { min-width: 0; }
      .m-grid4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 6px 10px; }
      .m-grid4 > div { min-width: 0; overflow: hidden; }
      .m-grid4 .k { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      .m-grid4 .v { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

      /* Compact Top Header */
      #menuBadge { display: none !important; }
      .hdr { flex-shrink: 0; margin: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--line); padding: calc(8px + var(--safe-top)) max(12px, var(--safe-right)) 8px max(12px, var(--safe-left)); gap: 4px; }
      .hdr .icon-btn, .hdr .avatar-btn { width: 44px; height: 44px; }
      .hdr-search { display: none; }
      .hdr-title { padding: 0 2px; min-width: 0; flex: 1; }
      .hdr-title h1 { font-size: 15.5px; font-weight: 800; line-height: 1.3; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
      .hdr-title p { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      .dropdown { right: max(8px, var(--safe-right)); left: max(8px, var(--safe-left)); width: auto !important; top: 100%; max-height: calc(100dvh - 160px - var(--safe-top) - var(--safe-bottom)); overflow-y: auto; overscroll-behavior: contain; border-radius: 16px; }

      /* Single-Row Compact Filter Toolbar + Collapsible Channel/Staff Drawer */
      .toolbar { flex-shrink: 0; margin: 8px max(8px, var(--safe-right)) 0 max(8px, var(--safe-left)); padding: 0; border-radius: 16px; gap: 6px; }
      .toolbar-top { width: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
      .toolbar-top > #tbDateSeg {
        flex: 1 1 0;
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 3px;
        padding: 4px;
        border: 1px solid var(--line);
        border-radius: 13px;
        overflow: visible;
        box-shadow: var(--shadow-sm);
      }
      #tbDateSeg button {
        width: 100%;
        min-width: 0;
        height: 40px;
        padding: 0 3px;
        border-radius: 9px;
        font-size: 11.5px;
        line-height: 1.15;
        white-space: nowrap;
      }
      #tbDateSeg button.active { box-shadow: 0 3px 10px rgba(236,72,153,.14); }
      #accSeg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
      #accSeg::-webkit-scrollbar { display: none; }
      #accSeg button { flex: 0 0 auto; height: 30px; padding: 0 8px; font-size: 11.5px; border-radius: 8px; white-space: nowrap; }
      .range-chip { display: none !important; }
      .mob-filter-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 36px; padding: 0 11px; border-radius: 11px; border: 1px solid var(--line); background: var(--soft2); color: var(--pink-ink); font-size: 11.5px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
      .mob-filter-btn.active { background: var(--pink-soft); border-color: var(--pink); }
      .toolbar-r { width: 100%; display: none !important; grid-template-columns: 1fr 1fr; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--line2); }
      .toolbar.mob-open .toolbar-r { display: grid !important; }
      .toolbar.custom-range .range-chip { display: inline-flex !important; order: 3; flex: 0 0 100%; width: 100%; justify-content: center; height: 34px; font-size: 11.5px; margin-top: 1px; box-shadow: none; border: 1px solid var(--line); background: var(--soft2); }
      .toolbar-r .sel { width: 100%; min-width: 0; height: 32px !important; font-size: 11.5px !important; font-weight: 500 !important; padding: 0 8px !important; border-radius: 9px !important; }
      .tb-summary-group { gap: 4px; flex: 1; min-width: 0; flex-wrap: wrap; }
      .tb-summary-group::-webkit-scrollbar { display: none; }
      .tb-sum-chip { padding: 4px 8px; font-size: 11px; border-radius: 9px; flex-shrink: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
      .tb-edit-btn { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 9px; flex-shrink: 0; }
      .tb-collapse-btn { height: 34px; padding: 0 10px; font-size: 11.5px; border-radius: 9px; grid-column: 1 / -1; width: 100%; justify-content: center; margin-top: 2px; }
      .assign-done-box { min-width: 0; width: 100%; flex-wrap: wrap; gap: 6px; }
      .assign-done-info { flex: 1 1 160px; min-width: 0; }
      .assign-done-row { flex-wrap: wrap; word-break: break-word; font-size: 11px; }
      .assign-edit-form { min-width: 0; width: 100%; }

      /* Slim Storage Alert Bar on Mobile Overview */
      .desk-only-alert { display: none !important; }
      .mob-alert-bar { display: flex; align-items: center; gap: 8px; background: #FFF5F7; border: 1px solid #F9C6D3; border-radius: 14px; padding: 8px 10px; font-size: 11.5px; box-shadow: var(--shadow-sm); flex-wrap: wrap; }

      /* Main Scroll View & Bento KPI Cards */
      .view { padding: 12px max(8px, var(--safe-right)) calc(96px + var(--safe-bottom)) max(8px, var(--safe-left)); min-height: 0; overflow-x: hidden; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
      input[type="text"]:focus, input[type="search"]:focus, textarea:focus { font-size: 16px; }
      select, .sel, select.sel { font-size: 11.5px !important; font-weight: 500 !important; height: 32px !important; line-height: 1.3 !important; }
      select.sm, .sel.sm, select.sel.sm { font-size: 11px !important; height: 28px !important; }
      .pill { font-size: 11px !important; }
      label, .lbl { font-size: 12px; font-weight: 700; }
      table.pt thead th { font-size: 11.5px; }
      table.pt td { font-size: 12.5px; }
      body.pending-account .view { padding: calc(20px + var(--safe-top)) max(12px, var(--safe-right)) calc(20px + var(--safe-bottom)) max(12px, var(--safe-left)); }
      body.pending-account #pendingGate { padding: 24px 18px; border-radius: 24px; }
      body.pending-account #pendingGate h2 { font-size: 20px !important; line-height: 1.35; }
      body.pending-account #pendingGate .muted { font-size: 13px; line-height: 1.65; }
      .wrap { gap: 10px; }
      .tab.active { gap: 10px; }
      .kpis, #kpiGrid, #ordKpis, #stfKpis, #sesKpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
      .kpi { padding: 11px 12px; border-radius: 16px; gap: 5px; min-width: 0; overflow: hidden; }
      .kpi.hl { grid-column: 1 / -1 !important; order: -1; padding: 12px 14px; background: linear-gradient(135deg, #FFF5FA 0%, #F7F0FF 100%); }
      .kpi-top { gap: 7px; min-height: 30px; }
      .kpi-ic { width: 30px; height: 30px; border-radius: 9px; }
      .kpi-l { font-size: 11.5px; font-weight: 700; line-height: 1.25; min-width: 0; overflow-wrap: break-word; }
      .kpi-v { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      .kpi.hl .kpi-v { font-size: 18.5px; }
      .kpi-s { font-size: 11px; padding-top: 5px; flex-wrap: wrap; gap: 4px; }
      #sesKpis > .kpi:nth-last-child(2), #stfKpis > .kpi:last-child { grid-column: 1 / -1; }

      /* Compact Rule Note & Cards */
      .note { padding: 9px 12px; font-size: 11.5px; border-radius: 13px; gap: 6px; line-height: 1.45; word-break: break-word; }
      .page-guide-bar { align-items: stretch; padding: 0; gap: 6px; }
      .page-guide-bar > span:not(.pill) { display: none; }
      .page-guide-bar .page-guide-link { flex: 1 1 auto; }
      .guide-intro { align-items: stretch; gap: 12px; }
      .guide-index { justify-content: flex-start; gap: 6px; }
      .guide-index .page-guide-link { flex: 1 1 calc(33.333% - 6px); min-width: 92px; }
      .guide-grid { grid-template-columns: 1fr; gap: 8px; }
      .guide-section summary { min-height: 48px; padding: 0 12px; }
      .guide-body { padding: 10px 12px 14px; }
      #ovRuleNote { display: block; }
      #ovRuleNote .pill { display: inline-flex; margin-bottom: 6px; }
      .card { padding: 12px; border-radius: 18px; overflow: hidden; }
      .card-h { margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
      .card-h-l { min-width: 0; flex: 1 1 auto; }
      .card-h-l > div:not(.card-ic) { min-width: 0; flex: 1 1 auto; }
      .card-h-l > .card-ic { flex: 0 0 auto; }
      .card-ic { width: 34px; height: 34px; border-radius: 11px; }
      .h-title { font-size: 15px; font-weight: 800; line-height: 1.3; word-break: break-word; }
      .h-sub { font-size: 11.5px; word-break: break-word; }
      .grid-3 { grid-template-columns: 1fr; gap: 10px; }
      .grid-2, .grid-ov { gap: 10px; }

      /* Side-by-Side Compact Goal Ring on Mobile */
      .goal { grid-template-columns: 104px minmax(0, 1fr); gap: 10px; align-items: center; }
      .ring { width: 104px; height: 104px; }
      .ring svg { width: 104px; height: 104px; }
      .ring-v { font-size: 18px; }
      .ring-l { font-size: 10.5px; font-weight: 700; }
      .goal-stats { gap: 6px; width: 100%; min-width: 0; }
      .gs { padding: 7px 9px; border-radius: 12px; gap: 8px; min-width: 0; overflow: hidden; }
      .gs-ic { width: 28px; height: 28px; border-radius: 8px; }
      .gs-l { font-size: 11px; }
      .gs-v { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

      /* Compact 7-Day Activity Bars & Staff Leaderboard */
      .bars { min-height: 130px; height: 130px; padding: 8px 4px 2px; gap: 4px; }
      .bar-v { font-size: 10px; font-weight: 700; }
      .bar-d { font-size: 10.5px; font-weight: 600; }
      .pli { padding: 9px 10px; border-radius: 14px; gap: 9px; min-width: 0; }
      .ava { width: 36px; height: 36px; font-size: 12px; }
      .pli-main { min-width: 0; flex: 1 1 auto; overflow: hidden; }
      .pli-name { font-size: 13px; font-weight: 700; white-space: normal; word-break: break-word; }
      .pli-sub { font-size: 11px; flex-wrap: wrap; word-break: break-word; gap: 2px 6px; }
      .pli-right { flex-shrink: 0; }

      /* Table Tools, Single-Line Pagination & Bottom-Sheet Modals */
      .t-tools { gap: 6px; margin-bottom: 10px; }
      .t-tools .t-search, .t-search { min-width: 0; flex: 1 1 100%; height: 34px !important; padding: 0 10px !important; border-radius: 9px !important; }
      .t-tools .t-search input, .t-search input { font-size: 11.5px !important; font-family: var(--font-sans) !important; }
      .t-tools .t-search input::placeholder, .t-search input::placeholder { font-size: 11.5px !important; color: #94A3B8 !important; }
      .t-tools .t-search svg, .t-search svg { width: 14px !important; height: 14px !important; }
      .t-filters { width: 100%; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 6px !important; }
      .t-filters .sel { width: 100% !important; min-width: 0 !important; }
      .t-filters .admin-only { grid-column: 1 / -1; justify-content: center; height: 32px !important; font-size: 11px !important; }
      select, select.sel, .sel { font-size: 11.5px !important; font-weight: 500 !important; height: 32px !important; padding: 0 8px !important; border-radius: 9px !important; color: var(--text) !important; background-color: #fff !important; border: 1px solid var(--ctl) !important; }
      select.sm, select.sel.sm, .sel.sm { font-size: 11px !important; font-weight: 500 !important; height: 28px !important; padding: 0 6px !important; }
      #accSeg { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-wrap: nowrap; }
      #accSeg::-webkit-scrollbar { display: none; }
      /* .t-search mobile styled above */
      .t-foot { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 10px; font-size: 11.5px; text-align: center; }
      .pager { width: 100%; justify-content: center; flex-wrap: wrap; padding: 4px 6px; gap: 3px; max-width: 100%; }
      .pg { min-width: 30px; height: 30px; font-size: 11.5px; padding: 0 6px; }
      .pg-size { height: 30px; font-size: 11px; padding: 0 6px; }
      .pg-go-lbl, .pg-go { display: none; }

      /* Export cards: keep identity, badges and actions inside the viewport. */
      .export-hero { padding: 14px 16px !important; align-items: flex-start !important; }
      .export-hero > div { min-width: 0; }
      .export-staff-select { width: 100%; min-width: 0 !important; }
      #expStaffSelect { width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); font-family: var(--font-sans); }
      .export-preview { padding: 12px !important; overflow: hidden; }
      .export-preview-head { align-items: flex-start !important; }
      .export-person { width: 100%; min-width: 0; align-items: flex-start !important; }
      .export-person-info { min-width: 0; flex: 1 1 auto; }
      .export-person-pills { flex-wrap: wrap; align-items: flex-start !important; }
      .export-person-pills .pill { white-space: normal; }
      .export-preview-actions { width: 100%; display: grid !important; grid-template-columns: 1fr; }
      .export-preview-actions .btn { width: 100%; height: auto; min-height: 36px; padding: 8px 10px; white-space: normal; line-height: 1.25; }
      .export-report-grid { grid-template-columns: minmax(0, 1fr) !important; }
      .export-report-grid > div { min-width: 0; }

      .who { min-width: 0; flex: 1 1 auto; overflow: hidden; }
      .who-n { white-space: normal; word-break: break-word; font-size: 12.5px; }
      .who-e { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; max-width: 180px; }

      .modal { align-items: flex-end; padding: 0; }
      .modal-card { width: 100% !important; max-height: 90dvh; border-radius: 24px 24px 0 0; padding: 16px 14px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
      .modal.show .modal-card { animation: modalSheetUp 340ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
      .modal.closing .modal-card { animation: modalSheetDown 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
      @keyframes modalSheetUp {
        0% { transform: translateY(100%); }
        100% { transform: translateY(0); }
      }
      @keyframes modalSheetDown {
        0% { transform: translateY(0); }
        100% { transform: translateY(100%); }
      }
      .dr { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
      .dr-sel { flex-direction: row; flex-wrap: wrap; justify-content: space-between; padding: 10px 12px; }
      .dr-sel .card-ic { display: none; }
      .dr-d { height: 34px; font-size: 12px; }

      .shift-stat-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 6px; }
      .shift-row-card { flex-direction: column; align-items: stretch; gap: 8px; }

      .alert-w { padding: 14px; border-radius: 18px; gap: 10px; }
      .alert-top { gap: 10px; }
      .alert-ic { width: 42px; height: 42px; box-shadow: 0 0 0 5px #FFF3F5; }
      .alert-h { font-size: 16px; }
      .chk-box { padding: 4px 12px; border-radius: 16px; }
      .chk-row, .chk-all { gap: 10px; padding: 9px 0; }
      .login { padding: 16px 12px calc(24px + env(safe-area-inset-bottom)); }
      .login-brand { margin-bottom: 12px; }
      .login-card { padding: 24px 20px 20px; border-radius: 24px; }
      .login-card h2 { font-size: 22px; }
      .login .shield-badge { width: 56px; height: 56px; margin-bottom: 12px; }
      .soc-btn { height: 52px; font-size: 12.5px; padding: 0 8px 0 10px; }
      .soc-t { font-size: 13px; }
      .soc-ic { width: 32px; height: 32px; }
      .soc-arrow { width: 30px; height: 30px; }
    }
    @media (max-width: 480px) {
      .goal { grid-template-columns: 1fr; justify-items: center; text-align: center; }
      .goal-stats { width: 100%; }
      .kpi-v { font-size: 15px; }
      .kpi.hl .kpi-v { font-size: 18px; }
    }
    @media (max-width: 380px) {
      #tbDateSeg button { font-size: 10px; padding: 0 1px; }
      .mob-filter-btn { padding: 0 9px; font-size: 10.5px; }
      .dock-lbl { font-size: 9px; }
      .hdr-title h1 { font-size: 14.5px; }
      .kpi-v { font-size: 14px; }
      .kpi.hl .kpi-v { font-size: 17px; }
      .who-e { max-width: 130px; }
      .hdr-title p { display: none; }
    }
    @media (max-width: 340px) {
      .mob-filter-btn { padding-inline: 4px; }
      .hdr-title h1 { font-size: 13.5px; }
      .hdr-title p { display: none; }
    }

    .storage-select-all-box { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
    .storage-select-all-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
    .storage-select-all-copy { display: grid; gap: 2px; }
    .storage-select-all-copy small { color: var(--pink2); font-weight: 600; font-size: 11px; }
    .btn-sim { background: var(--pink-soft) !important; color: var(--pink-ink) !important; border: 1px solid rgba(219,39,119,0.15) !important; font-weight: 600; }
    .btn-sim:hover { background: var(--soft) !important; }
    .storage-lock-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(16,185,129,0.3); background: rgba(16,185,129,0.08); color: var(--green); font-size: 10.5px; font-weight: 600; }
    .storage-check-icon { width: 22px; height: 22px; border-radius: 50%; background: rgba(16,185,129,0.12); color: var(--green); display: grid; place-items: center; flex-shrink: 0; }
    .storage-btn-clean-provider { color: var(--pink2) !important; border: 1px solid var(--line2) !important; background: var(--surface) !important; font-size: 11px; font-weight: 600; margin-top: 6px; }
    .storage-btn-clean-provider:hover { border-color: var(--pink) !important; background: var(--pink-soft) !important; }

#stProviders { opacity: 1 !important; animation: none !important; }

/* ==================== GLOBAL ANTI-ZOOM & IPHONE RESPONSIVENESS ==================== */
html, body {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

@media screen and (max-width: 860px) {
  /* Chống iOS Safari tự động phóng to (auto-zoom) khi bấm/tap vào bất kỳ input, select hoặc textarea */
  input[type="text"], input[type="search"], input[type="number"], input[type="password"], input[type="email"], select, textarea, .inp, .sel {
    font-size: 16px !important;
  }
  .inp.sm, .sel.sm, select.sm, input.sm {
    font-size: 16px !important;
  }
  
  /* Đảm bảo toàn bộ modals và bảng trên iPhone (như iPhone 16 Pro Max) không bị phình hoặc tràn ngang */
  .modal-card {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  .modal-card .tbl-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .modal-form-grid-2 {
    grid-template-columns: 1fr !important;
  }
  .modal-staff-table-wrap {
    display: none !important;
  }
  .modal-shifts-cards {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    max-height: 290px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
  }
  .modal-shift-item {
    background: #FFFFFF;
    border: 1px solid var(--line2);
    border-radius: 12px;
    padding: 9px 11px;
    box-shadow: 0 1px 3px rgba(42, 18, 32, 0.04);
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
}

.modal-shifts-cards {
  display: none;
}

/* ==================== SESSIONS TABLE & MOBILE CARDS RESPONSIVE ==================== */
#sesTableWrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin-bottom: 12px;
}
#sesTableWrap::-webkit-scrollbar {
  height: 6px;
}
#sesTableWrap::-webkit-scrollbar-track {
  background: rgba(248, 241, 245, 0.8);
  border-radius: 99px;
}
#sesTableWrap::-webkit-scrollbar-thumb {
  background: #EFC9DA;
  border-radius: 99px;
}
#sesTableWrap::-webkit-scrollbar-thumb:hover {
  background: var(--pink);
}
#sesTableWrap table {
  min-width: 1080px;
  width: 100%;
}
.mob-scroll-hint {
  display: none !important;
}

@media screen and (max-width: 860px) {
  /* MOBILE AUTOMATIC: ALWAYS SHOW CARDS, HIDE TABLE */
  #sesTableWrap {
    display: none !important;
  }
  #sesMobile {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media screen and (min-width: 861px) {
  /* DESKTOP AUTOMATIC: ALWAYS SHOW TABLE, HIDE CARDS */
  #sesTableWrap {
    display: block !important;
  }
  #sesMobile {
    display: none !important;
  }
}
