/* 管理總覽 / 部門總覽 (overviewPage), built on the quota page classes in 75-quota.css. Load order matters: later files override earlier ones. */
/* ==========================================================================
   Overview redesign (2026-11-16): content column max 1000px; four KPI cards; 需要處理 (alerts) and 待審核 (approvals) side by side;
   額度概況 with a company strip, department cards and members from 85%. Reuses .qt-page, .qt-head, .qt-card, .qt-bar, .qt-tag, .qt-empty.
   Bars are <progress> (no inline style under CSP). Every selector is scoped to .ov-* classes.
   ========================================================================== */
:root {
  --ov-red: var(--qt-full);
  --ov-red-soft: var(--qt-full-soft);
  --ov-red-text: var(--qt-full-text);
  --ov-orange: var(--qt-warn);
  --ov-orange-soft: var(--qt-warn-soft);
  --ov-orange-text: var(--qt-warn-text);
  --ov-violet: #6a5acd;
  --ov-violet-soft: #efedfb;
  --ov-violet-text: #5a4bbf;
  --ov-row-line: var(--fg-soft);
}
body.dark {
  --ov-violet: #a99cf0;
  --ov-violet-soft: #2e2a47;
  --ov-violet-text: #c7befa;
  --ov-row-line: var(--fg-line);
}

.qt-page.ov-page { max-width:1000px; }

/* KPI cards */
.ov-kpis { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:12px; margin-bottom:16px; }
.ov-kpi { display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:0; padding:14px 16px; border:1px solid transparent; border-radius:12px; background:var(--fg-surface); box-shadow:var(--qt-shadow); }
body.dark .ov-kpi { border-color:var(--fg-line); }
.ov-kpi small { color:var(--fg-muted); font-size:12.5px; font-weight:600; }
.ov-kpi strong { font-size:28px; line-height:1.15; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.ov-unit { margin-left:6px; color:var(--fg-muted); font-size:14px; font-weight:600; }
.ov-kpi-foot { color:var(--fg-muted); font-size:12px; }
.ov-kpi.is-hot strong { color:var(--ov-orange); }

/* Links styled as text buttons (navigate actions) */
.qt-page .ov-link { min-height:24px; padding:0; border:0; border-radius:4px; background:transparent; color:var(--fg-accent); font-size:12.5px; font-weight:700; }
.qt-page .ov-link:hover { background:transparent; text-decoration:underline; text-underline-offset:3px; }
.qt-page .ov-link:disabled { opacity:1; }

/* Two columns */
.ov-cols { display:grid; grid-template-columns:minmax(0, 1.45fr) minmax(0, 1fr); gap:16px; align-items:start; }
.ov-card { padding:18px 20px; }
.ov-card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:6px; }
.ov-card-head h2 { color:var(--fg-text); font-size:15px; }
.ov-count { padding:2px 8px; border-radius:999px; background:var(--fg-soft); color:var(--fg-text); font-size:11.5px; font-weight:700; font-variant-numeric:tabular-nums; }
.ov-period { color:var(--fg-muted); font-size:12px; font-weight:700; }
.ov-list { margin:0; padding:0; list-style:none; }
.ov-empty { padding:8px 0 4px; }
.ov-act { display:flex; gap:6px; flex:none; }
.qt-page .ov-act button { min-height:32px; padding:5px 11px; border:1px solid var(--fg-line); background:var(--fg-surface); color:var(--fg-text); font-size:12.5px; white-space:nowrap; }
.qt-page .ov-act button:hover { border-color:var(--fg-accent); }
.qt-page .ov-act button.primary { border-color:var(--fg-accent); background:var(--fg-accent); color:var(--fg-surface); }

/* 需要處理 */
.ov-alert { display:grid; grid-template-columns:10px minmax(0, 1fr) auto; gap:12px; align-items:start; padding:12px 0; border-top:1px solid var(--ov-row-line); }
.ov-alert:first-child { border-top:0; }
.ov-dot { width:10px; height:10px; margin-top:6px; border-radius:50%; background:var(--fg-muted); }
.ov-alert.is-red .ov-dot { background:var(--ov-red); }
.ov-alert.is-orange .ov-dot { background:var(--ov-orange); }
.ov-alert.is-violet .ov-dot { background:var(--ov-violet); }
.ov-alert-text { min-width:0; }
.ov-alert-title { display:flex; align-items:center; flex-wrap:wrap; gap:4px 8px; }
.ov-alert-title b { font-size:14px; }
.ov-tag { padding:1px 8px; border-radius:999px; background:var(--fg-soft); color:var(--fg-muted); font-size:11px; font-weight:700; white-space:nowrap; }
.ov-alert.is-red .ov-tag { background:var(--ov-red-soft); color:var(--ov-red-text); }
.ov-alert.is-orange .ov-tag { background:var(--ov-orange-soft); color:var(--ov-orange-text); }
.ov-alert.is-violet .ov-tag { background:var(--ov-violet-soft); color:var(--ov-violet-text); }
.ov-alert-detail { margin-top:2px !important; font-size:13px; line-height:1.55; overflow-wrap:anywhere; }
.ov-alert small, .ov-ap small { display:block; margin-top:2px; color:var(--fg-muted); font-size:12px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }

