/* 由 dashboard.html 拆出（2026-08-28）。
   原本 160 KB 一個檔，HTML+CSS+JS 全部寫埋一齊，改嘢要人手數引號。
   拆完之後：dashboard.html 淨係得結構，樣式喺呢度，行為喺 dashboard.js。*/
:root {
      --bg: #f4f6f9;
      --card: #fff;
      --primary: #1a5fb4;
      --primary-d: #124a8f;
      --gold: #a67c3d;
      --ok: #2e7d32;
      --warn: #e65100;
      --muted: #5f6b7a;
      --border: #e2e8f0;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
      background: var(--bg);
      color: #1a1a1a;
      min-height: 100vh;
    }
    header {
      background: linear-gradient(135deg, #1a5fb4, #3584e4);
      color: #fff;
      padding: 8px 16px;
      box-shadow: 0 1px 6px rgba(0,0,0,.1);
      position: relative;
      z-index: 80;
    }
    header .brand {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    header .logo-wrap {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      overflow: hidden;
    }
    header .logo-wrap img {
      width: 26px;
      height: 26px;
      object-fit: contain;
      display: block;
    }
    header h1 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: .02em; }
    header .en { display: none; }
    header p { margin: 0; opacity: .9; font-size: 12px; }
    header .header-bottom {
      margin-left: auto;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }
    header .biz {
      font-size: 16px; font-weight: 800;
      background: rgba(255,255,255,.18); display: inline-block;
      padding: 6px 12px; border-radius: 10px;
      letter-spacing: .02em;
    }
    header a.backup-pill {
      font-size: 12px; font-weight: 600;
      background: rgba(255,255,255,.15); display: inline-block;
      padding: 3px 8px; border-radius: 999px;
      color: #fff; text-decoration: none; max-width: 280px;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    header a.backup-pill.ok { background: rgba(34,197,94,.35); }
    header a.backup-pill.wait { background: rgba(234,179,8,.35); }
    .herb-lookup {
      position: relative;
      width: 168px;
    }
    .herb-lookup input {
      width: 100%;
      border: none;
      border-radius: 999px;
      padding: 5px 10px;
      font-size: 12px;
      font-family: inherit;
      background: rgba(255,255,255,.18);
      color: #fff;
      outline: none;
    }
    .herb-lookup input::placeholder { color: rgba(255,255,255,.75); }
    .herb-lookup input:focus { background: rgba(255,255,255,.28); }
    .herb-lookup-hits {
      position: absolute;
      top: calc(100% + 4px);
      right: 0;
      min-width: 240px;
      max-width: min(360px, 90vw);
      background: #fff;
      color: #1a1a1a;
      border-radius: 8px;
      box-shadow: 0 8px 24px rgba(0,0,0,.18);
      z-index: 120;
      overflow: hidden;
    }
    .herb-lookup-hits a,
    .herb-lookup-hits div.hit {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      padding: 6px 10px;
      font-size: 12px;
      text-decoration: none;
      color: inherit;
      border-bottom: 1px solid #eef2f6;
      cursor: pointer;
    }
    .herb-lookup-hits .hit:hover { background: #f1f5f9; }
    .herb-lookup-hits .hit b { font-weight: 800; }
    .herb-lookup-hits .hit span { color: #1a5fb4; font-weight: 800; font-variant-numeric: tabular-nums; }
    .herb-lookup-hits .hit em { color: #64748b; font-style: normal; font-size: 11px; }
    .herb-lookup-hits .empty { padding: 8px 10px; font-size: 12px; color: #64748b; }
    .store-switch {
      display: inline-flex;
      background: rgba(0,0,0,.18);
      border-radius: 999px;
      padding: 2px;
      gap: 2px;
    }
    .store-switch button {
      appearance: none;
      border: none;
      background: transparent;
      color: rgba(255,255,255,.88);
      font-family: inherit;
      font-size: 13px;
      font-weight: 700;
      padding: 6px 12px;
      min-height: 32px;
      border-radius: 999px;
      cursor: pointer;
      transition: background .12s, color .12s;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }
    .store-switch button:hover { background: rgba(255,255,255,.12); }
    .store-switch button.active {
      background: #fff;
      color: #124a8f;
      box-shadow: 0 1px 4px rgba(0,0,0,.15);
    }
    .store-hint { display: none; }
    .store-hint strong { color: var(--primary); }
    .store-banner {
      display: none;
      background: #fff7ed;
      border: 1px solid #fed7aa;
      color: #9a3412;
      border-radius: 8px;
      padding: 6px 10px;
      margin-bottom: 8px;
      font-size: 12px;
      line-height: 1.4;
    }
    .store-banner.on { display: block; }
    .store-banner b { color: #7c2d12; }
    .toast {
      position: fixed;
      left: 50%;
      top: 72px;
      bottom: auto;
      transform: translateX(-50%);
      z-index: 10050;
      max-width: min(92vw, 520px);
      background: #0f172a;
      color: #f8fafc;
      padding: 14px 18px;
      border-radius: 12px;
      font-size: 16px;
      font-weight: 700;
      line-height: 1.45;
      box-shadow: 0 8px 28px rgba(0,0,0,.28);
      display: none;
    }
    .toast.on { display: block; }
    .toast.warn { background: #9a3412; }
    .toast.ok { background: #14532d; }
    .pdf-overlay {
      position: fixed;
      inset: 0;
      z-index: 10000;
      background: rgba(15, 23, 42, 0.55);
      display: flex;
      flex-direction: column;
      padding: 12px;
    }
    .pdf-overlay[hidden] { display: none !important; }
    .pdf-overlay-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      background: #0f172a;
      color: #fff;
      padding: 8px 10px;
      border-radius: 10px 10px 0 0;
      font-weight: 800;
    }
    .pdf-overlay-bar span { flex: 1; font-size: 15px; }
    .pdf-overlay-bar button {
      appearance: none;
      border: 0;
      border-radius: 8px;
      font-family: inherit;
      font-weight: 700;
      font-size: 13px;
      padding: 6px 10px;
      cursor: pointer;
      background: #fff;
      color: #1a5fb4;
    }
    .pdf-overlay-bar button.ghost {
      background: transparent;
      color: #fff;
      border: 1px solid rgba(255,255,255,.45);
    }
    .pdf-overlay iframe {
      flex: 1;
      width: 100%;
      border: 0;
      background: #1b1b1b;
      border-radius: 0 0 10px 10px;
      min-height: 0;
    }
    .login-pop { position: relative; }
    .login-toggle {
      appearance: none;
      border: 1px solid rgba(255,255,255,.45);
      background: rgba(0,0,0,.18);
      color: #fff;
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      padding: 4px 10px;
      min-height: 32px;
      border-radius: 999px;
      cursor: pointer;
    }
    .login-pop.open .login-toggle {
      background: #fff;
      color: #124a8f;
    }
    .login-panel {
      display: none;
      position: absolute;
      right: 0;
      top: calc(100% + 8px);
      z-index: 90;
      width: min(360px, 92vw);
      max-height: min(80vh, 560px);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      background: #fff;
      color: #1a1a1a;
      border: 1px solid #93c5fd;
      border-radius: 10px;
      padding: 12px;
      box-shadow: 0 10px 28px rgba(15,23,42,.22);
    }
    .login-pop.open .login-panel { display: block; }
    .run-sticky {
      display: none;
      position: sticky;
      top: 0;
      z-index: 20;
      background: #fffbeb;
      border-bottom: 1px solid #fde68a;
      color: #92400e;
      font-weight: 700;
      font-size: 15px;
      padding: 12px 16px;
      text-align: center;
    }
    .run-sticky.on { display: block; }
    .run-sticky.ok { background: #ecfdf5; border-color: #a7f3d0; color: #14532d; }
    .run-sticky.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
    .login-panel h3 {
      margin: 0 0 6px;
      font-size: 15px;
      color: var(--primary);
    }
    .login-panel .sub {
      margin: 0 0 12px;
      font-size: 12px;
      color: var(--muted);
      line-height: 1.45;
    }
    .login-panel .row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      margin-bottom: 10px;
    }
    .login-panel label {
      font-size: 13px;
      color: var(--muted);
      min-width: 48px;
    }
    .login-panel input[type="text"],
    .login-panel input[type="password"] {
      flex: 1;
      min-width: 160px;
      font-size: 16px; /* iOS 唔自動 zoom */
      padding: 10px 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      font-family: inherit;
    }
    .login-panel .actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 4px;
    }
    .login-panel button {
      appearance: none;
      border: none;
      border-radius: 8px;
      padding: 11px 16px;
      font-size: 14px;
      font-weight: 700;
      font-family: inherit;
      cursor: pointer;
      min-height: 44px;
      touch-action: manipulation;
    }
    .login-panel button.primary {
      background: var(--primary);
      color: #fff;
    }
    .login-panel button.primary:disabled {
      opacity: .55;
      cursor: wait;
    }
    .login-panel button.ghost {
      background: #f1f5f9;
      color: #334155;
    }
    .login-panel .status-line {
      font-size: 13px;
      margin-top: 8px;
      font-weight: 600;
    }
    .login-panel .status-line.ok { color: var(--ok); }
    .login-panel .status-line.err { color: #b91c1c; }
    .login-panel .status-line.wait { color: #b45309; }
    .login-panel .remember {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 13px;
      color: var(--muted);
    }
    main {
      max-width: 1280px;
      margin: 0 auto;
      padding: 10px 12px 28px;
    }
    .money {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 6px 10px;
      margin-bottom: 8px;
      display: flex;
      flex-wrap: wrap;
      gap: 6px 14px;
      align-items: baseline;
      width: 100%;
      max-width: 100%;
    }
    .money .item {
      background: transparent;
      border-radius: 0;
      padding: 0;
      display: flex;
      align-items: baseline;
      gap: 6px;
    }
    .money .lab { font-size: 11px; color: var(--muted); }
    .money .lab small { display: block; font-size: 10px; font-weight: 600; opacity: .85; }
    .money .val { font-size: 15px; font-weight: 700; margin-top: 0; }
    .money .val.cash { color: #b45309; }
    .money .val.kpay { color: #047857; }
    .money .val.voucher { color: #6d28d9; }
    .money .val.total { color: var(--primary); }
    .money .val.unpaid { color: #c2410c; }
    .guest-row.unpaid .gpay {
      background: #fff7ed;
      color: #c2410c;
    }
    .np-panel {
      background: #fffbeb;
      border: 2px solid #f59e0b;
      border-radius: 10px;
      padding: 4px 10px 6px;
      margin: 0 0 10px;
    }
    .np-panel .fold-head { color: #92400e; }
    .np-panel.closed { padding-bottom: 4px; }
    .np-head { font-weight: 900; color: #92400e; font-size: 14px; }
    .np-why { margin: 4px 0 8px; font-size: 12px; color: #78350f; }
    .np-qr-row {
      display: flex;
      gap: 12px;
      align-items: center;
      background: #fff;
      border-radius: 8px;
      padding: 8px;
      margin-bottom: 8px;
    }
    .np-qr-row img { width: 120px; height: 120px; background: #fff; }
    #npQrHint { font-weight: 800; font-size: 14px; color: #92400e; }
    #npQrUrl { display: block; font-size: 11px; word-break: break-all; color: #64748b; margin-top: 4px; }
    .np-row {
      background: #fff;
      border: 1px solid #fde68a;
      border-radius: 8px;
      padding: 8px 10px;
      margin-bottom: 6px;
      font-size: 13px;
    }
    .np-row b { font-size: 15px; }
    .np-row .meta { color: #64748b; margin-top: 2px; }
    .np-row .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
    .np-row .acts button {
      appearance: none;
      border: 0;
      font-family: inherit;
      font-weight: 800;
      font-size: 13px;
      padding: 6px 10px;
      border-radius: 8px;
      cursor: pointer;
    }
    .np-row .acts .go { background: #166534; color: #fff; }
    .np-row .acts .no { background: #fee2e2; color: #991b1b; }
    .np-row .acts .see { background: #e2e8f0; color: #0f172a; }
    .np-detail {
      margin-top: 6px;
      background: #f8fafc;
      border-radius: 6px;
      padding: 8px;
      white-space: pre-wrap;
      font-size: 12px;
      line-height: 1.45;
    }
    .compare {
      margin: -2px 0 8px;
      font-size: 12px;
      color: var(--muted);
      padding: 0 2px;
    }
    .compare b { color: #1a1a1a; }
    .month-glance {
      background: #fff;
      border: 1px solid #93c5fd;
      border-radius: 10px;
      padding: 6px 10px 10px;
      margin: 0 0 10px;
    }
    .month-glance .fold-head { color: var(--primary); }
    .m-glance-bar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      margin: 0 0 8px;
    }
    .m-glance-bar button {
      appearance: none;
      border: 1px solid #93c5fd;
      background: #fff;
      color: var(--primary);
      font-family: inherit;
      font-size: 16px;
      font-weight: 900;
      width: 32px;
      height: 32px;
      border-radius: 8px;
      cursor: pointer;
    }
    .m-glance-bar #btnGlanceThis {
      width: auto;
      padding: 0 10px;
      font-size: 13px;
    }
    .m-glance-bar button:hover { background: #dbeafe; }
    #glanceMonthLabel {
      font-size: 16px;
      font-weight: 800;
      color: #0f172a;
      min-width: 7.5em;
      text-align: center;
    }
    .m-glance-sum {
      font-size: 13px;
      font-weight: 700;
      color: #334155;
      margin: 0 0 8px;
      line-height: 1.5;
    }
    .m-glance-sum b { color: #0f172a; }
    .m-glance-wrap {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
    .m-glance-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
      min-width: 640px;
    }
    .m-glance-table th,
    .m-glance-table td {
      border-bottom: 1px solid #e2e8f0;
      padding: 6px 8px;
      text-align: left;
      vertical-align: top;
    }
    .m-glance-table th {
      background: #eff6ff;
      color: #1a5fb4;
      font-size: 12px;
      font-weight: 800;
      position: sticky;
      top: 0;
    }
    .m-glance-table .d {
      font-weight: 800;
      white-space: nowrap;
      color: #0f172a;
      width: 4.5em;
    }
    .m-glance-table .w { color: #64748b; width: 2.2em; }
    .m-glance-table tr.today { background: #fff7ed; }
    .m-glance-table tr.on td.d { color: var(--primary); }
    .m-glance-cell {
      appearance: none;
      display: block;
      width: 100%;
      text-align: left;
      border: 1px solid transparent;
      background: transparent;
      font-family: inherit;
      font-size: 13px;
      line-height: 1.35;
      padding: 4px 6px;
      border-radius: 8px;
      cursor: pointer;
      color: inherit;
    }
    .m-glance-cell:hover { background: #dbeafe; border-color: #93c5fd; }
    .m-glance-cell.on { background: #1a5fb4; color: #fff; }
    .m-glance-cell.on .muted,
    .m-glance-cell.on .warn,
    .m-glance-cell.on .ok { color: #fff; }
    .m-glance-cell .who { font-size: 11px; color: #64748b; }
    .m-glance-cell.on .who { color: #dbeafe; }
    .m-glance-cell .muted { color: #94a3b8; font-weight: 700; }
    .m-glance-cell .ok { color: #166534; font-weight: 800; }
    .m-glance-cell .warn { color: #c2410c; font-weight: 800; }
    .m-glance-cell .amt { font-weight: 800; }
    .m-glance-foot td {
      background: #f8fafc;
      font-weight: 800;
      border-bottom: 0;
    }
    @media (max-width: 720px) {
      header { padding: 8px 10px; }
      header .header-bottom {
        margin-left: 0;
        width: 100%;
      }
      .login-pop {
        position: static;
      }
      .login-panel {
        position: fixed;
        left: 8px;
        right: 8px;
        top: auto;
        bottom: 8px;
        width: auto;
        max-height: min(70vh, 480px);
        z-index: 120;
      }
      .money {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px 10px;
      }
      .money .item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
      }
      .money .val { font-size: 18px; }
      .m-glance-table { font-size: 12px; min-width: 520px; }
      .m-glance-cell { font-size: 12px; }
    }
    .files-panel {
      background: #fff;
      border: 1px solid #93c5fd;
      border-radius: 8px;
      padding: 6px 10px;
      margin-bottom: 8px;
    }
    .files-panel h3 {
      margin: 0 0 4px;
      font-size: 15px;
      color: var(--primary);
    }
    .files-panel .sub {
      margin: 0 0 12px;
      font-size: 12px;
      color: var(--muted);
      line-height: 1.45;
    }
    .file-list { display: flex; flex-direction: column; gap: 8px; }
    .files-why {
      margin: 0 0 8px;
      font-size: 12px;
      color: var(--muted);
      line-height: 1.45;
    }
    .files-nav {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      margin: 0 0 8px;
      font-size: 13px;
    }
    .files-nav input[type="date"] {
      font-family: inherit;
      font-size: 13px;
      padding: 4px 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
    }
    .files-nav button {
      appearance: none;
      border: 1px solid #93c5fd;
      background: #fff;
      color: var(--primary);
      font-family: inherit;
      font-size: 12px;
      font-weight: 800;
      border-radius: 8px;
      padding: 5px 10px;
      cursor: pointer;
    }
    .files-nav #btnSyncMonthFiles {
      background: var(--primary);
      color: #fff;
      border-color: var(--primary);
    }
    .settle-days {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin: 0 0 10px;
    }
    .settle-days a {
      font-size: 12px;
      font-weight: 700;
      color: var(--primary);
      text-decoration: none;
      background: #eff6ff;
      border-radius: 999px;
      padding: 3px 8px;
    }
    .settle-days a.on { background: var(--primary); color: #fff; }
    .settle-days .muted { font-size: 12px; color: var(--muted); }
    .file-tiles {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }
    .pdf-preview {
      display: block;
      width: 100%;
      height: min(72vh, 820px);
      min-height: 420px;
      margin-top: 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #1b1b1b;
    }
    .file-tile {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-height: 68px;
      padding: 10px 8px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: #f8fafc;
      color: var(--primary);
      text-decoration: none;
      font-weight: 700;
      font-size: 15px;
      text-align: center;
      cursor: pointer;
      font-family: inherit;
      width: 100%;
    }
    .file-tile.ready {
      background: var(--primary);
      border-color: var(--primary);
      color: #fff;
    }
    .file-tile.missing {
      opacity: .5;
      pointer-events: none;
      cursor: default;
    }
    .file-tile small {
      display: block;
      margin-top: 3px;
      font-size: 11px;
      font-weight: 600;
      opacity: .88;
    }
    .file-more {
      margin-top: 8px;
      font-size: 13px;
      color: var(--muted);
    }
    .file-more summary {
      cursor: pointer;
      font-weight: 700;
      color: var(--primary);
      user-select: none;
    }
    .file-more .file-list { margin-top: 8px; }
    @media (max-width: 640px) {
      .file-tiles { grid-template-columns: 1fr; }
    }
    .file-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      padding: 10px 12px;
      background: #f8fafc;
      border-radius: 10px;
      border: 1px solid var(--border);
    }
    .file-row.missing { opacity: .55; border-style: dashed; }
    .file-row .meta { flex: 1 1 160px; min-width: 0; }
    .file-row .ftitle { font-weight: 700; font-size: 14px; }
    .file-row .fdesc { font-size: 12px; color: var(--muted); margin-top: 2px; }
    .file-row .acts { display: flex; flex-wrap: wrap; gap: 6px; }
    .file-row a, .file-row button {
      appearance: none;
      border: 1px solid var(--border);
      background: #fff;
      color: var(--primary);
      font-family: inherit;
      font-size: 13px;
      font-weight: 600;
      padding: 8px 12px;
      min-height: 40px;
      border-radius: 8px;
      text-decoration: none;
      cursor: pointer;
    }
    .file-row a.primary, .file-row button.primary {
      background: var(--primary);
      border-color: var(--primary);
      color: #fff;
    }
    .special-panel {
      background: #fff;
      border: 1px solid #a7f3d0;
      border-radius: 12px;
      padding: 14px 16px;
      margin-bottom: 16px;
      box-shadow: 0 2px 10px rgba(16,185,129,.08);
    }
    .special-panel h3 {
      margin: 0 0 4px;
      font-size: 15px;
      color: #047857;
    }
    .special-panel .sub {
      margin: 0 0 12px;
      font-size: 12px;
      color: var(--muted);
      line-height: 1.45;
    }
    .work-split {
      display: grid;
      grid-template-columns: minmax(280px, 1.15fr) minmax(320px, 0.95fr);
      gap: 14px;
      align-items: start;
      margin-bottom: 10px;
    }
    .work-col {
      min-width: 0;
      display: flex;
      flex-direction: column;
    }
    .work-left {
      border: 2px solid #1a5fb4;
      border-radius: 12px;
      background: #f0f6ff;
      box-shadow: 0 2px 10px rgba(26,95,180,.12);
      overflow: hidden;
    }
    .work-col-title {
      font-size: 13px;
      font-weight: 800;
      color: #047857;
      margin: 0 0 8px;
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
    }
    .work-left .work-col-title {
      margin: 0;
      padding: 8px 12px;
      background: #1a5fb4;
      color: #fff;
      font-size: 14px;
    }
    .work-col-title .n {
      font-weight: 700;
      color: var(--muted);
    }
    .work-left .work-col-title .n { color: #dbeafe; }
    .guest-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
      max-height: none;
      overflow: visible;
      margin-bottom: 0;
      padding: 10px;
    }
    .guest-section {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .guest-sec-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 6px 10px;
      font-size: 13px;
      font-weight: 800;
      border-radius: 8px;
      letter-spacing: .04em;
    }
    .guest-section.clinic .guest-sec-head {
      background: #1a5fb4;
      color: #fff;
    }
    .guest-section.product .guest-sec-head {
      background: #0f766e;
      color: #fff;
    }
    .guest-sec-head .n {
      font-weight: 700;
      font-size: 12px;
      opacity: .92;
    }
    .guest-sec-empty {
      font-size: 12px;
      color: var(--muted);
      padding: 8px 10px;
      background: #f8fafc;
      border-radius: 8px;
      border: 1px dashed var(--border);
    }
    .guest-section.product .guest-row {
      border-color: #5eead4;
      background: #f0fdfa;
    }
    .guest-section.product .guest-row:hover { border-color: #14b8a6; }
    .guest-section.product .guest-row.on {
      border-color: #0f766e;
      background: #ccfbf1;
      box-shadow: 0 0 0 2px rgba(15,118,110,.2);
    }
    .guest-section.product .guest-row.saved {
      border-color: #f59e0b;
      background: #fffbeb;
    }
    .guest-section.product .guest-row.saved.on {
      border-color: #d97706;
      box-shadow: 0 0 0 2px rgba(245,158,11,.25);
    }
    .guest-row .gdoc.prod {
      color: #0f766e;
      background: #ccfbf1;
    }
    .work-left .guest-editor {
      margin: 0 10px 8px;
    }
    .work-left .product-box {
      margin: 0 10px 10px;
    }
    .guest-row {
      display: grid;
      grid-template-columns: 1.6em auto minmax(0, 1fr) auto auto;
      grid-template-areas: "idx name item amt pay";
      column-gap: 8px;
      row-gap: 2px;
      align-items: center;
      width: 100%;
      text-align: left;
      border: 1.5px solid #93c5fd;
      background: #fff;
      border-radius: 10px;
      padding: 6px 10px;
      font-family: inherit;
      overflow: hidden;
      position: relative;
      cursor: pointer;
      box-shadow: 0 1px 3px rgba(26,95,180,.08);
    }
    .guest-row .gidx { grid-area: idx; color: #94a3b8; font-size: 12px; font-weight: 700; }
    .guest-row .gname {
      grid-area: name;
      font-weight: 700;
      font-size: 15px;
      white-space: nowrap;
    }
    .guest-row .gdoc {
      display: inline-block;
      margin-left: 6px;
      font-size: 11px;
      font-weight: 700;
      color: #1d4ed8;
      background: #dbeafe;
      border-radius: 999px;
      padding: 1px 7px;
      vertical-align: middle;
    }
    .guest-row .gdoc.none {
      color: #9a3412;
      background: #ffedd5;
    }
    .guest-row .gitem {
      grid-area: item;
      font-size: 13px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
    }
    .guest-row.on {
      grid-template-columns: 1.6em auto minmax(0, 1fr) auto auto;
      grid-template-areas:
        "idx name item amt pay"
        "edit edit edit edit edit";
    }
    .guest-row.on .gitem { display: none; }
    .guest-row .inline-item {
      display: none;
      grid-area: edit;
      width: 100%;
      min-height: 76px;
      margin-top: 6px;
      font-size: 14px;
      line-height: 1.45;
      padding: 8px 10px;
      border: 1px solid #93c5fd;
      border-radius: 8px;
      font-family: inherit;
      background: #fff;
      resize: vertical;
    }
    .guest-row.on .inline-item { display: block; }
    .guest-row .gamt {
      grid-area: amt;
      font-weight: 800;
      color: #b45309;
      white-space: nowrap;
      font-size: 15px;
    }
    .guest-row .amt-edit {
      grid-area: amt;
      display: none;
      align-items: center;
      gap: 2px;
      font-weight: 800;
      color: #b45309;
      font-size: 15px;
    }
    .guest-row .amt-edit input {
      width: 5.2em;
      font-size: 16px;
      font-weight: 800;
      color: #b45309;
      padding: 4px 6px;
      border: 1px solid #fdba74;
      border-radius: 8px;
      font-family: inherit;
      background: #fffbeb;
      text-align: right;
    }
    .guest-row.on .gamt { display: none; }
    .guest-row.on .amt-edit { display: flex; }
    .guest-row .gpay {
      grid-area: pay;
      font-size: 11px;
      font-weight: 700;
      color: #334155;
      background: #f1f5f9;
      border-radius: 999px;
      padding: 1px 8px;
      justify-self: end;
      white-space: nowrap;
    }
    .guest-edit {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      align-items: end;
    }
    .guest-edit .field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
    .guest-edit .field span {
      font-size: 11px;
      color: var(--muted);
      font-weight: 600;
    }
    .guest-edit .fld-item,
    .guest-edit .fld-note { grid-column: 1 / -1; }
    .guest-edit input, .guest-edit select, .guest-edit textarea {
      width: 100%;
      font-size: 16px;
      padding: 10px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-family: inherit;
      background: #fff;
    }
    .guest-edit textarea { min-height: 52px; resize: vertical; }
    .guest-edit textarea.item-box {
      min-height: 88px;
      font-size: 15px;
      line-height: 1.4;
    }
    .edit-empty {
      margin: 0;
      padding: 10px 12px;
      text-align: left;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.4;
      background: #f8fafc;
      border: 1px dashed var(--border);
      border-radius: 10px;
    }
    .guest-editor {
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 10px;
      margin-bottom: 8px;
    }
    @media (max-width: 860px) {
      .work-split { grid-template-columns: 1fr; }
      .guest-list { max-height: none; }
    }
    .special-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 8px;
    }
    .special-toolbar button {
      appearance: none;
      border: none;
      border-radius: 8px;
      padding: 6px 12px;
      font-size: 13px;
      font-weight: 700;
      font-family: inherit;
      cursor: pointer;
      min-height: 34px;
    }
    .special-toolbar .sync { background: #1a5fb4; color: #fff; }
    .special-toolbar .go { background: #047857; color: #fff; }
    .special-toolbar .ghost { background: #f1f5f9; color: #334155; }
    .cat-tabs {
      display: inline-flex;
      background: #e2e8f0;
      border-radius: 999px;
      padding: 2px;
      gap: 2px;
      margin-bottom: 6px;
    }
    .cat-tabs button {
      appearance: none;
      border: none;
      background: transparent;
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      padding: 4px 10px;
      border-radius: 999px;
      cursor: pointer;
      color: #334155;
    }
    .cat-tabs button.on { background: #1a5fb4; color: #fff; }
    .guest-row:hover { border-color: #6ee7b7; }
    .guest-row.on {
      border-color: #059669;
      background: #ecfdf5;
      box-shadow: 0 0 0 2px rgba(16,185,129,.2);
    }
    .guest-row.saved {
      border-color: #f59e0b;
      background: #fffbeb;
    }
    .guest-row.saved.on {
      border-color: #d97706;
      box-shadow: 0 0 0 2px rgba(245,158,11,.25);
    }
    .mark-saved {
      display: inline-block;
      margin-left: 6px;
      font-size: 11px;
      font-weight: 800;
      color: #b45309;
      background: #fde68a;
      border-radius: 999px;
      padding: 1px 7px;
    }
    .lock-bar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      margin: 6px 0 8px;
      padding: 6px 10px;
      border-radius: 8px;
      background: #f8fafc;
      border: 1px solid var(--border);
      font-size: 12px;
      color: #334155;
    }
    .lock-bar.locked {
      background: #fff7ed;
      border-color: #fdba74;
      color: #9a3412;
    }
    .lock-bar .lock-msg { flex: 1 1 220px; line-height: 1.4; }
    .lock-bar button {
      appearance: none;
      border: none;
      border-radius: 8px;
      padding: 8px 12px;
      font-size: 13px;
      font-weight: 700;
      font-family: inherit;
      cursor: pointer;
      min-height: 36px;
    }
    .lock-bar .btn-lock { background: #9a3412; color: #fff; }
    .lock-bar .btn-unlock { background: #fff; color: #9a3412; border: 1px solid #fdba74; }
    .autosave-ok { color: #047857; font-weight: 700; }
    .guest-row .gmeta { font-size: 12px; color: var(--muted); margin-top: 2px; }
    .special-form {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 10px;
      margin-bottom: 10px;
    }
    .special-form label {
      display: block;
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 4px;
    }
    .special-form input,
    .special-form select {
      width: 100%;
      font-size: 16px;
      padding: 9px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-family: inherit;
    }
    .special-form .span2 { grid-column: 1 / -1; }
    .special-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 10px;
    }
    .special-actions button {
      appearance: none;
      border: none;
      border-radius: 8px;
      padding: 11px 16px;
      font-size: 14px;
      font-weight: 700;
      font-family: inherit;
      cursor: pointer;
      min-height: 44px;
    }
    .special-actions button.primary { background: #047857; color: #fff; }
    .special-actions button.go { background: var(--primary); color: #fff; }
    .special-actions button.ghost { background: #f1f5f9; color: #334155; }
    .special-queue { font-size: 13px; }
    .special-queue .qrow {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      padding: 6px 0;
      border-bottom: 1px dashed var(--border);
    }
    .special-queue button.del {
      appearance: none;
      border: none;
      background: transparent;
      color: #b91c1c;
      font-weight: 700;
      cursor: pointer;
    }
    .grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 12px;
      margin-bottom: 16px;
    }
    button.card {
      appearance: none;
      border: 1px solid var(--border);
      background: var(--card);
      border-radius: 14px;
      padding: 18px 16px;
      text-align: left;
      cursor: pointer;
      transition: transform .08s, box-shadow .15s, border-color .15s;
      box-shadow: 0 1px 3px rgba(0,0,0,.04);
      min-height: 110px;
      font-family: inherit;
      color: inherit;
    }
    button.card:hover:not(:disabled) {
      transform: translateY(-1px);
      border-color: #93c5fd;
      box-shadow: 0 6px 16px rgba(26,95,180,.12);
    }
    button.card:active:not(:disabled) { transform: translateY(0); }
    button.card:disabled { opacity: .55; cursor: wait; }
    button.card .icon { font-size: 26px; line-height: 1; margin-bottom: 8px; }
    button.card .title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
    button.card .desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
    button.card.primary {
      background: linear-gradient(160deg, #1a5fb4, #3584e4);
      color: #fff;
      border: none;
    }
    button.card.primary .desc { color: rgba(255,255,255,.85); }
    button.card.secondary { background: #ecfdf5; border-color: #a7f3d0; }
    button.card.warn { background: #fff7ed; border-color: #fed7aa; }
    .log-wrap {
      background: #0f172a;
      color: #e2e8f0;
      border-radius: 12px;
      overflow: hidden;
      border: 1px solid #1e293b;
    }
    .log-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 14px;
      background: #1e293b;
      font-size: 13px;
    }
    .log-head .status { font-weight: 600; }
    .log-head .status.run { color: #fbbf24; }
    .log-head .status.ok { color: #4ade80; }
    .log-head .status.err { color: #f87171; }
    #log {
      margin: 0;
      padding: 12px 14px;
      height: 280px;
      overflow: auto;
      font-family: Consolas, "Courier New", monospace;
      font-size: 12px;
      line-height: 1.45;
      white-space: pre-wrap;
      word-break: break-word;
    }
    footer {
      text-align: center;
      color: var(--muted);
      font-size: 12px;
      margin-top: 16px;
    }
    .busy-bar {
      display: none;
      height: 3px;
      background: linear-gradient(90deg, #1a5fb4, #67e8f9, #1a5fb4);
      background-size: 200% 100%;
      animation: slide 1.2s linear infinite;
    }
    .busy-bar.on { display: block; }
    @keyframes slide {
      0% { background-position: 100% 0; }
      100% { background-position: -100% 0; }
    }
    .period {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 6px 10px;
      margin-bottom: 8px;
    }
    .period h3 { margin: 0 0 10px; font-size: 15px; }
    .period .row {
      display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px;
    }
    .period label { font-size: 13px; color: var(--muted); }
    .period select, .period input {
      font-size: 14px; padding: 8px 10px; border-radius: 8px;
      border: 1px solid var(--border); font-family: inherit;
    }
    .period button.go {
      font-size: 14px; font-weight: 700; padding: 10px 16px;
      border: none; border-radius: 10px; cursor: pointer;
      background: #1a5fb4; color: #fff;
      font-family: inherit;
    }
    .period button.go:hover { background: #124a8f; }
    .period button.go.alt { background: #0f766e; }
    .period button.go.day { background: #b45309; }
    .period button.go.day:hover { background: #92400e; }
    .period button.go:disabled { opacity: .55; cursor: wait; }
    .period .hint { font-size: 12px; color: var(--muted); margin: 0; }
    .period input[type=date] { min-width: 160px; }
    .period.highlight {
      border-color: #fbbf24;
      background: linear-gradient(180deg, #fffbeb, #fff);
    }
    .forms {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 6px 10px;
      margin-bottom: 8px;
    }
    .forms h3 { margin: 0 0 6px; font-size: 15px; }
    .forms .sub {
      margin: 0 0 12px;
      font-size: 12px;
      color: var(--muted);
    }
    .form-list {
      display: grid;
      gap: 10px;
    }
    .form-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
      padding: 12px 12px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: #f8fafc;
    }
    .form-row .meta { flex: 1 1 180px; min-width: 160px; }
    .form-row .ftitle {
      font-weight: 700;
      font-size: 14px;
      margin-bottom: 2px;
    }
    .form-row .fdesc {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.35;
    }
    .form-row .badge {
      display: inline-block;
      font-size: 10px;
      font-weight: 700;
      padding: 2px 6px;
      border-radius: 999px;
      margin-left: 6px;
      vertical-align: middle;
      background: #e2e8f0;
      color: #334155;
      text-transform: uppercase;
    }
    .form-row .badge.pdf { background: #fee2e2; color: #b91c1c; }
    .form-row .badge.xlsx { background: #dcfce7; color: #166534; }
    .form-row .badge.docx { background: #dbeafe; color: #1d4ed8; }
    .form-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .form-actions a,
    .form-actions button {
      appearance: none;
      border: 1px solid var(--border);
      background: #fff;
      color: #1a1a1a;
      border-radius: 8px;
      padding: 8px 12px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      text-decoration: none;
      font-family: inherit;
      line-height: 1.2;
    }
    .form-actions a:hover,
    .form-actions button:hover {
      border-color: #93c5fd;
      background: #eff6ff;
    }
    .form-actions button.primary,
    .form-actions a.primary {
      background: var(--primary);
      border-color: var(--primary);
      color: #fff;
    }
    .form-actions button.primary:hover,
    .form-actions a.primary:hover {
      background: var(--primary-d);
      border-color: var(--primary-d);
    }
    .form-actions button:disabled {
      opacity: .55;
      cursor: wait;
    }
    .form-row.missing {
      opacity: .65;
      border-style: dashed;
    }
    .privacy-btn {
      appearance: none;
      border: 1px solid rgba(255,255,255,.45);
      background: rgba(0,0,0,.18);
      color: #fff;
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      padding: 4px 10px;
      min-height: 32px;
      border-radius: 999px;
      cursor: pointer;
    }
    .privacy-btn.on { background: #fff; color: #124a8f; border-color: #fff; }
    body:not(.mgmt-view) .mgmt-only {
      display: none !important;
    }
    body.hide-sensitive .sensitive {
      display: none !important;
    }
    body.mgmt-view.hide-sensitive .money.sensitive {
      display: flex !important;
    }
    body.mgmt-view.hide-sensitive .compare.sensitive,
    body.mgmt-view.hide-sensitive .m-glance-sum.sensitive,
    body.mgmt-view.hide-sensitive .m-glance-wrap.sensitive {
      display: block !important;
    }
    body.hide-sensitive .guest-list.sensitive {
      display: flex !important;
    }
    .guest-panel {
      background: #fff;
      border: 1px solid #a7f3d0;
      border-radius: 12px;
      padding: 10px 12px;
      margin-bottom: 12px;
    }
    .guest-panel h3 { display: none; }
    .guest-panel > .sub { display: none; }
    .sensitive-placeholder {
      display: none;
      flex: 0 0 auto;
      background: #fff7ed;
      border: 1px dashed #fdba74;
      color: #9a3412;
      border-radius: 8px;
      padding: 4px 10px;
      margin-bottom: 0;
      font-size: 12px;
      font-weight: 600;
      white-space: nowrap;
    }
    body.hide-sensitive .sensitive-placeholder { display: block; }
    .product-box {
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 8px 10px;
      margin-bottom: 0;
    }
    .product-box .plab {
      font-size: 12px;
      font-weight: 700;
      color: #047857;
      margin-bottom: 6px;
    }
    .product-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
    }
    .product-chip {
      appearance: none;
      border: 1px solid #cbd5e1;
      background: #fff;
      color: #334155;
      font-family: inherit;
      font-size: 11px;
      font-weight: 600;
      padding: 3px 7px;
      border-radius: 6px;
      cursor: pointer;
      line-height: 1.3;
      min-height: 0;
    }
    .product-chip:hover { background: #e2e8f0; }
    .product-chip.on {
      background: #1a5fb4;
      border-color: #1a5fb4;
      color: #fff;
    }
    .product-qty {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      margin-top: 6px;
      font-size: 12px;
      color: var(--muted);
    }
    .product-qty input {
      width: 52px;
      font-size: 14px;
      padding: 4px 6px;
      border: 1px solid var(--border);
      border-radius: 6px;
      font-family: inherit;
    }
    .product-qty .undo,
    .guest-edit .btn-undo {
      appearance: none;
      border: 1px solid #fdba74;
      background: #fff7ed;
      color: #9a3412;
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      padding: 4px 8px;
      border-radius: 6px;
      cursor: pointer;
    }
    .product-qty .undo:disabled {
      opacity: .45;
      cursor: default;
    }
    .pkg-row {
      display: grid;
      grid-template-columns: 1fr 5.5em auto;
      gap: 6px;
      margin-top: 8px;
    }
    .pkg-row input {
      width: 100%;
      font-size: 14px;
      padding: 8px 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-family: inherit;
    }
    .pkg-row button {
      appearance: none;
      border: none;
      background: #1a5fb4;
      color: #fff;
      font-family: inherit;
      font-size: 13px;
      font-weight: 700;
      border-radius: 8px;
      cursor: pointer;
      padding: 0 10px;
      min-height: 36px;
    }
    .edit-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
    }
    .edit-actions button {
      appearance: none;
      border: 1px solid var(--border);
      background: #fff;
      color: #334155;
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      padding: 6px 10px;
      border-radius: 8px;
      cursor: pointer;
    }
    .edit-actions button.warn {
      border-color: #fdba74;
      background: #fff7ed;
      color: #9a3412;
    }
    .fold-head {
      appearance: none;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border: none;
      background: transparent;
      padding: 0;
      margin: 0 0 10px;
      font-family: inherit;
      text-align: left;
      cursor: pointer;
      color: inherit;
    }
    .files-panel .fold-head { color: var(--primary); }
    .special-panel .fold-head { color: #047857; }
    .fold-head .fold-title {
      font-size: 15px;
      font-weight: 700;
      line-height: 1.3;
    }
    .fold-head .chev {
      flex-shrink: 0;
      font-size: 12px;
      opacity: .7;
      transition: transform .12s;
    }
    .fold.closed .fold-head { margin-bottom: 0; }
    .fold.closed .fold-body { display: none; }
    .fold.closed .chev { transform: rotate(-90deg); }
    .fold-head:hover .chev { opacity: 1; }
    .status-row {
      display: flex;
      flex-wrap: wrap;
      align-items: stretch;
      gap: 6px;
      margin-bottom: 6px;
    }
    .result-banner {
      flex: 1 1 12em;
      background: #ecfdf5;
      border: 1px solid #a7f3d0;
      color: #14532d;
      border-radius: 8px;
      padding: 4px 10px;
      margin-bottom: 0;
      font-size: 12px;
      font-weight: 700;
    }
    .result-banner.err {
      background: #fef2f2;
      border-color: #fecaca;
      color: #991b1b;
    }
    .result-banner.wait {
      background: #fffbeb;
      border-color: #fde68a;
      color: #92400e;
    }
    .log-wrap .fold-head { color: #e2e8f0; }
    .log-wrap .fold-title { font-size: 13px; font-weight: 600; }
    .log-wrap .status { margin-left: auto; margin-right: 8px; }
    .cash-panel {
      background: #fff;
      border: 2px solid #1a5fb4;
      border-radius: 12px;
      padding: 8px 10px 10px;
      margin: 0;
    }
    .work-right .cash-panel { height: auto; }
    .cash-simple { max-width: none; }
    .cash-date-banner {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px 10px;
      margin: 0 0 6px;
      padding: 6px 8px;
      background: #eff6ff;
      border: 1px solid #bfdbfe;
      border-radius: 8px;
    }
    .cash-date-left {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }
    .cash-date-main {
      font-size: 18px;
      font-weight: 800;
      color: #1a5fb4;
      line-height: 1.1;
    }
    .cash-date-week {
      font-size: 13px;
      font-weight: 800;
      color: #0f172a;
    }
    .cash-date-pick {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .cash-date-pick button {
      appearance: none;
      border: 1px solid #93c5fd;
      background: #fff;
      color: #1a5fb4;
      font-size: 18px;
      font-weight: 900;
      line-height: 1;
      width: 32px;
      height: 32px;
      border-radius: 8px;
      cursor: pointer;
    }
    .cash-date-pick button:hover { background: #dbeafe; }
    .cash-date-left input[type="date"] {
      font-family: inherit;
      font-size: 16px;
      font-weight: 800;
      padding: 4px 8px;
      border: 2px solid #1a5fb4;
      border-radius: 8px;
      color: #0f172a;
      background: #fff;
      min-width: 148px;
    }
    .cash-date-duty {
      flex: 1;
      min-width: 140px;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.4;
      color: #334155;
    }
    .cash-hint {
      margin: 0 0 4px;
      font-size: 11px;
      color: var(--muted);
    }
    .cash-hint b { color: #0f172a; }
    .cash-close-links {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
      margin-top: 6px;
    }
    .cash-close-links a {
      display: block;
      text-align: center;
      font-size: 12px;
      font-weight: 800;
      color: #fff;
      background: #1a5fb4;
      padding: 6px 6px;
      border-radius: 6px;
      text-decoration: none;
    }
    .cash-close-links a.alt {
      background: #fff;
      color: #1a5fb4;
      border: 1px solid #1a5fb4;
    }
    .cash-people {
      margin: 4px 0 4px;
      display: block;
    }
    .cash-check-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin: 0 0 6px;
    }
    .cash-check-head h4 {
      margin: 0;
      font-size: 13px;
      color: #1a5fb4;
    }
    .cash-check-head .prog {
      font-size: 12px;
      font-weight: 800;
      color: #475569;
    }
    .cash-check-head .prog.ok { color: #166534; }
    .cash-check-actions {
      display: flex;
      gap: 6px;
      margin: 0 0 6px;
    }
    .cash-check-actions button {
      appearance: none;
      border: 1px solid #1a5fb4;
      background: #fff;
      color: #1a5fb4;
      font-family: inherit;
      font-size: 12px;
      font-weight: 700;
      padding: 4px 8px;
      border-radius: 8px;
      cursor: pointer;
    }
    .cash-check-actions button:hover { background: #eaf2fd; }
    .cash-check-row {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 7px 8px;
      border: 1px solid #dbe4ee;
      border-radius: 8px;
      background: #fff;
      margin-bottom: 5px;
      cursor: pointer;
    }
    .cash-check-row.on {
      background: #ecfdf5;
      border-color: #86efac;
    }
    .cash-check-row input[type="checkbox"] {
      width: 20px;
      height: 20px;
      margin-top: 1px;
      flex: 0 0 auto;
      accent-color: #15803d;
      cursor: pointer;
    }
    .cash-check-row .body { flex: 1; min-width: 0; }
    .cash-check-row .top {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: baseline;
    }
    .cash-check-row .nm { font-weight: 800; font-size: 13px; }
    .cash-check-row .am { font-weight: 800; font-size: 13px; white-space: nowrap; }
    .cash-check-row .meta {
      margin-top: 2px;
      font-size: 12px;
      color: #64748b;
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .cash-check-row .pay {
      font-weight: 800;
      color: #1e40af;
    }
    .cash-check-row .pay.cash { color: #166534; }
    .cash-check-row .pay.voucher { color: #c2410c; }
    .cash-check-empty {
      font-size: 12px;
      color: #64748b;
      padding: 8px;
      background: #f8fafc;
      border-radius: 8px;
    }
    .cash-check-sum {
      margin-top: 4px;
      font-size: 12px;
      font-weight: 800;
      color: #0f172a;
    }
    .duty-pick {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 4px 6px;
      margin: 0 0 6px;
      padding: 4px 8px;
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      font-size: 13px;
    }
    .duty-pick .dl {
      font-weight: 800;
      color: #1a5fb4;
      margin: 0 2px 0 4px;
    }
    .duty-pick .slot {
      font-weight: 700;
      color: #64748b;
      font-size: 12px;
    }
    .duty-pick label { display: none; }
    .duty-pick select {
      font-family: inherit;
      font-size: 13px;
      font-weight: 700;
      padding: 2px 4px;
      border: 1px solid #93c5fd;
      border-radius: 6px;
      background: #fff;
    }
    .duty-pick .hint { display: none; }
    .duty-pick #schedReason {
      font-family: inherit;
      font-size: 12px;
      width: 9em;
      min-width: 0;
      flex: 0 1 9em;
      padding: 2px 6px;
      border: 1px solid #93c5fd;
      border-radius: 6px;
    }
    .duty-pick #btnSchedSave {
      appearance: none;
      border: none;
      background: var(--primary);
      color: #fff;
      font-family: inherit;
      font-size: 12px;
      font-weight: 800;
      border-radius: 6px;
      padding: 3px 8px;
      cursor: pointer;
    }
    .duty-pick #schedSaveMsg {
      font-size: 12px;
      font-weight: 800;
      color: #14532d;
      margin-left: 4px;
    }
    .duty-pick #schedSaveMsg.err { color: #9a3412; }
    .cash-shifts { display: none; }
    .cash-shifts .sh {
      font-size: 14px;
      font-weight: 800;
      color: #1a5fb4;
    }
    .cash-shifts label {
      display: block;
      font-size: 11px;
      color: var(--muted);
      margin: 0 0 2px;
      font-weight: 700;
    }
    .cash-shifts select {
      width: 100%;
      font-family: inherit;
      font-size: 16px;
      font-weight: 700;
      padding: 6px 8px;
      border: 1px solid var(--border);
      border-radius: 6px;
      min-height: 38px;
    }
    .cash-table {
      width: 100%;
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      overflow: hidden;
      background: #fff;
    }
    .cash-tr {
      display: grid;
      grid-template-columns: 64px minmax(48px, 1fr) 64px;
      gap: 6px;
      align-items: center;
      padding: 3px 6px;
      border-bottom: 1px solid #e2e8f0;
    }
    .cash-tr:last-child { border-bottom: none; }
    .cash-tr.head {
      background: #e8eef6;
      font-size: 11px;
      font-weight: 800;
      color: #334155;
      letter-spacing: .04em;
      padding: 5px 8px;
      border-bottom: 1px solid #94a3b8;
    }
    .cash-tr .den {
      font-size: 13px;
      font-weight: 800;
      color: #0f172a;
      font-variant-numeric: tabular-nums;
    }
    .cash-tr input {
      width: 100%;
      font-family: inherit;
      font-size: 14px;
      font-weight: 700;
      padding: 3px 4px;
      border: 1px solid #94a3b8;
      border-radius: 6px;
      text-align: center;
      background: #fffbeb;
    }
    .cash-tr input::placeholder { color: #94a3b8; font-weight: 600; font-size: 13px; }
    .cash-tr input:focus {
      outline: 2px solid #1a5fb4;
      outline-offset: 0;
      background: #fff;
    }
    .cash-tr .sub {
      font-size: 13px;
      font-weight: 800;
      text-align: right;
      color: #334155;
      font-variant-numeric: tabular-nums;
    }
    .cash-tr.total {
      background: #f8fafc;
      font-weight: 800;
    }
    .cash-tr.total .den { font-size: 13px; }
    .cash-tr.total .sub { font-size: 15px; }
    .cash-tr.take {
      background: #eff6ff;
      border-top: 1px solid #93c5fd;
      grid-template-columns: 1fr auto;
      padding: 6px;
    }
    .cash-tr.take .take-lab {
      font-size: 13px;
      font-weight: 800;
      color: #1e3a8a;
    }
    .cash-tr.take .take-hint {
      display: block;
      font-size: 10px;
      font-weight: 600;
      color: #64748b;
      margin-top: 1px;
    }
    .cash-tr.take .take-val {
      font-size: 16px;
      font-weight: 800;
      color: #1d4ed8;
      font-variant-numeric: tabular-nums;
    }
    .cash-compare {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 4px;
      margin: 8px 0 6px;
      padding: 4px;
      border-radius: 10px;
    }
    .cash-compare .box {
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 4px 4px 5px;
      text-align: center;
    }
    .cash-compare .lab { font-size: 11px; color: var(--muted); font-weight: 700; }
    .cash-compare .lab-hint {
      font-size: 10px;
      font-weight: 600;
      color: #64748b;
      line-height: 1.25;
      margin-top: 1px;
    }
    .cash-compare .val { font-size: 14px; font-weight: 800; color: #0f172a; margin-top: 1px; }
    .cash-compare .box.short,
    .cash-compare .box.over,
    .cash-compare .box.balanced {
      border-width: 2px;
    }
    .cash-compare.short { background: #fef2f2; }
    .cash-compare .box.short {
      background: #fff1f2;
      border-color: #dc2626;
      box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
    }
    .cash-compare .box.short .lab,
    .cash-compare .box.short .val { color: #b91c1c; }
    .cash-compare .box.short .lab-hint { color: #991b1b; }
    .cash-compare.over { background: #ecfdf5; }
    .cash-compare .box.over {
      background: #dcfce7;
      border-color: #16a34a;
      box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16);
    }
    .cash-compare .box.over .lab,
    .cash-compare .box.over .val { color: #166534; }
    .cash-compare .box.over .lab-hint { color: #15803d; }
    .cash-compare.balanced { background: #eff6ff; }
    .cash-compare .box.balanced {
      background: #dbeafe;
      border-color: #2563eb;
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
    }
    .cash-compare .box.balanced .lab,
    .cash-compare .box.balanced .val { color: #1d4ed8; }
    .cash-compare .box.balanced .lab-hint { color: #1e40af; }
    .cash-gap-banner {
      padding: 7px 8px;
      border-radius: 8px;
      font-weight: 700;
      line-height: 1.45;
    }
    .cash-gap-banner.short {
      color: #991b1b;
      background: #fef2f2;
      border: 1px solid #fecaca;
    }
    .cash-gap-banner.over {
      color: #166534;
      background: #ecfdf5;
      border: 1px solid #bbf7d0;
    }
    .cash-gap-banner.balanced {
      color: #1e40af;
      background: #eff6ff;
      border: 1px solid #bfdbfe;
    }
    .cash-memo { margin: 0 0 8px; }
    .cash-memo label {
      display: block;
      font-weight: 800;
      font-size: 13px;
      margin: 0 0 4px;
    }
    .cash-memo textarea {
      width: 100%;
      min-height: 52px;
      resize: vertical;
      font-family: inherit;
      font-size: 13px;
      line-height: 1.4;
      padding: 6px 8px;
      border: 1px solid var(--border);
      border-radius: 6px;
    }
    .cash-memo.need-reason textarea {
      border-color: #fdba74;
      background: #fff7ed;
    }
    .cash-actions button {
      appearance: none;
      width: 100%;
      border: none;
      background: var(--primary);
      color: #fff;
      font-family: inherit;
      font-size: 14px;
      font-weight: 700;
      padding: 8px 12px;
      border-radius: 8px;
      cursor: pointer;
    }
    .cash-actions button:disabled {
      opacity: 0.75;
      cursor: wait;
    }
    .cash-actions button.ghost {
      margin-top: 6px;
      background: #fff;
      color: #1a5fb4;
      border: 1px solid #1a5fb4;
    }
    .cash-status { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
  
    /* 系統狀態總覽（2026-08-28）：姑娘開機一眼睇到系統健唔健康 */
    #sysOverview{margin:10px 0 14px;border:1px solid #e2e6ea;border-radius:12px;background:#fff;overflow:hidden}
    #sysOverview .ov-head{display:flex;align-items:center;gap:10px;padding:9px 13px;background:#f7f9fb;border-bottom:1px solid #e9edf1;cursor:pointer;user-select:none}
    #sysOverview .ov-head b{font-size:14px}
    #sysOverview .ov-sum{margin-left:auto;display:flex;gap:6px;flex-wrap:wrap}
    #sysOverview .ov-body{padding:11px 13px;display:none}
    #sysOverview.open .ov-body{display:block}
    #sysOverview .ov-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(215px,1fr));gap:11px}
    #sysOverview .ov-cell{border:1px solid #eef1f4;border-radius:9px;padding:9px 11px;background:#fcfdfe}
    #sysOverview .ov-cell h4{margin:0 0 6px;font-size:12px;color:#5b6874;font-weight:700;letter-spacing:.02em}
    #sysOverview .ov-cell .ln{font-size:13px;line-height:1.55}
    #sysOverview .ov-cell .ln .m{color:#7a8794}
    .ov-chip{display:inline-block;padding:2px 9px;border-radius:999px;font-size:12px;font-weight:700;line-height:1.7;white-space:nowrap}
    .ov-ok{background:#e8f6ec;color:#1c6b34}
    .ov-warn{background:#fdf3d8;color:#8a6100}
    .ov-bad{background:#fdeaea;color:#a32020}
    .ov-info{background:#eaf1fb;color:#1d4e89}
    .ov-mute{background:#f0f2f4;color:#67727d}
    @media(max-width:640px){#sysOverview .ov-grid{grid-template-columns:1fr}}

/* 跟返上日張數：冇現金出入嘅日子唔使重新點鈔 */
.cash-carry{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:4px 0}
.cash-carry button{background:#fff;color:#1a5fb4;border:1px solid #1a5fb4;font-weight:700;padding:6px 12px;border-radius:8px;cursor:pointer;font-size:13px}
.cash-carry button:hover{background:#eaf2fd}
.cash-carry button:disabled{opacity:.5;cursor:default}
.cash-carry-hint{color:#6b7280;font-size:12px}
