/* ════════════════════════════════════════════════════════════════════════════
   INSIGHT Template — the reference shell for INSIGHT WebBios apps.

   Design system  : OpenGTD (dark header, drawer sidebar, sub-toolbar, hero,
                    stat tiles, light/dark theme, session-timer box, language flags).
   Login          : OPQ (standard Google id_token → app-issued session).
   Menu-collapse  : OPQ (hamburger collapses the sidebar on desktop).

   Clone this app, rename the APP constants in app.js, swap the menu list and the
   dashboard copy, and you have a new INSIGHT app on the house style.
════════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html.theme-switching, html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; }

:root {
  color-scheme: light;
  --bg:#f0f2fa; --bg-card:#ffffff; --bg-hover:#e8eaf6; --bg-stripe:#f7f8fd;
  --header-bg:#13152a; --toolbar-bg:#f8f9fe;
  --text:#1e2340; --text-muted:#5a6280; --text-dim:#9aa0c0;
  --border:#dde0f0; --border-strong:#c0c6e0;
  --accent:#c0392b; --success:#27ae60; --warning:#e67e22; --info:#2980b9;
  --header-h:56px; --toolbar-h:40px;
}
html.dark {
  color-scheme: dark;
  --bg:#1e2030; --bg-card:#252840; --bg-hover:#2d3156; --bg-stripe:#222438; --toolbar-bg:#1a1c30;
  --text:#dde1f0; --text-muted:#8891b4; --text-dim:#555e80; --border:#2e3459; --border-strong:#3a4070;
}
html.dark body { color-scheme: dark; }
html, body { height:100%; background:var(--bg); color:var(--text); font-family:'Segoe UI', system-ui, -apple-system, sans-serif; font-size:13px; }

/* ─── Scrollbars — shared INSIGHT design (thin, theme-aware via color-scheme) ──
   color-scheme (above) makes the browser paint a matching native scrollbar in
   dark mode; the rules below just make it thin. Applies everywhere (global).   */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: var(--border-strong); border: 2px solid transparent; background-clip: content-box; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--text-dim); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ─── Header ───────────────────────────────────────────────────────────────── */
