/* ═════════════════════════════════════════════════════════════════════════════
   INSIGHT HSE Compliance Calendar — the group compliance calendar as a web app.

   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).
   Scope bar      : Generic Audit Report (site / category / risk, "All sites").
   Components     : the Audit Report stylesheet, plus the compliance-specific
                    blocks at the end of this file (state chips, the calendar
                    matrix, the record/sign forms and the signature chips).
═════════════════════════════════════════════════════════════════════════════ */
*, *::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-specific ═══════════════════════════════════════════════════════ */
:root { --scope-h:38px; --good:#27ae60; --ok:#2e86c1; --mid:#e6a100; --bad:#e67e22; --vbad:#c0392b; }

/* ─── Scope bar (Sorting app pattern): site + audit type + period ─────────── */
.scope-bar { min-height:var(--scope-h); background:var(--bg-card); border-bottom:1px solid var(--border); display:flex; align-items:center; gap:10px; padding:0 14px; flex-shrink:0; overflow-x:auto; }
.scope-bar .sc-lbl { font-size:10px; color:var(--text-dim); text-transform:uppercase; letter-spacing:.5px; white-space:nowrap; display:flex; align-items:center; gap:6px; }
.scope-bar .sc-lbl i { color:var(--accent); }
.scope-bar select, .scope-bar input[type=date] { padding:5px 26px 5px 10px; border:1px solid var(--border-strong); border-radius:6px; background:var(--bg-stripe); color:var(--text); font-size:12.5px; font-family:inherit; outline:none; min-width:130px; }
.scope-bar input[type=date] { padding-right:8px; min-width:140px; }
.scope-bar select:focus, .scope-bar input:focus { border-color:var(--accent); }
.scope-bar select.on { border-color:var(--accent); color:var(--accent); }
.scope-bar .sc-note { font-size:11.5px; color:var(--text-muted); white-space:nowrap; margin-left:auto; }
.scope-bar .sc-note b { color:var(--text); font-weight:400; }
body.has-scope .app-body { height:calc(100vh - var(--header-h) - var(--toolbar-h) - var(--scope-h)); }
@media (max-width:768px) { body.has-scope .sidebar { top:calc(var(--header-h) + var(--toolbar-h) + var(--scope-h)); height:calc(100vh - var(--header-h) - var(--toolbar-h) - var(--scope-h)); } .scope-bar .sc-note { display:none; } }

/* ─── Page filter bar (area group / area / level + page controls) ─────────── */
.filter-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.filter-bar .f-lbl { font-size:10px; color:var(--text-dim); text-transform:uppercase; letter-spacing:.5px; white-space:nowrap; }
.filter-bar select, .filter-bar input { padding:5px 10px; border:1px solid var(--border-strong); border-radius:6px; background:var(--bg-card); color:var(--text); font-size:12.5px; font-family:inherit; outline:none; }
.filter-bar select { padding-right:26px; max-width:230px; }
.filter-bar select.on { border-color:var(--accent); color:var(--accent); }
.filter-bar select:focus, .filter-bar input:focus { border-color:var(--accent); }
.filter-bar .f-sep { width:1px; height:22px; background:var(--border); }
.filter-bar .f-right { margin-left:auto; display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.seg { display:inline-flex; border:1px solid var(--border-strong); border-radius:6px; overflow:hidden; }
.seg button { padding:5px 10px; border:0; background:var(--bg-card); color:var(--text-muted); font-size:12px; cursor:pointer; font-family:inherit; border-right:1px solid var(--border); }
.seg button:last-child { border-right:0; }
.seg button.on { background:rgba(192,57,43,0.10); color:var(--accent); }
.seg button:hover { background:var(--bg-hover); }

/* ─── KPI tiles with deltas ────────────────────────────────────────────────── */
.kpi-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:12px; margin-bottom:16px; }
.kpi { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:14px 16px; box-shadow:0 1px 4px rgba(0,0,0,0.05); border-left:4px solid var(--tile-color, var(--text-dim)); min-width:0; }
.kpi-val { font-size:26px; font-weight:400; color:var(--text); line-height:1.1; display:flex; align-items:baseline; gap:6px; }
.kpi-val small { font-size:12px; color:var(--text-muted); }
.kpi-lbl { font-size:10.5px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.4px; margin-top:6px; display:flex; align-items:center; gap:6px; }
.kpi-lbl i { color:var(--tile-color, var(--text-dim)); }
.kpi-delta { font-size:11px; margin-top:6px; color:var(--text-dim); display:flex; align-items:center; gap:4px; }
.kpi-delta.up { color:var(--good); } .kpi-delta.down { color:var(--vbad); }
.kpi-delta.up.inv { color:var(--vbad); } .kpi-delta.down.inv { color:var(--good); }

/* ─── Charts ───────────────────────────────────────────────────────────────── */
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.grid-3 { display:grid; grid-template-columns:2fr 1fr; gap:14px; }
.grid-31 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }
@media (max-width:1100px) { .grid-2, .grid-3, .grid-31 { grid-template-columns:1fr; } }
.chart-card { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:14px 16px; box-shadow:0 1px 4px rgba(0,0,0,0.05); margin-bottom:14px; min-width:0; }
.chart-card .card-title { margin-bottom:8px; }
.chart-card .card-title .ct-right { margin-left:auto; font-weight:400; text-transform:none; letter-spacing:0; font-size:11px; color:var(--text-dim); }
.chart-wrap { position:relative; height:260px; }
.chart-wrap.tall { height:340px; }
.chart-wrap.short { height:200px; }
.chart-empty { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:var(--text-dim); font-size:12px; }