/* 待審核 */
.ov-ap { display:grid; grid-template-columns:minmax(0, 1fr) auto; gap:10px; align-items:center; padding:11px 0; border-top:1px solid var(--ov-row-line); }
.ov-ap:first-child { border-top:0; }
.ov-ap-text { min-width:0; }
.ov-ap b { font-size:14px; overflow-wrap:anywhere; }
.ov-amt { font-variant-numeric:tabular-nums; }

/* 再顯示 N 則 */
.qt-page .ov-more { display:block; margin:6px auto 0; min-height:30px; padding:4px 12px; border:0; background:transparent; color:var(--fg-accent); font-size:12.5px; font-weight:700; }
.qt-page .ov-more:hover { background:transparent; text-decoration:underline; text-underline-offset:3px; }
.qt-page .ov-more:disabled { opacity:1; }

/* 額度概況 */
.ov-quota { margin-top:16px; }
.ov-quota .ov-card-head { margin-bottom:10px; }
.ov-strip { display:grid; grid-template-columns:auto minmax(80px, 1fr) auto; align-items:center; gap:6px 14px; padding:2px 0 14px; border-bottom:1px solid var(--ov-row-line); font-size:13px; }
.ov-strip > b { white-space:nowrap; }
.ov-strip .ov-strip-bar { margin:0; }
.ov-strip-num { color:var(--fg-muted); font-variant-numeric:tabular-nums; white-space:nowrap; }
.ov-strip-num strong { color:var(--fg-text); font-size:22px; }
.ov-depts { display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:10px; margin:14px 0 0; padding:0; list-style:none; }
.ov-dc { min-width:0; padding:10px 12px; border:1px solid var(--ov-row-line); border-radius:10px; color:var(--fg-muted); font-size:12px; font-variant-numeric:tabular-nums; }
.ov-dc b { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-bottom:2px; color:var(--fg-text); font-size:13px; }
.ov-dc strong { color:var(--fg-text); font-size:16px; }
.ov-dc small { font-size:12px; }
.ov-near { margin-top:14px; }
.ov-near h3 { margin-bottom:4px !important; color:var(--fg-muted); font-size:13px; }
.ov-nr { display:grid; grid-template-columns:minmax(0, 150px) minmax(80px, 1fr) minmax(0, 140px) 60px; grid-template-areas:"who bar used tag"; align-items:center; gap:6px 14px; padding:8px 0; border-top:1px solid var(--ov-row-line); font-size:13px; font-variant-numeric:tabular-nums; }
.ov-nr .qt-who { grid-area:who; }
.ov-nr .ov-nr-bar { grid-area:bar; margin:0; }
.ov-nr-used { grid-area:used; text-align:right; white-space:nowrap; }
.ov-nr-tag { grid-area:tag; text-align:right; }
.ov-near-more { margin-top:4px !important; color:var(--fg-muted); font-size:12.5px; }
.qt-page .ov-foot-link { display:block; margin:10px auto 0; }

/* Narrow widths: KPIs two by two, one column of cards, compact quota rows */
@media (max-width: 900px) {
  .ov-kpis { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .ov-cols { grid-template-columns:1fr; }
}
@media (max-width: 720px) {
  .ov-card { padding:16px; }
  .ov-kpi strong { font-size:24px; }
  .ov-alert { grid-template-columns:10px minmax(0, 1fr); }
  .ov-alert .ov-act { grid-column:2; }
  .ov-strip { grid-template-columns:minmax(0, 1fr); gap:4px; }
  .ov-strip .ov-strip-bar { grid-row:3; margin-top:6px; }
  .ov-strip-num { white-space:normal; }
  .ov-depts { grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); }
  .ov-nr { grid-template-columns:minmax(0, 1fr) auto auto; grid-template-areas:"who used tag" "bar bar bar"; }
}
