/*
  JUAufgaben v1.6.6
  Konsolidiertes CSS-Designsystem

  Prinzipien:
  - keine append-only Override-Schicht
  - keine Prioritaets-Kaschierung
  - kanonische Komponentenregeln statt historischer Patch-Layer
  - style.css bleibt Source of Truth
*/

:root {
  color-scheme: light;

  --ju-brand-950:#003d36;
  --ju-brand-900:#004f46;
  --ju-brand-800:#005b50;
  --ju-brand-700:#006b5c;
  --ju-brand-600:#087a6b;
  --ju-brand-500:#11927f;
  --ju-brand-400:#22b69d;
  --ju-brand-soft:#e7f4f1;
  --ju-brand-mist:#f2faf8;

  --ju-white:#ffffff;
  --ju-bg:#f4f8f7;
  --ju-bg-soft:#f8fbfa;
  --ju-surface:#ffffff;
  --ju-surface-2:#f9fcfb;
  --ju-surface-3:#eef6f4;
  --ju-text:#172421;
  --ju-heading:#101c1a;
  --ju-muted:#687976;
  --ju-muted-2:#8a9996;
  --ju-border:#d8e5e2;
  --ju-border-strong:#bed4cf;

  --ju-danger:#b42318;
  --ju-danger-soft:#ffe8e5;
  --ju-warning:#a96816;
  --ju-warning-soft:#fff2d2;
  --ju-success:#1f7a4d;
  --ju-success-soft:#e0f7eb;
  --ju-info:#2563eb;
  --ju-info-soft:#e6efff;
  --ju-purple:#7c3aed;
  --ju-purple-soft:#efe7ff;

  --radius-xs:6px;
  --radius-sm:10px;
  --radius-md:14px;
  --radius-lg:20px;
  --radius-xl:28px;
  --radius-2xl:34px;

  --shadow-xs:0 1px 2px rgba(13,35,34,.05);
  --shadow-sm:0 4px 14px rgba(13,35,34,.07);
  --shadow-md:0 14px 38px rgba(13,35,34,.10);
  --shadow-lg:0 28px 76px rgba(13,35,34,.16);
  --shadow-inset:inset 0 1px 0 rgba(255,255,255,.64);

  --sidebar-w:292px;
  --sidebar-collapsed-w:76px;
  --topbar-h:76px;
  --statusbar-h:34px;
  --content-max:1760px;
  --page-pad-x:34px;
  --page-pad-y:30px;

  --font:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --ju-bg:#0c1513;
  --ju-bg-soft:#101b18;
  --ju-surface:#14211e;
  --ju-surface-2:#182824;
  --ju-surface-3:#20332e;
  --ju-text:#edf7f4;
  --ju-heading:#f8fffd;
  --ju-muted:#a8b9b5;
  --ju-muted-2:#82938f;
  --ju-border:#2a403a;
  --ju-border-strong:#3d5750;
  --ju-brand-soft:#102c27;
  --ju-brand-mist:#0f211e;
  --ju-danger-soft:#3b1916;
  --ju-warning-soft:#322817;
  --ju-success-soft:#173327;
  --ju-info-soft:#17233d;
  --ju-purple-soft:#271d3e;
  --shadow-xs:0 1px 2px rgba(0,0,0,.22);
  --shadow-sm:0 5px 18px rgba(0,0,0,.24);
  --shadow-md:0 16px 44px rgba(0,0,0,.30);
  --shadow-lg:0 32px 88px rgba(0,0,0,.42);
  --shadow-inset:inset 0 1px 0 rgba(255,255,255,.035);
}