.app-header { height:var(--header-h); background:var(--header-bg); border-bottom:1px solid rgba(255,255,255,0.07); display:flex; align-items:center; justify-content:space-between; padding:0 16px; flex-shrink:0; gap:12px; }
.header-left { display:flex; align-items:center; flex-shrink:0; }
.header-right { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.header-icon-box { width:42px; height:42px; background:#c0392b; border-radius:6px; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-right:11px; box-shadow:0 2px 8px rgba(192,57,43,0.45); }
.header-icon { width:26px; height:26px; object-fit:contain; }
.header-titles { display:flex; flex-direction:column; gap:2px; }
.header-brand-line { display:flex; align-items:baseline; gap:5px; }
.brand-main { font-size:21px; font-weight:700; color:#fff; letter-spacing:1px; }
.brand-version { font-size:11px; color:#8891b4; font-weight:500; letter-spacing:0.5px; }
.brand-tagline { font-size:11px; color:#a0a8c8; letter-spacing:0.2px; }
.header-user-info { display:flex; align-items:center; gap:8px; }
.header-avatar { width:28px; height:28px; border-radius:50%; font-size:10px; font-weight:700; color:#fff; background:#c0392b; display:flex; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden; }
.header-avatar img { width:100%; height:100%; object-fit:cover; }
.header-user-name { font-size:12px; color:#c8ccde; white-space:nowrap; max-width:160px; overflow:hidden; text-overflow:ellipsis; }
.header-sep { width:1px; height:22px; background:rgba(255,255,255,0.12); margin:0 2px; }
.theme-toggle { width:30px; height:30px; border-radius:50%; border:1px solid #3a4070; background:#252840; color:#8891b4; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:13px; flex-shrink:0; transition:color 0.2s, background 0.2s, border-color 0.2s; }
.theme-toggle:hover { color:#fff; border-color:#5a6290; background:#2d3156; }
.btn-logout { display:flex; align-items:center; gap:6px; padding:5px 11px; background:rgba(192,57,43,0.15); color:#e8a09a; border:1px solid rgba(192,57,43,0.35); border-radius:5px; font-size:12px; cursor:pointer; white-space:nowrap; }
.btn-logout:hover { background:rgba(192,57,43,0.3); color:#fff; }
.btn-logout-icon { width:30px; height:30px; border-radius:50%; border:1px solid rgba(192,57,43,0.35); background:rgba(192,57,43,0.15); color:#e8a09a; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:13px; flex-shrink:0; }
.btn-logout-icon:hover { background:rgba(192,57,43,0.3); color:#fff; }
/* Menu-collapse button (OPQ): always visible — collapses the sidebar on desktop, opens the drawer on mobile */
.hamburger-btn { display:flex; width:34px; height:34px; border-radius:6px; border:1px solid #3a4070; background:transparent; color:#a0a8c8; cursor:pointer; font-size:15px; align-items:center; justify-content:center; flex-shrink:0; margin-right:8px; }
.hamburger-btn:hover { background:rgba(255,255,255,0.1); color:#fff; }

/* ─── Sub-toolbar (carries the back arrow + language flags) ─────────────────── */
.sub-toolbar { min-height:var(--toolbar-h); background:var(--toolbar-bg); border-bottom:1px solid var(--border); display:flex; align-items:center; padding:0 14px; gap:8px; flex-shrink:0; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.sub-toolbar:empty { display:none; }
.tb-sep { width:1px; height:26px; background:var(--border-strong); flex-shrink:0; margin:0 2px; }
.tb-label { font-size:10px; font-weight:700; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.5px; white-space:nowrap; flex-shrink:0; }
.tb-back-btn { display:flex; align-items:center; justify-content:center; width:28px; height:28px; flex-shrink:0; border-radius:6px; border:1px solid var(--border); background:var(--bg-card); color:var(--text-dim); text-decoration:none; font-size:12px; cursor:pointer; font-family:inherit; }
.tb-back-btn:hover { color:var(--accent); border-color:var(--accent); }

/* ─── Language flags (translator) — pixel-identical to OpenGTD ──────────────── */
.lang-btn-row { display:flex; align-items:center; gap:4px; flex-shrink:0; }
.lang-btn { display:flex; align-items:center; gap:5px; padding:5px 9px; border-radius:6px; cursor:pointer; border:1px solid var(--border); background:var(--bg-card); color:var(--text-muted); font-size:12px; font-weight:500; font-family:inherit; }
.lang-btn:hover { background:var(--bg-hover); color:var(--text); border-color:var(--border-strong); }
.lang-btn.active { background:rgba(192,57,43,0.10); border-color:rgba(192,57,43,0.45); color:#c0392b; }
html.dark .lang-btn.active { color:#e8a09a; }
.lang-flag { width:16px; height:12px; object-fit:cover; border-radius:1px; }

/* ─── Layout ───────────────────────────────────────────────────────────────── */
.app-body { height:calc(100vh - var(--header-h) - var(--toolbar-h)); display:flex; overflow:hidden; }
.sidebar { width:214px; background:var(--bg-card); border-right:1px solid var(--border); display:flex; flex-direction:column; flex-shrink:0; box-shadow:2px 0 8px rgba(0,0,0,0.04); overflow-x:hidden; overflow-y:auto; transition:width 0.24s ease, border-color 0.24s ease; }
/* Collapsed state (menu-collapse): animate the width to 0 instead of snapping away.
   overflow-x:hidden (above) keeps the content clipped cleanly during the slide, and
   prevents a horizontal scrollbar when a vertical one is present. */
body.sidebar-collapsed .sidebar { width:0; border-right-color:transparent; box-shadow:none; }
.nav-section-label { font-size:10px; font-weight:700; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.8px; padding:16px 16px 6px; }
.nav-item { display:flex; align-items:center; gap:10px; padding:9px 16px; font-size:13px; color:var(--text-muted); cursor:pointer; border-left:3px solid transparent; transition:background 0.15s, color 0.15s; text-decoration:none; }
.nav-item:hover { background:var(--bg-hover); color:var(--text); }
.nav-item.active { background:var(--bg-hover); color:var(--text); border-left-color:var(--accent); font-weight:600; }
.nav-item i { width:16px; text-align:center; font-size:13px; flex-shrink:0; }
.nav-item span { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nav-item.disabled { opacity:.5; cursor:default; pointer-events:none; }
.nav-item .lock-badge { font-size:10px; color:var(--text-dim); flex:0 0 auto; }

/* ─── Session timer — pixel-identical to OpenGTD ───────────────────────────── */
.session-timer-box { margin-top:auto; padding:14px 16px 16px; border-top:1px solid var(--border); cursor:pointer; }
.session-timer-box:hover .session-timer-label { color:var(--accent); }
.session-timer-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.7px; color:var(--text-dim); display:flex; align-items:center; gap:6px; margin-bottom:7px; }
.session-timer-value { font-size:10px; font-weight:700; color:var(--text-dim); letter-spacing:0.04em; font-variant-numeric:tabular-nums; margin-left:auto; }
.session-timer-bar-wrap { height:4px; border-radius:2px; background:var(--border); overflow:hidden; }
.session-timer-bar { height:100%; border-radius:2px; background:#27ae60; transition:width 1s linear, background 0.5s; }

/* ─── Main content ─────────────────────────────────────────────────────────── */
.main-content { flex:1; overflow-y:auto; padding:20px 24px; background:var(--bg); }
.page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; gap:10px; flex-wrap:wrap; }
.page-title { font-size:18px; font-weight:700; color:var(--text); }
.page-subtitle { font-size:12px; color:var(--text-muted); margin-top:2px; }
.section-title { font-size:12px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; margin:22px 0 10px; display:flex; align-items:center; gap:8px; }
.section-title .st-count { font-weight:500; color:var(--text-dim); background:var(--bg-hover); border-radius:10px; padding:1px 8px; font-size:10px; }

/* ─── Dashboard hero (text left, image right) — from OpenGTD ────────────────── */
.hero { display:flex; gap:16px; align-items:stretch; margin-bottom:20px; }
.hero-info { flex:1; min-width:0; background:var(--bg-card); border:1px solid var(--border); border-radius:14px; padding:26px 30px; box-shadow:0 1px 4px rgba(0,0,0,0.05); display:flex; flex-direction:column; justify-content:flex-start; align-items:flex-start; }
.hero-media { flex:0 0 480px; border:1px solid var(--border); border-radius:14px; box-shadow:0 1px 4px rgba(0,0,0,0.05); overflow:hidden; min-height:300px; background:linear-gradient(135deg,#c0392b 0%,#13152a 100%); display:flex; align-items:center; justify-content:center; }
.hero-img { width:100%; height:100%; object-fit:cover; display:block; }
.hero-media .hero-fallback { color:rgba(255,255,255,0.85); font-size:80px; }
.hero-title { font-size:25px; font-weight:800; color:var(--text); letter-spacing:0.3px; margin-bottom:12px; line-height:1.2; }
.hero-title .accent { color:var(--accent); }
.hero-text { font-size:14px; color:var(--text-muted); line-height:1.65; max-width:620px; }
.hero-list { margin:14px 0 0; padding-left:0; list-style:none; display:flex; flex-direction:column; gap:7px; }
.hero-list li { font-size:13px; color:var(--text-muted); line-height:1.5; display:flex; align-items:flex-start; gap:8px; }
.hero-list li i { color:var(--accent); font-size:11px; margin-top:3px; flex-shrink:0; }

/* ─── Stat tiles — from OpenGTD ────────────────────────────────────────────── */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:14px; margin-bottom:8px; }
.stat-card { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:16px 18px; box-shadow:0 1px 4px rgba(0,0,0,0.05); border-left:4px solid var(--tile-color, var(--text-dim)); }
.stat-count { font-size:28px; font-weight:800; color:var(--text); line-height:1; margin-bottom:6px; }
.stat-label { font-size:11px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.4px; display:flex; align-items:center; gap:6px; }

/* ─── Generic content card (used by the 9 stub pages) ──────────────────────── */
.card { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:18px 20px; box-shadow:0 1px 4px rgba(0,0,0,0.05); margin-bottom:14px; }
.card-title { font-size:13px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.4px; margin-bottom:12px; display:flex; align-items:center; gap:8px; }
.card-title i { color:var(--accent); }
.lorem { font-size:13.5px; color:var(--text-muted); line-height:1.7; }
.lorem + .lorem { margin-top:12px; }
.empty-wrap { text-align:center; color:var(--text-muted); padding:44px 20px; }
.empty-wrap i { font-size:42px; color:var(--text-dim); display:block; margin-bottom:16px; }

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:9px 15px; border-radius:6px; font-size:13px; font-weight:600; cursor:pointer; border:1px solid transparent; font-family:inherit; }
.btn-sm { padding:5px 10px; font-size:12px; }
.btn-primary { background:#c0392b; color:#fff; border-color:#c0392b; } .btn-primary:hover { background:#a93226; }
.btn-secondary { background:transparent; color:var(--text-muted); border-color:var(--border-strong); } .btn-secondary:hover { background:var(--bg-hover); color:var(--text); }

/* ─── Login (OPQ pattern) ──────────────────────────────────────────────────── */
.login-screen { position:fixed; inset:0; background:var(--header-bg); display:flex; align-items:center; justify-content:center; z-index:100; }
.login-card { width:380px; max-width:90vw; padding:40px 44px; background:var(--bg-card); border:1px solid var(--border); border-radius:12px; box-shadow:0 8px 40px rgba(0,0,0,0.35); text-align:center; }
.login-logo { display:flex; align-items:center; gap:14px; text-align:left; margin-bottom:22px; }
.login-icon-box { width:48px; height:48px; background:var(--accent); border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; box-shadow:0 3px 10px rgba(192,57,43,0.4); }
.login-icon-box img { width:30px; height:30px; object-fit:contain; }
.login-brand { display:flex; align-items:baseline; gap:5px; }
.login-brand .brand-main { color:#1e2340; } html.dark .login-brand .brand-main { color:#dde1f0; }
.login-brand .brand-version { color:var(--text-dim); }
.login-tagline { font-size:12px; color:var(--text-muted); margin-top:2px; }
.login-desc { font-size:13px; color:var(--text-muted); line-height:1.55; margin-bottom:20px; }
#googleSignInBtn { display:flex; justify-content:center; }
.login-error { font-size:12px; color:#e74c3c; text-align:center; min-height:16px; margin-top:12px; }

/* ─── Toast / loading ──────────────────────────────────────────────────────── */
.toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(80px); background:#2c3060; color:#fff; padding:10px 20px; border-radius:8px; font-size:13px; box-shadow:0 4px 20px rgba(0,0,0,0.25); z-index:360; opacity:0; transition:transform 0.25s ease, opacity 0.25s ease; white-space:nowrap; pointer-events:none; }
.toast.toast-success { background:#1a4a2a; border-left:4px solid #27ae60; }
.toast.toast-error { background:#7b1e1e; border-left:4px solid #e74c3c; }
.toast.toast-show { opacity:1; transform:translateX(-50%) translateY(0); }
.loading-overlay { position:fixed; inset:0; background:var(--bg); display:flex; align-items:center; justify-content:center; z-index:200; }
.loading-spinner { width:40px; height:40px; border:3px solid var(--border); border-top-color:#c0392b; border-radius:50%; animation:spin 0.8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.content-loading { color:var(--text-muted); padding:48px 0; text-align:center; } .content-loading i { font-size:24px; display:block; margin-bottom:10px; color:var(--accent); }

.sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:50; } .overlay-show { display:block; }
.show-mobile { display:none !important; }

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width:768px) {
  .hide-mobile { display:none !important; }
  .show-mobile { display:flex !important; }
  /* On mobile the sidebar is a drawer (transform-animated); the desktop width-collapse does not apply */
  body.sidebar-collapsed .sidebar { width:250px; border-right-color:var(--border); overflow-y:auto; }
  .sidebar { position:fixed; top:calc(var(--header-h) + var(--toolbar-h)); left:0; height:calc(100vh - var(--header-h) - var(--toolbar-h)); z-index:60; transform:translateX(-100%); transition:transform 0.25s ease; box-shadow:4px 0 20px rgba(0,0,0,0.25); width:250px; }
  .sidebar.sidebar-open { transform:translateX(0); }
  .sidebar-overlay.overlay-show { display:block; z-index:55; }
  .main-content { padding:14px 12px; }
  .page-title { font-size:16px; }
  .hero { flex-direction:column; }
  .hero-media { flex:1 1 auto; order:-1; min-height:180px; }
  .hero-img { height:200px; }
}
@media (max-width:480px) { .app-header { padding:0 10px; gap:6px; } }

/* ═══ Report Hub — shared helpers ═════════════════════════════════════
   Tables / badges / forms / modal helpers are inherited 1:1 from the sibling
   Cron Jobs app (same INSIGHT house style); Report-Hub-only bits are at the end.     */
.page-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.muted { color:var(--text-muted); } .small { font-size:11px; } .mono { font-family:Consolas, 'Cascadia Mono', monospace; font-size:12px; }
.ta-r { text-align:right; } .nowrap { white-space:nowrap; }
.lnk { color:var(--text); cursor:pointer; text-decoration:none; border-bottom:1px dotted var(--border-strong); } .lnk:hover { color:var(--accent); border-bottom-color:var(--accent); }
.btn-xs { padding:4px 8px; font-size:11px; }
.btn-danger { color:#e74c3c; } .btn-danger:hover { background:rgba(231,76,60,0.12); color:#e74c3c; border-color:rgba(231,76,60,0.5); }
.btn:disabled { opacity:.6; cursor:default; }
.empty-sub { font-size:12px; color:var(--text-dim); margin-top:6px; }
.empty-inline { color:var(--text-dim); padding:18px 4px; font-size:12.5px; }

/* tables */
.card-flush { padding:0; overflow:auto; }
.tbl { width:100%; border-collapse:collapse; font-size:12.5px; }
.tbl th { text-align:left; font-size:10px; text-transform:uppercase; letter-spacing:0.5px; color:var(--text-dim); padding:10px 12px; border-bottom:1px solid var(--border); white-space:nowrap; }
.tbl td { padding:9px 12px; border-bottom:1px solid var(--border); vertical-align:top; }
.tbl tbody tr:last-child td { border-bottom:none; }
.tbl tbody tr:nth-child(even) td { background:var(--bg-stripe); }
.tbl tr.row-click { cursor:pointer; } .tbl tr.row-click:hover td { background:var(--bg-hover); }
.tbl tr.row-off td { opacity:.55; }
.card .tbl th:first-child, .card .tbl td:first-child { padding-left:14px; }

/* badges + status dots */
.badge { display:inline-flex; align-items:center; gap:5px; padding:2px 8px; border-radius:10px; font-size:10.5px; letter-spacing:0.3px; white-space:nowrap; }
.dot { display:inline-block; width:9px; height:9px; border-radius:50%; vertical-align:middle; }
.two-col { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:14px; }
@media (max-width:1100px) { .two-col { grid-template-columns:1fr; } }

/* filter bar */
.filter-bar { display:flex; gap:8px; align-items:center; margin-bottom:12px; flex-wrap:wrap; }
.filter-bar select, .filter-input { padding:6px 10px; border-radius:6px; border:1px solid var(--border-strong); background:var(--bg-card); color:var(--text); font-size:12px; font-family:inherit; }
.filter-input { width:280px; max-width:100%; } .filter-input:focus, .filter-bar select:focus { outline:none; border-color:var(--accent); }

/* forms */
.f { display:flex; flex-direction:column; gap:4px; margin-bottom:12px; min-width:0; } .f-grow { flex:1; }
.frow { display:flex; gap:12px; align-items:flex-start; flex-wrap:wrap; }
.f label { font-size:10.5px; text-transform:uppercase; letter-spacing:0.5px; color:var(--text-dim); }
.f input:not([type=checkbox]), .f select, .f textarea { padding:7px 10px; border-radius:6px; border:1px solid var(--border-strong); background:var(--bg); color:var(--text); font-size:13px; font-family:inherit; width:100%; }
.f textarea { resize:vertical; line-height:1.45; } .f input.mono { font-family:Consolas, 'Cascadia Mono', monospace; font-size:12px; }
.f input:focus, .f select:focus, .f textarea:focus { outline:none; border-color:var(--accent); }
.f label.chk { display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--text); text-transform:none; letter-spacing:0; cursor:pointer; }
.form-error { color:#e74c3c; font-size:12px; min-height:16px; }
.copyrow { display:flex; gap:6px; align-items:center; margin-top:6px; } .copyrow input { flex:1; padding:7px 10px; border-radius:6px; border:1px solid var(--border-strong); background:var(--bg); color:var(--text); font-size:12px; min-width:0; }

/* modal */
.modal-wrap { position:fixed; inset:0; z-index:300; background:rgba(0,0,0,0.55); display:flex; align-items:center; justify-content:center; padding:20px; }
.modal { background:var(--bg-card); color:var(--text); border:1px solid var(--border); border-radius:12px; width:720px; max-width:100%; max-height:92vh; display:flex; flex-direction:column; box-shadow:0 12px 50px rgba(0,0,0,0.4); }
.modal-wide { width:900px; }
.modal-head { display:flex; align-items:center; justify-content:space-between; padding:14px 18px; border-bottom:1px solid var(--border); }
.modal-title { font-size:15px; display:flex; align-items:center; gap:8px; } .modal-title i { color:var(--accent); }
.modal-x { border:none; background:transparent; color:var(--text-dim); font-size:16px; cursor:pointer; width:28px; height:28px; border-radius:6px; } .modal-x:hover { background:var(--bg-hover); color:var(--text); }
.modal-body { padding:16px 18px; overflow-y:auto; }
.modal-foot { display:flex; justify-content:flex-end; gap:8px; padding:12px 18px; border-top:1px solid var(--border); }



/* ═══ Report Hub only ═════════════════════════════════════════════════════════ */
.nav-sub { padding-left:30px; font-size:12.5px; }
.nav-count { flex:0 0 auto; font-size:10px; color:var(--text-dim); background:var(--bg-hover); border-radius:9px; padding:0 6px; }
.badge-kind { background:rgba(41,128,185,0.12); color:#2980b9; text-transform:uppercase; font-weight:700; }
.badge-ok { background:rgba(39,174,96,0.13); color:#27ae60; } .badge-err { background:rgba(231,76,60,0.13); color:#e74c3c; } .badge-off { background:var(--bg-hover); color:var(--text-dim); }
.badge-grp { background:rgba(142,68,173,0.12); color:#8e44ad; }
html.dark .badge-kind { color:#7fb3d5; } html.dark .badge-grp { color:#c39bd3; }
.err-text { color:#e74c3c; font-size:12px; white-space:pre-wrap; word-break:break-word; }

/* dashboard gallery */
.dash-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(250px, 1fr)); gap:14px; margin-bottom:8px; }
.dash-card { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:16px 18px; box-shadow:0 1px 4px rgba(0,0,0,0.05); cursor:pointer; display:flex; gap:14px; align-items:flex-start; transition:transform .15s, box-shadow .15s, border-color .15s; text-decoration:none; color:inherit; }
.dash-card:hover { transform:translateY(-1px); box-shadow:0 4px 14px rgba(0,0,0,0.09); border-color:var(--border-strong); }
.dash-ic { width:40px; height:40px; border-radius:8px; background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; font-size:17px; flex-shrink:0; }
.dash-name { font-size:14px; font-weight:700; color:var(--text); margin-bottom:4px; }
.dash-desc { font-size:12px; color:var(--text-muted); line-height:1.5; }
.dash-off { opacity:.55; }

/* filter bar (dashboard + dataset preview) */
.fbar { display:flex; flex-wrap:wrap; gap:10px 18px; align-items:flex-end; background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:12px 16px; margin-bottom:14px; box-shadow:0 1px 4px rgba(0,0,0,0.05); }
.fgrp { display:flex; flex-direction:column; gap:5px; min-width:0; }
.fgrp > label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; color:var(--text-dim); }
.fctl { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.fctl select, .fctl input { padding:6px 9px; border-radius:6px; border:1px solid var(--border-strong); background:var(--bg); color:var(--text); font-size:12.5px; font-family:inherit; }
.fctl input[type=date] { width:135px; } .fctl input[type=text], .fctl input[type=number] { width:150px; }
.fctl select:focus, .fctl input:focus { outline:none; border-color:var(--accent); }
.chip { padding:5px 10px; border-radius:14px; border:1px solid var(--border-strong); background:var(--bg); color:var(--text-muted); font-size:12px; font-weight:600; cursor:pointer; font-family:inherit; white-space:nowrap; }
.chip:hover { border-color:var(--accent); color:var(--text); }
.chip.on { background:rgba(192,57,43,0.10); border-color:rgba(192,57,43,0.55); color:#c0392b; } html.dark .chip.on { color:#e8a09a; }
.fmulti { position:relative; } .fmulti > summary { list-style:none; cursor:pointer; padding:6px 26px 6px 10px; border-radius:6px; border:1px solid var(--border-strong); background:var(--bg); color:var(--text); font-size:12.5px; min-width:160px; max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; position:relative; }
.fmulti > summary::-webkit-details-marker { display:none; }
.fmulti > summary::after { content:'\f078'; font-family:'Font Awesome 6 Free'; font-weight:900; font-size:9px; position:absolute; right:10px; top:50%; transform:translateY(-50%); color:var(--text-dim); }
.fmulti-pop { position:absolute; z-index:40; top:calc(100% + 4px); left:0; min-width:220px; max-height:300px; overflow:auto; background:var(--bg-card); border:1px solid var(--border-strong); border-radius:8px; box-shadow:0 8px 28px rgba(0,0,0,0.2); padding:6px; }
.fmulti-pop label { display:flex; gap:8px; align-items:center; padding:5px 8px; border-radius:5px; font-size:12.5px; cursor:pointer; color:var(--text); } .fmulti-pop label:hover { background:var(--bg-hover); }
.fbar-actions { margin-left:auto; display:flex; gap:8px; align-items:center; }
.fbar-info { font-size:11px; color:var(--text-dim); white-space:nowrap; }

/* widget grid */
.wgrid { display:grid; grid-template-columns:repeat(12, minmax(0,1fr)); gap:14px; align-items:stretch; }
.wcard { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; box-shadow:0 1px 4px rgba(0,0,0,0.05); display:flex; flex-direction:column; min-width:0; position:relative; }
.whead { display:flex; align-items:center; gap:8px; padding:12px 14px 4px; min-height:36px; }
.wtitle { flex:1; font-size:12px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wtitle i { color:var(--accent); margin-right:6px; }
.wsub { font-size:11px; color:var(--text-dim); padding:0 14px; margin-top:-2px; }
.wmenu { display:flex; gap:2px; opacity:0.35; transition:opacity .15s; } .wcard:hover .wmenu, .wmenu:focus-within { opacity:1; }  /* faint until the card is hovered */
.wbtn { border:none; background:transparent; color:var(--text-dim); width:24px; height:24px; border-radius:5px; cursor:pointer; font-size:11px; } .wbtn:hover { background:var(--bg-hover); color:var(--accent); }
.wbody { flex:1; padding:6px 14px 14px; min-height:0; position:relative; }
.wchart { width:100%; height:100%; min-height:200px; }
.wstate { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:var(--text-dim); font-size:12px; text-align:center; padding:14px; }
.wstate i { font-size:18px; color:var(--accent); }
.wwarn { position:absolute; top:10px; right:12px; color:var(--warning); font-size:12px; cursor:help; }
.wsection { grid-column:1 / -1; font-size:12px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; margin:10px 0 -4px; display:flex; align-items:center; gap:8px; }
.wsection i { color:var(--accent); }
.wsection::after { content:''; flex:1; height:1px; background:var(--border); }
.wtext { font-size:13px; color:var(--text-muted); line-height:1.65; }

/* KPI (left colour stripe like the template stat tiles) */
.wcard.is-kpi::before { content:''; position:absolute; left:-1px; top:-1px; bottom:-1px; width:4px; border-radius:10px 0 0 10px; background:var(--kpi-color, var(--info)); }
.wcard.is-kpi .whead { padding-left:18px; } .wcard.is-kpi .wbody { padding-left:18px; }
.kpi { display:flex; flex-direction:column; justify-content:center; height:100%; gap:5px; }
.kpi-val { font-size:30px; font-weight:800; color:var(--text); line-height:1.05; font-variant-numeric:tabular-nums; }
.kpi-unit { font-size:14px; font-weight:600; color:var(--text-muted); margin-left:4px; }
.kpi-sub { font-size:11.5px; color:var(--text-muted); display:flex; gap:10px; flex-wrap:wrap; }
.kpi-good { color:var(--success) !important; } .kpi-bad { color:#e74c3c !important; }

/* data grid (widget tables + dataset preview) */
.dgrid-wrap { overflow:auto; max-height:100%; }
.dgrid { width:100%; border-collapse:collapse; font-size:12px; }
.dgrid th { position:sticky; top:0; z-index:1; background:var(--bg-card); text-align:left; font-size:10px; text-transform:uppercase; letter-spacing:0.4px; color:var(--text-dim); padding:8px 10px; border-bottom:1px solid var(--border-strong); white-space:nowrap; cursor:pointer; user-select:none; }
.dgrid th:hover { color:var(--accent); } .dgrid th .sort { margin-left:4px; font-size:9px; }
.dgrid td { padding:6px 10px; border-bottom:1px solid var(--border); white-space:nowrap; max-width:380px; overflow:hidden; text-overflow:ellipsis; }
.dgrid tbody tr:nth-child(even) td { background:var(--bg-stripe); } .dgrid tbody tr:hover td { background:var(--bg-hover); }
.dgrid td.num, .dgrid th.num { text-align:right; font-variant-numeric:tabular-nums; }
.dgrid tfoot td { font-weight:700; border-top:2px solid var(--border-strong); border-bottom:none; background:var(--bg-card); position:sticky; bottom:0; }
.dgrid .null { color:var(--text-dim); font-style:italic; }
.pager { display:flex; gap:8px; align-items:center; justify-content:flex-end; padding-top:8px; font-size:11.5px; color:var(--text-dim); }

/* editors */
.code-area { font-family:Consolas, 'Cascadia Mono', monospace !important; font-size:12px !important; line-height:1.5 !important; tab-size:2; white-space:pre; }
.hint { font-size:11.5px; color:var(--text-dim); line-height:1.5; margin-top:2px; } .hint code, .lorem code { font-family:Consolas, monospace; background:var(--bg-hover); padding:0 4px; border-radius:3px; color:var(--text); }
.bind-row { display:grid; grid-template-columns:150px 140px 1fr; gap:8px; align-items:center; padding:6px 0; border-bottom:1px solid var(--border); font-size:12.5px; }
.bind-row:last-child { border-bottom:none; }
.bind-row select, .bind-row input { padding:5px 8px; border-radius:6px; border:1px solid var(--border-strong); background:var(--bg); color:var(--text); font-size:12px; font-family:inherit; width:100%; }
.ed-grid { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:14px; align-items:start; }
@media (max-width:1200px) { .ed-grid { grid-template-columns:1fr; } }
.result-meta { display:flex; gap:12px; flex-wrap:wrap; align-items:center; font-size:11.5px; color:var(--text-dim); margin-bottom:8px; }

/* fullscreen widget */
.wfull { position:fixed !important; inset:20px; z-index:320; grid-column:auto !important; height:auto !important; box-shadow:0 12px 60px rgba(0,0,0,0.5); }
.wfull-back { position:fixed; inset:0; z-index:310; background:rgba(0,0,0,0.55); }

@media (max-width:900px) { .wgrid { grid-template-columns:repeat(6, minmax(0,1fr)); } .wcard { grid-column:span 6 !important; } }
@media (max-width:768px) { .fbar-actions { margin-left:0; } .bind-row { grid-template-columns:1fr; } }

/* workspace tiles (mainpage-style: tinted icon block + text) */
.dash-tile { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,0.05); cursor:pointer; display:flex; flex-direction:column; text-decoration:none; color:inherit; transition:transform .15s, box-shadow .15s; }
.dash-tile:hover { transform:translateY(-2px); box-shadow:0 6px 18px rgba(0,0,0,0.12); }
.dash-tile-ic { height:110px; display:flex; align-items:center; justify-content:center; color:#fff; font-size:38px; border-bottom:1px solid var(--border); position:relative; overflow:hidden; flex-shrink:0; }
.dash-tile-img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; padding:16px 0; box-sizing:border-box; display:block; background:inherit; }
.dash-tile-txt { padding:12px 14px 14px; min-width:0; }
.dash-tile .dash-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dash-tile .dash-desc { font-size:11.5px; display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; text-overflow:ellipsis; line-height:1.45; max-height:2.9em; }
.dash-grid { grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); }
.ws-bar { margin-bottom:6px; }

/* dashboard tabs (Power BI pages) */
.dtabs { display:flex; gap:4px; flex-wrap:wrap; border-bottom:2px solid var(--border); margin:-2px 0 14px; }
.dtab { padding:8px 14px; border:none; background:transparent; color:var(--text-muted); font-size:12.5px; font-weight:600; cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-2px; font-family:inherit; display:flex; gap:7px; align-items:center; }
.dtab:hover { color:var(--text); } .dtab.on { color:var(--text); border-bottom-color:var(--accent); }
.dtab i { color:var(--accent); font-size:11px; }
.dash-meta { display:flex; gap:16px; flex-wrap:wrap; font-size:11.5px; color:var(--text-dim); margin:-10px 0 12px; } .dash-meta b { color:var(--text-muted); font-weight:600; }

/* ═══ Mainpage tiles + sidebar department menu, copied 1:1 from /mainpage.html so INSIGHT-BI looks and behaves the same ═══ */
:root { --tile-shadow: 0 2px 12px rgba(30,35,64,0.10); --tile-hover-shadow: 0 6px 24px rgba(30,35,64,0.18); }
html.dark { --tile-shadow: 0 2px 12px rgba(0,0,0,0.30); --tile-hover-shadow: 0 6px 24px rgba(0,0,0,0.50); }
    .sidebar-dept-hdr {
      display: flex; align-items: center; justify-content: space-between;
      padding: 7px 16px 7px 32px; font-size: 12px; font-weight: 600;
      color: var(--text-muted); cursor: pointer; transition: background 0.12s;
    }
    .sidebar-dept-hdr:hover { background: var(--bg-hover); color: var(--text); }
    .sidebar-dept-hdr.open { color: var(--accent); }
    .sidebar-dept-hdr .dept-chev { font-size: 9px; transition: transform 0.2s; flex-shrink:0; }
    .sidebar-dept-hdr.open .dept-chev { transform: rotate(90deg); }
    .sidebar-dept-apps { display: none; }
    .sidebar-dept-apps.open { display: block; }
    .sidebar-app-link {
      display: flex; align-items: center; gap: 9px;
      padding: 6px 16px 6px 44px; font-size: 12px;
      color: var(--text-muted); text-decoration: none; transition: background 0.12s;
    }
    .sidebar-app-link:hover { background: var(--bg-hover); color: var(--text); }
    .sidebar-app-link.disabled { opacity: 0.4; pointer-events: none; }
    .sidebar-app-link i { width: 14px; text-align: center; font-size: 12px; flex-shrink: 0; }
/*----*/
    .tile-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 18px;
      max-width: 1500px;
    }

    .tile {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 24px 18px 20px;
      display: flex; flex-direction: column; align-items: center; gap: 14px;
      cursor: pointer; text-decoration: none; color: inherit;
      transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
      box-shadow: var(--tile-shadow);
      position: relative; overflow: hidden;
    }
    .tile::before {
      content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
      background: var(--tile-accent, #c0392b); opacity: 0;
      transition: opacity 0.18s;
    }
    .tile:hover { box-shadow: var(--tile-hover-shadow); transform: translateY(-3px); border-color: var(--border-strong); }
    .tile:hover::before { opacity: 1; }
    .tile.disabled { opacity: 0.4; cursor: default; pointer-events: none; }

    .tile-icon-wrap {
      width: 56px; height: 56px; border-radius: 14px;
      display: flex; align-items: center; justify-content: center;
      font-size: 24px; flex-shrink: 0;
      transition: transform 0.18s;
    }
    .tile:hover .tile-icon-wrap { transform: scale(1.08); }

    /* ── Big tile with generated image (menu icons = big) ──────────────
       The image fills the top 60% of the tile (uniformToFill = object-fit:
       cover); the fa-icon is hidden and the label/desc sit below the image.
       Only active in the large (non-compact) grid; compact keeps the small
       fa-icon. New menu items need a PNG in /Images/app_icons/ + a line in
       APP_IMG below — see the markdown note. */
    .tile.tile-has-img {
      padding: 0 0 14px; gap: 0; overflow: hidden; justify-content: flex-start;
    }
    .tile.tile-has-img .tile-icon-wrap { display: none; }
    .tile-img {
      width: 100%; aspect-ratio: 5 / 3;      /* ~60% of a ~180px-wide tile */
      object-fit: contain; object-position: center;  /* transparent drawing — don't crop */
      padding: 26px 40px; box-sizing: border-box;
      display: block; flex-shrink: 0;
      background: var(--tile-img-bg, var(--bg-hover));  /* dept-tinted, set per ic-* below */
      border-bottom: 1px solid var(--border);
    }
    .tile.tile-has-img .tile-text { padding: 12px 14px 0; gap: 6px; }
    .tile.tile-has-img:hover .tile-img { transform: none; }
    /* ── Department-tinted backgrounds behind the transparent drawings ──
       The tile's iconClass (ic-blue … ic-green) is the de-facto department
       colour; the drawing is transparent so this surface shows through. */
    /* WHITE icons on MUTED GREYISH-COLOUR department shades â€” desaturated, mid
       lightness so the white icon stays legible. Same department => same shade. */
    .tile.dept-general    { --tile-img-bg: #5b6472; }
    .tile.dept-ci         { --tile-img-bg: #5a6b6a; }
    .tile.dept-quality    { --tile-img-bg: #8a5a57; }
    .tile.dept-hr         { --tile-img-bg: #6d5f80; }
    .tile.dept-hq         { --tile-img-bg: #5f6b7a; }
    .tile.dept-it         { --tile-img-bg: #566b86; }
    .tile.dept-hse        { --tile-img-bg: #5c7a5e; }
    .tile.dept-me         { --tile-img-bg: #6a7355; }
    .tile.dept-prod       { --tile-img-bg: #5f7560; }
    .tile.dept-finance    { --tile-img-bg: #557170; }
    .tile.dept-purchasing { --tile-img-bg: #7a6a55; }
    .tile.dept-rnd        { --tile-img-bg: #5e667e; }
    .tile.dept-logistics  { --tile-img-bg: #70685a; }
    .tile.dept-maint      { --tile-img-bg: #80664f; }
    .tile.dept-others     { --tile-img-bg: #656a73; }
    /* disabled / WIP tiles: even fainter image band */
    .tile.disabled .tile-img { opacity: 0.45; filter: saturate(0.5); }    /* compact grid never shows the image — small fa-icon only */
    .tile-grid.compact .tile-img { display: none; }
    .tile-grid.compact .tile.tile-has-img { padding: 10px 14px; gap: 12px; justify-content: flex-start; }
    .tile-grid.compact .tile.tile-has-img .tile-icon-wrap { display: flex; }

    .tile-label {
      font-size: 13px; font-weight: 600; color: var(--text);
      text-align: center; line-height: 1.35;
      width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .tile-desc {
      font-size: 11px; color: var(--text-muted);
      text-align: center; line-height: 1.4; margin-top: -6px;
      width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .tile-badge {
      position: absolute; top: 10px; right: 10px;
      font-size: 9px; font-weight: 700; letter-spacing: 0.5px;
      padding: 2px 6px; border-radius: 4px; text-transform: uppercase;
    }
    .badge-new { background: rgba(39,174,96,0.15); color: #27ae60; border: 1px solid rgba(39,174,96,0.3); }
    .badge-wip { background: rgba(230,126,34,0.15); color: #e67e22; border: 1px solid rgba(230,126,34,0.3); }

    @keyframes vl-spin { to { transform: rotate(360deg); } }

    /* ── Tile animations ─────────────────────────────────────────────── */
    @keyframes tile-in {
      from { opacity: 0; transform: translateY(16px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .tile.tile-enter {
      opacity: 0;
      animation: tile-in 0.32s ease both;
      animation-delay: calc(var(--ti, 0) * 55ms);
    }

    /* icon — egyszínű, elegáns */
    .tile-icon-wrap {
      background: var(--bg-hover) !important;
      color: var(--text-muted) !important;
    }
    html.dark .tile-icon-wrap {
      background: rgba(255,255,255,0.06) !important;
      color: #8891b4 !important;
    }
    .tile:hover .tile-icon-wrap {
      background: rgba(192,57,43,0.12) !important;
      color: #c0392b !important;
    }

    /* ── tile-text wrapper (shared) ───────────────────────────────── */
    .tile-text {
      display: flex; flex-direction: column; gap: 8px;
      width: 100%; min-width: 0; align-items: center;
    }

    /* ── Compact tile layout ──────────────────────────────────────── */
    .tile-grid.compact { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
    .tile-grid.compact .tile {
      flex-direction: row; padding: 10px 14px; gap: 12px; align-items: center;
    }
    .tile-grid.compact .tile-icon-wrap {
      width: 36px; height: 36px; border-radius: 9px; font-size: 16px; flex-shrink: 0;
    }
    .tile-grid.compact .tile-text { align-items: flex-start; }
    .tile-grid.compact .tile-label { text-align: left; }
    .tile-grid.compact .tile-desc  { text-align: left; margin-top: 0; }
    .tile-grid.compact .tile-icons { top: 50%; transform: translateY(-50%); right: 10px; }

.sidebar-app-link { cursor:pointer; }
.sidebar-app-link.active { background:var(--bg-hover); color:var(--text); font-weight:600; box-shadow:inset 3px 0 0 var(--accent); }
.tile-grid + .section-title, .empty-inline + .section-title { margin-top:26px; }

/* orange dot before departments that already have dashboards */
.sidebar-dept-hdr .dept-dot{width:7px;height:7px;border-radius:50%;background:#f59e0b;flex-shrink:0;margin-right:8px;box-shadow:0 0 0 2px rgba(245,158,11,.18)}
.sidebar-dept-hdr .dept-dot.empty{background:transparent;box-shadow:none}


/* ── STANDARD dashboard header + left filter panel (INSIGHT-BI) ───────────── */
.dhead { margin-bottom:12px; }
.dhead-title { font-size:22px; font-weight:700; color:var(--text); display:flex; align-items:center; gap:10px; line-height:1.2; }
.dhead-title > i { color:var(--accent); font-size:18px; }
.dhead-sub { font-size:12.5px; color:var(--text-dim); margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dhead .dash-meta { margin:9px 0 0; padding:7px 12px; background:var(--bg-card); border:1px solid var(--border); border-radius:8px; gap:6px 22px; align-items:center; }
.dm-item { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.dm-item > i { color:var(--text-dim); font-size:12px; }
.dm-av { width:20px; height:20px; border-radius:50%; overflow:hidden; display:inline-flex; align-items:center; justify-content:center; background:var(--border-strong); color:var(--text); font-size:9px; font-weight:700; flex-shrink:0; }
.dm-av img { width:100%; height:100%; object-fit:cover; }
.dlayout { display:grid; grid-template-columns:210px minmax(0,1fr); gap:14px; align-items:start; }
.dmain { min-width:0; }
.dfpanel { position:sticky; top:8px; }
.fpanel { display:flex; flex-direction:column; gap:12px; }
.fpbox { background:var(--bg-card); border:1px solid var(--border); border-radius:8px; overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,0.05); }
.fpbox-h { background:#2c2f45; color:#fff; font-size:12px; font-weight:700; letter-spacing:0.6px; text-transform:uppercase; padding:6px 10px; display:flex; align-items:center; gap:7px; } .fpbox-h > i { color:#fff; font-size:12px; width:14px; text-align:center; }
.fpbox .fctl { padding:8px 10px; display:block; }
.fp-list { display:flex; flex-direction:column; gap:2px; max-height:358px; overflow-y:auto; }  /* 15 rows x (22px + 2px gap) fit without a scrollbar */
.fp-row { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text); height:22px; padding:0 2px; flex-shrink:0; cursor:pointer; border-radius:4px; }
.fp-row:hover { background:var(--bg); }
.fp-row input { accent-color:#c0392b; margin:0; }
.fp-row span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fp-date { display:flex; flex-direction:column; gap:6px; }
.fp-date select, .fp-date input { width:100%; box-sizing:border-box; }
.fp-range { font-size:11.5px; color:var(--text-dim); }
.fpanel-actions { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.fpanel-actions .fbar-info { width:100%; }
@media (max-width:900px) { .dlayout { grid-template-columns:1fr; } .dfpanel { position:static; } .fpanel { flex-direction:row; flex-wrap:wrap; } .fpbox { flex:1 1 200px; } }

/* filter panel rows: selectable list items instead of check boxes
   (the native checkbox stays in the DOM for the click / keyboard, but is invisible) */
.fp-row { position:relative; user-select:none; height:26px !important; padding:0 8px 0 10px !important; gap:9px !important; border-radius:6px; transition:background .12s, color .12s; }
.fp-row input.fp-chk { position:absolute; opacity:0; width:1px; height:1px; margin:0; pointer-events:none; }
.fp-dot { width:8px; height:8px; border-radius:50%; border:1.5px solid var(--border-strong); flex-shrink:0; transition:all .12s; }
.fp-lbl { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text-muted); }
.fp-tick { font-size:10px; color:#c0392b; opacity:0; transform:scale(0.6); transition:opacity .12s, transform .12s; }
.fp-row:hover { background:var(--bg); }
.fp-row:hover .fp-dot { border-color:#c0392b; }
.fp-row.on { background:rgba(192,57,43,0.09); }
.fp-row.on::before { content:''; position:absolute; left:0; top:5px; bottom:5px; width:3px; border-radius:2px; background:#c0392b; }
.fp-row.on .fp-dot { background:#c0392b; border-color:#c0392b; box-shadow:0 0 0 3px rgba(192,57,43,0.18); }
.fp-row.on .fp-lbl { color:var(--text); font-weight:600; }
.fp-row.on .fp-tick { opacity:1; transform:scale(1); }
html.dark .fp-row.on { background:rgba(232,160,154,0.12); } html.dark .fp-row.on .fp-tick { color:#e8a09a; }
.fp-row:has(input.fp-chk:focus-visible) { box-shadow:0 0 0 2px rgba(192,57,43,0.35); }
.fp-list { max-height:420px !important; }   /* 15 rows x (26px + 2px gap) without a scrollbar */