/* ─── Tables ───────────────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x:auto; }
table.rep { width:100%; border-collapse:collapse; font-size:12.5px; }
table.rep th { text-align:left; font-size:10.5px; color:var(--text-dim); text-transform:uppercase; letter-spacing:.4px; padding:8px 10px; border-bottom:1px solid var(--border-strong); white-space:nowrap; cursor:pointer; user-select:none; font-weight:400; }
table.rep th.num, table.rep td.num { text-align:right; font-variant-numeric:tabular-nums; }
table.rep th.sorted { color:var(--accent); }
table.rep th .si { font-size:9px; margin-left:3px; opacity:.8; }
table.rep td { padding:7px 10px; border-bottom:1px solid var(--border); color:var(--text); vertical-align:middle; }
table.rep tbody tr:nth-child(even) td { background:var(--bg-stripe); }
table.rep tbody tr:hover td { background:var(--bg-hover); }
table.rep tr.click { cursor:pointer; }
table.rep td.muted, .muted { color:var(--text-muted); }
table.rep td.dim { color:var(--text-dim); }
table.rep td.wrap { white-space:normal; min-width:260px; }
table.rep td .sub { display:block; font-size:11px; color:var(--text-dim); }
.tbl-note { font-size:11.5px; color:var(--text-dim); margin-top:8px; }
.pager { display:flex; align-items:center; gap:8px; margin-top:10px; font-size:12px; color:var(--text-muted); }
.pager button { padding:4px 10px; border:1px solid var(--border-strong); border-radius:6px; background:var(--bg-card); color:var(--text); cursor:pointer; font-family:inherit; }
.pager button:disabled { opacity:.4; cursor:default; }

/* score badge + inline bars */
.sc { display:inline-block; min-width:44px; text-align:center; padding:2px 7px; border-radius:10px; font-size:11.5px; color:#fff; font-variant-numeric:tabular-nums; }
.sc.s5 { background:var(--good); } .sc.s4 { background:var(--ok); } .sc.s3 { background:var(--mid); } .sc.s2 { background:var(--bad); } .sc.s1 { background:var(--vbad); } .sc.s0 { background:var(--text-dim); }
.bar { display:inline-flex; align-items:center; gap:6px; min-width:110px; }
.bar .bar-track { flex:1; height:6px; border-radius:3px; background:var(--border); overflow:hidden; min-width:50px; }
.bar .bar-fill { height:100%; border-radius:3px; background:var(--accent); }
.bar .bar-val { font-size:11.5px; color:var(--text-muted); min-width:36px; text-align:right; font-variant-numeric:tabular-nums; }
.delta { font-size:11px; }
.delta.up { color:var(--good); } .delta.down { color:var(--vbad); }
.pill { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; background:var(--bg-hover); color:var(--text-muted); white-space:nowrap; }
.pill.ok { background:rgba(39,174,96,.15); color:var(--good); }
.pill.warn { background:rgba(230,161,0,.15); color:#b07d00; }
.pill.bad { background:rgba(192,57,43,.15); color:var(--vbad); }
.pill.info { background:rgba(46,134,193,.15); color:var(--ok); }
html.dark .pill.warn { color:#f0b429; }
.rank { display:inline-block; width:22px; height:22px; line-height:22px; text-align:center; border-radius:50%; background:var(--bg-hover); color:var(--text-muted); font-size:11px; }
.rank.top { background:rgba(192,57,43,.15); color:var(--vbad); }

/* ─── Heatmap ──────────────────────────────────────────────────────────────── */
.heat-wrap { overflow:auto; max-height:75vh; }
table.heat { border-collapse:separate; border-spacing:2px; font-size:11.5px; width:100%; table-layout:auto; }
table.heat th { font-size:10px; color:var(--text-dim); font-weight:400; padding:4px 6px; white-space:nowrap; position:sticky; top:0; background:var(--bg-card); z-index:2; }
table.heat th.rowh { text-align:left; position:sticky; left:0; z-index:3; max-width:260px; overflow:hidden; text-overflow:ellipsis; color:var(--text); font-size:11.5px; }
table.heat td { min-width:44px; height:26px; text-align:center; border-radius:4px; color:#fff; font-variant-numeric:tabular-nums; cursor:default; }
table.heat td.click { cursor:pointer; }
table.heat td.click:hover { outline:2px solid var(--accent); outline-offset:-2px; }
table.heat td.lastc { color:var(--text); background:var(--bg-stripe); white-space:nowrap; font-size:11px; padding:0 8px; }
table.heat td.lastc.old { background:rgba(192,57,43,.25); color:var(--vbad); }
html.dark table.heat td.lastc.old { color:#f5a29a; }
table.heat th.sortable { cursor:pointer; }
table.heat th.sorted { color:var(--accent); }
table.heat th .si { font-size:9px; margin-left:3px; }
table.heat td.na { background:var(--bg-stripe); color:var(--text-dim); }
table.heat td.avgc { color:var(--text); background:var(--bg-hover); }
.legend { display:flex; gap:10px; align-items:center; font-size:11px; color:var(--text-muted); flex-wrap:wrap; }
.legend span i { display:inline-block; width:12px; height:12px; border-radius:3px; margin-right:4px; vertical-align:-2px; }

/* ─── Question detail / audit detail modal ─────────────────────────────────── */
.modal-back { position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:300; display:flex; align-items:flex-start; justify-content:center; padding:30px 12px; overflow-y:auto; }
.modal { background:var(--bg); color:var(--text); border-radius:12px; width:100%; max-width:1100px; box-shadow:0 12px 50px rgba(0,0,0,.45); border:1px solid var(--border); }
.modal-head { display:flex; align-items:flex-start; gap:12px; padding:16px 20px; border-bottom:1px solid var(--border); background:var(--bg-card); border-radius:12px 12px 0 0; }
.modal-title { font-size:15px; color:var(--text); }
.modal-sub { font-size:12px; color:var(--text-muted); margin-top:3px; }
.modal-close { margin-left:auto; width:30px; height:30px; border-radius:50%; border:1px solid var(--border-strong); background:var(--bg-card); color:var(--text-muted); cursor:pointer; flex-shrink:0; }
.modal-close:hover { color:var(--accent); border-color:var(--accent); }
.modal-body { padding:16px 20px; }
.comment { padding:8px 10px; border-left:3px solid var(--border-strong); background:var(--bg-card); border-radius:0 6px 6px 0; margin-bottom:6px; font-size:12.5px; }
.comment .c-meta { font-size:11px; color:var(--text-dim); margin-bottom:2px; display:flex; gap:8px; flex-wrap:wrap; }
.comment.c-bad { border-left-color:var(--vbad); }
.comment.c-mid { border-left-color:var(--mid); }
.info-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:8px 16px; margin-bottom:14px; }
.info-grid .ig-l { font-size:10px; color:var(--text-dim); text-transform:uppercase; letter-spacing:.4px; }
.info-grid .ig-v { font-size:13px; color:var(--text); }
.grp-row { display:flex; align-items:center; gap:10px; padding:5px 0; font-size:12.5px; }
.grp-row .g-name { width:180px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.grp-row .g-track { flex:1; height:8px; background:var(--border); border-radius:4px; overflow:hidden; }
.grp-row .g-fill { height:100%; border-radius:4px; }
.grp-row .g-val { width:44px; text-align:right; font-variant-numeric:tabular-nums; }

/* flex / grid children must be allowed to shrink, otherwise a wide table pushes the whole page wider */
.main-content, .card, .grid-2 > div, .grid-3 > div, .grid-31 > div { min-width:0; }

/* ─── Misc ─────────────────────────────────────────────────────────────────── */
.btn-icon { display:inline-flex; align-items:center; gap:6px; padding:5px 10px; border:1px solid var(--border-strong); border-radius:6px; background:var(--bg-card); color:var(--text-muted); font-size:12px; cursor:pointer; font-family:inherit; }
.btn-icon:hover { color:var(--accent); border-color:var(--accent); }
.list-plain { list-style:none; padding:0; margin:0; }
.list-plain li { padding:8px 0; border-bottom:1px solid var(--border); display:flex; gap:10px; align-items:flex-start; font-size:12.5px; }
.list-plain li:last-child { border-bottom:0; }
.list-plain .li-main { flex:1; min-width:0; }
.list-plain .li-sub { font-size:11px; color:var(--text-dim); margin-top:2px; }
.page-actions { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.note-box { font-size:12px; color:var(--text-muted); background:var(--bg-card); border:1px dashed var(--border-strong); border-radius:8px; padding:8px 12px; margin-bottom:12px; }
.link { color:var(--accent); cursor:pointer; }
.link:hover { text-decoration:underline; }
/* the user prefers no bold: soften the template's heavier weights */
.page-title, .hero-title, .stat-count, .card-title, .nav-item.active, .brand-main, .tb-label, .nav-section-label, .session-timer-label, .session-timer-value, .stat-label { font-weight:400; }

/* ─── Plant map (WPF Page_GenericAuditHeatmap look: blind map + area tiles) ─── */
.pmap-wrap { overflow-x:auto; overflow-y:hidden; border:1px solid var(--border); border-radius:8px; background:#dadada; position:relative; }
html.dark .pmap-wrap { background:#2a2d44; }
.pmap { position:relative; transform-origin:0 0; background:#dadada center / contain no-repeat; }
html.dark .pmap { background-color:#2a2d44; }
.pmap::before { content:''; position:absolute; inset:0; background:rgba(255,255,255,.55); }   /* the WPF map is drawn at 30% opacity */
html.dark .pmap::before { background:rgba(30,32,48,.45); }
.pmt { position:absolute; width:100px; height:118px; text-align:center; cursor:pointer; color:#111; font-family:'Segoe UI', system-ui, sans-serif; }
.pmt::before { content:''; position:absolute; left:-30px; top:-14px; width:160px; height:160px; border-radius:50%; background:radial-gradient(circle, var(--c) 0%, transparent 70%); opacity:.35; pointer-events:none; }
.pmt-name { position:relative; font-size:11px; line-height:1.15; height:26px; overflow:hidden; }
.pmt-score { position:relative; width:56px; height:56px; margin:2px auto 0; border-radius:50%; background:#fff; border:3px solid var(--c); color:var(--c); font-size:22px; line-height:50px; }
.pmt-date { position:relative; font-size:10px; margin-top:2px; }
.pmt-user { position:relative; font-size:9px; color:#333; white-space:nowrap; overflow:hidden; }
.pmt-warn { position:absolute; right:-4px; bottom:14px; color:#f61d00; font-size:22px; animation:pmt-blink 1s steps(2,start) infinite; text-shadow:0 0 3px #fff; }
.pmt-gm { position:absolute; left:-2px; bottom:16px; width:26px; height:26px; border-radius:50%; background:#e67e22; color:#fff; font-size:9px; line-height:26px; box-shadow:0 1px 3px rgba(0,0,0,.4); }
.pmt.low .pmt-score { animation:pmt-pulse 1.2s ease-in-out infinite; }
.pmt:hover { z-index:5; }
.pmt:hover .pmt-score { box-shadow:0 0 0 4px rgba(0,0,0,.15); }
@keyframes pmt-blink { 50% { opacity:0; } }
@keyframes pmt-pulse { 0%,100% { transform:scale(1); } 50% { transform:scale(1.12); } }

/* ─── Plant map full screen + draggable tiles ─────────────────────────────── */
body.map-full .sidebar, body.map-full .sub-toolbar, body.map-full .scope-bar, body.map-full .sidebar-overlay { display:none !important; }
body.map-full .app-body { height:calc(100vh - var(--header-h)); }
body.map-full .main-content { padding:10px 14px; }
.map-full-bar { display:flex; align-items:center; gap:10px; margin-bottom:8px; flex-wrap:wrap; }
.map-full-title { font-size:14px; color:var(--text); display:flex; align-items:center; gap:8px; }
.map-full-title i { color:var(--accent); }
.pmt.draggable { cursor:grab; }
.pmt.dragging { cursor:grabbing; z-index:10; opacity:.85; }
.pmt.dragging::before { opacity:.6; }
table.rep td input[type=checkbox] { width:15px; height:15px; cursor:pointer; accent-color:var(--accent); }
.filter-bar label input[type=checkbox] { accent-color:var(--accent); vertical-align:-2px; }

/* ═══════════════════════════════════════════════════════════════════════════
   HSE Compliance Calendar — compliance-specific blocks
═══════════════════════════════════════════════════════════════════════════ */
:root { --st-overdue:#c0392b; --st-failed:#8e44ad; --st-due:#e67e22; --st-planned:#27ae60; --st-unsched:#7f8c8d; }

/* ─── State chip: the single visual language of the whole app ─────────────── */
.st { display:inline-flex; align-items:center; gap:5px; padding:2px 9px; border-radius:11px; font-size:11px; white-space:nowrap; }
.st i { font-size:9px; }
.st-overdue     { background:rgba(192,57,43,.15);  color:var(--st-overdue); }
.st-failed      { background:rgba(142,68,173,.16); color:var(--st-failed); }
.st-due_soon    { background:rgba(230,126,34,.16); color:#b45f0d; }
.st-planned     { background:rgba(39,174,96,.15);  color:var(--st-planned); }
.st-unscheduled { background:var(--bg-hover);      color:var(--text-muted); }
html.dark .st-due_soon { color:#f0a355; }
html.dark .st-failed   { color:#c39bd3; }

/* risk badge */
.rk { display:inline-block; min-width:64px; text-align:center; padding:2px 8px; border-radius:10px; font-size:11px; color:#fff; }
.rk-Critical { background:#7b241c; } .rk-High { background:#c0392b; }
.rk-Medium   { background:#e6a100; } .rk-Low  { background:#2e86c1; }
.rk-none     { background:var(--text-dim); }

/* signature chips */
.sig-row { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.sig { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:14px; font-size:11.5px; border:1px solid var(--border-strong); background:var(--bg-card); color:var(--text-muted); font-family:inherit; }
.sig.done { border-color:rgba(39,174,96,.5); background:rgba(39,174,96,.12); color:var(--st-planned); }
.sig.wait { border-style:dashed; }
.sig .sig-who { font-size:10px; text-transform:uppercase; letter-spacing:.4px; color:var(--text-dim); }
.sig.act { cursor:pointer; }
.sig.act:hover { border-color:var(--accent); color:var(--accent); }

/* ─── Forms (record a control, corrective action, register editor) ────────── */
.form-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(210px,1fr)); gap:12px 16px; }
.form-grid.wide { grid-template-columns:1fr; }
.fld { display:flex; flex-direction:column; gap:4px; min-width:0; }
.fld > label { font-size:10px; color:var(--text-dim); text-transform:uppercase; letter-spacing:.45px; }
.fld input, .fld select, .fld textarea {
  padding:7px 10px; border:1px solid var(--border-strong); border-radius:6px;
  background:var(--bg-card); color:var(--text); font-size:13px; font-family:inherit; outline:none; width:100%; }
.fld textarea { min-height:74px; resize:vertical; line-height:1.45; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color:var(--accent); }
.fld input:disabled, .fld select:disabled, .fld textarea:disabled { opacity:.55; cursor:not-allowed; }
.fld .fld-hint { font-size:11px; color:var(--text-dim); }
.fld.span2 { grid-column:1 / -1; }
.form-actions { display:flex; gap:8px; justify-content:flex-end; align-items:center; margin-top:16px; padding-top:14px; border-top:1px solid var(--border); flex-wrap:wrap; }
.form-actions .fa-left { margin-right:auto; }

/* ─── Calendar matrix: rows = controls, columns = the months of the window ── */
.cal-wrap { overflow:auto; max-height:72vh; }
table.cal { border-collapse:separate; border-spacing:2px; font-size:11.5px; width:100%; }
table.cal th { font-size:10px; color:var(--text-dim); font-weight:400; padding:4px 6px; white-space:nowrap; position:sticky; top:0; background:var(--bg-card); z-index:2; text-align:center; }
table.cal th.rowh { text-align:left; position:sticky; left:0; z-index:3; min-width:260px; max-width:380px; background:var(--bg-card); color:var(--text); font-size:11.5px; }
table.cal th.now { color:var(--accent); }
table.cal td.rowh { position:sticky; left:0; z-index:1; background:var(--bg-card); text-align:left; padding:4px 8px; max-width:380px; }
table.cal td.rowh .rh-name { color:var(--text); display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
table.cal td.rowh .rh-sub  { color:var(--text-dim); font-size:10.5px; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
table.cal td.mo { min-width:46px; height:26px; text-align:center; border-radius:4px; background:var(--bg-stripe); color:var(--text-dim); }
table.cal td.mo.nowcol { box-shadow:inset 0 0 0 1px var(--border-strong); }
table.cal td.mo.has { color:#fff; cursor:pointer; }
table.cal td.mo.has:hover { outline:2px solid var(--accent); outline-offset:-2px; }
table.cal td.mo.d-overdue { background:var(--st-overdue); }
table.cal td.mo.d-failed  { background:var(--st-failed); }
table.cal td.mo.d-due     { background:var(--st-due); }
table.cal td.mo.d-plan    { background:var(--st-planned); }
table.cal td.mo.d-done    { background:rgba(39,174,96,.35); color:var(--text); }
table.cal td.mo.d-rec     { background:repeating-linear-gradient(45deg, var(--st-planned), var(--st-planned) 4px, rgba(255,255,255,.35) 4px, rgba(255,255,255,.35) 8px); }

/* ─── Site / category cards ──────────────────────────────────────────────── */
.tile-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px,1fr)); gap:12px; }
.tile { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:14px 16px; display:flex; flex-direction:column; gap:10px; }
.tile.click { cursor:pointer; }
.tile.click:hover { border-color:var(--accent); }
.tile-head { display:flex; align-items:center; gap:10px; }
.tile-head .t-ic { width:30px; height:30px; border-radius:8px; background:var(--bg-hover); color:var(--accent); display:flex; align-items:center; justify-content:center; font-size:13px; flex-shrink:0; }
.tile-name { font-size:14px; color:var(--text); }
.tile-sub { font-size:11px; color:var(--text-dim); }
.tile-bar { display:flex; height:8px; border-radius:4px; overflow:hidden; background:var(--border); }
.tile-bar span { display:block; height:100%; }
.tile-nums { display:flex; gap:14px; flex-wrap:wrap; font-size:11.5px; color:var(--text-muted); }
.tile-nums b { font-weight:400; color:var(--text); font-variant-numeric:tabular-nums; }
.tile-foot { font-size:11px; color:var(--text-dim); line-height:1.5; }

/* compliance ring used on the site cards and the dashboard */
.ring { width:58px; height:58px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; position:relative; }
.ring::after { content:""; position:absolute; inset:6px; border-radius:50%; background:var(--bg-card); }
.ring span { position:relative; z-index:1; font-size:13px; color:var(--text); font-variant-numeric:tabular-nums; }

/* the detail modal */
.det-sec { border-top:1px solid var(--border); margin-top:14px; padding-top:14px; }
.det-sec:first-child { border-top:0; margin-top:0; padding-top:0; }
.det-sec-t { font-size:10px; color:var(--text-dim); text-transform:uppercase; letter-spacing:.5px; margin-bottom:8px; }
.timeline { list-style:none; padding:0; margin:0; }
.timeline li { position:relative; padding:0 0 12px 18px; border-left:2px solid var(--border); font-size:12.5px; }
.timeline li:last-child { border-left-color:transparent; padding-bottom:0; }
.timeline li::before { content:""; position:absolute; left:-5px; top:4px; width:8px; height:8px; border-radius:50%; background:var(--border-strong); }
.timeline li.pass::before   { background:var(--st-planned); }
.timeline li.failed::before { background:var(--st-overdue); }
.timeline .tl-meta { font-size:11px; color:var(--text-dim); }

@media (max-width:768px) {
  .form-grid { grid-template-columns:1fr; }
  table.cal th.rowh, table.cal td.rowh { min-width:180px; max-width:200px; }
}

/* the card title also carries a counter and a right-hand action slot here */
.card-title .st-count { font-weight:400; color:var(--text-dim); background:var(--bg-hover); border-radius:10px; padding:1px 8px; font-size:10px; }
.card-title .ct-right { margin-left:auto; font-weight:400; text-transform:none; letter-spacing:0; font-size:11px; color:var(--text-dim); display:flex; gap:6px; align-items:center; }

/* ═══════════════════════════════════════════════════════════════════════════
   AI Analysis — Renata, the INSIGHT AI agent
   The persona block follows the Idea Box (same colleague, same face), the rest
   is this app's own: the function cards, one analysis, and the activity history.
═══════════════════════════════════════════════════════════════════════════ */
.renata-hero { display:flex; gap:22px; align-items:stretch; }
.renata-photo { flex:0 0 240px; position:relative; min-height:300px; border-radius:12px; overflow:hidden;
  background:linear-gradient(135deg, var(--accent), #7d3cc0); box-shadow:0 4px 18px rgba(0,0,0,.18); }
.renata-photo img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.renata-photo-fallback { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#fff; font-size:72px; }
.renata-photo-name { position:absolute; left:0; right:0; bottom:0; padding:22px 14px 12px;
  background:linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0)); color:#fff; font-size:19px;
  display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.renata-badge { font-size:11px; color:#fff; background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.35);
  border-radius:20px; padding:3px 10px; display:inline-flex; align-items:center; gap:6px; }
.renata-intro { flex:1 1 auto; min-width:0; }
.renata-intro p { font-size:13.5px; color:var(--text-muted); line-height:1.65; margin:2px 0 8px; }
.renata-how-title { font-size:10px; text-transform:uppercase; letter-spacing:.5px; color:var(--text-dim); margin:14px 0 7px; }
.renata-how { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.renata-how li { font-size:13px; color:var(--text-muted); line-height:1.5; display:flex; align-items:flex-start; gap:10px; }
.renata-how li i { color:var(--accent); width:16px; text-align:center; margin-top:3px; flex-shrink:0; }
.renata-note { font-size:12.5px !important; background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:9px 12px; margin-top:14px !important; }
.renata-note i { color:var(--accent); margin-right:6px; }

/* the five things she can do */
.ai-grid { grid-template-columns:repeat(auto-fill, minmax(300px,1fr)); margin-bottom:16px; }
.ai-card { justify-content:space-between; }
.ai-card .tile-foot { flex:1; }
.ai-card-act { display:flex; align-items:center; min-height:30px; }

/* one analysis */
.ai-thinking { display:flex; align-items:center; gap:10px; font-size:13.5px; color:var(--text-muted); }
.ai-thinking > i { color:var(--accent); font-size:18px; }
.ai-dots i { display:inline-block; width:5px; height:5px; border-radius:50%; background:var(--accent); margin-right:3px; animation:aiblink 1.1s infinite; }
.ai-dots i:nth-child(2) { animation-delay:.18s; } .ai-dots i:nth-child(3) { animation-delay:.36s; }
@keyframes aiblink { 0%,60%,100% { opacity:.25; } 30% { opacity:1; } }
.ai-result { border-left:3px solid var(--accent); }
.ai-headline { font-size:16px; color:var(--text); line-height:1.4; margin-bottom:8px; }
.ai-meta { display:flex; flex-wrap:wrap; gap:6px 14px; font-size:11.5px; color:var(--text-dim); margin-bottom:10px; align-items:center; }
.ai-meta i { margin-right:4px; }
.ai-summary { font-size:13.5px; color:var(--text-muted); line-height:1.65; margin:0 0 4px; }
.ai-standing { font-size:12px; padding:4px 12px; margin-bottom:4px; display:inline-flex; align-items:center; gap:6px; }
.ai-ids { display:inline-flex; gap:4px; flex-wrap:wrap; margin-top:5px; }
.ai-id { font-size:10.5px; color:var(--accent); background:var(--bg-hover); border-radius:9px; padding:1px 7px; cursor:pointer; font-variant-numeric:tabular-nums; }
.ai-id:hover { background:var(--accent); color:#fff; }
.ai-sugg { display:flex; gap:5px; flex-wrap:wrap; margin-top:6px; }
.ai-raw { font-size:11.5px; color:var(--text-muted); white-space:pre-wrap; max-height:400px; overflow:auto; }
.ai-draft { margin-top:14px; padding-top:12px; border-top:1px solid var(--border); font-size:11.5px; color:var(--text-dim); }
.ai-draft i { color:var(--accent); margin-right:6px; }

/* activity history */
.renata-entry { display:flex; gap:12px; padding:12px 4px; border-bottom:1px solid var(--border); }
.renata-entry:last-child { border-bottom:none; }
.renata-entry:hover { background:var(--bg-stripe); }
.renata-entry-icon { flex:0 0 34px; width:34px; height:34px; border-radius:50%;
  background:linear-gradient(135deg, var(--accent), #7d3cc0); color:#fff; display:flex; align-items:center; justify-content:center; font-size:14px; }
.renata-entry-body { flex:1 1 auto; min-width:0; }
.renata-entry-head { font-size:13.5px; color:var(--text); display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.renata-entry-when { margin-left:auto; font-size:11.5px; color:var(--text-dim); font-variant-numeric:tabular-nums; }
.renata-entry-meta { font-size:12px; color:var(--text-dim); margin:3px 0; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.renata-entry-summary { font-size:12.5px; color:var(--text-muted); line-height:1.55; margin-top:3px; }
.renata-chip { font-size:10.5px; color:var(--text-muted); background:var(--bg-hover); border-radius:10px; padding:2px 9px; display:inline-flex; align-items:center; gap:5px; }
.renata-chip i { color:var(--accent); }
.renata-feas { font-size:10.5px; text-transform:uppercase; border-radius:8px; padding:1px 8px; }
.renata-feas-high   { color:var(--success); background:rgba(39,174,96,.12); }
.renata-feas-medium { color:#b07d00; background:rgba(230,161,0,.14); }
.renata-feas-low    { color:#c0392b; background:rgba(192,57,43,.10); }
html.dark .renata-feas-medium { color:#f0b429; }

@media (max-width:768px) {
  .renata-hero { flex-direction:column; align-items:stretch; }
  .renata-photo { flex-basis:auto; width:100%; min-height:220px; }
}
