/* ---------- Degular type family (local font files, see /fonts) ---------- */
@font-face{ font-family:'Degular Display'; src:url('fonts/DegularDisplay-Thin.otf') format('opentype'); font-weight:100; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Display'; src:url('fonts/DegularDisplay-Light.otf') format('opentype'); font-weight:300; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Display'; src:url('fonts/DegularDisplay-Regular.otf') format('opentype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Display'; src:url('fonts/DegularDisplay-Medium.otf') format('opentype'); font-weight:500; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Display'; src:url('fonts/DegularDisplay-Semibold.otf') format('opentype'); font-weight:600; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Display'; src:url('fonts/DegularDisplay-Bold.otf') format('opentype'); font-weight:700; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Display'; src:url('fonts/DegularDisplay-Black.otf') format('opentype'); font-weight:900; font-style:normal; font-display:swap; }

@font-face{ font-family:'Degular Text'; src:url('fonts/DegularText-Thin.otf') format('opentype'); font-weight:100; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Text'; src:url('fonts/DegularText-Light.otf') format('opentype'); font-weight:300; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Text'; src:url('fonts/DegularText-Regular.otf') format('opentype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Text'; src:url('fonts/DegularText-Medium.otf') format('opentype'); font-weight:500; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Text'; src:url('fonts/DegularText-Semibold.otf') format('opentype'); font-weight:600; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Text'; src:url('fonts/DegularText-Bold.otf') format('opentype'); font-weight:700; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Text'; src:url('fonts/DegularText-Black.otf') format('opentype'); font-weight:900; font-style:normal; font-display:swap; }

@font-face{ font-family:'Degular Mono'; src:url('fonts/DegularMono-Light.otf') format('opentype'); font-weight:300; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Mono'; src:url('fonts/DegularMono-Regular.otf') format('opentype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Mono'; src:url('fonts/DegularMono-Medium.otf') format('opentype'); font-weight:500; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Mono'; src:url('fonts/DegularMono-Semibold.otf') format('opentype'); font-weight:600; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular Mono'; src:url('fonts/DegularMono-Bold.otf') format('opentype'); font-weight:700; font-style:normal; font-display:swap; }

@font-face{ font-family:'Degular'; src:url('fonts/Degular-Regular.otf') format('opentype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face{ font-family:'Degular'; src:url('fonts/Degular-Italic.otf') format('opentype'); font-weight:400; font-style:italic; font-display:swap; }

  :root{
    --bg:#F3F8F6; --bg-elevated:#FFFFFF;
    --glass: rgba(255,255,255,0.62); --glass-strong: rgba(255,255,255,0.82); --glass-border: rgba(255,255,255,0.9);
    --ink:#12302B; --ink-soft:#4B6B63; --ink-faint:#7C948C;
    --brand:#1C6E8C; --brand-deep:#12506A; --brand-soft:#DCEEF3;
    --vital:#2F9E6E; --vital-soft:#DEF3E7;
    --warning:#B9791F; --warning-soft:#FBEEDA;
    --critical:#B8443A; --critical-soft:#FBE4E1;
    --border: #D8E6E1; --border-strong:#C3D9D2;
    --shadow-sm: 0 2px 10px rgba(18,48,43,0.06);
    --shadow-md: 0 10px 30px rgba(18,48,43,0.10);
    --shadow-lg: 0 24px 60px rgba(18,48,43,0.16);
    --radius-lg:22px; --radius-md:14px; --radius-sm:9px;
    --font-display:'Degular Display','Iowan Old Style','Palatino Linotype', Georgia, 'Times New Roman', serif;
    --font-body:'Degular Text', -apple-system, BlinkMacSystemFont,'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono:'Degular Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --seq-1:#E6F2ED; --seq-2:#C9E5DA; --seq-3:#A6D6C2; --seq-4:#7EC5A9; --seq-5:#52AF8C; --seq-6:#2E8E6E; --seq-7:#146650;
    --sidebar-w: 232px;
  }
  @media (prefers-color-scheme: dark){
    :root{
      --bg:#0B1815; --bg-elevated:#102420;
      --glass: rgba(20,42,37,0.58); --glass-strong: rgba(20,42,37,0.78); --glass-border: rgba(255,255,255,0.08);
      --ink:#E9F5F0; --ink-soft:#AFC9C1; --ink-faint:#75948B;
      --brand:#63C4DA; --brand-deep:#8FDCEA; --brand-soft: rgba(99,196,218,0.14);
      --vital:#4ED198; --vital-soft: rgba(78,209,152,0.14);
      --warning:#E3A94C; --warning-soft: rgba(227,169,76,0.14);
      --critical:#E58177; --critical-soft: rgba(229,129,119,0.14);
      --border: rgba(255,255,255,0.10); --border-strong: rgba(255,255,255,0.16);
      --shadow-sm: 0 2px 10px rgba(0,0,0,0.30);
      --shadow-md: 0 10px 30px rgba(0,0,0,0.38);
      --shadow-lg: 0 24px 60px rgba(0,0,0,0.5);
      --seq-1:#2A6E5A; --seq-2:#2F7F68; --seq-3:#3B9177; --seq-4:#48A386; --seq-5:#57B695; --seq-6:#6FCBA8; --seq-7:#8FE2C2;
    }
  }
  :root[data-theme="dark"]{
    --bg:#0B1815; --bg-elevated:#102420;
    --glass: rgba(20,42,37,0.58); --glass-strong: rgba(20,42,37,0.78); --glass-border: rgba(255,255,255,0.08);
    --ink:#E9F5F0; --ink-soft:#AFC9C1; --ink-faint:#75948B;
    --brand:#63C4DA; --brand-deep:#8FDCEA; --brand-soft: rgba(99,196,218,0.14);
    --vital:#4ED198; --vital-soft: rgba(78,209,152,0.14);
    --warning:#E3A94C; --warning-soft: rgba(227,169,76,0.14);
    --critical:#E58177; --critical-soft: rgba(229,129,119,0.14);
    --border: rgba(255,255,255,0.10); --border-strong: rgba(255,255,255,0.16);
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.30);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.38);
    --shadow-lg: 0 24px 60px rgba(0,0,0,0.5);
    --seq-1:#2A6E5A; --seq-2:#2F7F68; --seq-3:#3B9177; --seq-4:#48A386; --seq-5:#57B695; --seq-6:#6FCBA8; --seq-7:#8FE2C2;
  }
  :root[data-theme="light"]{
    --bg:#F3F8F6; --bg-elevated:#FFFFFF;
    --glass: rgba(255,255,255,0.62); --glass-strong: rgba(255,255,255,0.82); --glass-border: rgba(255,255,255,0.9);
    --ink:#12302B; --ink-soft:#4B6B63; --ink-faint:#7C948C;
    --brand:#1C6E8C; --brand-deep:#12506A; --brand-soft:#DCEEF3;
    --vital:#2F9E6E; --vital-soft:#DEF3E7;
    --warning:#B9791F; --warning-soft:#FBEEDA;
    --critical:#B8443A; --critical-soft:#FBE4E1;
    --border: #D8E6E1; --border-strong:#C3D9D2;
  }

  *,*::before,*::after{ box-sizing:border-box; }
  html,body{ height:100%; }
  body{
    margin:0; background:var(--bg); color:var(--ink); font-family:var(--font-body);
    font-size:15px; line-height:1.55; -webkit-font-smoothing:antialiased;
  }
  h1,h2,h3,h4{ font-family:var(--font-display); font-weight:600; margin:0; text-wrap:balance; }
  p{ margin:0; }
  button,input,select,textarea{ font-family:inherit; font-size:inherit; color:inherit; }
  button{ cursor:pointer; }
  a{ color:inherit; }
  ::selection{ background:var(--brand-soft); }
  :focus-visible{ outline:2.5px solid var(--brand); outline-offset:2px; border-radius:6px; }
  .num{ font-family:var(--font-mono); font-variant-numeric:tabular-nums; }
  .visually-hidden{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
  @media (prefers-reduced-motion: reduce){
    *{ animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; scroll-behavior:auto !important; }
  }

  /* ---------- Vitals signature trace ---------- */
  .vitals-trace{ display:block; width:100%; height:100%; }
  .vitals-trace path{
    fill:none; stroke:var(--vital); stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round;
    stroke-dasharray: var(--trace-len, 620); stroke-dashoffset: var(--trace-len, 620);
    animation: trace-draw 3.6s ease-in-out infinite;
  }
  @keyframes trace-draw{
    0%{ stroke-dashoffset: var(--trace-len, 620); }
    55%{ stroke-dashoffset: 0; }
    100%{ stroke-dashoffset: calc(var(--trace-len, 620) * -1); }
  }

  /* ---------- Glass primitives ---------- */
  .glass{
    background:var(--glass); backdrop-filter:blur(18px) saturate(140%); -webkit-backdrop-filter:blur(18px) saturate(140%);
    border:1px solid var(--glass-border); border-radius:var(--radius-lg); box-shadow:var(--shadow-md);
  }
  .glass-strong{ background:var(--glass-strong); backdrop-filter:blur(22px) saturate(150%); -webkit-backdrop-filter:blur(22px) saturate(150%); }

  /* ---------- Buttons ---------- */
  .btn{
    display:inline-flex; align-items:center; gap:8px; padding:10px 16px; border-radius:999px; border:1px solid transparent;
    font-weight:600; font-size:13.5px; letter-spacing:.1px; transition:transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
    min-height:40px; white-space:nowrap;
  }
  .btn:active{ transform:scale(0.97); }
  .btn-primary{ background:var(--brand); color:#fff; box-shadow:var(--shadow-sm); }
  .btn-primary:hover{ background:var(--brand-deep); }
  .btn-ghost{ background:transparent; border-color:var(--border-strong); color:var(--ink); }
  .btn-ghost:hover{ background:var(--brand-soft); border-color:var(--brand); }
  .btn-soft{ background:var(--brand-soft); color:var(--brand-deep); }
  .btn-soft:hover{ filter:brightness(0.97); }
  .btn-danger{ background:transparent; border-color:var(--critical); color:var(--critical); }
  .btn-danger:hover{ background:var(--critical-soft); }
  .btn-sm{ padding:6px 12px; min-height:30px; font-size:12.5px; border-radius:999px; }
  .btn-icon{ width:38px; height:38px; padding:0; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:transparent; border:1px solid var(--border-strong); }
  .btn-icon:hover{ background:var(--brand-soft); border-color:var(--brand); }
  .btn:disabled{ opacity:.45; cursor:not-allowed; }
  svg{ width:1em; height:1em; vertical-align:-2px; }
  .btn svg{ width:16px; height:16px; flex:none; }

  /* ---------- Forms ---------- */
  .field{ display:flex; flex-direction:column; gap:6px; }
  .field label{ font-size:12.5px; font-weight:600; color:var(--ink-soft); }
  .field .hint{ font-size:11.5px; color:var(--ink-faint); }
  .input, select.input, textarea.input{
    width:100%; padding:11px 13px; border-radius:var(--radius-sm); border:1.5px solid var(--border-strong);
    background:var(--bg-elevated); color:var(--ink); transition:border-color 150ms ease, box-shadow 150ms ease;
  }
  .input:focus{ border-color:var(--brand); box-shadow:0 0 0 3.5px var(--brand-soft); outline:none; }
  textarea.input{ resize:vertical; min-height:84px; }
  .input-icon-wrap{ position:relative; }
  .input-icon-wrap svg{ position:absolute; left:13px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--ink-faint); }
  .input-icon-wrap .input{ padding-left:38px; }
  .checkbox-row{ display:flex; align-items:center; gap:8px; font-size:13px; color:var(--ink-soft); }

  /* ---------- Chips / badges ---------- */
  .chip{ display:inline-flex; align-items:center; gap:5px; padding:4px 10px; border-radius:999px; font-size:11.5px; font-weight:700; letter-spacing:.2px; }
  .chip svg{ width:12px; height:12px; }
  .chip-good{ background:var(--vital-soft); color:var(--vital); }
  .chip-warn{ background:var(--warning-soft); color:var(--warning); }
  .chip-bad{ background:var(--critical-soft); color:var(--critical); }
  .chip-neutral{ background:var(--brand-soft); color:var(--brand-deep); }
  .role-pill{ padding:3px 9px; border-radius:999px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; }
  .role-admin{ background:var(--critical-soft); color:var(--critical); }
  .role-supervisor{ background:var(--brand-soft); color:var(--brand-deep); }
  .role-student{ background:var(--vital-soft); color:var(--vital); }

  /* ---------- Layout: auth ---------- */
  #auth-screen{ min-height:100vh; display:grid; grid-template-columns:1fr; place-items:center; padding:32px 18px; position:relative; overflow:hidden; }
  #auth-screen::before{
    content:""; position:absolute; inset:0; z-index:0;
    background:
      radial-gradient(700px 420px at 12% 8%, var(--brand-soft), transparent 60%),
      radial-gradient(600px 420px at 92% 92%, var(--vital-soft), transparent 60%);
  }
  .auth-trace-bg{ position:absolute; inset:0; z-index:0; opacity:.5; }
  .auth-card{ position:relative; z-index:1; width:100%; max-width:400px; padding:36px 32px 30px; }
  .brand-mark{ display:flex; align-items:center; gap:10px; margin-bottom:22px; }
  .brand-mark .mark{ width:38px; height:38px; border-radius:11px; background:linear-gradient(155deg,var(--brand),var(--vital)); display:flex; align-items:center; justify-content:center; flex:none; box-shadow:var(--shadow-sm); }
  .brand-mark .mark svg{ width:20px; height:20px; color:#fff; }
  .brand-mark .wordmark{ font-family:var(--font-display); font-size:22px; font-weight:700; letter-spacing:.4px; }
  .brand-mark .tagline{ font-size:10.5px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:1.4px; margin-top:1px; }
  .brand-mark-btn{ background:none; border:none; padding:0; cursor:pointer; }
  .auth-title{ font-size:23px; margin-bottom:4px; }
  .auth-sub{ color:var(--ink-soft); font-size:13.5px; margin-bottom:22px; }
  .auth-form{ display:flex; flex-direction:column; gap:14px; }
  .auth-foot{ margin-top:18px; font-size:13px; color:var(--ink-soft); display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; }
  .link{ background:none; border:none; padding:0; color:var(--brand); font-weight:600; cursor:pointer; text-align:left; display:block; }
  .demo-divider{ display:flex; align-items:center; gap:10px; margin:20px 0 14px; color:var(--ink-faint); font-size:11px; text-transform:uppercase; letter-spacing:.8px; }
  .demo-divider::before,.demo-divider::after{ content:""; flex:1; height:1px; background:var(--border); }
  .oauth-btn{ border-color:var(--border-strong); }
  .signup-cta{ margin-top:18px; padding:14px 16px; border-radius:var(--radius-md); background:var(--brand-soft); display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12.5px; color:var(--brand-deep); font-weight:600; }
  .notice-box{ display:flex; gap:10px; padding:12px 14px; border-radius:var(--radius-sm); background:var(--brand-soft); color:var(--brand-deep); font-size:12.5px; line-height:1.5; }
  .notice-box svg{ width:16px; height:16px; flex:none; margin-top:1px; }

  /* ---------- App shell ---------- */
  #app{ display:none; min-height:100vh; }
  #app.active{ display:block; }
  .topbar{
    position:sticky; top:0; z-index:40; height:64px; display:flex; align-items:center; gap:16px;
    padding:0 20px; border-bottom:1px solid var(--border); background:var(--glass-strong);
    backdrop-filter:blur(20px) saturate(150%); -webkit-backdrop-filter:blur(20px) saturate(150%);
  }
  .topbar .brand-mark{ margin-bottom:0; }
  .topbar .brand-mark .wordmark{ font-size:18px; }
  .topbar .vitals-divider{ height:22px; width:70px; flex:none; opacity:.85; display:none; }
  @media(min-width:720px){ .topbar .vitals-divider{ display:block; } }
  .global-search{ flex:1; max-width:440px; position:relative; }
  .global-search .input{ border-radius:999px; padding-left:38px; background:var(--bg); }
  .search-results{ position:absolute; top:calc(100% + 8px); left:0; right:0; max-height:360px; overflow:auto; z-index:50; padding:8px; display:none; }
  .search-results.show{ display:block; }
  .search-results .sr-group-label{ font-size:10.5px; text-transform:uppercase; letter-spacing:.6px; color:var(--ink-faint); font-weight:700; padding:8px 10px 4px; }
  .search-hit{ display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:var(--radius-sm); }
  .search-hit:hover{ background:var(--brand-soft); }
  .search-hit .t{ font-size:13px; font-weight:600; }
  .search-hit .s{ font-size:11.5px; color:var(--ink-faint); }
  .topbar-actions{ display:flex; align-items:center; gap:10px; margin-left:auto; }
  .role-switch{ display:flex; align-items:center; gap:8px; padding:5px 6px 5px 12px; border-radius:999px; border:1.5px dashed var(--border-strong); }
  .role-switch label{ font-size:10.5px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.4px; }
  .role-switch select{ border:none; background:var(--brand-soft); color:var(--brand-deep); font-weight:700; font-size:12px; padding:6px 10px; border-radius:999px; }
  .avatar{ width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12.5px; flex:none; }
  .avatar-sm{ width:26px; height:26px; font-size:10.5px; }
  .avatar-xs{ width:20px; height:20px; font-size:9px; }
  .avatar img{ width:100%; height:100%; object-fit:cover; border-radius:50%; }
  #bell-badge{ position:absolute; top:6px; right:6px; width:8px; height:8px; border-radius:50%; background:var(--critical); border:1.5px solid var(--bg-elevated); }

  .app-body{ display:flex; align-items:flex-start; }
  .sidebar{ width:var(--sidebar-w); flex:none; position:sticky; top:64px; height:calc(100vh - 64px); padding:18px 12px; border-right:1px solid var(--border); display:flex; flex-direction:column; gap:2px; }
  .nav-item{ display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:var(--radius-sm); background:none; border:none; text-align:left; color:var(--ink-soft); font-weight:600; font-size:13.5px; width:100%; transition:background 150ms,color 150ms; }
  .nav-item svg{ width:18px; height:18px; flex:none; }
  .nav-item:hover{ background:var(--brand-soft); color:var(--brand-deep); }
  .nav-item.active{ background:var(--brand); color:#fff; box-shadow:var(--shadow-sm); }
  .nav-section-label{ font-size:10.5px; text-transform:uppercase; letter-spacing:.6px; color:var(--ink-faint); font-weight:700; padding:14px 12px 6px; }
  .sidebar-foot{ margin-top:auto; padding-top:12px; border-top:1px solid var(--border); }

  main.view-root{ flex:1; min-width:0; padding:26px 30px 60px; }
  .view{ display:none; animation:view-in 260ms ease; }
  .view.active{ display:block; }
  @keyframes view-in{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }
  .view-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:22px; flex-wrap:wrap; }
  .view-eyebrow{ font-size:11px; text-transform:uppercase; letter-spacing:.8px; color:var(--brand); font-weight:700; margin-bottom:4px; }
  .view-title{ font-size:25px; }
  .view-desc{ color:var(--ink-soft); font-size:13.5px; margin-top:4px; max-width:56ch; }
  .scope-banner{ display:flex; align-items:center; gap:9px; padding:9px 14px; border-radius:999px; background:var(--vital-soft); color:var(--vital); font-size:12px; font-weight:600; margin-bottom:20px; }
  .scope-banner svg{ width:15px; height:15px; flex:none; }

  /* ---------- Stat tiles / analytics ---------- */
  .stat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:22px; }
  .stat-tile{ padding:18px 20px; }
  .stat-tile .label{ font-size:11.5px; text-transform:uppercase; letter-spacing:.5px; color:var(--ink-faint); font-weight:700; }
  .stat-tile .value{ font-size:30px; font-family:var(--font-mono); font-weight:600; margin-top:8px; }
  .stat-tile .delta{ font-size:11.5px; margin-top:6px; display:flex; align-items:center; gap:4px; }
  .stat-tile .delta.up{ color:var(--vital); } .stat-tile .delta.down{ color:var(--critical); }
  .analytics-grid{ display:grid; grid-template-columns:1.3fr 1fr; gap:16px; margin-bottom:16px; }
  .panel{ padding:20px 22px; }
  .panel-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
  .panel-title{ font-size:14.5px; font-weight:700; font-family:var(--font-display); }
  .panel-sub{ font-size:11.5px; color:var(--ink-faint); }
  .seq-chart{ display:flex; align-items:flex-end; gap:10px; height:150px; padding-top:8px; }
  .seq-bar-col{ flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; height:100%; justify-content:flex-end; }
  .seq-bar{ width:100%; border-radius:6px 6px 3px 3px; position:relative; min-height:4px; transition:height 500ms cubic-bezier(.2,.8,.2,1); }
  .seq-bar-count{ font-size:11px; font-family:var(--font-mono); color:var(--ink-soft); }
  .seq-bar-label{ font-size:9.5px; color:var(--ink-faint); text-align:center; line-height:1.25; }
  .trend-chart{ width:100%; height:140px; }
  .activity-list, .deadline-list{ display:flex; flex-direction:column; gap:2px; }
  .activity-row, .deadline-row{ display:flex; align-items:center; gap:10px; padding:9px 4px; border-bottom:1px solid var(--border); }
  .activity-row:last-child, .deadline-row:last-child{ border-bottom:none; }
  .activity-row .dot{ width:7px; height:7px; border-radius:50%; background:var(--brand); flex:none; }
  .activity-row .txt{ font-size:12.5px; flex:1; }
  .activity-row .t{ font-size:10.5px; color:var(--ink-faint); font-family:var(--font-mono); flex:none; }
  .deadline-row .n{ font-size:12.5px; font-weight:600; flex:1; }
  .deadline-row .d{ font-size:11px; font-family:var(--font-mono); color:var(--ink-faint); }

  /* ---------- Toolbar (search/filter row) ---------- */
  .toolbar{ display:flex; align-items:center; gap:10px; margin-bottom:18px; flex-wrap:wrap; }
  .toolbar .input-icon-wrap{ flex:1; min-width:200px; }
  .filter-select{ padding:9px 12px; border-radius:999px; border:1.5px solid var(--border-strong); background:var(--bg-elevated); font-size:12.5px; font-weight:600; }

  /* ---------- Kanban ---------- */
  .kanban{ display:grid; grid-auto-flow:column; grid-auto-columns:246px; gap:14px; overflow-x:auto; padding-bottom:10px; }
  .kanban-col{ display:flex; flex-direction:column; gap:10px; min-height:200px; }
  .kanban-col-head{ display:flex; align-items:center; gap:8px; padding:2px 4px 8px; }
  .kanban-col-num{ width:20px; height:20px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:800; color:var(--ink); background:var(--bg-elevated); border:2px solid var(--border-strong); flex:none; }
  .kanban-col-title{ font-size:12px; font-weight:700; flex:1; }
  .kanban-col-count{ font-size:11px; color:var(--ink-faint); font-family:var(--font-mono); }
  .kanban-drop{ flex:1; display:flex; flex-direction:column; gap:10px; border-radius:var(--radius-md); padding:4px; min-height:120px; transition:background 150ms; }
  .kanban-drop.drag-over{ background:var(--brand-soft); }
  .paper-card{ padding:14px; cursor:pointer; transition:transform 150ms, box-shadow 150ms; }
  .paper-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-lg); }
  .paper-card.dragging{ opacity:.4; }
  .paper-card .grp-tag{ font-size:9.5px; text-transform:uppercase; letter-spacing:.4px; font-weight:700; color:var(--brand); margin-bottom:6px; }
  .paper-card .ptitle{ font-size:12.5px; font-weight:700; line-height:1.35; margin-bottom:10px; }
  .paper-card .pmeta{ display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
  .paper-card .avatars{ display:flex; }
  .paper-card .avatars .avatar-xs{ margin-left:-6px; border:2px solid var(--bg-elevated); }
  .paper-card .avatars .avatar-xs:first-child{ margin-left:0; }
  .progress-track{ height:6px; border-radius:99px; background:var(--border); overflow:hidden; position:relative; }
  .progress-fill{ height:100%; border-radius:99px; background:linear-gradient(90deg,var(--brand),var(--vital)); position:relative; transition:width 500ms cubic-bezier(.2,.8,.2,1); }
  .progress-fill::after{ content:""; position:absolute; right:-1px; top:50%; width:8px; height:8px; background:var(--vital); border-radius:50%; transform:translate(50%,-50%); box-shadow:0 0 0 3px var(--vital-soft); }
  .progress-pct{ font-size:10.5px; font-family:var(--font-mono); color:var(--ink-faint); margin-top:5px; text-align:right; }

  /* ---------- Grids: groups/tools/people ---------- */
  .card-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:14px; }
  .group-card{ padding:20px; display:flex; flex-direction:column; gap:10px; cursor:pointer; transition:transform 150ms, box-shadow 150ms; position:relative; }
  .group-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-lg); }
  .group-card-actions{ position:absolute; top:14px; right:14px; display:flex; gap:4px; }
  .group-card-actions .btn-icon{ width:28px; height:28px; background:var(--bg-elevated); }
  .group-deadline{ font-size:11px; color:var(--ink-faint); font-family:var(--font-mono); }
  .group-icon{ width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center; background:var(--brand-soft); color:var(--brand-deep); }
  .group-icon svg{ width:22px; height:22px; }
  .group-card h3{ font-size:15px; }
  .group-card .field-tag{ font-size:11px; color:var(--ink-faint); }
  .group-stats{ display:flex; gap:14px; margin-top:4px; }
  .group-stats .gs{ font-size:11px; color:var(--ink-soft); }
  .group-stats .gs b{ display:block; font-family:var(--font-mono); font-size:15px; color:var(--ink); }

  .tool-card{ padding:18px; display:flex; flex-direction:column; gap:10px; text-align:left; transition:transform 150ms, box-shadow 150ms, border-color 150ms; cursor:pointer; }
  .tool-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-lg); border-color:var(--brand); }
  .tool-icon{ width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center; }
  .tool-icon svg{ width:19px; height:19px; }
  .tool-card h4{ font-size:14px; }
  .tool-card p{ font-size:12px; color:var(--ink-soft); line-height:1.5; }
  .tool-card .phase-tag{ font-size:10px; font-weight:700; color:var(--brand); text-transform:uppercase; letter-spacing:.3px; }

  table.data-table{ width:100%; border-collapse:collapse; }
  .data-table thead th{ text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:.5px; color:var(--ink-faint); font-weight:700; padding:10px 12px; border-bottom:1.5px solid var(--border); }
  .data-table tbody td{ padding:12px; border-bottom:1px solid var(--border); font-size:13px; vertical-align:middle; }
  .data-table tbody tr:last-child td{ border-bottom:none; }
  .person-cell{ display:flex; align-items:center; gap:10px; }
  .person-cell .name{ font-weight:600; font-size:13px; }
  .person-cell .email{ font-size:11px; color:var(--ink-faint); font-family:var(--font-mono); }
  .row-actions{ display:flex; gap:6px; justify-content:flex-end; }

  /* ---------- Modal ---------- */
  .modal-backdrop{ position:fixed; inset:0; background:rgba(10,26,22,0.42); backdrop-filter:blur(3px); z-index:100; display:none; align-items:center; justify-content:center; padding:20px; }
  .modal-backdrop.show{ display:flex; }
  .modal{ width:100%; max-width:640px; max-height:88vh; overflow:auto; padding:0; }
  .modal.modal-lg{ max-width:920px; }
  .modal-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding:22px 24px 16px; position:sticky; top:0; background:var(--glass-strong); backdrop-filter:blur(16px); z-index:1; border-bottom:1px solid var(--border); }
  .modal-body{ padding:20px 24px 26px; }
  .modal-title{ font-size:18px; }
  .modal-eyebrow{ font-size:11px; text-transform:uppercase; letter-spacing:.6px; color:var(--brand); font-weight:700; margin-bottom:3px; }

  /* Paper detail modal specifics */
  .stepper{ display:flex; align-items:center; gap:4px; margin:6px 0 20px; overflow-x:auto; padding-bottom:4px; }
  .step{ display:flex; align-items:center; gap:6px; flex:none; }
  .step-dot{ width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:800; flex:none; border:2px solid var(--border-strong); color:var(--ink-faint); background:var(--bg-elevated); }
  .step.done .step-dot{ background:var(--vital); border-color:var(--vital); color:#fff; }
  .step.current .step-dot{ background:var(--brand); border-color:var(--brand); color:#fff; box-shadow:0 0 0 4px var(--brand-soft); }
  .step-label{ font-size:10.5px; color:var(--ink-faint); font-weight:600; white-space:nowrap; }
  .step.current .step-label, .step.done .step-label{ color:var(--ink); }
  .step-line{ width:20px; height:2px; background:var(--border-strong); flex:none; }
  .step.done + .step-line{ background:var(--vital); }

  .detail-grid{ display:grid; grid-template-columns:1.2fr 1fr; gap:22px; }
  .section-list{ display:flex; flex-direction:column; gap:8px; }
  .section-row{ display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:var(--radius-sm); border:1px solid var(--border); }
  .section-row .sname{ flex:1; font-size:13px; font-weight:600; }
  .status-dot{ width:9px; height:9px; border-radius:50%; flex:none; }
  .status-done{ background:var(--vital); } .status-progress{ background:var(--warning); } .status-none{ background:var(--ink-faint); opacity:.4; }

  .dropzone{ border:1.8px dashed var(--border-strong); border-radius:var(--radius-md); padding:22px; text-align:center; transition:border-color 150ms, background 150ms; }
  .dropzone.drag-over{ border-color:var(--brand); background:var(--brand-soft); }
  .dropzone svg{ width:26px; height:26px; color:var(--ink-faint); margin-bottom:8px; }
  .file-row{ display:flex; align-items:center; gap:10px; padding:9px 4px; border-bottom:1px solid var(--border); }
  .file-row:last-child{ border-bottom:none; }
  .file-icon{ width:30px; height:30px; border-radius:8px; background:var(--brand-soft); color:var(--brand-deep); display:flex; align-items:center; justify-content:center; flex:none; }
  .file-icon svg{ width:15px; height:15px; }
  .file-meta{ flex:1; min-width:0; }
  .file-meta .fn{ font-size:12.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .file-meta .fs{ font-size:10.5px; color:var(--ink-faint); font-family:var(--font-mono); }

  .assignee-row{ display:flex; align-items:center; gap:10px; padding:8px 0; }
  .assignee-row .who{ flex:1; }
  .assignee-row .who .n{ font-size:12.5px; font-weight:600; }
  .assignee-row .who .r{ font-size:10.5px; color:var(--ink-faint); }

  /* Tool panel output */
  .tool-output{ background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-md); padding:16px 18px; font-size:12.8px; line-height:1.7; }
  .tool-output h5{ font-family:var(--font-body); font-size:11px; text-transform:uppercase; letter-spacing:.5px; color:var(--brand); margin:0 0 6px; }
  .tool-output + .tool-output{ margin-top:12px; }
  .pico-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .pico-cell{ background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px; }
  .pico-cell .k{ font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.5px; color:var(--vital); margin-bottom:5px; }
  .pico-cell .v{ font-size:12.5px; }
  .validator-row{ display:flex; gap:10px; padding:10px; border-radius:var(--radius-sm); border:1px solid var(--border); margin-bottom:8px; }
  .note-row{ padding:10px 12px; border-radius:var(--radius-sm); border:1px solid var(--border); margin-bottom:8px; }
  .note-row .meta{ display:flex; justify-content:space-between; font-size:10.5px; color:var(--ink-faint); margin-bottom:4px; }
  .note-row .meta .who{ font-weight:700; color:var(--ink-soft); }
  .note-row .txt{ font-size:12.5px; line-height:1.5; }
  .reminder-row{ display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border-radius:var(--radius-sm); border:1px solid var(--border); margin-bottom:8px; }
  .reminder-row.done .txt{ text-decoration:line-through; color:var(--ink-faint); }
  .reminder-row input[type=checkbox]{ margin-top:2px; flex:none; width:16px; height:16px; accent-color:var(--vital); }
  .reminder-row .body{ flex:1; }
  .reminder-row .txt{ font-size:12.5px; font-weight:600; }
  .reminder-row .date{ font-size:10.5px; color:var(--ink-faint); font-family:var(--font-mono); margin-top:2px; }
  .checklist-row{ display:flex; align-items:flex-start; gap:10px; padding:9px 4px; border-bottom:1px solid var(--border); }
  .checklist-row:last-child{ border-bottom:none; }
  .checklist-row input[type=checkbox]{ margin-top:2px; flex:none; width:16px; height:16px; accent-color:var(--vital); }
  .checklist-row.checked .txt{ text-decoration:line-through; color:var(--ink-faint); }
  .add-inline-row{ display:flex; gap:6px; margin-top:4px; flex-wrap:wrap; }
  .add-inline-row .input{ flex:1; min-width:120px; }
  .template-card{ border:1.5px solid var(--border); border-radius:var(--radius-md); padding:14px; margin-bottom:10px; display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
  .template-card .match{ font-family:var(--font-mono); font-weight:700; color:var(--vital); font-size:13px; }

  /* ---------- Toasts ---------- */
  #toast-stack{ position:fixed; bottom:22px; right:22px; z-index:200; display:flex; flex-direction:column; gap:10px; max-width:320px; }
  .toast{ padding:12px 16px; display:flex; align-items:center; gap:10px; font-size:12.8px; font-weight:600; animation:toast-in 220ms ease; }
  .toast svg{ width:16px; height:16px; color:var(--vital); flex:none; }
  @keyframes toast-in{ from{ opacity:0; transform:translateY(8px);} to{opacity:1; transform:none;} }

  /* ---------- Responsive ---------- */
  @media (max-width: 1080px){
    .stat-grid{ grid-template-columns:repeat(2,1fr); }
    .analytics-grid{ grid-template-columns:1fr; }
    .detail-grid{ grid-template-columns:1fr; }
  }
  @media (max-width: 860px){
    .sidebar{ position:fixed; left:0; top:64px; z-index:39; background:var(--bg-elevated); box-shadow:var(--shadow-lg); transform:translateX(-100%); transition:transform 200ms ease; }
    .sidebar.open{ transform:translateX(0); }
    main.view-root{ padding:18px 16px 50px; }
    .global-search{ display:none; }
    .stat-grid{ grid-template-columns:1fr 1fr; }
  }
  @media (max-width: 560px){
    .stat-grid{ grid-template-columns:1fr; }
    .auth-card{ padding:26px 20px 22px; }
    .topbar{ padding:0 12px; gap:10px; }
  }
  .menu-btn{ display:none; }
  @media (max-width:860px){ .menu-btn{ display:inline-flex; } }

  /* ---------- Print / A4 PDF export ---------- */
  #print-area{ display:none; }
  @media print{
    @page{ size:A4; margin:18mm; }
    body *{ visibility:hidden; }
    #print-area, #print-area *{ visibility:visible; }
    #print-area{ display:block; position:absolute; left:0; top:0; width:100%; color:#12302B; background:#fff; font-family:var(--font-body); }
    #print-area h1{ font-family:var(--font-display); font-size:22px; margin-bottom:4px; }
    #print-area .p-meta{ font-size:11.5px; color:#4B6B63; margin-bottom:18px; }
    #print-area h2{ font-family:var(--font-display); font-size:14px; margin:18px 0 8px; border-bottom:1.5px solid #D8E6E1; padding-bottom:4px; }
    #print-area table{ width:100%; border-collapse:collapse; font-size:11.5px; }
    #print-area th, #print-area td{ text-align:left; padding:6px 8px; border-bottom:1px solid #D8E6E1; }
    #print-area ul{ margin:0; padding-left:18px; font-size:11.5px; }
    #print-area li{ margin-bottom:4px; }
  }
