:root {
  --bg: #f3f5f9; --panel: #ffffff; --ink: #172033; --ink-2: #3d4a5f; --muted: #6b778a; --line: #e2e7ef; --line-2: #cfd7e3;
  --accent: #2563eb; --accent-2: #1d4ed8; --accent-soft: #e8efff; --accent-ink: #1e40af;
  --side: #0f1f3a; --side-2: #172b4d; --side-ink: #c9d4e6; --side-muted: #7f8fab;
  --ok: #15803d; --ok-soft: #e7f6ec; --warn: #b45309; --warn-soft: #fff4e0; --bad: #c62828; --bad-soft: #fdecec;
  --radius: 10px; --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
  font-family: "IBM Plex Sans Thai", "Sarabun", "Thonburi", "Tahoma", sans-serif; font-size: 14px; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
.spacer { flex: 1; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .5px; box-shadow: 0 4px 12px rgba(37,99,235,.35); }

/* ---------------------------------------------------------------- login */
.login { position: fixed; inset: 0; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login-art { position: relative; overflow: hidden; color: #e8eefc; padding: 40px 48px; display: flex; flex-direction: column;
  background: radial-gradient(1200px 500px at -10% 110%, rgba(59,130,246,.45), transparent 60%), radial-gradient(800px 400px at 110% -10%, rgba(14,165,233,.35), transparent 60%), linear-gradient(160deg, #0f1f3a, #1b3563); }
.login-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.04); }
.login-brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 17px; }
.login-hero { margin: auto 0; max-width: 480px; }
.login-hero h1 { font-size: 38px; line-height: 1.25; margin: 0 0 14px; color: #fff; }
.login-hero p { font-size: 15.5px; line-height: 1.7; color: #b9c7e2; margin: 0 0 22px; }
.login-hero ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.login-hero li { display: flex; gap: 10px; align-items: center; color: #d6e0f3; }
.login-hero li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(96,165,250,.25); color: #93c5fd; font-size: 12px; font-weight: 700; }
.login-date { color: #8ea2c8; font-size: 13px; }
.login-panel { display: grid; place-items: center; padding: 24px; background: #f8fafc; }
.login-box { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; }
.login-box h2 { margin: 0; font-size: 24px; }
.login-box p { margin: -6px 0 6px; }
.login-box .f input { height: 42px; font-size: 15px; }
.login-err { min-height: 20px; color: var(--bad); font-weight: 500; font-size: 13.5px; }
.btn.block { width: 100%; height: 44px; font-size: 15px; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: 272px 1fr; grid-template-rows: 58px 1fr 30px; height: 100vh; transition: grid-template-columns .2s; }
.app.side-hidden { grid-template-columns: 0 1fr; }
.app.side-hidden .side { visibility: hidden; }
.side { grid-row: 1 / 4; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 12px 16px; height: 58px; border-bottom: 1px solid rgba(255,255,255,.06); }
.side-brand b { display: block; color: #fff; font-size: 15px; line-height: 1.1; }
.side-brand small { color: var(--side-muted); font-size: 12px; }
.side-search { padding: 12px 12px 6px; }
.menu-search { width: 100%; height: 36px; padding: 0 12px 0 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f8fab' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center / 16px; color: #fff; outline: none; }
.menu-search::placeholder { color: var(--side-muted); }
.menu-search:focus { border-color: #3b82f6; background-color: rgba(255,255,255,.1); }
.side-tools { display: flex; gap: 6px; padding: 4px 12px 8px; }
.chip-btn { border: 1px solid rgba(255,255,255,.1); background: transparent; color: var(--side-ink); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; cursor: pointer; }
.chip-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu { flex: 1; overflow: auto; padding: 4px 8px 16px; scrollbar-width: thin; scrollbar-color: #2a4170 transparent; }
.mg { margin-bottom: 2px; }
.mg-h { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; user-select: none; color: var(--side-ink); font-weight: 500; }
.mg-h:hover { background: rgba(255,255,255,.06); color: #fff; }
.mg-h .gicon { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: rgba(255,255,255,.06); color: #93b4ff; }
.mg-h .glabel { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-h .caret { color: var(--side-muted); transition: transform .15s; width: 14px; height: 14px; }
.mg.open > .mg-h { color: #fff; }
.mg.open > .mg-h .gicon { background: #2563eb; color: #fff; }
.mg.open > .mg-h .caret { transform: rotate(90deg); }
.mg-items { display: none; padding: 2px 0 6px 24px; margin-left: 14px; border-left: 1px solid rgba(255,255,255,.08); }
.mg.open > .mg-items { display: block; }
.mi { padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; color: var(--side-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi:hover { background: rgba(255,255,255,.06); color: #fff; }
.mi.active { background: rgba(59,130,246,.22); color: #fff; font-weight: 500; }
.side-foot { padding: 10px 16px; font-size: 12px; color: var(--side-muted); border-top: 1px solid rgba(255,255,255,.06); }

.topbar { display: flex; align-items: center; gap: 12px; padding: 0 18px 0 10px; background: rgba(255,255,255,.9); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: none; border-radius: 9px; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--bg); }
.top-title { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-chips { display: flex; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 12.5px; white-space: nowrap; border: 1px solid var(--line); }
.pill b { color: var(--ink); font-weight: 600; }
.pill.blue { background: var(--accent-soft); color: var(--accent-ink); border-color: #d3e0ff; }
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; }
.user-chip:hover { border-color: var(--line-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #60a5fa, #2563eb); color: #fff; font-weight: 600; }
.who { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.who b { font-size: 13.5px; font-weight: 600; } .who small { font-size: 11.5px; color: var(--muted); }
.user-pop { position: absolute; right: 0; top: 46px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 210px; display: grid; }
.user-pop button { border: none; background: none; text-align: left; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.user-pop button:hover { background: var(--bg); }
.danger-text { color: var(--bad); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tabs { display: flex; gap: 6px; padding: 10px 18px 0; overflow-x: auto; flex-shrink: 0; scrollbar-width: none; }
.tab { padding: 7px 12px 7px 14px; background: transparent; border: 1px solid transparent; border-radius: 9px 9px 0 0; cursor: pointer; white-space: nowrap;
  display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.tab:hover { color: var(--ink); background: rgba(255,255,255,.6); }
.tab.active { background: var(--panel); color: var(--accent-ink); border-color: var(--line); border-bottom-color: var(--panel); position: relative; top: 1px; }
.tab .x { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px; font-size: 11px; opacity: .55; }
.tab .x:hover { opacity: 1; background: var(--bg); }
.tab-bodies { flex: 1; overflow: auto; min-height: 0; background: var(--panel); border-top: 1px solid var(--line); }
.tab-body { padding: 18px 22px 48px; display: none; max-width: 1500px; }
.tab-body.active { display: block; }
.status { grid-column: 2; display: flex; gap: 20px; align-items: center; padding: 0 18px; border-top: 1px solid var(--line); background: #fff; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.status b { color: var(--ink-2); font-weight: 600; }
@media (max-width: 900px) {
  .app, .app.side-hidden { grid-template-columns: minmax(0, 1fr); grid-template-rows: 58px minmax(0, 1fr) 30px; }
  .main { grid-column: 1; grid-row: 2; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 30; box-shadow: var(--shadow-lg); transform: translateX(0); transition: transform .2s; }
  .app.side-hidden .side { transform: translateX(-100%); visibility: visible; }
  .app:not(.side-hidden) .main::before { content: ""; position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 20; }
  .topbar, .status { grid-column: 1; }
  .top-chips, .who { display: none; }
  .tab-body { padding: 14px 14px 40px; }
}

/* ---------------------------------------------------------------- screen */
.screen-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 20px; font-weight: 600; margin: 0 0 14px; color: var(--ink); }
.screen-title::before { content: ""; width: 4px; height: 22px; border-radius: 3px; background: var(--accent); }
.screen-title .badge-cancel { font-size: 13px; font-weight: 600; color: var(--bad); background: var(--bad-soft); padding: 2px 10px; border-radius: 999px; }
.screen-title .badge-cancel:empty { display: none; }
.badge-cancel { color: var(--bad); font-weight: 600; }
.badge-cancel:empty { display: none; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; align-items: center; }
.toolbar > b { font-size: 15px; margin-right: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 8px;
  background: #fff; color: var(--ink-2); cursor: pointer; white-space: nowrap; font-weight: 500; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: #f7f9fc; border-color: #b9c4d4; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.25); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 1px 2px rgba(37,99,235,.3); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { background: #fff; color: var(--bad); border-color: #f2c2c2; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.small.danger { background: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 14px; padding: 14px 16px 16px; background: #fff; box-shadow: var(--shadow); min-width: 0; }
legend { float: left; width: 100%; padding: 0 0 12px; margin: 0 0 4px; font-weight: 600; font-size: 14.5px; color: var(--ink); border-bottom: 1px solid var(--line); }
legend + * { clear: both; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; clear: both; padding-top: 6px; }
.grid .w2 { grid-column: span 2; } .grid .w3 { grid-column: span 3; } .grid .w4 { grid-column: 1 / -1; }
@media (max-width: 700px) { .grid .w2, .grid .w3 { grid-column: 1 / -1; } }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.f input, .f select, .f textarea { height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; min-width: 0; width: 100%; transition: border-color .12s, box-shadow .12s; }
.f select { padding-right: 28px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b778a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 16px; }
.f textarea { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.f input[readonly], .f textarea[readonly], .f select:disabled, .f input:disabled { background: #f5f7fa; color: var(--ink-2); border-color: var(--line); }
.f input.num { text-align: right; font-variant-numeric: tabular-nums; }
.f.check { flex-direction: row; align-items: center; gap: 8px; padding-top: 22px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.f.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.f .req { color: var(--bad); }
.datef { display: flex; position: relative; }
.datef input[type=text] { flex: 1; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.datef button { border: 1px solid var(--line-2); border-left: none; background: #f7f9fc; padding: 0 9px; cursor: pointer; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; }
.datef button:hover { background: var(--accent-soft); }
.datef input[type=date] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.withbtn { display: flex; gap: 6px; } .withbtn input { flex: 1; } .withbtn .btn.small { height: 36px; }
.screen-title .withbtn input { height: 32px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; font-size: 14px; }
.toolbar input:not([type=checkbox]) { height: 36px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 12px; outline: none; }
.toolbar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
h4 { margin: 18px 0 8px; font-size: 15px; }

/* ---------------------------------------------------------------- tables */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); max-height: 460px; background: #fff; box-shadow: var(--shadow); }
table.tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
.tbl th { position: sticky; top: 0; background: #f7f9fc; border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; white-space: nowrap; font-weight: 600; color: var(--ink-2); font-size: 12.5px; z-index: 1; }
.tbl td { border-bottom: 1px solid #eef1f6; padding: 7px 10px; white-space: nowrap; }
.tbl tbody tr:nth-child(even) td { background: #fbfcfe; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--accent-soft); }
.tbl tr.cancelled td { color: #b45b5b; text-decoration: line-through; }
.tbl tfoot td { position: sticky; bottom: 0; font-weight: 600; background: #f3f6fb; border-top: 1px solid var(--line); }
.tbl input:not([type=checkbox]), .tbl select { height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 6px; width: 100%; min-width: 80px; background: #fff; }
.tbl .datef input[type=text] { height: 32px; }
.tbl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.tbl td.sel, .tbl th.sel { width: 34px; }
.tbl-wrap > .muted { padding: 18px !important; text-align: center; }
.muted { color: var(--muted); }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.sum-box { display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; background: linear-gradient(180deg, #f8fbff, #f2f6fd); border: 1px solid #dbe5f6; border-radius: var(--radius); padding: 10px 16px; margin: 10px 0; color: var(--ink-2); }
.sum-box b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sum-box b.ok { color: var(--ok); } .sum-box b.bad { color: var(--bad); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.note { background: var(--warn-soft); border: 1px solid #f6dfb3; color: #7a4a06; border-radius: 8px; padding: 8px 12px; margin: 4px 0 8px; font-size: 13px; clear: both; }
.menus-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; clear: both; padding-top: 6px; }
.menus-pick label { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.menus-pick input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------------------------------------------------------------- dashboard */
.home { max-width: 1240px; }
.hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 26px; border-radius: 16px; color: #fff; margin-bottom: 18px;
  background: radial-gradient(600px 220px at 100% 0%, rgba(56,189,248,.35), transparent 60%), linear-gradient(120deg, #1d4ed8, #1e3a8a); box-shadow: 0 10px 30px rgba(30,58,138,.25); }
.hero h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; }
.hero p { margin: 0; color: #c7d7fb; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick button { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12); color: #fff; cursor: pointer; font-weight: 500; }
.quick button:hover { background: rgba(255,255,255,.22); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.kpi-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.kpi-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kpi-ic svg { width: 21px; height: 21px; }
.kpi.k-amber .kpi-ic { background: var(--warn-soft); color: var(--warn); }
.kpi.k-green .kpi-ic { background: var(--ok-soft); color: var(--ok); }
.kpi.k-red .kpi-ic { background: var(--bad-soft); color: var(--bad); }
.kpi.k-violet .kpi-ic { background: #f1ecff; color: #6d28d9; }
.kpi h3 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 500; line-height: 1.3; }
.kpi .big { font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .row { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; margin: 0 -8px; cursor: pointer; border-radius: 7px; color: var(--ink-2); font-size: 13.5px; }
.kpi .row:hover { background: var(--bg); }
.kpi .row b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi .row b::after { content: " ›"; color: var(--muted); font-weight: 400; }
.panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 14px; }
@media (max-width: 1100px) { .panels { grid-template-columns: 1fr; } }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.panel-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.panel-h h3 { margin: 0; font-size: 15px; }
.panel-h a { margin-left: auto; color: var(--accent); cursor: pointer; font-size: 13px; text-decoration: none; }
.panel .tbl-wrap { box-shadow: none; max-height: 340px; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: center; font-size: 13px; position: relative; }
.bar-row .name { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 14px; border-radius: 0 4px 4px 0; position: relative; }
.bar-fill { height: 100%; background: #3b6fe0; border-radius: 0 4px 4px 0; min-width: 2px; transition: background .12s; }
.bar-row:hover .bar-fill { background: #1d4ed8; }
.bar-row .val { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; }
.bar-tip { position: absolute; left: 106px; top: -34px; background: #172033; color: #fff; padding: 5px 9px; border-radius: 6px; font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .1s; z-index: 2; }
.bar-row:hover .bar-tip { opacity: 1; }
.empty { color: var(--muted); padding: 26px 0; text-align: center; }
.home .lic { text-align: center; margin-top: 22px; color: var(--muted); line-height: 1.7; font-size: 12.5px; }

/* ---------------------------------------------------------------- modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: min(920px, 100%); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; animation: pop .15s; }
.modal.sm { width: min(460px, 100%); }
.modal-h { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15.5px; }
.modal-h button { width: 32px; height: 32px; border-radius: 8px; border: none; background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.modal-h button:hover { background: var(--bg); color: var(--ink); }
.modal-b { padding: 16px 18px; overflow: auto; }
.modal-b > .toolbar:first-child { margin-top: 0; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: #fafbfd; }
.toast { position: fixed; right: 22px; bottom: 44px; background: #172033; color: #fff; padding: 12px 18px 12px 42px; border-radius: 10px; z-index: 60; max-width: 440px; box-shadow: var(--shadow-lg); animation: pop .15s; }
.toast::before { content: "✓"; position: absolute; left: 14px; top: 11px; width: 18px; height: 18px; border-radius: 50%; background: #22c55e; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.toast.err { background: #7f1d1d; }
.toast.err::before { content: "!"; background: #f87171; }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