* { box-sizing:border-box; }
html { min-height:100%; -webkit-text-size-adjust:100%; }
body {
  margin:0;
  min-height:100%;
  font-family:var(--font);
  background:
    radial-gradient(circle at top right, rgba(17,146,127,.12), transparent 32rem),
    linear-gradient(135deg, var(--ju-bg-soft) 0%, var(--ju-bg) 44%, #edf5f3 100%);
  color:var(--ju-text);
  font-size:15px;
  line-height:1.5;
  text-rendering:optimizeLegibility;
}
[data-theme="dark"] body {
  background:
    radial-gradient(circle at top right, rgba(34,182,157,.09), transparent 34rem),
    linear-gradient(135deg, #07100e 0%, var(--ju-bg) 52%, #0f1b18 100%);
}
a { color:inherit; text-decoration:none; }
button,input,select,textarea { font:inherit; color:inherit; }
button { cursor:pointer; }
button:disabled,input:disabled,select:disabled,textarea:disabled { cursor:not-allowed; opacity:.62; }
img,svg { display:block; }
svg.icon { width:21px; height:21px; flex:0 0 auto; }
hr { border:0; border-top:1px solid var(--ju-border); margin:24px 0; }
code,kbd { font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; }

:focus-visible {
  outline:3px solid rgba(34,182,157,.34);
  outline-offset:3px;
}

.muted { color:var(--ju-muted); }
.small { font-size:12px; }
.stack { display:grid; gap:14px; }
.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
.three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.compact { gap:10px; }
.ok { --level:#1f7a4d; }
.warn,.warning { --level:#a96816; }
.critical,.danger { --level:#b42318; }
.info { --level:#2563eb; }
.purple { --level:#7c3aed; }
.teal,.success { --level:#11927f; }

/* Auth */
.auth-body {
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:32px;
  background:
    radial-gradient(circle at 18% 12%, rgba(34,182,157,.18), transparent 24rem),
    linear-gradient(135deg, #eef8f5, #f8fbfa 50%, #eaf4f2);
}
[data-theme="dark"] .auth-body { background:linear-gradient(135deg,#07110f,#0e1916 58%,#10231f); }
.auth-shell { width:min(1060px,100%); display:grid; grid-template-columns:minmax(280px,.9fr) minmax(320px,420px); gap:28px; align-items:center; }
.login-brand { color:var(--ju-heading); }
.login-logo { width:min(260px,70vw); height:auto; margin-bottom:24px; }
.login-brand h1 { margin:0 0 10px; font-size:clamp(34px,5vw,58px); line-height:1; letter-spacing:-.06em; }
.login-brand p { margin:0; max-width:38rem; color:var(--ju-muted); font-size:17px; }
.login-card {
  background:rgba(255,255,255,.86);
  border:1px solid rgba(0,79,70,.12);
  box-shadow:var(--shadow-lg);
  border-radius:var(--radius-2xl);
  padding:30px;
  backdrop-filter:blur(18px);
}
[data-theme="dark"] .login-card { background:rgba(20,33,30,.88); border-color:rgba(255,255,255,.08); }
.login-card h2 { margin:0 0 8px; font-size:26px; letter-spacing:-.04em; }
.login-card-refined { position:relative; overflow:hidden; }
.login-card-refined::before { content:""; position:absolute; inset:0 auto 0 0; width:5px; background:linear-gradient(180deg,var(--ju-brand-400),var(--ju-brand-800)); }
.local-login-form { display:grid; gap:16px; margin-top:22px; }
.login-actions { display:flex; gap:12px; flex-wrap:wrap; align-items:center; margin-top:18px; }
.login-helper-grid { display:grid; gap:10px; grid-template-columns:repeat(2,minmax(0,1fr)); margin-top:18px; }
.mode-card,.debug-box { border:1px solid var(--ju-border); border-radius:var(--radius-lg); padding:14px; background:var(--ju-surface-2); }
.eyebrow { display:inline-flex; color:var(--ju-brand-700); font-size:12px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }

/* Shell */
.app-body { overflow:hidden; }
.app-shell {
  display:grid;
  grid-template-columns:var(--sidebar-w) minmax(0,1fr);
  min-height:100vh;
  transition:grid-template-columns .22s ease;
}
body.is-sidebar-collapsed .app-shell { grid-template-columns:var(--sidebar-collapsed-w) minmax(0,1fr); }
.sidebar {
  position:relative;
  z-index:20;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  color:#f8fffd;
  background:
    radial-gradient(circle at 20% 2%, rgba(255,255,255,.15), transparent 32%),
    linear-gradient(180deg, var(--ju-brand-700) 0%, var(--ju-brand-900) 47%, var(--ju-brand-950) 100%);
  box-shadow:inset -1px 0 rgba(255,255,255,.08), 14px 0 40px rgba(0,61,54,.08);
  overflow:hidden auto;
}
.brand {
  min-height:86px;
  display:flex;
  align-items:center;
  padding:18px 22px;
  border-bottom:1px solid rgba(255,255,255,.13);
}
.brand img { width:218px; max-width:100%; height:auto; filter:drop-shadow(0 10px 22px rgba(0,0,0,.18)); }
.nav-section { display:grid; gap:5px; padding:16px 14px 8px; }
.nav-section-spaced { margin-top:6px; padding-top:18px; border-top:1px solid rgba(255,255,255,.12); }
.nav-section-title {
  margin:4px 8px 7px;
  color:rgba(248,255,253,.55);
  font-size:10px;
  font-weight:800;
  letter-spacing:.13em;
  text-transform:uppercase;
}
.nav-item {
  position:relative;
  display:flex;
  align-items:center;
  gap:12px;
  min-height:44px;
  padding:11px 13px;
  border-radius:15px;
  color:rgba(248,255,253,.82);
  font-weight:720;
  letter-spacing:-.01em;
  transition:background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item:hover { background:rgba(255,255,255,.10); color:#fff; transform:translateX(1px); }
.nav-item.is-active {
  color:#fff;
  background:linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,.08));
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.10);
}
.nav-item.is-active::before {
  content:"";
  position:absolute;
  left:0;
  top:12px;
  bottom:12px;
  width:3px;
  border-radius:999px;
  background:#bff4ea;
}
.nav-badge { margin-left:auto; color:#bff4ea; line-height:1; }
.sidebar-mode {
  margin:auto 14px 0;
  display:grid;
  gap:6px;
  padding:13px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.075);
  border-radius:18px;
}
.sidebar-mode small { color:rgba(248,255,253,.68); }
.sidebar-footer { padding:14px; }
.sidebar-collapse,.sidebar-expand-rail {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  width:100%;
  min-height:42px;
  border:1px solid rgba(255,255,255,.17);
  border-radius:15px;
  background:rgba(255,255,255,.07);
  color:#fff;
}
.sidebar-collapse:hover,.sidebar-expand-rail:hover { background:rgba(255,255,255,.12); }
.sidebar-expand-rail { display:none; }
body.is-sidebar-collapsed .brand { justify-content:center; padding:18px 10px; }
body.is-sidebar-collapsed .brand img { width:42px; max-width:42px; object-fit:cover; object-position:left center; }
body.is-sidebar-collapsed .nav-section { padding-inline:10px; }
body.is-sidebar-collapsed .nav-section-title,
body.is-sidebar-collapsed .nav-item span,
body.is-sidebar-collapsed .nav-badge,
body.is-sidebar-collapsed .sidebar-mode,
body.is-sidebar-collapsed .sidebar-collapse-label { display:none; }
body.is-sidebar-collapsed .nav-item { justify-content:center; padding:12px 0; }
body.is-sidebar-collapsed .nav-item.is-active::before { left:5px; }
body.is-sidebar-collapsed .sidebar-footer { margin-top:auto; }
body.is-sidebar-collapsed .sidebar-collapse { width:48px; margin:0 auto; }
body.is-sidebar-collapsed .sidebar-expand-rail { display:none; }
.sidebar-collapse-icon--expand { display:none; }
body.is-sidebar-collapsed .sidebar-collapse-icon--collapse { display:none; }
body.is-sidebar-collapsed .sidebar-collapse-icon--expand { display:flex; }

.main-shell { min-width:0; display:grid; grid-template-rows:var(--topbar-h) minmax(0,1fr) var(--statusbar-h); height:100vh; }
.topbar {
  min-width:0;
  height:var(--topbar-h);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:0 var(--page-pad-x);
  background:rgba(255,255,255,.78);
  border-bottom:1px solid rgba(0,79,70,.10);
  backdrop-filter:blur(20px);
}
[data-theme="dark"] .topbar { background:rgba(12,21,19,.82); border-bottom-color:rgba(255,255,255,.08); }
.global-search {
  width:min(720px,48vw);
  height:48px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 14px;
  border:1px solid var(--ju-border);
  background:rgba(255,255,255,.86);
  border-radius:17px;
  box-shadow:var(--shadow-xs),var(--shadow-inset);
}
[data-theme="dark"] .global-search { background:rgba(20,33,30,.78); }
.global-search input { min-width:0; width:100%; border:0; background:transparent; outline:0; font-size:14px; }
.global-search kbd { padding:3px 8px; border:1px solid var(--ju-border); border-radius:8px; background:var(--ju-surface-2); color:var(--ju-muted); font-size:11px; }
.topbar-actions { display:flex; align-items:center; gap:10px; min-width:0; }
.topbar-divider { width:1px; height:30px; background:var(--ju-border); }
.user-chip {
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  padding:5px 8px;
  border-radius:15px;
}
.user-chip:hover { background:var(--ju-surface-2); }
.avatar {
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:linear-gradient(135deg,var(--ju-brand-500),var(--ju-brand-800));
  color:#fff;
  font-weight:850;
}
.user-chip strong { display:block; font-size:12px; line-height:1.2; }
.user-chip small { display:block; max-width:210px; color:var(--ju-muted); font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-chip i { font-style:normal; opacity:.78; }
.statusbar {
  min-width:0;
  height:var(--statusbar-h);
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 var(--page-pad-x);
  color:var(--ju-muted);
  font-size:12px;
  background:rgba(255,255,255,.62);
  border-top:1px solid rgba(0,79,70,.08);
}
[data-theme="dark"] .statusbar { background:rgba(8,15,13,.78); border-top-color:rgba(255,255,255,.07); }
.dot { width:8px; height:8px; border-radius:999px; background:currentColor; }
.dot.ok { color:var(--ju-success); }
.content {
  min-width:0;
  min-height:0;
  overflow:auto;
  padding:var(--page-pad-y) var(--page-pad-x) calc(var(--page-pad-y) + 12px);
}
.content > section,.content > .detail-page,.content > .task-drawer {
  max-width:var(--content-max);
  margin-inline:auto;
}

/* Command Center */
.command-palette {
  position:fixed;
  inset:0;
  z-index:1000;
  display:grid;
  place-items:start center;
  padding:8vh 24px 24px;
  background:rgba(6,20,17,.46);
  backdrop-filter:blur(12px);
}
.command-palette[hidden] { display:none; }
.command-box {
  width:min(880px,100%);
  display:grid;
  gap:16px;
  padding:20px;
  border:1px solid var(--ju-border-strong);
  border-radius:var(--radius-2xl);
  background:rgba(255,255,255,.94);
  box-shadow:var(--shadow-lg);
}
[data-theme="dark"] .command-box { background:rgba(20,33,30,.96); }
.command-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.command-header strong { display:block; font-size:20px; letter-spacing:-.04em; }
.command-header span { display:block; color:var(--ju-muted); font-size:13px; }
.command-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.command-list section { display:grid; align-content:start; gap:8px; padding:14px; border:1px solid var(--ju-border); border-radius:18px; background:var(--ju-surface-2); }
.command-list h3 { margin:0 0 4px; color:var(--ju-muted); font-size:11px; letter-spacing:.11em; text-transform:uppercase; }
.command-list a,.command-list button { display:flex; align-items:center; gap:10px; min-height:40px; padding:9px 10px; border:1px solid transparent; border-radius:13px; background:transparent; color:var(--ju-text); text-align:left; }
.command-list a:hover,.command-list button:hover { background:var(--ju-surface); border-color:var(--ju-border); }

/* Page Hero */
.page-hero {
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:start;
  gap:22px;
  margin-bottom:24px;
  padding:4px 0 6px 22px;
}
.page-hero::before {
  content:"";
  position:absolute;
  left:0;
  top:8px;
  bottom:8px;
  width:4px;
  border-radius:999px;
  background:linear-gradient(180deg,var(--ju-brand-400),var(--ju-brand-800));
  box-shadow:0 8px 20px rgba(17,146,127,.20);
}
.page-hero__copy { min-width:0; display:grid; gap:7px; }
.page-hero h1 { margin:0; color:var(--ju-heading); font-size:clamp(30px,3vw,46px); line-height:1.03; letter-spacing:-.058em; font-weight:820; }
.page-hero p { margin:0; max-width:820px; color:var(--ju-muted); font-size:15.5px; }
.page-hero__actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:10px; }
.page-hero__meta { display:flex; flex-wrap:wrap; gap:8px; margin-top:3px; }
.page-hero__meta span { display:inline-flex; align-items:center; min-height:28px; padding:6px 10px; border:1px solid var(--ju-border); border-radius:999px; background:var(--ju-brand-mist); color:var(--ju-brand-800); font-size:12px; font-weight:720; }
[data-theme="dark"] .page-hero__meta span { color:#b9f1e5; background:rgba(17,146,127,.14); border-color:rgba(185,241,229,.14); }

/* Buttons and controls */
.btn,.icon-btn,.link-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  min-height:42px;
  padding:10px 15px;
  border:1px solid var(--ju-border);
  border-radius:14px;
  background:var(--ju-surface);
  color:var(--ju-text);
  font-weight:760;
  line-height:1;
  box-shadow:var(--shadow-xs),var(--shadow-inset);
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover,.icon-btn:hover,.link-button:hover { transform:translateY(-1px); box-shadow:var(--shadow-sm); border-color:var(--ju-border-strong); }
.btn-primary {
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg,var(--ju-brand-600),var(--ju-brand-800));
  box-shadow:0 14px 34px rgba(0,107,92,.20);
}
.btn-primary:hover { box-shadow:0 18px 42px rgba(0,107,92,.27); }
.btn-secondary { background:var(--ju-surface-2); }
.btn-ghost { background:transparent; box-shadow:none; }
.btn-lg { min-height:50px; padding:13px 18px; border-radius:17px; }
.btn-sm,.btn-compact { min-height:32px; padding:7px 10px; border-radius:11px; font-size:12px; }
.btn-block,.btn-full { width:100%; }
.icon-btn { width:42px; padding:0; }
.topbar-icon { position:relative; }
.has-dot span,[data-overdue-dot] { position:absolute; right:9px; top:9px; width:8px; height:8px; border-radius:999px; background:var(--ju-danger); box-shadow:0 0 0 2px var(--ju-surface); }
.input,input.input,select.input,textarea.input,.field input,.field select,.field textarea,.searchbox input {
  width:100%;
  min-height:42px;
  border:1px solid var(--ju-border);
  border-radius:14px;
  background:var(--ju-surface);
  color:var(--ju-text);
  padding:10px 12px;
  outline:0;
  box-shadow:var(--shadow-xs),var(--shadow-inset);
}
textarea.input,.field textarea { min-height:120px; resize:vertical; }
.inline-select,.inline-field {
  width:100%;
  min-height:34px;
  border:1px solid var(--ju-border);
  border-radius:11px;
  background:var(--ju-surface);
  color:var(--ju-text);
  padding:7px 9px;
  box-shadow:var(--shadow-xs),var(--shadow-inset);
}
.inline-field.is-saved { border-color:rgba(31,122,77,.55); box-shadow:0 0 0 3px rgba(31,122,77,.10); }
.textarea-lg { min-height:220px; }
.input-xl { min-height:52px; font-size:17px; }
.input:focus,input:focus,select:focus,textarea:focus { border-color:rgba(17,146,127,.55); box-shadow:0 0 0 4px rgba(17,146,127,.10); }
.field { display:grid; gap:7px; }
.field label,.field > span,label:not(.checkbox-inline):not(.checkbox-line):not(.confirm-line):not(.toggle-line):has(> .input) { color:var(--ju-heading); font-size:12px; font-weight:780; }
label:has(> .input) { display:grid; gap:7px; }
.field-full { grid-column:1/-1; }
.grid-form,.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.form-actions,.button-row,.row-actions,.toolbar-row,.toolbar-row-compact { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.checkbox-grid { display:grid; gap:10px; }
.checkbox-inline,.checkbox-line,.confirm-line,.toggle-line { display:flex; align-items:center; gap:10px; color:var(--ju-text); }
input[type="checkbox"] { width:16px; height:16px; margin:0; accent-color:var(--ju-brand-700); flex:0 0 auto; }
.checkbox-inline label,.checkbox-line label,.confirm-line,.toggle-line { display:inline-flex; align-items:center; gap:8px; }

/* Badges and semantic pills */
.badge,.status-pill,.ui-pill,.tag-pill,.tag-mini,.filter-chip,.check-chip {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:26px;
  padding:5px 10px;
  border:1px solid var(--ju-border);
  border-radius:999px;
  background:var(--ju-surface-2);
  color:var(--ju-muted);
  font-size:12px;
  font-weight:730;
  line-height:1;
  white-space:nowrap;
}
.badge-soft,.badge-neutral,.badge-muted,.ui-pill--neutral,.ui-pill--muted,.ui-pill--meta { background:var(--ju-brand-mist); color:#3d5f58; border-color:rgba(0,79,70,.10); }
.badge-success,.ui-pill--success { background:var(--ju-success-soft); color:var(--ju-success); border-color:rgba(31,122,77,.16); }
.badge-warning,.ui-pill--warning { background:var(--ju-warning-soft); color:var(--ju-warning); border-color:rgba(169,104,22,.18); }
.badge-danger,.ui-pill--danger { background:var(--ju-danger-soft); color:var(--ju-danger); border-color:rgba(180,35,24,.18); }
.badge-info,.ui-pill--info { background:var(--ju-info-soft); color:var(--ju-info); border-color:rgba(37,99,235,.18); }
.badge-purple { background:var(--ju-purple-soft); color:var(--ju-purple); border-color:rgba(124,58,237,.16); }
.status-pill.local { background:rgba(255,255,255,.13); color:#eafffb; border-color:rgba(255,255,255,.16); }
.status-pill.cloud { background:rgba(37,99,235,.18); color:#dbe7ff; border-color:rgba(255,255,255,.18); }
[data-theme="dark"] .badge-soft,[data-theme="dark"] .badge-neutral,[data-theme="dark"] .badge-muted,[data-theme="dark"] .ui-pill--neutral,[data-theme="dark"] .ui-pill--muted,[data-theme="dark"] .ui-pill--meta { color:#d6e7e3; background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.10); }

/* Surfaces */
.panel,.card,.app-card,.table-workbench,.table-workbench-pro,.smart-view-strip,.mode-banner,.admin-tile,.template-card,.score-card,.mini-stat,.maintenance-hero-card,.tag-card,.tag-panel,.settings-panel,.system-priority-panel,.coach-panel,.quick-capture-card,.calendar-card,.timeline-panel,.side-panel,.backup-center-panel,.empty-rich {
  border:1px solid var(--ju-border);
  border-radius:var(--radius-xl);
  background:rgba(255,255,255,.82);
  box-shadow:var(--shadow-sm),var(--shadow-inset);
}
[data-theme="dark"] :where(.panel,.card,.app-card,.table-workbench,.table-workbench-pro,.smart-view-strip,.mode-banner,.admin-tile,.template-card,.score-card,.mini-stat,.maintenance-hero-card,.tag-card,.tag-panel,.settings-panel,.system-priority-panel,.coach-panel,.quick-capture-card,.calendar-card,.timeline-panel,.side-panel,.backup-center-panel,.empty-rich) { background:rgba(20,33,30,.82); }
.panel { padding:20px; }
.panel-large { padding:24px; }
.panel-header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}
.panel-header h2 { display:flex; align-items:center; gap:10px; margin:0; color:var(--ju-heading); font-size:17px; line-height:1.2; letter-spacing:-.025em; }
.panel-header p { margin:4px 0 0; color:var(--ju-muted); }
.empty-state,.empty-state-action,.empty-rich,.report-empty {
  display:grid;
  place-items:center;
  gap:9px;
  min-height:180px;
  padding:28px;
  color:var(--ju-muted);
  text-align:center;
  border:1px dashed var(--ju-border-strong);
  border-radius:var(--radius-xl);
  background:linear-gradient(135deg,var(--ju-surface-2),var(--ju-brand-mist));
}
[data-theme="dark"] :where(.empty-state,.empty-state-action,.empty-rich,.report-empty) { background:linear-gradient(135deg,rgba(255,255,255,.045),rgba(17,146,127,.07)); }
.empty-state strong,.empty-rich strong { color:var(--ju-heading); }
.empty-state p,.empty-rich p { margin:0; max-width:34rem; }

/* Tables */
.table-wrap,.table-wrap-pro { overflow:auto; border:1px solid var(--ju-border); border-radius:var(--radius-lg); background:var(--ju-surface); }
.data-table { width:100%; border-collapse:collapse; min-width:720px; }
.data-table th,.data-table td { padding:13px 14px; border-bottom:1px solid var(--ju-border); text-align:left; vertical-align:top; }
.data-table th { color:var(--ju-muted); background:var(--ju-surface-2); font-size:11px; font-weight:820; letter-spacing:.08em; text-transform:uppercase; }
.data-table td { font-size:13px; }
.data-table td.loading-cell { display:table-cell; min-height:0; padding:34px 18px; color:var(--ju-muted); text-align:center; background:linear-gradient(135deg,var(--ju-surface-2),var(--ju-brand-mist)); border:1px dashed var(--ju-border-strong); }
.data-table tbody tr:hover { background:var(--ju-brand-mist); }
.data-table tbody tr:last-child td { border-bottom:0; }
.interactive-table tbody tr { cursor:pointer; }
.select-col { width:42px; }

/* Dashboard */
.dashboard-grid,.dashboard-grid-image { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(340px,.85fr); gap:20px; align-items:start; }
.dash-primary { display:grid; gap:18px; }
.onboarding-panel { display:grid; gap:16px; padding:24px; margin-bottom:18px; border:1px solid var(--ju-border); border-radius:var(--radius-2xl); background:rgba(255,255,255,.86); box-shadow:var(--shadow-sm),var(--shadow-inset); }
[data-theme="dark"] .onboarding-panel { background:rgba(20,33,30,.84); }
.onboarding-panel h2 { display:flex; align-items:center; gap:10px; margin:0; color:var(--ju-heading); font-size:21px; letter-spacing:-.03em; }
.onboarding-panel p { margin:0; color:var(--ju-muted); }
.onboarding-steps { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.onboarding-step { appearance:none; width:100%; min-height:92px; display:grid; align-content:start; gap:8px; padding:15px; border:1px solid var(--ju-border); border-radius:18px; background:linear-gradient(135deg,var(--ju-surface),var(--ju-surface-2)); color:var(--ju-text); text-align:left; box-shadow:var(--shadow-xs),var(--shadow-inset); transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.onboarding-step:hover { transform:translateY(-1px); border-color:rgba(17,146,127,.28); box-shadow:var(--shadow-sm); }
.onboarding-step strong { color:var(--ju-heading); font-size:14px; }
.onboarding-step small { color:var(--ju-muted); font-size:12px; line-height:1.35; }
.kpi-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:14px; }
.kpi-card {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  grid-template-areas:"icon value" "icon label" "icon meta";
  gap:3px 13px;
  align-items:center;
  min-height:94px;
  padding:18px;
  border:1px solid var(--ju-border);
  border-radius:var(--radius-xl);
  background:var(--ju-surface);
  box-shadow:var(--shadow-sm),var(--shadow-inset);
}
.kpi-icon { grid-area:icon; width:44px; height:44px; display:grid; place-items:center; border-radius:15px; color:#fff; background:linear-gradient(135deg,var(--ju-brand-500),var(--ju-brand-800)); }
.kpi-card strong { grid-area:value; display:block; color:var(--ju-heading); font-size:30px; line-height:1; letter-spacing:-.045em; }
.kpi-card span:not(.kpi-icon) { grid-area:label; color:var(--ju-heading); font-size:12px; font-weight:800; }
.kpi-card small { grid-area:meta; color:var(--ju-muted-2); }
.work-coach-grid,.work-coach-grid-excellence { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; }
.coach-panel,.coach-panel-pro { padding:20px; }
.coach-actions,.coach-actions-pro,.compact-list,.compact-list-tight,.timeline-list,.focus-list,.calendar-agenda { display:grid; gap:10px; }
.coach-action { display:grid; grid-template-columns:auto minmax(0,1fr) auto; grid-template-areas:"dot title action" "dot text action"; gap:2px 12px; align-items:center; padding:13px; border:1px solid var(--ju-border); border-radius:17px; background:var(--ju-surface-2); }
.coach-action:hover { border-color:rgba(17,146,127,.24); background:var(--ju-brand-mist); }
.coach-action strong { grid-area:title; color:var(--ju-heading); }
.coach-action small { grid-area:text; color:var(--ju-muted); }
.coach-action em { grid-area:action; color:var(--ju-brand-700); font-style:normal; font-weight:800; white-space:nowrap; }
.coach-dot { grid-area:dot; width:10px; height:10px; border-radius:999px; background:var(--level,var(--ju-brand-500)); box-shadow:0 0 0 6px rgba(17,146,127,.10); }
.timeline-item,.compact-row,.agenda-item {
  appearance:none;
  width:100%;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  padding:13px 14px;
  border:1px solid var(--ju-border);
  border-radius:17px;
  background:linear-gradient(135deg,var(--ju-surface),var(--ju-surface-2));
  color:var(--ju-text);
  text-align:left;
  box-shadow:var(--shadow-xs),var(--shadow-inset);
}
.timeline-item:hover,.compact-row:hover,.agenda-item:hover {
  transform:translateY(-1px);
  border-color:rgba(17,146,127,.28);
  box-shadow:var(--shadow-sm);
}
.timeline-item time,.agenda-item time,.compact-row time {
  color:var(--ju-brand-700);
  font-size:12px;
  font-weight:820;
  white-space:nowrap;
}
.timeline-item strong,.compact-row strong,.agenda-item strong { color:var(--ju-heading); }
.timeline-item small,.compact-row small,.agenda-item small { display:block; color:var(--ju-muted); margin-top:2px; }
.onboarding-steps { display:grid; }
.calendar-card { display:grid; gap:15px; padding:18px; }
.calendar-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.calendar-head strong { color:var(--ju-heading); font-size:15px; letter-spacing:-.02em; }
.mini-calendar { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
.weekday { color:var(--ju-muted); font-size:11px; font-weight:850; letter-spacing:.08em; text-align:center; text-transform:uppercase; }
.day,.outlook-day {
  appearance:none;
  min-height:66px;
  display:grid;
  align-content:start;
  gap:5px;
  padding:10px;
  border:1px solid var(--ju-border);
  border-radius:16px;
  background:linear-gradient(180deg,var(--ju-surface),var(--ju-surface-2));
  color:var(--ju-text);
  text-align:left;
  box-shadow:var(--shadow-xs),var(--shadow-inset);
}
.day:hover,.outlook-day:hover { border-color:rgba(17,146,127,.28); background:var(--ju-brand-mist); }
.day.is-today,.outlook-day.is-today {
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg,var(--ju-brand-500),var(--ju-brand-800));
  box-shadow:0 14px 30px rgba(0,107,92,.22);
}
.outlook-day__number { font-size:18px; font-weight:860; line-height:1; letter-spacing:-.03em; }
.outlook-day__meta { color:var(--ju-muted); font-size:10px; font-weight:780; text-transform:uppercase; }
.outlook-day.is-today .outlook-day__meta { color:rgba(255,255,255,.78); }
.outlook-day__dots { display:flex; align-items:center; gap:4px; min-height:8px; }
.outlook-day__dots i { width:6px; height:6px; border-radius:999px; background:var(--ju-brand-500); }
.outlook-day.is-today .outlook-day__dots i { background:#fff; }
.outlook-agenda-list { display:grid; gap:8px; margin-top:2px; }
.outlook-agenda-title { display:flex; align-items:center; justify-content:space-between; color:var(--ju-muted); font-size:11px; font-weight:830; letter-spacing:.08em; text-transform:uppercase; }
.outlook-event,.agenda-item {
  grid-template-columns:68px minmax(0,1fr) auto;
  align-items:center;
  min-height:58px;
  border-radius:16px;
  border-left:4px solid var(--ju-brand-500);
}
.outlook-event time,.agenda-item time { justify-self:start; color:var(--ju-brand-700); }
.outlook-event span,.agenda-item span { min-width:0; }
.outlook-event em,.agenda-item em { color:var(--ju-muted); font-style:normal; font-size:12px; font-weight:750; }
.outlook-event.dot-1,.agenda-item.dot-1 { border-left-color:var(--ju-info); }
.outlook-event.dot-2,.agenda-item.dot-2 { border-left-color:var(--ju-warning); }
.outlook-event.dot-3,.agenda-item.dot-3 { border-left-color:var(--ju-purple); }
.calendar-empty { min-height:94px; }
/* Workbench and task list */
.workbench-toolbar,.journal-commandbar,.template-toolbar,.smart-view-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.workbench-toolbar { justify-content:space-between; }
.workbench-toolbar-compact { display:grid; grid-template-columns:minmax(320px,2fr) repeat(4,minmax(140px,.75fr)) auto auto; gap:10px; align-items:center; }
.workbench-toolbar-compact > .input,.workbench-toolbar-compact > .btn { width:auto; min-width:0; }
.searchbox,.searchbox-wide { display:flex; align-items:center; gap:10px; min-width:min(100%,340px); }
.searchbox-wide { min-width:0; width:100%; }
.searchbox-wide .input { width:100%; }
.smart-view-strip { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:center; padding:16px; margin-bottom:16px; }
.smart-view-strip strong { color:var(--ju-heading); }
.smart-view-strip small { display:block; color:var(--ju-muted); }
.view-switcher,.filter-chip-row,.saved-view-list { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.view-switcher { margin-bottom:12px; }
.view-switcher a,.saved-view-list a { padding:8px 12px; border-radius:999px; border:1px solid var(--ju-border); background:var(--ju-surface-2); color:var(--ju-muted); font-size:13px; font-weight:720; }
.view-switcher a.is-active,.saved-view-list a.is-active { color:#fff; background:var(--ju-brand-700); border-color:transparent; }
.table-workbench,.table-workbench-pro { display:grid; gap:14px; padding:16px; }
.worklist-intelligence { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 13px; border:1px solid rgba(17,146,127,.18); border-radius:14px; background:var(--ju-brand-mist); color:var(--ju-brand-800); font-size:13px; font-weight:720; }
.advanced-filter-drawer,.bulk-action-bar { border:1px solid var(--ju-border); border-radius:var(--radius-lg); padding:14px; background:var(--ju-surface-2); }
.advanced-filter-drawer { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.advanced-filter-drawer .input { width:auto; min-width:220px; }
.journal-commandbar { justify-content:flex-start; margin-bottom:16px; }

/* Calendar workspace */
.calendar-app-shell {
  display:grid;
  gap:18px;
}
.calendar-app-toolbar {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:14px;
  align-items:center;
  padding:16px;
  border:1px solid var(--ju-border);
  border-radius:var(--radius-xl);
  background:rgba(255,255,255,.78);
  box-shadow:var(--shadow-sm), var(--shadow-inset);
  backdrop-filter:blur(16px);
}
[data-theme="dark"] .calendar-app-toolbar { background:rgba(20,33,30,.82); }
.calendar-app-title { display:grid; gap:2px; }
.calendar-app-title strong { color:var(--ju-heading); font-size:22px; letter-spacing:-.04em; }
.calendar-app-title span { color:var(--ju-muted); font-size:13px; }
.calendar-nav,.calendar-view-switch { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.calendar-view-switch {
  padding:5px;
  border:1px solid var(--ju-border);
  border-radius:999px;
  background:var(--ju-surface-2);
}
.calendar-view-switch a {
  min-width:74px;
  padding:8px 13px;
  border-radius:999px;
  text-align:center;
  font-size:13px;
  font-weight:850;
  color:var(--ju-muted);
}
.calendar-view-switch a.is-active { color:#fff; background:var(--ju-brand-700); box-shadow:0 8px 18px rgba(0,107,92,.18); }
.calendar-grid {
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:1px;
  overflow:hidden;
  border:1px solid var(--ju-border);
  border-radius:var(--radius-xl);
  background:var(--ju-border);
  box-shadow:var(--shadow-md);
}
.calendar-weekday {
  padding:12px 14px;
  background:var(--ju-surface-2);
  color:var(--ju-muted);
  font-size:12px;
  font-weight:900;
  letter-spacing:.10em;
  text-transform:uppercase;
}
.calendar-day-cell {
  min-height:184px;
  padding:12px;
  background:rgba(255,255,255,.86);
  display:grid;
  align-content:start;
  gap:10px;
}
[data-theme="dark"] .calendar-day-cell { background:rgba(20,33,30,.82); }
.calendar-grid--week .calendar-day-cell { min-height:360px; }
.calendar-day-cell.is-outside-month { opacity:.56; background:var(--ju-surface-2); }
.calendar-day-cell.is-today { box-shadow:inset 0 0 0 2px rgba(0,107,92,.34); background:linear-gradient(180deg,var(--ju-brand-mist),var(--ju-surface)); }
[data-theme="dark"] .calendar-day-cell.is-today { background:linear-gradient(180deg,rgba(17,146,127,.16),rgba(20,33,30,.82)); }
.calendar-day-cell header { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.calendar-day-cell header a {
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:999px;
  color:var(--ju-heading);
  font-size:18px;
  font-weight:900;
  letter-spacing:-.04em;
}
.calendar-day-cell.is-today header a { color:#fff; background:var(--ju-brand-700); }
.calendar-day-cell header span { color:var(--ju-muted); font-size:12px; font-weight:850; }
.calendar-day-events { display:grid; gap:7px; align-content:start; }
.calendar-event-pill {
  display:grid;
  grid-template-columns:58px minmax(0,1fr);
  gap:8px;
  align-items:center;
  min-height:34px;
  padding:7px 9px;
  border:1px solid rgba(0,107,92,.16);
  border-left:4px solid var(--ju-brand-700);
  border-radius:12px;
  background:var(--ju-surface);
  box-shadow:var(--shadow-xs);
}
.calendar-event-pill time { color:var(--ju-brand-700); font-size:11px; font-weight:900; white-space:nowrap; }
.calendar-event-pill span { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:12px; font-weight:820; }
.calendar-event-pill--import { border-left-color:var(--ju-info); }
.calendar-more { color:var(--ju-brand-700); font-size:12px; font-weight:850; padding:4px 2px; }
.calendar-day-view {
  display:grid;
  grid-template-columns:120px minmax(0,1fr);
  gap:1px;
  overflow:hidden;
  border:1px solid var(--ju-border);
  border-radius:var(--radius-xl);
  background:var(--ju-border);
  box-shadow:var(--shadow-md);
}
.calendar-day-rail {
  display:grid;
  place-items:center;
  align-content:center;
  gap:8px;
  min-height:520px;
  background:var(--ju-brand-700);
  color:#fff;
}
.calendar-day-rail span { font-size:28px; font-weight:920; letter-spacing:-.05em; }
.calendar-day-rail strong { font-size:13px; text-transform:uppercase; letter-spacing:.12em; }
.calendar-agenda-day { display:grid; align-content:start; gap:10px; padding:18px; background:rgba(255,255,255,.86); }
[data-theme="dark"] .calendar-agenda-day { background:rgba(20,33,30,.82); }
.calendar-event-card {
  display:grid;
  grid-template-columns:96px minmax(0,1fr);
  gap:14px;
  align-items:center;
  padding:14px;
  border:1px solid var(--ju-border);
  border-left:5px solid var(--ju-brand-700);
  border-radius:18px;
  background:var(--ju-surface);
  box-shadow:var(--shadow-xs);
}
.calendar-event-card--import { border-left-color:var(--ju-info); }
.calendar-event-card time { color:var(--ju-brand-700); font-weight:900; }
.calendar-event-card strong { display:block; color:var(--ju-heading); }
.calendar-event-card span { color:var(--ju-muted); font-size:13px; }
.calendar-empty-large { min-height:320px; display:grid; place-items:center; text-align:center; }

/* Dashboard compact Outlook preview */
.calendar-card--outlook .mini-calendar--outlook { grid-template-columns:repeat(7,minmax(0,1fr)); }
.calendar-card--outlook .outlook-day { min-height:76px; }

.task-drawer[hidden] { display:none; }
.task-drawer {
  position:fixed;
  z-index:860;
  top:calc(var(--topbar-h) + 18px);
  right:38px;
  bottom:calc(var(--statusbar-h) + 18px);
  width:min(1120px, calc(100vw - var(--sidebar-w) - 92px));
  max-width:calc(100vw - 76px);
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  border:1px solid var(--ju-border-strong);
  border-radius:30px;
  background:rgba(255,255,255,.975);
  box-shadow:0 36px 110px rgba(0,61,54,.24), var(--shadow-inset);
  overflow:hidden;
  backdrop-filter:blur(24px);
}
body.is-sidebar-collapsed .task-drawer { width:min(1180px, calc(100vw - var(--sidebar-collapsed-w) - 86px)); }
[data-theme="dark"] .task-drawer { background:rgba(18,31,28,.985); box-shadow:0 36px 110px rgba(0,0,0,.54), var(--shadow-inset); }
body.is-task-drawer-open .table-workbench-pro { max-width:calc(100% - min(1120px, 58vw)); }
body.is-task-drawer-open .worklist-table { min-width:860px; }
body.is-task-drawer-open .worklist-table tr.is-selected { background:linear-gradient(90deg,rgba(0,107,92,.13),rgba(255,255,255,.82)); box-shadow:inset 5px 0 0 var(--ju-brand-600); }
[data-theme="dark"] body.is-task-drawer-open .worklist-table tr.is-selected { background:linear-gradient(90deg,rgba(17,146,127,.20),rgba(20,33,30,.90)); }
.drawer-header.case-header,
.drawer-header.case-loading {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:16px;
  align-items:start;
  padding:22px 26px 18px;
  border-bottom:1px solid var(--ju-border);
  background:
    radial-gradient(circle at 86% 0%,rgba(17,146,127,.14),transparent 34%),
    linear-gradient(135deg,var(--ju-surface),var(--ju-brand-mist));
}
[data-theme="dark"] .drawer-header.case-header,
[data-theme="dark"] .drawer-header.case-loading { background:linear-gradient(135deg,rgba(255,255,255,.05),rgba(17,146,127,.10)); }
.case-close { align-self:start; }
.case-title-block { min-width:0; display:grid; gap:8px; }
.case-title-block h2,
.case-loading h2 { margin:0; color:var(--ju-heading); font-size:clamp(28px,2.3vw,38px); line-height:1.02; letter-spacing:-.06em; }
.case-title-block p { margin:0; color:var(--ju-muted); font-size:13px; line-height:1.42; }
.case-kicker { color:var(--ju-brand-700); font-size:11px; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.case-chip-row { display:flex; flex-wrap:wrap; gap:7px; align-items:center; }
.case-primary-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; align-items:center; }
.case-body { min-height:0; overflow:auto; display:grid; gap:18px; padding:20px 22px 24px; }
.case-command-strip { display:none; }
.case-command { appearance:none; }
.case-layout { display:grid; grid-template-columns:180px minmax(0,1fr); gap:20px; align-items:start; }
.drawer-tabs.case-nav {
  position:sticky;
  top:0;
  display:grid;
  gap:8px;
  padding:8px;
  overflow:visible;
  border:1px solid var(--ju-border);
  border-radius:22px;
  background:var(--ju-surface-2);
  box-shadow:var(--shadow-xs),var(--shadow-inset);
}
.drawer-tabs.case-nav .case-tab {
  appearance:none;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:2px;
  width:100%;
  min-height:50px;
  padding:10px 12px;
  border:1px solid transparent;
  border-radius:16px;
  background:transparent;
  color:var(--ju-muted);
  text-align:left;
}
.case-tab strong { color:inherit; font-size:13px; font-weight:860; }
.case-tab span { color:inherit; opacity:.78; font-size:11px; font-weight:650; }
.drawer-tabs.case-nav .case-tab:hover { color:var(--ju-heading); background:var(--ju-surface); border-color:var(--ju-border); }
.drawer-tabs.case-nav .case-tab.is-active { color:#fff; background:linear-gradient(135deg,var(--ju-brand-700),var(--ju-brand-600)); box-shadow:0 10px 22px rgba(0,107,92,.22); }
.case-panel-stack { min-width:0; display:grid; gap:18px; align-content:start; }
[data-panel] { display:grid; gap:18px; }
[data-panel][hidden] { display:none; }
.case-overview { display:grid; gap:16px; }
.case-hero-grid { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr); gap:14px; align-items:stretch; }
.case-focus-card {
  display:grid;
  gap:10px;
  align-content:center;
  min-height:176px;
  padding:22px;
  border:1px solid rgba(0,107,92,.20);
  border-radius:24px;
  background:linear-gradient(135deg,var(--ju-brand-mist),var(--ju-surface));
  box-shadow:var(--shadow-sm),var(--shadow-inset);
}
.case-focus-card.is-warning { border-color:rgba(180,83,9,.28); background:linear-gradient(135deg,rgba(255,247,237,.82),var(--ju-surface)); }
[data-theme="dark"] .case-focus-card.is-warning { background:linear-gradient(135deg,rgba(180,83,9,.16),rgba(20,33,30,.86)); }
.case-focus-card strong { color:var(--ju-heading); font-size:22px; line-height:1.22; letter-spacing:-.03em; }
.case-focus-card p { margin:0; color:var(--ju-muted); line-height:1.48; }
.case-inline-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:4px; }
.case-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.case-facts--focus { align-content:stretch; }
.case-facts article,
.case-section,
.detail-cell,
.note-card,
.file-card,
.event-card,
.resource-card,
.timeline-card,
.event-preview-card,
.mail-preview-card,
.import-preview-card,
.body-preview-html,
.linked-module-head,
.progress-line {
  padding:16px;
  border:1px solid var(--ju-border);
  border-radius:20px;
  background:var(--ju-surface-2);
  box-shadow:var(--shadow-xs),var(--shadow-inset);
}
.case-facts article { display:grid; gap:6px; align-content:center; min-height:82px; }
.case-facts span,
.detail-cell > span,
.progress-line span { color:var(--ju-muted); font-size:11px; font-weight:840; letter-spacing:.08em; text-transform:uppercase; }
.case-facts strong,
.detail-cell strong { color:var(--ju-heading); font-size:16px; }
.case-section { display:grid; gap:14px; }
.case-section header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.case-section h3 { margin:0; color:var(--ju-heading); font-size:16px; letter-spacing:-.02em; }
.case-prose { color:var(--ju-text); line-height:1.62; }
.case-definition { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 18px; margin:0; }
.case-definition dt { color:var(--ju-muted); font-size:11px; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }
.case-definition dd { margin:0; color:var(--ju-heading); font-weight:720; }
.case-definition dd small { display:block; margin-top:3px; color:var(--ju-muted); font-weight:650; }
.resource-strip { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.resource-chip { display:inline-flex; align-items:center; min-height:28px; padding:5px 10px; border:1px solid var(--ju-border); border-radius:999px; background:var(--ju-surface); color:var(--ju-brand-800); font-size:12px; font-weight:800; }
.case-composer { background:linear-gradient(135deg,var(--ju-surface),var(--ju-surface-2)); }
.note-composer { display:grid; gap:12px; }
.composer-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; }
.timeline-list { display:grid; gap:12px; }
.timeline-card { display:grid; grid-template-columns:auto minmax(0,1fr); gap:12px; align-items:start; }
.timeline-dot { width:10px; height:10px; margin-top:7px; border-radius:999px; background:var(--ju-brand-600); box-shadow:0 0 0 5px var(--ju-brand-mist); }
.timeline-card header,
.resource-card header,
.note-card header,
.file-card header,
.event-card header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.timeline-card header small,
.resource-card header small,
.note-card header small,
.file-card header small,
.event-card header small { color:var(--ju-muted); }
.timeline-card p,
.resource-card p,
.note-card p,
.file-card p,
.event-card p { margin:0; color:var(--ju-text); line-height:1.5; }
.case-empty { min-height:170px; display:grid; place-items:center; padding:28px; text-align:center; }
.case-dropzone { padding:14px; border:1px solid var(--ju-border); border-radius:20px; background:var(--ju-surface-2); }
.case-quick-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; }
.case-check { background:var(--ju-surface); }
.progress-shell { height:12px; overflow:hidden; border-radius:999px; background:var(--ju-border); }
.progress-shell span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--ju-brand-700),var(--ju-brand-500)); }
.detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.detail-cell { display:grid; gap:5px; }
.detail-cell p { margin:0; color:var(--ju-text); }
.linked-module-head,.progress-line { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.check-item { display:flex; align-items:center; gap:10px; padding:12px; border:1px solid var(--ju-border); border-radius:15px; background:var(--ju-surface-2); }
.task-form { display:grid; gap:16px; }
.detail-page { display:grid; gap:20px; }
.detail-page-header.case-page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
@media (min-width:1500px) {
  .task-drawer { right:54px; width:min(1240px, calc(100vw - var(--sidebar-w) - 130px)); }
  body.is-sidebar-collapsed .task-drawer { width:min(1280px, calc(100vw - var(--sidebar-collapsed-w) - 116px)); }
}
@media (max-width:1280px) {
  body.is-task-drawer-open .table-workbench-pro { max-width:none; }
  .task-drawer { inset:74px 18px 46px calc(var(--sidebar-w) + 18px); width:auto; max-width:none; }
  body.is-sidebar-collapsed .task-drawer { left:calc(var(--sidebar-collapsed-w) + 18px); width:auto; }
  .case-hero-grid { grid-template-columns:1fr; }
}
@media (max-width:960px) {
  .task-drawer { inset:74px 12px 46px; width:auto; max-width:none; }
  .case-layout { grid-template-columns:1fr; }
  .drawer-tabs.case-nav { position:static; display:flex; overflow-x:auto; }
  .drawer-tabs.case-nav .case-tab { min-width:126px; }
}
@media (max-width:720px) {
  .drawer-header.case-header { grid-template-columns:minmax(0,1fr) auto; }
  .case-primary-actions { grid-column:1 / -1; justify-content:flex-start; }
  .case-facts,.case-definition,.composer-row { grid-template-columns:1fr; }
}
/* Import pages *//* Import pages */
.mode-banner { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:14px; align-items:center; padding:16px 18px; margin-bottom:18px; border:1px solid var(--ju-border); border-radius:var(--radius-xl); background:rgba(255,255,255,.84); box-shadow:var(--shadow-xs),var(--shadow-inset); }
[data-theme="dark"] .mode-banner { background:rgba(20,33,30,.82); }
.mode-banner > span:first-child { width:42px; height:42px; display:grid; place-items:center; border-radius:15px; color:#fff; background:var(--ju-brand-700); }
.mode-banner strong { color:var(--ju-heading); }
.mode-banner p { margin:2px 0 0; color:var(--ju-muted); }
.mode-banner em { color:var(--ju-brand-700); font-style:normal; font-weight:800; font-size:12px; }
.import-workspace { display:grid; grid-template-columns:minmax(240px,.62fr) minmax(420px,1.22fr) minmax(340px,.9fr); gap:20px; align-items:start; }
.report-workspace { display:grid; grid-template-columns:minmax(360px,.72fr) minmax(520px,1.28fr); gap:20px; align-items:start; }
.import-main,.report-builder { display:grid; gap:16px; }
.import-card,.upload-card { display:grid; gap:16px; }
.import-card form,.upload-card form,.import-card form:not(.grid-form) { display:grid; gap:13px; }
.import-steps { position:sticky; top:18px; }
.import-steps h2 { display:flex; align-items:center; gap:10px; margin:0 0 14px; color:var(--ju-heading); font-size:22px; letter-spacing:-.035em; }
.import-steps ol { list-style:none; margin:0; padding:0; display:grid; gap:9px; }
.import-steps li { display:grid; grid-template-columns:auto minmax(0,1fr); gap:2px 10px; align-items:center; padding:12px; border:1px solid var(--ju-border); border-radius:15px; background:var(--ju-surface-2); color:var(--ju-muted); }
.import-steps li::before { content:counter(step); counter-increment:step; grid-row:1/3; width:30px; height:30px; display:grid; place-items:center; border-radius:11px; background:var(--ju-brand-mist); color:var(--ju-brand-800); font-weight:850; }
.import-steps ol { counter-reset:step; }
.import-steps li.is-active { color:var(--ju-heading); border-color:rgba(17,146,127,.26); background:var(--ju-brand-mist); }
.import-steps li strong { color:var(--ju-heading); }
.import-steps li span { font-size:12px; }
.import-preview,.report-preview-panel { min-height:330px; }
.import-history,.import-list,.import-list-pro { display:grid; gap:10px; }
.import-row,.import-source { padding:12px; border:1px solid var(--ju-border); border-radius:14px; background:var(--ju-surface-2); }
.dropzone,.sql-upload-zone { display:grid; gap:12px; }
.dropzone-visual { display:grid; place-items:center; gap:8px; min-height:154px; padding:22px; border:1.5px dashed var(--ju-border-strong); border-radius:var(--radius-xl); background:linear-gradient(135deg,var(--ju-surface-2),var(--ju-brand-mist)); text-align:center; }
.dropzone-visual svg { color:var(--ju-brand-600); }
.is-dragover .dropzone-visual,.dropzone.is-dragover { border-color:var(--ju-brand-500); background:var(--ju-brand-soft); }
.sql-upload-zone.is-disabled .dropzone-visual { opacity:.72; filter:saturate(.75); }
/* Reports */
.report-preset-grid,.report-preset-grid-pro { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:20px; }
.report-preset-grid button,.report-preset-grid-pro button {
  appearance:none;
  display:grid;
  gap:6px;
  min-height:92px;
  padding:15px;
  border:1px solid var(--ju-border);
  border-radius:18px;
  background:linear-gradient(135deg,var(--ju-surface),var(--ju-surface-2));
  color:var(--ju-text);
  text-align:left;
  box-shadow:var(--shadow-xs),var(--shadow-inset);
}
.report-preset-grid button:hover,.report-preset-grid-pro button:hover { border-color:rgba(17,146,127,.26); box-shadow:var(--shadow-sm); transform:translateY(-1px); }
.report-preset-grid strong,.report-preset-grid-pro strong { color:var(--ju-heading); font-size:14px; }
.report-preset-grid span,.report-preset-grid-pro span { color:var(--ju-muted); font-size:12px; line-height:1.35; }
.report-options { display:grid; gap:14px; }
.report-preview { min-height:370px; display:grid; place-items:center; border:1px solid var(--ju-border); border-radius:var(--radius-xl); background:var(--ju-surface-2); }
.ghost-report,.ghost-timeline,.tag-convention-grid { display:grid; gap:10px; padding:16px; border:1px solid var(--ju-border); border-radius:var(--radius-lg); background:var(--ju-surface-2); }
.ghost-report { grid-template-columns:repeat(2,minmax(0,1fr)); }
.ghost-report span,.ghost-timeline span { min-height:30px; display:grid; place-items:center; padding:7px 10px; border-radius:999px; background:var(--ju-surface); color:var(--ju-brand-700); font-size:12px; font-weight:740; }
/* Journal and tags */
.journal-timeline,.empty-state-timeline { display:grid; gap:12px; }
.empty-state-timeline .ghost-timeline { width:min(420px,100%); margin-inline:auto; }
.timeline-panel { padding:18px; }
.journal-item { display:grid; gap:8px; padding:14px; border:1px solid var(--ju-border); border-radius:16px; background:var(--ju-surface-2); }
.tag-cloud,.tag-filter { display:flex; flex-wrap:wrap; gap:8px; }
.tag-convention-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.tag-convention-grid code { display:block; padding:12px; border-radius:12px; background:var(--ju-surface); color:var(--ju-brand-700); }

/* Admin, settings, templates */
.settings-grid,.category-admin-grid,.templates-layout,.users-admin { display:grid; grid-template-columns:minmax(300px,.82fr) minmax(360px,1.18fr); gap:20px; align-items:start; }
.settings-form-pro,.template-form-panel,.category-list-panel,.template-list-panel { display:grid; gap:16px; }
.admin-tile-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.admin-tile { display:grid; gap:8px; padding:17px; color:var(--ju-text); min-height:116px; }
.admin-tile:hover { transform:translateY(-1px); box-shadow:var(--shadow-md); }
.admin-tile strong { color:var(--ju-heading); }
.admin-tile span { color:var(--ju-muted); font-size:13px; }
.template-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.template-card { display:grid; gap:12px; padding:16px; }
.template-card header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.template-card header small { display:block; margin-top:3px; color:var(--ju-muted); font-size:12px; line-height:1.35; }
.template-card p { margin:0; color:var(--ju-text); line-height:1.5; }
.template-card footer { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.color-dot { width:18px; height:18px; display:inline-block; border-radius:999px; border:1px solid rgba(0,0,0,.12); vertical-align:middle; }
.excellence-metric-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.excellence-metric-strip article,.mini-stat { display:grid; gap:4px; padding:15px; border:1px solid var(--ju-border); border-radius:18px; background:var(--ju-surface); box-shadow:var(--shadow-xs); }
.excellence-metric-strip strong,.mini-stat strong { font-size:26px; letter-spacing:-.04em; color:var(--ju-heading); }
.expert-panel { overflow:hidden; }
.expert-panel summary { cursor:pointer; display:flex; justify-content:space-between; gap:14px; padding:16px 20px; font-weight:800; color:var(--ju-heading); }
.expert-panel summary em { color:var(--ju-muted); font-size:12px; font-style:normal; font-weight:650; }
.expert-panel .table-wrap { margin:0 20px 20px; }
.system-values-panel { margin-top:18px; }
.definition-list { display:grid; grid-template-columns:max-content 1fr; gap:10px 18px; }
.definition-list dt { color:var(--ju-muted); font-weight:740; }
.definition-list dd { margin:0; }

/* Systemcheck */
.system-scoreboard { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
.score-card { display:grid; gap:6px; padding:18px; border-left:4px solid var(--level,var(--ju-brand-500)); }
.score-card strong { color:var(--ju-heading); font-size:34px; line-height:1; letter-spacing:-.055em; }
.score-card span { color:var(--ju-muted); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.system-priority-panel { display:grid; gap:16px; padding:20px; margin-bottom:20px; border-left:4px solid var(--level,var(--ju-brand-500)); }
.system-priority-panel--critical { --level:var(--ju-danger); }
.system-priority-panel--warn { --level:var(--ju-warning); }
.system-priority-panel--ok { --level:var(--ju-success); }
.system-priority-panel header { display:flex; align-items:flex-start; gap:14px; }
.priority-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:15px; background:var(--ju-brand-mist); color:var(--level,var(--ju-brand-700)); }
.priority-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.priority-item { display:grid; gap:6px; padding:14px; border:1px solid var(--ju-border); border-radius:16px; background:var(--ju-surface-2); }
.priority-item span { color:var(--ju-muted); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.priority-item p { margin:0; color:var(--ju-muted); }
.systemcheck-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.check-list { display:grid; gap:9px; }
.check-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:12px; align-items:start; padding:12px; border:1px solid var(--ju-border); border-radius:15px; background:var(--ju-surface-2); }
.check-dot { width:10px; height:10px; margin-top:6px; border-radius:999px; background:var(--level,var(--ju-muted)); box-shadow:0 0 0 5px rgba(17,146,127,.10); }
.check-row.level-ok { --level:var(--ju-success); }
.check-row.level-warn,.check-row.level-warning { --level:var(--ju-warning); }
.check-row.level-critical { --level:var(--ju-danger); }
.check-row.level-info { --level:var(--ju-info); }
.check-row strong { color:var(--ju-heading); }
.check-row p,.check-row small { margin:2px 0 0; color:var(--ju-muted); }
.check-value { display:grid; justify-items:end; gap:8px; max-width:230px; text-align:right; }

/* Maintenance */
.update-stepper { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:18px; }
.update-stepper article { display:grid; grid-template-columns:auto minmax(0,1fr); grid-template-areas:"num title" "num text"; gap:2px 10px; align-items:center; padding:12px; border:1px solid var(--ju-border); border-radius:15px; background:var(--ju-surface-2); }
.update-stepper article > span { grid-area:num; width:30px; height:30px; display:grid; place-items:center; border-radius:11px; background:var(--ju-brand-mist); color:var(--ju-brand-800); font-weight:850; }
.update-stepper article > strong { grid-area:title; color:var(--ju-heading); }
.update-stepper article > small { grid-area:text; color:var(--ju-muted); }
.update-stepper .is-active { border-color:rgba(17,146,127,.28); background:var(--ju-brand-mist); }
.maintenance-wow { display:grid; grid-template-columns:minmax(0,1fr) repeat(3,minmax(120px,150px)); gap:14px; align-items:stretch; margin-bottom:20px; }
.maintenance-hero-card { display:flex; align-items:center; gap:14px; padding:18px; }
.maintenance-hero-card strong { display:block; color:var(--ju-heading); font-size:15px; }
.maintenance-hero-card p { margin:4px 0 0; color:var(--ju-muted); }
.maintenance-wow .mini-stat { align-content:center; min-height:86px; }
.maintenance-control-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
.maintenance-switchboard,.quality-callout { padding:18px; }
.maintenance-toggle-form { display:grid; gap:10px; margin-top:12px; }
.maintenance-grid { display:grid; gap:20px; }
.maintenance-grid-main { grid-template-columns:minmax(0,1fr) minmax(320px,.38fr); align-items:start; }
.maintenance-side { position:sticky; top:18px; }
.migration-list,.maintenance-file-list { display:grid; gap:12px; }
.migration-card,.maintenance-file-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:16px; align-items:center; padding:14px; border:1px solid var(--ju-border); border-radius:18px; background:var(--ju-surface-2); }
.migration-main { display:grid; gap:4px; }
.migration-main p,.migration-main small { margin:0; color:var(--ju-muted); }
.migration-side { display:grid; justify-items:end; gap:8px; }
.warning-text { color:var(--ju-warning); }
.danger-text { color:var(--ju-danger); }
.progress-shell { height:12px; border-radius:999px; background:var(--ju-surface-3); overflow:hidden; }
.progress-bar { height:100%; width:0; border-radius:999px; background:linear-gradient(90deg,var(--ju-brand-500),var(--ju-brand-700)); }
.maintenance-progress-meta { display:flex; justify-content:space-between; gap:12px; color:var(--ju-muted); }
.maintenance-log { min-height:140px; padding:14px; border-radius:16px; background:#081310; color:#c9fff1; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12px; overflow:auto; }
/* Backups */
.backup-table strong { color:var(--ju-heading); }
.smart-empty-line { color:var(--ju-muted); font-size:13px; }

/* Modals and task generated content */
.modal[hidden] { display:none; }
.modal {
  position:fixed;
  inset:0;
  z-index:900;
  display:grid;
  place-items:center;
  padding:24px;
  background:rgba(6,20,17,.42);
  backdrop-filter:blur(10px);
}
.modal-backdrop { position:absolute; inset:0; z-index:0; background:transparent; }
.modal-card {
  position:relative;
  z-index:1;
  width:min(720px,100%);
  max-height:min(86vh,920px);
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  border:1px solid var(--ju-border);
  border-radius:var(--radius-2xl);
  background:var(--ju-surface);
  box-shadow:var(--shadow-lg);
  overflow:hidden;
}
.modal-wide,.modal-card-wide { width:min(980px,100%); }
.modal-header,.modal-footer { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:18px 20px; border-bottom:1px solid var(--ju-border); }
.modal-footer { border-top:1px solid var(--ju-border); border-bottom:0; justify-content:flex-end; }
.modal-card > form,.modal-card > div:not(.modal-header):not(.modal-footer) { min-height:0; overflow:auto; padding:20px; }
.row-warnings,.has-warnings { color:var(--ju-warning); }
.is-selected { outline:3px solid rgba(17,146,127,.16); }
.is-unread { font-weight:760; }
.is-clean { color:var(--ju-success); }
/* Alerts */
.alert { padding:13px 14px; border:1px solid var(--ju-border); border-radius:15px; background:var(--ju-surface-2); }
.alert-danger { color:var(--ju-danger); background:var(--ju-danger-soft); border-color:rgba(180,35,24,.16); }
.alert-warning { color:var(--ju-warning); background:var(--ju-warning-soft); border-color:rgba(169,104,22,.18); }
.alert-info { color:var(--ju-info); background:var(--ju-info-soft); border-color:rgba(37,99,235,.16); }


/* Canonical utility hooks retained for scripts and route semantics */

.toast-host { position:fixed; right:22px; bottom:22px; z-index:1100; display:grid; gap:10px; width:min(360px,calc(100vw - 32px)); }
.command-trigger { white-space:nowrap; }
.command-center { isolation:isolate; }
.badge-row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.danger-edge { border-left:4px solid var(--ju-danger); }
.hero-icon { width:48px; height:48px; display:grid; place-items:center; border-radius:18px; color:#fff; background:linear-gradient(135deg,var(--ju-brand-500),var(--ju-brand-800)); box-shadow:0 16px 34px rgba(0,107,92,.20); }
.subtle { opacity:.76; }
.quick-form,.maintenance-confirm,.maintenance-runner,.maintenance-rules,.maintenance-toggle-form,.maintenance-wow,.migration-panel,.check-group,.worklist-table { min-width:0; }
.ui-pill--priority { background:var(--ju-warning-soft); color:var(--ju-warning); border-color:rgba(169,104,22,.16); }
.ui-pill--status { background:var(--ju-success-soft); color:var(--ju-success); border-color:rgba(31,122,77,.16); }


/* Responsive */
@media (max-width:1320px) {
  .kpi-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .mini-calendar { grid-template-columns:repeat(7,minmax(64px,1fr)); }
  .calendar-grid { overflow:auto; grid-template-columns:repeat(7,minmax(150px,1fr)); }
  .calendar-day-cell { min-height:150px; }
}
@media (max-width:1180px) {
  :root { --page-pad-x:22px; }
  .dashboard-grid,.dashboard-grid-image,.import-workspace,.report-workspace,.maintenance-grid-main,.settings-grid,.category-admin-grid,.templates-layout,.users-admin,.calendar-app-toolbar,.calendar-day-view { grid-template-columns:1fr; }
  .workbench-toolbar-compact { grid-template-columns:minmax(280px,1fr) repeat(2,minmax(140px,.5fr)); }
  .workbench-toolbar-compact > .btn { min-width:120px; }
  .report-preset-grid,.report-preset-grid-pro,.onboarding-steps { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .maintenance-wow { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .maintenance-hero-card { grid-column:1/-1; }
  .maintenance-side { position:static; }
  .kpi-grid,.system-scoreboard,.maintenance-control-grid,.admin-tile-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .priority-list,.systemcheck-grid { grid-template-columns:1fr; }
}
@media (max-width:860px) {
  :root { --sidebar-w:0px; --topbar-h:auto; --statusbar-h:auto; --page-pad-x:16px; --page-pad-y:18px; }
  .app-shell,body.is-sidebar-collapsed .app-shell { grid-template-columns:1fr; }
  .sidebar { position:fixed; inset:0 auto 0 0; width:292px; transform:translateX(-100%); transition:transform .2s ease; }
  body:not(.is-sidebar-collapsed) .sidebar { transform:translateX(0); }
  .main-shell { min-height:100vh; height:auto; grid-template-rows:auto minmax(0,1fr) auto; }
  .topbar { min-height:74px; flex-wrap:wrap; align-items:stretch; padding-block:12px; }
  .global-search { width:100%; order:2; }
  .topbar-actions { width:100%; justify-content:space-between; }
  .page-hero { grid-template-columns:1fr; }
  .page-hero__actions { justify-content:flex-start; }
  .grid-form,.form-grid,.two,.three,.work-coach-grid,.work-coach-grid-excellence,.report-preset-grid,.report-preset-grid-pro,.tag-convention-grid,.template-grid,.workbench-toolbar-compact,.onboarding-steps,.maintenance-wow { grid-template-columns:1fr; }
  .command-list { grid-template-columns:1fr; }
  .user-chip small,.topbar-divider { display:none; }
}
@media (max-width:560px) {
  .kpi-grid,.system-scoreboard,.maintenance-control-grid,.admin-tile-grid,.excellence-metric-strip { grid-template-columns:1fr; }
  .page-hero h1 { font-size:30px; }
  .content { padding-inline:14px; }
  .panel { padding:16px; }
  .data-table { min-width:620px; }
  .task-drawer { inset:74px 12px 46px; width:auto; max-width:none; }
  .drawer-header,.drawer-body { padding-inline:16px; }
  .detail-grid { grid-template-columns:1fr; }
  .mini-calendar { grid-template-columns:repeat(7,minmax(44px,1fr)); gap:5px; }
  .calendar-app-toolbar { gap:10px; }
  .calendar-nav,.calendar-view-switch { justify-content:flex-start; }
  .calendar-grid { grid-template-columns:repeat(7,minmax(132px,1fr)); }
  .outlook-day { min-height:56px; padding:8px; }
  .outlook-event,.agenda-item { grid-template-columns:58px minmax(0,1fr); }
  .outlook-event em,.agenda-item em { display:none; }
}

@media print {
  .sidebar,.topbar,.statusbar,.page-hero__actions,.btn,.icon-btn { display:none; }
  .app-shell,.main-shell { display:block; height:auto; }
  .content { padding:0; overflow:visible; }
  .panel,.table-wrap { box-shadow:none; break-inside:avoid; }
}