/* Power & Sun MRS — application stylesheet (v2, mobile-first refresh). No external fonts or scripts. */
:root{--orange:#E9622B;--orange-d:#c84d1c;--orange-bg:#fff1ea;--amber:#F6A63A;--navy:#1E4F9E;--navy-2:#173f80;--navy-3:#12315f;--ink:#1c2230;--muted:#6b7280;--line:#e5e7eb;--line-2:#eef0f3;--bg:#f3f5f9;--card:#fff;--green:#15803d;--green-bg:#dcfce7;--amber-text:#b45309;--amber-bg:#fef3c7;--red:#b91c1c;--red-bg:#fee2e2;--blue:#1d4ed8;--blue-bg:#dbeafe;--teal:#0f766e;--teal-bg:#ccfbf1;--grey-bg:#e5e7eb;--radius:12px;--radius-sm:8px;--shadow:0 1px 2px rgba(16,24,40,.06),0 1px 3px rgba(16,24,40,.08);--shadow-lg:0 8px 24px rgba(16,24,40,.12);--focus:0 0 0 3px rgba(233,98,43,.28);--nav-h:58px}
*{box-sizing:border-box}html{font-size:15px;-webkit-text-size-adjust:100%}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;color:var(--ink);background:var(--bg);line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:var(--navy-2)}a:hover{color:var(--orange-d)}
h1{font-size:1.5rem;margin:.2rem 0 .6rem;letter-spacing:-.01em}h2{font-size:1.12rem;margin:0 0 .6rem;letter-spacing:-.01em}h3{font-size:.98rem;margin:1rem 0 .4rem}p{margin:.3rem 0 .7rem}
.muted{color:var(--muted)}.small{font-size:.85rem}.mt{margin-top:1rem}.right{text-align:right}.center{text-align:center}.nowrap{white-space:nowrap}.inline{display:inline}

/* ---- shell ---- */
.shell{display:flex;min-height:100vh}
.sidebar{width:252px;background:linear-gradient(180deg,var(--navy) 0%,var(--navy-3) 100%);color:#dbe3f5;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;overflow-y:auto;flex-shrink:0}
.brand{display:block;padding:.9rem 1rem .8rem;border-bottom:1px solid rgba(255,255,255,.08)}.brand-card{background:#fff;border-radius:10px;padding:.5rem .6rem}.brand-card img{width:100%;display:block}
.brand-mark{width:40px;height:40px;flex-shrink:0}.brand-mark img{width:40px;height:40px;display:block}.brand-logo{width:220px;max-width:100%;display:block;margin:0 auto .6rem}
.brand-name{font-weight:800;color:#fff;letter-spacing:.02em}.brand-name .p{color:var(--orange)}.brand-name .s{color:var(--amber)}.brand-sub{font-size:.72rem;opacity:.75}
.brand-lg{padding:0 0 1rem;border:0}.brand-lg .brand-name{color:var(--navy)}.brand-lg .brand-sub{color:var(--muted)}
.sidebar nav{padding:.5rem 0;flex:1}.nav-group{font-size:.66rem;text-transform:uppercase;letter-spacing:.14em;opacity:.55;padding:.9rem 1rem .3rem}
.sidebar nav a{display:flex;align-items:center;justify-content:space-between;padding:.5rem 1rem .5rem .9rem;color:#dbe3f5;text-decoration:none;font-size:.92rem;border-left:3px solid transparent;transition:background .15s}
.sidebar nav a:hover{background:rgba(255,255,255,.07);color:#fff}.sidebar nav a.active{background:rgba(255,255,255,.13);border-left-color:var(--amber);color:#fff;font-weight:600}
.badge{background:var(--orange);color:#fff;border-radius:99px;font-size:.68rem;padding:.08rem .45rem;font-weight:700;line-height:1.3}
.sidebar-foot{padding:1rem;border-top:1px solid rgba(255,255,255,.08);text-align:center}.group-name{font-size:.7rem;letter-spacing:.1em;text-transform:uppercase;opacity:.7}.group-logos{display:grid;grid-template-columns:1fr 1fr;gap:.4rem;margin:.45rem 0}.group-card{background:#fff;border-radius:8px;padding:.3rem .4rem;display:flex;align-items:center;justify-content:center;height:44px}.group-card img{max-width:100%;max-height:100%;width:auto;height:auto;display:block}.group-sub{font-size:.66rem;opacity:.6;letter-spacing:.06em}
.sidebar-foot .foot-links{margin-top:.5rem;font-size:.7rem}.sidebar-foot .foot-links a{color:#c7d3ec}
.main{flex:1;display:flex;flex-direction:column;min-width:0}
.topbar{display:flex;align-items:center;gap:.8rem;background:#fff;border-bottom:3px solid var(--amber);padding:.55rem 1.2rem;position:sticky;top:0;z-index:15;min-height:var(--nav-h)}
.topbar-title{font-weight:700;font-size:1.05rem;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar-right{display:flex;align-items:center;gap:.7rem}.clock{font-size:.78rem;color:var(--muted);white-space:nowrap}
.icon-btn{display:none;background:none;border:1px solid var(--line);border-radius:8px;font-size:1.1rem;padding:.2rem .55rem;cursor:pointer;line-height:1.4}
.js-back{white-space:nowrap}
.user-chip{display:flex;align-items:center;gap:.5rem;text-decoration:none;color:inherit}.user-meta{display:flex;flex-direction:column;line-height:1.15}.user-meta small{color:var(--muted);font-size:.72rem}
.avatar{width:34px;height:34px;border-radius:50%;background:var(--navy-2);color:#fff;display:flex;align-items:center;justify-content:center;font-size:.8rem;font-weight:700;flex-shrink:0}
.content{padding:1.2rem;flex:1}.foot{padding:.8rem 1.2rem;font-size:.72rem;color:var(--muted);border-top:1px solid var(--line);display:flex;gap:.8rem;flex-wrap:wrap;justify-content:space-between}
.topsearch{display:flex;gap:.3rem}.topsearch input{width:230px;padding:.4rem .7rem;border:1px solid var(--line);border-radius:99px;font:inherit;font-size:.85rem;background:#f8fafc}.topsearch input:focus{background:#fff}
.search-toggle{display:none}

/* ---- cards & grids ---- */
.card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:1.1rem 1.2rem;margin-bottom:1.1rem;border:1px solid rgba(16,24,40,.04)}.card.narrow{max-width:560px}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:.6rem}.card-head h2{margin:0}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:1.1rem}.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:1.1rem}.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem}
.stat{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:.9rem 1rem;border:1px solid rgba(16,24,40,.04)}.stat .label{font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}.stat .value{font-size:1.6rem;font-weight:700;margin:.1rem 0;color:var(--navy);letter-spacing:-.02em}.stat .sub{font-size:.8rem;color:var(--muted)}
.stat.ok .value{color:var(--green)}.stat.warn .value{color:#b45309}.stat.bad .value{color:var(--red)}

/* ---- tables ---- */
.table{width:100%;border-collapse:collapse;font-size:.9rem}.table th,.table td{padding:.55rem .6rem;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}.table th{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);background:#f8fafc;position:sticky;top:0}
.table.small{font-size:.83rem}.table tbody tr:hover td,.table tr:hover td{background:#fbfcfe}.table tfoot td{font-weight:700;background:#f8fafc}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:var(--radius-sm)}
.pill{display:inline-block;padding:.12rem .58rem;border-radius:99px;font-size:.73rem;font-weight:600;white-space:nowrap;line-height:1.5}
.pill-green{background:var(--green-bg);color:var(--green)}.pill-amber{background:#fdecd2;color:#9a5a00}.pill-red{background:var(--red-bg);color:var(--red)}.pill-blue{background:var(--blue-bg);color:var(--blue)}.pill-teal{background:var(--teal-bg);color:var(--teal)}.pill-grey{background:var(--grey-bg);color:#374151}

/* ---- buttons ---- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.35rem;border:1px solid var(--line);background:#fff;color:var(--ink);padding:.48rem .95rem;border-radius:var(--radius-sm);font-size:.9rem;font-weight:500;cursor:pointer;text-decoration:none;line-height:1.3;transition:background .15s,box-shadow .15s;white-space:nowrap}
.btn:hover{background:#f3f4f6;color:var(--ink)}.btn:focus-visible{outline:none;box-shadow:var(--focus)}.btn:disabled{opacity:.5;cursor:not-allowed}
.btn-primary{background:var(--orange);border-color:var(--orange);color:#fff}.btn-primary:hover{background:var(--orange-d);border-color:var(--orange-d);color:#fff}
.btn-dark{background:var(--navy);border-color:var(--navy);color:#fff}.btn-dark:hover{background:var(--navy-2);color:#fff}
.btn-danger{background:#fff;border-color:#fecaca;color:var(--red)}.btn-danger:hover{background:var(--red-bg)}
.btn-ghost{background:transparent;border-color:transparent;color:var(--muted)}.btn-ghost:hover{background:#f3f4f6;color:var(--ink)}
.btn-sm{padding:.28rem .62rem;font-size:.8rem}.btn-lg{padding:.75rem 1.3rem;font-size:1.02rem;font-weight:600}.btn-block{width:100%}
.stack{display:flex;flex-direction:column;gap:.8rem}

/* ---- forms ---- */
label{display:flex;flex-direction:column;gap:.25rem;font-size:.88rem;font-weight:600}label .help{font-weight:400;color:var(--muted);font-size:.8rem}
input[type=text],input[type=password],input[type=number],input[type=date],input[type=month],input[type=time],input[type=search],input[type=email],select,textarea{width:100%;padding:.52rem .65rem;border:1px solid #cfd4dc;border-radius:var(--radius-sm);font:inherit;font-size:.92rem;background:#fff;color:var(--ink);min-height:40px}
input[type=file]{font-size:.85rem}
textarea{min-height:90px;resize:vertical}input:focus,select:focus,textarea:focus{outline:none;box-shadow:var(--focus);border-color:var(--orange)}
input[readonly],.computed{background:#f3f4f6;color:#374151}input.is-invalid,select.is-invalid{border-color:var(--red)}
.check{flex-direction:row;align-items:flex-start;gap:.6rem;font-weight:500}.check input{width:auto;margin-top:.25rem;min-height:0}
.form-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:.85rem 1rem}.form-grid>*{min-width:0}.section-body,.card{min-width:0}.table-wrap{max-width:100%}.form-grid .span-2{grid-column:span 2}.form-grid .span-all{grid-column:1/-1}
.filters{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center;margin-bottom:.9rem}.filters input,.filters select{width:auto;min-width:150px}
.flash{padding:.75rem .95rem;border-radius:var(--radius-sm);margin-bottom:.9rem;font-size:.9rem;border:1px solid transparent}.flash ul{margin:.3rem 0 0 1rem}.flash-ok{background:var(--green-bg);color:var(--green);border-color:#bbf7d0}.flash-warn{background:#fdecd2;color:#9a5a00;border-color:#fcd9b0}.flash-err{background:var(--red-bg);color:var(--red);border-color:#fecaca}
.dl{display:grid;grid-template-columns:max-content 1fr;gap:.35rem 1rem;font-size:.9rem}.dl dt{color:var(--muted)}.dl dd{margin:0;min-width:0;overflow-wrap:anywhere}

/* ---- guest ---- */
.guest{background:radial-gradient(circle at 20% 20%,#2a63b8 0%,var(--navy) 45%,var(--navy-3) 100%);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:1rem}.guest-wrap{width:100%;max-width:440px}
.guest-card{background:#fff;border-radius:16px;padding:1.6rem 1.5rem 1.4rem;box-shadow:var(--shadow-lg)}.guest-group{display:flex;align-items:center;justify-content:center;gap:.5rem;margin-top:1rem;color:#dbe3f5;font-size:.8rem}.guest-group img{height:26px;background:#fff;border-radius:6px;padding:.15rem .4rem}.guest-foot{color:#c7d3ec;font-size:.72rem;text-align:center;margin-top:.7rem}.guest-foot a{color:#fff}

/* ---- dashboard ---- */
.due-list{display:flex;flex-direction:column;gap:.6rem}.due{display:flex;align-items:center;gap:.9rem;padding:.7rem .9rem;border:1px solid var(--line);border-radius:10px;background:#fff}.due.overdue{border-color:#fecaca;background:#fff7f7}.due .meta{flex:1;min-width:0}.due small{display:block;color:var(--muted)}
.howto{background:linear-gradient(135deg,#fff7f2,#fff);border:1px solid #fbd9c4}.howto ol{margin:.3rem 0 .4rem 1.1rem;padding:0}.howto li{margin:.15rem 0}
.task-row.overdue td{background:#fff7f5}.prio-Critical{color:var(--red);font-weight:700}.prio-High{color:#b45309;font-weight:600}.task-mini{display:flex;justify-content:space-between;gap:.6rem;padding:.4rem 0;border-bottom:1px solid #f1f3f6;font-size:.86rem}.task-mini:last-child{border:0}
.checkin-card{background:linear-gradient(135deg,#f5f8ff,#fff);border:1px solid #d6e2f7}

/* ---- report forms ---- */
.section{border:1px solid var(--line);border-radius:var(--radius);margin-bottom:1rem;background:#fff;box-shadow:var(--shadow)}.section-head{padding:.75rem 1rem;background:#f8fafc;border-bottom:1px solid var(--line);border-radius:var(--radius) var(--radius) 0 0}.section-head h3{margin:0;font-size:1rem}.section-head p{margin:.25rem 0 0;color:var(--muted);font-size:.83rem}.section-body{padding:1rem}
.note{background:#fffbeb;border-left:3px solid #f59e0b;padding:.55rem .75rem;font-size:.85rem;border-radius:0 6px 6px 0}
.ftable{width:100%;border-collapse:collapse;font-size:.85rem}.ftable th{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);padding:.35rem .3rem;text-align:left;border-bottom:1px solid var(--line);white-space:nowrap}.ftable td{padding:.25rem .2rem;vertical-align:top}.ftable td input,.ftable td select{padding:.35rem .4rem;min-height:34px;font-size:.85rem}.ftable td.rowlabel{font-weight:600;font-size:.82rem;padding-top:.5rem;min-width:140px}
.ftable .rm{color:var(--red);background:none;border:0;cursor:pointer;font-size:1.05rem;padding:0 .3rem}
.ftable-view td{padding:.35rem .4rem}
.view-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:.5rem 1.2rem}.view-grid .kv{display:flex;flex-direction:column;padding:.35rem 0;border-bottom:1px dashed #eef0f3}.view-grid .kv .k{font-size:.75rem;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}.view-grid .kv.span-all{grid-column:1/-1}
.stars{color:#f59e0b;letter-spacing:.05em}
.notice{display:flex;justify-content:space-between;gap:1rem;padding:.7rem .8rem;border:1px solid var(--line);border-radius:8px;margin-bottom:.5rem}.notice.read{opacity:.65}.notice.level-3,.notice.level-4{border-color:#fecaca;background:#fff7f7}.notice .actions{display:flex;gap:.4rem;align-items:flex-start}
.timeline{list-style:none;padding:0;margin:0}.timeline li{padding:.45rem 0;border-bottom:1px solid #f1f3f6;font-size:.88rem}
.progress{height:8px;background:#e5e7eb;border-radius:99px;overflow:hidden}.progress span{display:block;height:100%;background:var(--green)}.progress.warn span{background:#f59e0b}.progress.bad span{background:var(--red)}
.sticky-actions{position:sticky;bottom:0;background:#fff;border-top:1px solid var(--line);padding:.7rem 1rem;display:flex;gap:.5rem;align-items:center;justify-content:flex-end;flex-wrap:wrap;border-radius:0 0 var(--radius) var(--radius);z-index:6;box-shadow:0 -4px 12px rgba(16,24,40,.06)}
.legend{font-size:.8rem;color:var(--muted)}.kbd{font-family:ui-monospace,Menlo,monospace;background:#f3f4f6;padding:.05rem .3rem;border-radius:4px;font-size:.85em}
pre.code{background:#0f172a;color:#e2e8f0;padding:1rem;border-radius:8px;overflow:auto;font-size:.8rem}textarea.code{font-family:ui-monospace,Menlo,monospace;font-size:.8rem;min-height:420px}
.tabs{display:flex;gap:.3rem;border-bottom:1px solid var(--line);margin-bottom:1rem;overflow-x:auto}.tabs a{padding:.5rem .8rem;text-decoration:none;color:var(--muted);border-bottom:2px solid transparent;font-weight:600;white-space:nowrap}.tabs a.active{color:var(--navy);border-bottom-color:var(--orange)}
th.sortable a{color:inherit;text-decoration:none;white-space:nowrap}th.sortable a:hover{color:var(--orange)}th.sortable.active a{color:var(--navy)}.sort-idle{opacity:.35;font-size:.7rem}.sort-on{color:var(--orange);font-size:.7rem}
input.computed.rag-G{background:var(--green-bg);color:var(--green);font-weight:700;text-align:center}input.computed.rag-A{background:#fdecd2;color:#9a5a00;font-weight:700;text-align:center}input.computed.rag-R{background:var(--red-bg);color:var(--red);font-weight:700;text-align:center}
.duration{display:inline-flex;align-items:center;gap:.25rem;white-space:nowrap}.duration input,.duration select{padding:.35rem .4rem;min-height:34px}
.pagination ul{list-style:none;display:flex;gap:.3rem;padding:0;margin:.8rem 0 0;flex-wrap:wrap;align-items:center}.pagination li a,.pagination li span{display:inline-block;padding:.25rem .6rem;border:1px solid var(--line);border-radius:6px;font-size:.85rem;background:#fff;text-decoration:none}.pagination li.active span{background:var(--navy);color:#fff;border-color:var(--navy)}.pagination li.disabled span,.pagination li.muted span{color:var(--muted);border-color:transparent;background:transparent}
.bar{display:inline-block;width:80px;height:6px;background:#e5e7eb;border-radius:3px;vertical-align:middle;margin-left:.3rem;overflow:hidden}.bar span{display:block;height:100%}.bar-navy{background:var(--navy)}.bar-green{background:var(--green)}.bar-amber{background:#f59e0b}.bar-red{background:var(--red)}
[hidden]{display:none!important}

/* ---- step-by-step report form ---- */
.stepper{display:flex;gap:.35rem;list-style:none;padding:0 0 .2rem;margin:0 0 1rem;overflow-x:auto;scrollbar-width:thin;max-width:100%;min-width:0;-webkit-overflow-scrolling:touch}.stepper li{flex-shrink:0}.stepper button{display:flex;align-items:center;gap:.4rem;border:1px solid var(--line);background:#fff;border-radius:99px;padding:.32rem .75rem .32rem .35rem;font:inherit;font-size:.8rem;color:var(--muted);cursor:pointer;white-space:nowrap}
.stepper button .n{width:22px;height:22px;border-radius:50%;background:#e5e7eb;color:#374151;display:inline-flex;align-items:center;justify-content:center;font-size:.72rem;font-weight:700}
.stepper button.active{border-color:var(--orange);color:var(--ink);background:var(--orange-bg);font-weight:600}.stepper button.active .n{background:var(--orange);color:#fff}.stepper button.done .n{background:var(--green);color:#fff}.stepper button.has-error{border-color:#fecaca;color:var(--red)}
.step-progress{height:5px;background:#e5e7eb;border-radius:99px;overflow:hidden;margin:-.4rem 0 1rem}.step-progress span{display:block;height:100%;background:linear-gradient(90deg,var(--orange),var(--amber));transition:width .25s}
.js-form{min-width:0;max-width:100%}.kbd{overflow-wrap:anywhere}.js-form.stepped .section.step{display:none}.js-form.stepped .section.step.current{display:block}
.step-meta{font-size:.8rem;color:var(--muted);margin-right:auto}

/* ---- cookie notice ---- */
.cookie-notice{position:fixed;left:1rem;right:1rem;bottom:1rem;z-index:40;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-lg);padding:.8rem 1rem;display:flex;gap:1rem;align-items:center;font-size:.85rem;max-width:760px;margin:0 auto}

/* ---- mobile bottom navigation & drawer ---- */
.bottom-nav{display:none}
.drawer-overlay{display:none;position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:19}
.drawer-overlay.show{display:block}

@media (max-width:1100px){.grid-4{grid-template-columns:1fr 1fr}.grid-3{grid-template-columns:1fr 1fr}}
@media (max-width:960px){.grid-2{grid-template-columns:1fr}.topsearch input{width:170px}}
@media (max-width:760px){
  html{font-size:15.5px}
  .sidebar{position:fixed;left:-270px;top:0;bottom:0;height:100%;width:270px;transition:left .22s;z-index:20;box-shadow:none}.sidebar.open{left:0;box-shadow:var(--shadow-lg)}
  .icon-btn{display:block}.topsearch{display:none}.search-toggle{display:block}.topbar.search-open .topsearch{display:flex;position:absolute;left:0;right:0;top:100%;background:#fff;padding:.5rem .8rem;border-bottom:1px solid var(--line)}.topbar.search-open .topsearch input{flex:1;width:auto}
  .topbar{padding:.5rem .8rem;gap:.5rem}.user-meta{display:none}.clock{display:none}.topbar .btn-ghost.js-back{padding:.25rem .4rem}
  .content{padding:.8rem;padding-bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + 1.2rem)}.card{padding:.9rem .95rem;border-radius:10px}.grid-2,.grid-3,.grid-4{grid-template-columns:1fr}
  .form-grid{grid-template-columns:1fr}.form-grid .span-2{grid-column:auto}.filters input,.filters select{min-width:0;flex:1 1 140px}.filters .btn{flex:0 0 auto}
  .card-head{gap:.5rem}.card-head>div{display:flex;gap:.4rem;flex-wrap:wrap}
  .dl{grid-template-columns:1fr}.dl dt{margin-top:.3rem;font-size:.75rem;text-transform:uppercase;letter-spacing:.05em}
  .sticky-actions{bottom:calc(var(--nav-h) + env(safe-area-inset-bottom));border-radius:0;margin:0 -.8rem;padding:.6rem .8rem;max-width:calc(100% + 1.6rem)}.sticky-actions .legend{display:none}.sticky-actions .btn{flex:1 1 auto}
  .foot{padding-bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + .8rem)}
  .bottom-nav{display:flex;position:fixed;left:0;right:0;bottom:0;height:calc(var(--nav-h) + env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line);z-index:18;justify-content:space-around;align-items:stretch;box-shadow:0 -4px 14px rgba(16,24,40,.08);padding-bottom:env(safe-area-inset-bottom)}
  .bottom-nav a,.bottom-nav button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.1rem;font-size:.66rem;color:var(--muted);text-decoration:none;background:none;border:0;font-family:inherit;cursor:pointer;position:relative}
  .bottom-nav .ic{font-size:1.25rem;line-height:1}.bottom-nav a.active{color:var(--orange);font-weight:600}.bottom-nav .badge{position:absolute;top:6px;right:18%}
  .cookie-notice{left:.6rem;right:.6rem;bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + .6rem);flex-direction:column;align-items:stretch;gap:.6rem}
  .stat .value{font-size:1.35rem}.table{font-size:.85rem}.table th,.table td{padding:.45rem .5rem}
}
@media print{.sidebar,.topbar,.foot,.sticky-actions,.btn,.filters,.bottom-nav,.cookie-notice,.stepper,.step-progress{display:none!important}.content{padding:0}.card,.section{box-shadow:none;border:1px solid #ccc;break-inside:avoid}body{background:#fff}.js-form.stepped .section.step{display:block!important}}

/* ---- colour codes ---- */
.pill-navy{background:#dbe5f7;color:var(--navy)}
.due.due-soon{border-color:#fcd9b0;background:#fffaf3}.due.on-track{border-left:4px solid var(--green)}.due.overdue{border-left:4px solid var(--red)}.due.due-soon{border-left:4px solid var(--amber)}
.due .freq{display:none}
.score-g{color:var(--green);font-weight:700}.score-a{color:#9a5a00;font-weight:700}.score-r{color:var(--red);font-weight:700}
tr.row-late td{background:#fffaf3}tr.row-missing td,tr.row-overdue td{background:#fff5f5}tr.row-exempt td{color:var(--muted)}
.legend-codes{display:flex;gap:.5rem .9rem;flex-wrap:wrap;font-size:.78rem;color:var(--muted);align-items:center}.legend-codes .pill{font-size:.7rem}
.prio-Critical,.prio-High{font-weight:600}
.cookie-notice.above-actions{bottom:auto;top:calc(var(--nav-h) + .6rem)}

.pill-purple{background:#ece6fb;color:#4c2d9c}

.date-dmy{display:inline-block;margin-left:.35rem;font-size:.78rem;color:var(--muted);font-variant-numeric:tabular-nums}.date-dmy.empty{opacity:.6}

/* ---- v3 polish: elegant, calmer surfaces, clearer hierarchy ---- */
:root{--radius:14px;--radius-sm:9px;--shadow:0 1px 2px rgba(16,24,40,.04),0 6px 18px -8px rgba(16,24,40,.12);--shadow-lg:0 20px 50px -20px rgba(16,24,40,.35);--focus:0 0 0 3px rgba(233,98,43,.22);--gold-bg:#fbf1d6;--gold:#7a5a00}
body{background:linear-gradient(180deg,#f6f8fc 0%,#f1f4f9 100%) fixed;letter-spacing:.005em}
h1,h2{color:var(--navy-3);font-weight:750}h2{font-size:1.15rem}h3{color:#26324a;font-weight:700;text-transform:none}
.card{border-radius:var(--radius);border:1px solid rgba(30,79,158,.07);box-shadow:var(--shadow);padding:1.2rem 1.35rem}
.card-head{padding-bottom:.55rem;border-bottom:1px solid var(--line-2);margin-bottom:.8rem}
.sidebar{background:linear-gradient(175deg,#1d4d9c 0%,#153b78 55%,#10305e 100%)}
.sidebar nav a{margin:.1rem .55rem;border-radius:9px;border-left:0;padding:.5rem .8rem}.sidebar nav a.active{background:rgba(255,255,255,.16);box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}.sidebar nav a:hover{background:rgba(255,255,255,.1)}
.nav-group{padding:1rem 1.3rem .35rem;opacity:.5}
.topbar{background:rgba(255,255,255,.92);backdrop-filter:saturate(1.4) blur(10px);border-bottom:1px solid var(--line);box-shadow:0 1px 0 rgba(233,98,43,.35),0 6px 20px -16px rgba(16,24,40,.25)}
.topbar-title{color:var(--navy-3);letter-spacing:-.01em}
.avatar{background:linear-gradient(135deg,var(--orange),var(--amber));box-shadow:0 2px 6px rgba(233,98,43,.35)}
.btn{border-radius:10px;box-shadow:0 1px 1px rgba(16,24,40,.04)}.btn-primary{background:linear-gradient(180deg,#ee6c36,var(--orange));box-shadow:0 2px 8px -2px rgba(233,98,43,.55)}.btn-primary:hover{background:var(--orange-d)}
.btn-dark{background:linear-gradient(180deg,#245aac,var(--navy))}.btn-ghost{box-shadow:none}
input[type=text],input[type=password],input[type=number],input[type=date],input[type=month],input[type=time],input[type=search],input[type=email],input[type=url],select,textarea{border-radius:10px;border-color:#d5dae3;background:#fbfcfe;transition:border-color .15s,box-shadow .15s,background .15s}
input:focus,select:focus,textarea:focus{background:#fff}input[type=url]{width:100%;padding:.52rem .65rem;border:1px solid #d5dae3;border-radius:10px;font:inherit;font-size:.92rem;min-height:40px}
label{color:#2b3548}label .help{line-height:1.35}
.table th{background:#f4f6fa;color:#4b5563;letter-spacing:.07em;border-bottom:2px solid #e3e7ee}.table td{border-bottom:1px solid #eef1f5}.table tbody tr:nth-child(even) td,.table tr:nth-child(even) td{background:#fbfcfe}.table tr:hover td{background:#f5f8ff}
.pill{font-weight:650;letter-spacing:.01em;padding:.15rem .62rem}.pill-gold{background:var(--gold-bg);color:var(--gold)}
.stat{border-radius:var(--radius);background:linear-gradient(180deg,#fff,#fbfcff)}.stat .value{font-weight:800;color:var(--navy-3)}
.section{border-radius:var(--radius);border:1px solid rgba(30,79,158,.08)}.section-head{background:linear-gradient(180deg,#f8fafd,#f2f5fa);border-radius:var(--radius) var(--radius) 0 0}.section-head h3{color:var(--navy-3);font-size:1.02rem}
.note{border-radius:0 10px 10px 0;background:#fffaf0}
.flash{border-radius:10px;box-shadow:0 2px 8px -4px rgba(16,24,40,.12)}
.due{border-radius:11px;transition:box-shadow .15s,transform .15s}.due:hover{box-shadow:var(--shadow);transform:translateY(-1px)}
.guest{background:radial-gradient(circle at 15% 15%,#2f6dc4 0%,#1e4f9e 40%,#0f2c57 100%)}.guest-card{border-radius:20px;padding:1.9rem 1.7rem 1.6rem;box-shadow:0 30px 70px -25px rgba(0,0,0,.55)}
.guest-card h2,.guest-card h1{color:var(--navy-3)}
.pw-wrap{position:relative;display:flex;align-items:center}.pw-wrap input{padding-right:2.6rem;flex:1}.pw-eye{position:absolute;right:.35rem;top:50%;transform:translateY(-50%);border:0;background:transparent;cursor:pointer;font-size:1.05rem;line-height:1;padding:.3rem .45rem;border-radius:8px;color:var(--muted)}.pw-eye:hover{background:#f3f4f6;color:var(--ink)}.pw-eye.on{color:var(--orange)}
.plan-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:1.1rem;align-items:start}.plan-col .due{margin-bottom:.5rem}.plan-annual{border-top:4px solid var(--gold)}.plan-quarterly{border-top:4px solid #4c2d9c}.plan-monthly{border-top:4px solid var(--navy)}.plan-weekly{border-top:4px solid var(--teal)}.plan-daily{border-top:4px solid var(--blue)}
.matrix td,.matrix th{white-space:nowrap}.matrix td:first-child{white-space:normal;min-width:220px}
.foot{background:transparent}
@media (max-width:760px){.card{padding:1rem 1rem;border-radius:12px}.sidebar nav a{margin:.1rem .4rem}}

/* ---- brand: smaller logo, larger system name ---- */
.brand-card{padding:.35rem .5rem;max-width:199px;margin:0 auto}.brand-card img{width:100%}
.sidebar .brand-sub{font-size:1.02rem;font-weight:800;color:#fff;opacity:1;letter-spacing:.02em;line-height:1.25;margin-top:.5rem!important}
.brand-logo{width:150px;margin:0 auto .5rem}
.brand-lg .brand-name{font-size:1.32rem;font-weight:800;letter-spacing:.01em;line-height:1.2}.brand-lg .brand-sub{font-size:.8rem}

img.avatar{border-radius:50%;display:inline-block;flex-shrink:0;box-shadow:0 2px 6px rgba(16,24,40,.2)}.avatar-lg{border:3px solid #fff;box-shadow:0 4px 14px -4px rgba(16,24,40,.35)}

.budget-grid td input{min-width:80px;width:88px;padding:.25rem .3rem;min-height:30px;font-size:.8rem;text-align:right}.budget-grid td{white-space:nowrap;padding:.25rem .35rem;text-align:right}.budget-grid td:first-child,.budget-grid td:nth-child(2){text-align:left}.budget-grid tr.var-row td{font-size:.78rem;border-bottom:2px solid #e3e7ee}.budget-grid tr.plan-row td:first-child{vertical-align:middle}
/* v3.1 — getting-started flow, manual layout */
.flow{display:flex;flex-wrap:wrap;gap:.5rem;align-items:stretch;margin:.6rem 0 1rem}.flow .step{flex:1 1 150px;min-width:150px;background:linear-gradient(180deg,#fff,#f6f8fb);border:1px solid var(--line);border-radius:12px;padding:.6rem .7rem;position:relative}.flow .step .n{display:inline-block;width:22px;height:22px;border-radius:50%;background:var(--orange);color:#fff;font-weight:800;font-size:.75rem;text-align:center;line-height:22px;margin-right:.35rem}.flow .step strong{display:block;margin:.25rem 0 .2rem;color:var(--navy)}.flow .step .small{line-height:1.35}.flow .step .who{display:block;margin-top:.35rem;font-size:.72rem;color:var(--muted);text-transform:uppercase;letter-spacing:.03em}.flow .step::after{content:"›";position:absolute;right:-.55rem;top:38%;font-size:1.3rem;color:var(--muted)}.flow .step:last-child::after{content:""}
.checklist{list-style:none;padding:0;margin:.3rem 0}.checklist li{padding:.35rem 0 .35rem 1.7rem;position:relative;border-bottom:1px dashed var(--line)}.checklist li::before{content:"☐";position:absolute;left:.2rem;top:.3rem;color:var(--orange);font-weight:700}
.manual-layout{display:grid;grid-template-columns:260px 1fr;gap:1.2rem;align-items:start}.manual-toc{position:sticky;top:70px;max-height:calc(100vh - 90px);overflow:auto;border-right:1px solid var(--line);padding-right:.6rem}.manual-toc ul{list-style:none;padding:0;margin:.3rem 0}.manual-toc li{margin:.15rem 0}.manual-toc .toc-2{padding-left:.6rem}.manual-toc .toc-3{padding-left:1.3rem;font-size:.8rem}.manual-body h2{margin-top:1.6rem;border-bottom:1px solid var(--line);padding-bottom:.25rem}.manual-body h3{margin-top:1.1rem}.manual-body h4{margin-top:.9rem}.manual-body code{background:#f1f3f7;padding:.05rem .3rem;border-radius:4px;font-size:.85em}.manual-body p,.manual-body li{max-width:80ch;line-height:1.55}
@media (max-width:900px){.manual-layout{grid-template-columns:1fr}.manual-toc{position:static;max-height:none;border-right:0}}
/* v3.1 — video guide */
.video-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:1.2rem;align-items:start}.guide-video{width:100%;aspect-ratio:16/10;background:#0f2a55;border-radius:12px;box-shadow:0 10px 30px rgba(15,42,85,.25)}
.video-chapters{max-height:70vh;overflow:auto;border-left:1px solid var(--line);padding-left:1rem}.chapter-list{list-style:none;padding:0;margin:0;counter-reset:ch}.chapter-list li{margin:0}.chapter-list a{display:flex;gap:.5rem;align-items:baseline;padding:.32rem .4rem;border-radius:8px;text-decoration:none;color:var(--text,#1d2733);font-size:.86rem;line-height:1.3}.chapter-list a:hover{background:#f1f4f9}.chapter-list a.current{background:#fff1e8;color:#a33d0d;font-weight:700}.chapter-list a.chapter-head{font-weight:700;margin-top:.35rem;color:var(--navy)}.chapter-list .ts{font-variant-numeric:tabular-nums;color:var(--muted);min-width:44px;font-size:.78rem}
@media (max-width:900px){.video-layout{grid-template-columns:1fr}.video-chapters{border-left:0;padding-left:0;max-height:none}}
/* v3.1 — appearance switch (sidebar) */
.theme-switch{display:flex;gap:.2rem;margin:.6rem 0 .2rem;background:rgba(255,255,255,.09);border-radius:10px;padding:.2rem}.theme-switch button{flex:1;border:0;background:transparent;color:#c7d3ec;font:inherit;font-size:.72rem;font-weight:600;padding:.32rem .2rem;border-radius:8px;cursor:pointer;white-space:nowrap}.theme-switch button:hover{color:#fff;background:rgba(255,255,255,.08)}.theme-switch button.active{background:#fff;color:#12315f;box-shadow:0 1px 3px rgba(0,0,0,.25)}
/* v3.1 — dark theme (html[data-theme=dark], resolved by js/theme.js from the light / dark / system choice) */
html[data-theme=dark]{--bg:#0f1626;--card:#182238;--ink:#e6eaf3;--muted:#98a3b8;--line:#2b3650;--line-2:#25304a;--navy:#9dbbf0;--navy-2:#2b5aa6;--navy-3:#0b1a36;--orange-bg:#3b2114;--green:#5ee49a;--green-bg:#123524;--amber-text:#f6c15b;--amber-bg:#3a2a0a;--red:#ff8a8a;--red-bg:#43201f;--blue:#93c5fd;--blue-bg:#1c3559;--teal:#6ee7d5;--teal-bg:#10403b;--grey-bg:#2e3950;--gold:#f3d67f;--gold-bg:#3a2f10;--shadow:0 1px 2px rgba(0,0,0,.35),0 6px 18px -8px rgba(0,0,0,.55);--shadow-lg:0 20px 50px -20px rgba(0,0,0,.75);color-scheme:dark}
html[data-theme=dark] body{background:linear-gradient(180deg,#0f1626 0%,#0b1120 100%) fixed;color:var(--ink)}
html[data-theme=dark] a{color:#a9c6f5}html[data-theme=dark] .sidebar nav a,html[data-theme=dark] .btn,html[data-theme=dark] .bottom-nav a{color:inherit}html[data-theme=dark] .sidebar nav a{color:#dbe3f5}
html[data-theme=dark] .card,html[data-theme=dark] .stat,html[data-theme=dark] .section,html[data-theme=dark] .due,html[data-theme=dark] .sticky-actions,html[data-theme=dark] .pagination li a,html[data-theme=dark] .pagination li span,html[data-theme=dark] .stepper button,html[data-theme=dark] .cookie-notice,html[data-theme=dark] .bottom-nav,html[data-theme=dark] .guest-card{background:var(--card);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .btn{background:#1f2a44;color:var(--ink);border-color:#34405c}html[data-theme=dark] .btn:hover,html[data-theme=dark] .btn-ghost:hover{background:#2a3754;color:#fff}html[data-theme=dark] .btn-dark{background:linear-gradient(180deg,#2f63b8,#1e4f9e);border-color:#2f63b8;color:#fff}html[data-theme=dark] .btn-primary{color:#fff}
html[data-theme=dark] .topbar{background:rgba(17,26,44,.94);border-bottom-color:var(--line)}html[data-theme=dark] .topsearch input{background:#0f1626;color:var(--ink);border-color:var(--line)}
html[data-theme=dark] input[type=text],html[data-theme=dark] input[type=password],html[data-theme=dark] input[type=number],html[data-theme=dark] input[type=date],html[data-theme=dark] input[type=month],html[data-theme=dark] input[type=time],html[data-theme=dark] input[type=datetime-local],html[data-theme=dark] input[type=email],html[data-theme=dark] input[type=search],html[data-theme=dark] input[type=url],html[data-theme=dark] input[type=tel],html[data-theme=dark] select,html[data-theme=dark] textarea{background:#0f1626;color:var(--ink);border-color:#3a4763}
html[data-theme=dark] input[readonly],html[data-theme=dark] .computed{background:#1f2940;color:#c4ccdb}html[data-theme=dark] input:focus,html[data-theme=dark] select:focus,html[data-theme=dark] textarea:focus{background:#121c30}
html[data-theme=dark] .table th{background:#1d2740;color:#aab4c8;border-bottom-color:#2b3650}html[data-theme=dark] .table td{border-bottom-color:#25304a}html[data-theme=dark] .table tbody tr:nth-child(even) td,html[data-theme=dark] .table tr:nth-child(even) td{background:#1b2540}html[data-theme=dark] .table tbody tr:hover td,html[data-theme=dark] .table tr:hover td{background:#22304d}html[data-theme=dark] .table tfoot td{background:#1d2740}
html[data-theme=dark] .section-head{background:linear-gradient(180deg,#1d2740,#182238);border-bottom-color:var(--line)}html[data-theme=dark] .stat{background:var(--card)}html[data-theme=dark] .flow .step{background:linear-gradient(180deg,#1d2740,#182238)}
html[data-theme=dark] .note{background:#2a2410;color:#f1e6c8;border-left-color:#f6a63a}html[data-theme=dark] .howto{background:linear-gradient(135deg,#2a1c14,#182238);border-color:#4a2c1c}html[data-theme=dark] .checkin-card{background:linear-gradient(135deg,#16233d,#182238);border-color:#2b3f66}
html[data-theme=dark] .flash-warn{background:#3a2a0a;color:#f6c15b;border-color:#5a4212}html[data-theme=dark] .flash-err{background:#43201f;color:#ff8a8a;border-color:#6b2f2f}html[data-theme=dark] .flash-ok{border-color:#1f5a3a}
html[data-theme=dark] .pill-amber{background:#3a2a0a;color:#f6c15b}html[data-theme=dark] .pill-navy{background:#1c3559;color:#a9c6f5}html[data-theme=dark] .pill-purple{background:#2d2350;color:#c9b8f5}html[data-theme=dark] .pill-grey{color:#d5dbe6}html[data-theme=dark] .score-a{color:#f6c15b}
html[data-theme=dark] .due.overdue{background:#3a1d1d;border-color:#6b2f2f}html[data-theme=dark] .due.due-soon{background:#2f2410;border-color:#5a4212}html[data-theme=dark] tr.row-late td{background:#2a2410}html[data-theme=dark] tr.row-missing td,html[data-theme=dark] tr.row-overdue td,html[data-theme=dark] .task-row.overdue td,html[data-theme=dark] .notice.level-3,html[data-theme=dark] .notice.level-4{background:#3a1d1d;border-color:#6b2f2f}
html[data-theme=dark] .task-mini,html[data-theme=dark] .timeline li,html[data-theme=dark] .view-grid .kv,html[data-theme=dark] .checklist li,html[data-theme=dark] .budget-grid tr.var-row td{border-color:#25304a}html[data-theme=dark] .progress{background:#2e3950}
html[data-theme=dark] .kbd,html[data-theme=dark] .manual-body code,html[data-theme=dark] code{background:#25304a;color:#e6eaf3}html[data-theme=dark] .tabs a.active{color:#a9c6f5}html[data-theme=dark] .chapter-list a{color:var(--ink)}html[data-theme=dark] .chapter-list a:hover{background:#22304d}html[data-theme=dark] .chapter-list a.current{background:#3b2114;color:#ffb48a}
html[data-theme=dark] .pagination li.active span{background:#2b5aa6;color:#fff;border-color:#2b5aa6}html[data-theme=dark] .stepper button.active .n{color:#fff}html[data-theme=dark] .step-progress{background:#2e3950}
html[data-theme=dark] .guest-foot,html[data-theme=dark] .guest-foot a{color:#c7d3ec}html[data-theme=dark] .foot{color:var(--muted)}html[data-theme=dark] .avatar{color:#fff}
html[data-theme=dark] .brand-card,html[data-theme=dark] .group-card{background:#fff}
html[data-theme=dark] .budget-grid td input{background:#0f1626;color:var(--ink)}html[data-theme=dark] .plan-col,html[data-theme=dark] .plan-grid .card{background:var(--card)}html[data-theme=dark] .guide-video{background:#000}
html[data-theme=dark] h1,html[data-theme=dark] h2,html[data-theme=dark] h3,html[data-theme=dark] h4,html[data-theme=dark] .topbar-title,html[data-theme=dark] label,html[data-theme=dark] .section-head h3,html[data-theme=dark] .card-head h2{color:#eef2f8}
html[data-theme=dark] .stat .value{color:#a9c6f5}html[data-theme=dark] .stat.ok .value{color:#5ee49a}html[data-theme=dark] .stat.warn .value{color:#f6c15b}html[data-theme=dark] .stat.bad .value{color:#ff8a8a}
html[data-theme=dark] .stepper button .n{background:#2e3950;color:#e6eaf3}html[data-theme=dark] .stepper button.active{color:#fff;border-color:#4a5a80}html[data-theme=dark] .prio-High{color:#ffb48a}html[data-theme=dark] input.computed.rag-A{background:#3a2a0a;color:#f6c15b}html[data-theme=dark] .pw-eye:hover{color:#fff}
html[data-theme=dark] .muted,html[data-theme=dark] .small.muted,html[data-theme=dark] .legend{color:var(--muted)}
/* v3.1 — channels */
.post{border:1px solid var(--line);border-radius:12px;padding:.7rem .9rem;margin:.6rem 0;background:var(--card)}.post.pinned{border-color:#f2c14e;box-shadow:inset 3px 0 0 #f2c14e}.post.kind-alert{box-shadow:inset 3px 0 0 var(--red)}.post.kind-decision{box-shadow:inset 3px 0 0 var(--green)}.post.kind-action{box-shadow:inset 3px 0 0 var(--teal)}
.post-head{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}.post-meta{flex:1 1 auto}.post-tags{display:flex;gap:.3rem;flex-wrap:wrap}.post-body{margin:.5rem 0 .3rem;line-height:1.55;overflow-wrap:anywhere}.post-foot{display:flex;gap:.3rem;flex-wrap:wrap;align-items:center;color:var(--muted)}.post-foot form{display:inline}
.mention{background:var(--navy-soft,#e6eefb);color:var(--navy);border-radius:6px;padding:0 .3rem;font-weight:600}.refchip{display:inline-block;border:1px solid var(--line);border-radius:999px;padding:0 .5rem;font-size:.82em;text-decoration:none;background:var(--bg)}
.composer{border:1px dashed var(--line);border-radius:12px;padding:.7rem .9rem;margin:.6rem 0 1rem;background:var(--bg)}.thread .post{margin-left:2rem}.share-box summary{list-style:none;cursor:pointer;display:inline-block}.share-box summary::-webkit-details-marker{display:none}
html[data-theme=dark] .mention{background:#1c3559;color:#a9c6f5}html[data-theme=dark] .refchip{background:#22304d}html[data-theme=dark] .composer{background:#121c30}

/* Help assistant (partials/assistant.blade.php, js/assistant.js) */
.assistant{position:fixed;right:18px;bottom:18px;z-index:60;display:flex;flex-direction:column;align-items:flex-end;gap:10px;font-size:.92rem}
.assistant-launcher{display:inline-flex;align-items:center;gap:.45rem;border:0;border-radius:999px;background:var(--navy-2);color:#fff;padding:.7rem 1.05rem;font-weight:600;box-shadow:var(--shadow-lg);cursor:pointer;transition:transform .15s,background .15s}
.assistant-launcher:hover{background:var(--navy-3);transform:translateY(-1px)}
.assistant-launcher:focus-visible{outline:none;box-shadow:var(--focus),var(--shadow-lg)}
.assistant-launcher svg{width:20px;height:20px}
.assistant-icon-close,.assistant.is-open .assistant-icon-open,.assistant.is-open .assistant-launcher-text{display:none}
.assistant.is-open .assistant-icon-close{display:block}
.assistant-panel{order:-1;width:min(380px,calc(100vw - 24px));height:min(560px,calc(100vh - 120px));display:flex;flex-direction:column;background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-lg);overflow:hidden}
.assistant-panel[hidden]{display:none}
.assistant-head{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;padding:.8rem 1rem;background:var(--navy-2);color:#fff}
.assistant-title{margin:0;font-weight:700;font-size:.98rem}
.assistant-sub{margin:.1rem 0 0;font-size:.76rem;opacity:.8}
.assistant-close{border:0;background:transparent;color:inherit;padding:.25rem;border-radius:6px;cursor:pointer;opacity:.85}
.assistant-close:hover{opacity:1;background:rgba(255,255,255,.12)}
.assistant-close svg{width:16px;height:16px;display:block}
.assistant-log{flex:1;overflow-y:auto;padding:.9rem;display:flex;flex-direction:column;gap:.6rem;background:var(--bg)}
.assistant-msg{max-width:88%;padding:.55rem .75rem;border-radius:12px;line-height:1.45;word-wrap:break-word}
.assistant-msg p{margin:0}.assistant-msg p+p{margin-top:.45rem}
.assistant-msg ul{margin:.3rem 0;padding-left:1.1rem}
.assistant-msg a{color:var(--orange);font-weight:600}
.assistant-msg-bot{align-self:flex-start;background:var(--card);border:1px solid var(--line);border-bottom-left-radius:4px}
.assistant-msg-user{align-self:flex-end;background:var(--navy-2);color:#fff;border-bottom-right-radius:4px}
.assistant-error{margin:0;font-size:.82rem;color:var(--red);background:var(--red-bg);border-radius:8px;padding:.45rem .65rem}
.assistant-suggestions{display:flex;flex-wrap:wrap;gap:.4rem;padding:.6rem .9rem 0;background:var(--card)}
.assistant-suggestions[hidden],.assistant-suggestions:empty{display:none}
.assistant-chip{border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:999px;padding:.3rem .65rem;font-size:.8rem;cursor:pointer;text-align:left}
.assistant-chip:hover{border-color:var(--orange);color:var(--orange)}
.assistant-form{display:flex;gap:.45rem;padding:.7rem .9rem;border-top:1px solid var(--line);background:var(--card)}
.assistant-input{flex:1;min-width:0;border:1px solid var(--line);border-radius:var(--radius-sm);padding:.5rem .7rem;font:inherit;background:var(--card);color:var(--ink)}
.assistant-input:focus{outline:none;border-color:var(--orange);box-shadow:var(--focus)}
.assistant-send{border:0;border-radius:var(--radius-sm);background:var(--orange);color:#fff;padding:0 .75rem;cursor:pointer}
.assistant-send:disabled{opacity:.45;cursor:not-allowed}
.assistant-send svg{width:16px;height:16px;display:block}
.assistant-foot{margin:0;padding:0 .9rem .7rem;font-size:.72rem;color:var(--muted);background:var(--card)}
.assistant-dots{display:inline-flex;gap:4px;padding:.2rem 0}
.assistant-dots i{width:6px;height:6px;border-radius:50%;background:var(--muted);animation:assistant-blink 1.2s infinite ease-in-out}
.assistant-dots i:nth-child(2){animation-delay:.15s}.assistant-dots i:nth-child(3){animation-delay:.3s}
@keyframes assistant-blink{0%,80%,100%{opacity:.25}40%{opacity:1}}
@media (prefers-reduced-motion:reduce){.assistant-dots i{animation:none}.assistant-launcher{transition:none}}
/* Phones: sit above the fixed bottom navigation, and let the panel use the width. */
@media (max-width:760px){
  .assistant{right:12px;bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px)}
  .assistant-launcher-text{display:none}
  .assistant-launcher{padding:.75rem}
  .assistant-panel{height:min(520px,calc(100vh - var(--nav-h) - 110px))}
}
@media print{.assistant{display:none}}

/* Cash flow grid (28-Sep-2026) */
.cf-grid td,.cf-grid th{white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}
.cf-grid td:first-child,.cf-grid th:first-child{text-align:left;position:sticky;left:0;background:#fff;z-index:1}
.cf-grid th.cf-now{background:#e8f0fb}
.cf-grid tr.cf-head td{background:#f3f4f6;font-weight:700;text-align:left;text-transform:uppercase;font-size:.72rem;letter-spacing:.04em}
.cf-grid tr.cf-total td{font-weight:700;border-top:2px solid #cbd5e1}
.cf-grid a{text-decoration:none;border-bottom:1px dotted #94a3b8}
.cf-grid a.cf-sel{background:#fde68a;border-radius:3px;padding:0 2px}
html[data-theme=dark] .cf-grid td:first-child,html[data-theme=dark] .cf-grid th:first-child{background:#1c2230}
html[data-theme=dark] .cf-grid th.cf-now{background:#25304a}
html[data-theme=dark] .cf-grid tr.cf-head td{background:#242b3a}
html[data-theme=dark] .cf-grid tr.cf-total td{border-top-color:#3b4658}
html[data-theme=dark] .cf-grid a.cf-sel{background:#6b5a12}

/* ---- v3.5 (29-Sep-2026): sidebar icons, calmer page rhythm, Imports hub ---- */
.sidebar nav a{justify-content:flex-start;gap:.6rem;padding:.48rem .8rem .48rem .7rem;line-height:1.25}
.sidebar nav a .nav-ic{flex:0 0 17px;width:17px;height:17px;opacity:.78;transition:opacity .15s,transform .15s}
.sidebar nav a:hover .nav-ic,.sidebar nav a.active .nav-ic{opacity:1}
.sidebar nav a.active .nav-ic{color:var(--amber)}
.sidebar nav a .nav-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar nav a .badge{flex:0 0 auto;margin-left:.2rem}
.nav-group{display:flex;align-items:center;gap:.5rem;padding:1.05rem 1.1rem .35rem;opacity:.55;font-weight:700}
.nav-group::after{content:"";flex:1;height:1px;background:rgba(255,255,255,.14)}
.nav-group:first-child{padding-top:.5rem}
.content{padding:1.35rem 1.6rem 3rem}
.card + .card,.section + .section{margin-top:1rem}
.card-head h2{font-size:1.22rem}
.card-head .muted.small{display:block;margin-top:.15rem;max-width:72ch}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:.6rem;flex-wrap:wrap}
.section-body{padding:.9rem 1rem}
.table th{font-size:.72rem;text-transform:uppercase}
.table td{vertical-align:top}
.table .num,.table td.right{font-variant-numeric:tabular-nums}
.filters{row-gap:.5rem;padding:.55rem .65rem;background:rgba(30,79,158,.035);border-radius:var(--radius-sm);border:1px solid rgba(30,79,158,.06)}
.filters .btn{white-space:nowrap}
.empty{padding:1.4rem 1rem;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:var(--radius-sm);background:#fbfcfe}
.import-steps .section{margin-bottom:.9rem}
.import-guide td{font-size:.8rem;line-height:1.4}
.import-guide td:nth-child(2){min-width:150px}.import-guide td:nth-child(4){min-width:200px;max-width:320px}.import-guide td:nth-child(5){min-width:240px}
.import-row{padding:.55rem 0;border-bottom:1px dashed var(--line-2)}.import-row:last-child{border-bottom:0}
.import-row-head{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin-bottom:.3rem}
.import-row .filters{margin-bottom:0;background:transparent;border:0;padding:0}
.lock-pill{background:#ececf1;color:#4b5563}
@media (max-width:760px){.content{padding:1rem .9rem 5rem}.card-head .muted.small{max-width:none}.nav-group{padding:.9rem .9rem .3rem}}
html[data-theme=dark] .sidebar nav a.active .nav-ic{color:#f6c15b}
html[data-theme=dark] .nav-group::after{background:rgba(255,255,255,.1)}
html[data-theme=dark] .filters{background:rgba(255,255,255,.04);border-color:var(--line-2)}
html[data-theme=dark] .empty{background:#141c2e;border-color:var(--line)}
html[data-theme=dark] .import-row{border-bottom-color:var(--line-2)}
html[data-theme=dark] .lock-pill{background:#2b3650;color:#c4ccdb}

/* ---- v3.5.1 (29-Sep-2026): one selection row everywhere — same control height, capped select width, header placement ---- */
.filters{align-items:center;gap:.5rem .55rem}
.filters input:not([type=checkbox]):not([type=radio]):not([type=file]),.filters select{width:auto;min-width:150px;max-width:min(100%,300px);min-height:36px;padding:.36rem .6rem;font-size:.86rem;line-height:1.3;border-radius:9px}
.filters input[type=month],.filters input[type=date]{min-width:150px;max-width:190px}
.filters input[type=search],.filters input[type=text]{max-width:240px}
.filters input[type=file]{max-width:260px;font-size:.82rem}
.filters .btn{min-height:36px;padding:.32rem .8rem;font-size:.84rem;border-radius:9px}
.filters .btn-primary{font-weight:600}
.filters label{display:inline-flex;flex-direction:row;align-items:center;gap:.35rem;margin:0;font-size:.84rem;font-weight:500;white-space:normal;max-width:320px;line-height:1.25}
.filters label input[type=checkbox]{width:auto;min-width:0;margin:0;flex:0 0 auto}
.filters .small.muted,.filters .muted.small{align-self:center}
.card-head{align-items:flex-start}
.card-head>div:last-child{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;justify-content:flex-end;margin-left:auto}
.card-head>div:first-child{margin-left:0;justify-content:flex-start;flex:1 1 320px;min-width:0}
.card-head .filters{margin:0;padding:0;background:transparent;border:0;justify-content:flex-end}
.card-head .filters + .filters{margin-left:.2rem}
.tabs{margin-top:.2rem}
.tabs + .filters{margin-top:.1rem}
html[data-theme=dark] .card-head .filters{background:transparent}

/* ---- v3.5.2 (29-Sep-2026): Banking / Cash flow dashboards on the MD's dashboard ---- */
.fin-dash{margin-bottom:1rem}
.fin-card{padding:1rem 1.1rem}
.fin-stats{grid-template-columns:repeat(4,1fr);gap:.55rem;margin:.2rem 0 .6rem}
.fin-stats .stat{padding:.6rem .7rem}.fin-stats .stat .value{font-size:1.15rem;font-variant-numeric:tabular-nums;white-space:nowrap}.fin-stats .stat .label{font-size:.66rem}.fin-stats .stat .sub{font-size:.7rem;line-height:1.3}
.day-strip{display:grid;grid-template-columns:repeat(7,1fr);gap:.35rem;align-items:end;margin:.2rem 0 .7rem;padding:.5rem .4rem .3rem;background:rgba(30,79,158,.035);border-radius:var(--radius-sm)}
.day-strip .day{text-align:center;font-size:.68rem;color:var(--muted)}
.day-strip .bars{display:flex;justify-content:center;align-items:flex-end;gap:2px;height:44px}
.day-strip .bars span{display:block;width:9px;border-radius:2px 2px 0 0;min-height:1px}
.day-strip .bars .in{background:var(--green)}.day-strip .bars .out{background:var(--red);opacity:.8}
.day-strip .lbl{margin-top:.15rem;font-weight:600}.day-strip .net{font-variant-numeric:tabular-nums;color:var(--green)}.day-strip .net.neg{color:var(--red)}
.fin-tables{display:grid;grid-template-columns:repeat(3,1fr);gap:.7rem}
.fin-tables h4{margin:0 0 .25rem;font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.table.tight td{padding:.22rem .35rem;font-size:.78rem;border-bottom:1px solid var(--line-2)}
@media (max-width:1200px){.fin-stats{grid-template-columns:repeat(2,1fr)}}
@media (max-width:760px){.fin-tables{grid-template-columns:1fr}.fin-stats{grid-template-columns:1fr 1fr}}
html[data-theme=dark] .day-strip{background:rgba(255,255,255,.04)}
@media (max-width:1240px){.fin-dash{grid-template-columns:1fr}.fin-stats{grid-template-columns:repeat(4,1fr)}}
@media (max-width:900px){.fin-stats{grid-template-columns:repeat(2,1fr)}}

/* Searchable dropdown (select[data-searchable], built by app.js): task form Assign to / Supported by. */
.combo{position:relative;font-weight:400}
.combo-btn{position:relative;display:block;width:100%;min-height:40px;padding:.52rem 2rem .52rem .65rem;border:1px solid #d5dae3;border-radius:10px;background:#fbfcfe;color:var(--ink);font:inherit;font-size:.92rem;font-weight:400;text-align:left;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.combo-btn::after{content:"";position:absolute;right:.85rem;top:50%;margin-top:-2px;border:5px solid transparent;border-top-color:var(--muted)}
.combo-btn[aria-expanded=true]::after{margin-top:-7px;border-top-color:transparent;border-bottom-color:var(--muted)}
.combo-btn:focus{outline:none;box-shadow:var(--focus);border-color:var(--orange)}
.combo-btn.combo-placeholder{color:var(--muted)}
.combo-panel{position:absolute;z-index:60;left:0;right:0;top:calc(100% + 4px);padding:.4rem;background:var(--card);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow-lg)}
.combo-search{margin:0 0 .35rem}
.combo-list{list-style:none;margin:0;padding:0;max-height:280px;overflow:auto}
.combo-group{padding:.5rem .5rem .2rem;font-size:.72rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--muted)}
.combo-opt{position:relative;padding:.42rem .5rem .42rem 1.7rem;border-radius:7px;font-size:.9rem;font-weight:400;color:var(--ink);cursor:pointer}
.combo-opt.combo-active,.combo-opt:hover{background:var(--line-2)}
.combo-opt[aria-selected=true]{font-weight:600;color:var(--orange-d)}
.combo-opt[aria-selected=true]::before{content:"\2713";position:absolute;left:.55rem}
.combo-empty{padding:.5rem;font-size:.88rem;color:var(--muted)}
html[data-theme=dark] .combo-btn{background:#0f1626;border-color:#3a4763}
html[data-theme=dark] .combo-opt[aria-selected=true]{color:#ffb38f}

/* MD chain levels as columns on the approval page (8-Oct-2026); stacked on phones */
@media (max-width:600px){.chain-cols{grid-template-columns:1fr !important}}

/* view-only documents (12-Oct-2026): no selection; printing shows only a notice */
html.doc-protected [data-doc-protect]{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
html.doc-protected [data-doc-protect] img{-webkit-user-drag:none;pointer-events:none}
.doc-print-notice{display:none}
@media print{html.doc-protected body *{visibility:hidden !important}html.doc-protected .doc-print-notice,html.doc-protected .doc-print-notice *{visibility:visible !important}html.doc-protected .doc-print-notice{display:block;position:fixed;top:40%;left:0;right:0;text-align:center;font-size:16pt}}

/* view-only document viewer (pdf.js pages drawn as images, 12-Oct-2026) */
.doc-viewer{border:1px solid var(--line);border-radius:8px;background:var(--line-2)}
.dv-bar{display:flex;gap:.4rem;align-items:center;justify-content:flex-end;padding:.4rem .6rem;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:2;background:var(--card)}
.dv-zoom{min-width:3.5rem;text-align:center;font-size:.85rem}
.dv-status{padding:1rem;text-align:center}
.dv-pages{max-height:80vh;overflow:auto;padding:12px;text-align:center}
.dv-page{margin:0 auto 14px;display:inline-block;width:auto}
.dv-page canvas{display:block;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.25);-webkit-user-drag:none}
.dv-num{font-size:.75rem;color:var(--muted);margin-top:.25rem}
html[data-theme=dark] .doc-viewer{background:#0f172a}

/* Communication menu: links that open Zoho in a new tab (12-Oct-2026) */
.nav-ext{font-size:.75em;opacity:.65;margin-left:.15rem}

/* notifications: the whole line is the link (12-Oct-2026) */
a.notice-link{color:inherit;text-decoration:none;cursor:pointer;align-items:center}
a.notice-link:hover{border-color:var(--navy);box-shadow:var(--shadow)}
a.notice-link.unread{border-left:3px solid var(--orange)}
a.notice-link p{margin:.3rem 0 0}
.notice-go{font-size:1.4rem;color:var(--muted);line-height:1}

/* MRS logo on the sign-in page: on a white tile so the dark-blue tagline reads in dark mode (12-Oct-2026) */
.brand-logo{background:#fff;border-radius:10px;padding:.45rem .7rem;box-sizing:border-box;width:230px}

/* document acknowledgement (12-Oct-2026) */
.ack-box{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;justify-content:space-between;padding:.6rem .8rem;border:1px solid var(--amber);background:var(--amber-bg);border-radius:8px;margin:.4rem 0 .8rem}
.ack-done{border-color:var(--green);background:var(--green-bg);color:var(--green)}
html[data-theme=dark] .ack-box{background:#2f2410;border-color:#5a4212}
html[data-theme=dark] .ack-done{background:#12301f;border-color:#1f5c3a;color:#86efac}

/* document viewer on phones (13-Oct-2026): the page scrolls (no box-in-a-box), placeholders keep the page height */
.dv-holder{margin:0 auto;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.25);max-width:100%}
.dv-holder canvas{box-shadow:none}
@media (max-width:760px){.dv-pages{max-height:none;overflow:visible;padding:6px}}

/* Masters forms: a heading above each field (14-Oct-2026) */
.filters label.mfield,label.mfield{display:inline-flex;flex-direction:column;align-items:stretch;gap:.2rem;font-size:.74rem;font-weight:600;color:var(--muted);margin:0 .2rem .35rem 0}
.mfield > span:first-child{white-space:nowrap}
.mfield input,.mfield select{font-weight:400}

/* Tables styled like the Notifications list (14-Oct-2026): every row is a rounded, bordered card with a gap
   between rows; hovering outlines the row in navy with an orange edge. Compact grids (.tight, .matrix, .cf-grid) keep the plain look. */
.table:not(.tight):not(.matrix):not(.cf-grid){border-collapse:separate;border-spacing:0 .4rem;margin-top:-.25rem}
.table:not(.tight):not(.matrix):not(.cf-grid) th{background:var(--card);border-top:0;border-bottom:0}
.table:not(.tight):not(.matrix):not(.cf-grid) td,.table:not(.tight):not(.matrix):not(.cf-grid) tr:has(td) > th{background:var(--card);border-top:1px solid var(--line);border-bottom:1px solid var(--line);transition:border-color .12s,background-color .12s}
.table:not(.tight):not(.matrix):not(.cf-grid) tr:has(td) > :first-child{border-left:1px solid var(--line);border-radius:8px 0 0 8px}
.table:not(.tight):not(.matrix):not(.cf-grid) tr:has(td) > :last-child{border-right:1px solid var(--line);border-radius:0 8px 8px 0}
.table:not(.tight):not(.matrix):not(.cf-grid) tr:has(td) > :only-child{border-radius:8px}
.table:not(.tight):not(.matrix):not(.cf-grid) tbody tr:nth-child(even) td,.table:not(.tight):not(.matrix):not(.cf-grid) tr:nth-child(even) td{background:var(--card)}
.table:not(.tight):not(.matrix):not(.cf-grid) tr:has(td):hover > *{border-color:var(--navy);background:#f8faff}
.table:not(.tight):not(.matrix):not(.cf-grid) tr:has(td):hover > :first-child{box-shadow:inset 3px 0 0 var(--orange)}
.table:not(.tight):not(.matrix):not(.cf-grid) tfoot td{background:#f8fafc;font-weight:700}
html[data-theme=dark] .table:not(.tight):not(.matrix):not(.cf-grid) th{background:var(--card)}
html[data-theme=dark] .table:not(.tight):not(.matrix):not(.cf-grid) td,html[data-theme=dark] .table:not(.tight):not(.matrix):not(.cf-grid) tr:nth-child(even) td{background:var(--card)}
html[data-theme=dark] .table:not(.tight):not(.matrix):not(.cf-grid) tr:has(td):hover > *{background:#1d2945}
html[data-theme=dark] .table:not(.tight):not(.matrix):not(.cf-grid) tfoot td{background:#1d2740}
/* Reference codes (APR-2026-0011 etc.) stay on one line in tables (14-Oct-2026) */
.table td.kbd{white-space:nowrap}

/* Rewards — add / deduct form (15-Oct-2026): employee picker wide enough for name · designation · ID; one column on phones */
.reward-adjust{display:flex;flex-wrap:wrap;gap:.6rem .8rem;align-items:flex-end;margin:.4rem 0 1rem;padding:.8rem;border:1px solid var(--line);border-radius:10px;background:var(--bg)}
.reward-adjust .mfield{display:flex;margin:0;min-width:0;flex:1 1 16rem}
.reward-adjust .mfield:nth-of-type(2){flex:0 1 9rem}
.reward-adjust .mfield:nth-of-type(3){flex:2 1 16rem}
.reward-adjust .mfield input,.reward-adjust .mfield select,.reward-adjust .combo{width:100%}
.reward-adjust .btn{height:40px;white-space:nowrap}
/* searchable dropdown: the list is never narrower than its options need */
.combo-panel{min-width:min(22rem,90vw)}

/* Rich text (21-Oct-2026): the minutes editor and how formatted text reads */
.rte{border:1px solid var(--line);border-radius:10px;background:var(--card);overflow:hidden;margin-top:.3rem}
.rte-bar{display:flex;flex-wrap:wrap;gap:.25rem;padding:.35rem;border-bottom:1px solid var(--line);background:var(--bg)}
.rte-btn{border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:6px;padding:.2rem .55rem;font:inherit;font-size:.82rem;cursor:pointer}
.rte-btn:hover{border-color:var(--navy)}.rte-bold{font-weight:800}.rte-italic{font-style:italic}.rte-underline{text-decoration:underline}
.rte-area{min-height:12rem;max-height:32rem;overflow:auto;padding:.7rem .8rem;outline:none;font-weight:400}
.rte-area:empty:before{content:attr(data-placeholder);color:var(--muted)}
.rte:focus-within{box-shadow:var(--focus);border-color:var(--orange)}
.rich-text{line-height:1.55;overflow-wrap:anywhere}.rich-text p{margin:0 0 .55rem}.rich-text h3{margin:.8rem 0 .35rem;font-size:1rem}
.rich-text ul,.rich-text ol{margin:.2rem 0 .6rem;padding-left:1.4rem}.rich-text li{margin:.15rem 0}
.rich-text blockquote{margin:.4rem 0;padding:.3rem .8rem;border-left:3px solid var(--line);color:var(--muted)}

/* =====================================================================================================================
   v4 design layer (22-Oct-2026): calmer surfaces, one type scale, colour codes for every state, collapsible sidebar
   sections in order of use, wider use of the page, mobile-first. Uses tokens only, so light and dark both follow.
   ===================================================================================================================== */
:root{
  --font:"Inter","Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",Arial,sans-serif;
  --bg:#f4f6fb;--card:#fff;--ink:#0f1b33;--muted:#5f6b80;--line:#e3e8f1;--line-2:#eef2f8;
  --surface-2:#f7f9fd;--hover:#f2f5fb;--ring:0 0 0 3px rgba(30,79,158,.22);
  --radius:14px;--radius-sm:10px;--radius-xs:7px;
  --shadow:0 1px 2px rgba(15,27,51,.04),0 2px 8px -2px rgba(15,27,51,.06);
  --shadow-hover:0 2px 4px rgba(15,27,51,.05),0 12px 28px -10px rgba(15,27,51,.18);
  /* colour codes: one hue per meaning, a strong tone for text / bars and a soft tone for grounds */
  --c-ok:#14935a;--c-ok-bg:#e5f6ee;--c-warn:#c27803;--c-warn-bg:#fdf3dc;--c-bad:#d93535;--c-bad-bg:#fde8e8;
  --c-info:#2563eb;--c-info-bg:#e6efff;--c-neutral:#64748b;--c-neutral-bg:#eef1f6;--c-brand:#1E4F9E;--c-brand-bg:#e8eef9;
  --c-accent:#E9622B;--c-accent-bg:#fdeee6;--c-violet:#7c3aed;--c-violet-bg:#efe9fe;--c-teal:#0d8a7d;--c-teal-bg:#dff5f2;
  --side-bg:#0e2250;--side-bg-2:#0a1a3d;--side-ink:#c9d5ee;--side-ink-dim:#8696b8;--side-hover:rgba(255,255,255,.06);--side-active:rgba(255,255,255,.11)
}
html[data-theme=dark]{
  --bg:#0c1220;--card:#141d31;--ink:#e7ecf6;--muted:#93a0b8;--line:#25304a;--line-2:#1d2740;--surface-2:#111a2d;--hover:#1a2540;
  --ring:0 0 0 3px rgba(125,165,240,.3);--shadow:0 1px 2px rgba(0,0,0,.3),0 4px 14px -6px rgba(0,0,0,.5);--shadow-hover:0 2px 6px rgba(0,0,0,.35),0 16px 34px -12px rgba(0,0,0,.65);
  --c-ok:#4ad08f;--c-ok-bg:#10301f;--c-warn:#f4bd52;--c-warn-bg:#33270b;--c-bad:#ff8585;--c-bad-bg:#3d1b1c;--c-info:#8fb5ff;--c-info-bg:#162a4d;
  --c-neutral:#a3afc4;--c-neutral-bg:#1f2a40;--c-brand:#9dbbf0;--c-brand-bg:#182c52;--c-accent:#ff9a6b;--c-accent-bg:#3a2014;--c-violet:#c4a6ff;--c-violet-bg:#2a1f4a;
  --c-teal:#5fe0cf;--c-teal-bg:#0f3532;--side-bg:#0a1427;--side-bg-2:#070f1f
}
body{font-family:var(--font);font-size:.97rem;letter-spacing:-.003em;background:var(--bg)}
h1{font-size:1.45rem;font-weight:700;letter-spacing:-.02em}h2{font-size:1.06rem;font-weight:650;letter-spacing:-.012em}h3{font-weight:650}
:focus-visible{outline:none;box-shadow:var(--ring);border-radius:6px}
::selection{background:rgba(233,98,43,.22)}

/* ---- sidebar: sections in order of use ---- */
.sidebar{width:264px;background:linear-gradient(185deg,var(--side-bg) 0%,var(--side-bg-2) 100%);color:var(--side-ink);border-right:1px solid rgba(255,255,255,.04);scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent}
.sidebar .brand{padding:.95rem .95rem .7rem;border-bottom:0}
.sidebar .brand-card{border-radius:12px;box-shadow:0 6px 18px -8px rgba(0,0,0,.5)}
.sidebar .brand-sub{font-size:.7rem;letter-spacing:.12em;text-transform:uppercase;color:var(--side-ink-dim)!important;font-weight:600}
.nav-find{padding:.25rem .8rem .55rem}
.nav-find input{width:100%;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.08);color:#fff;border-radius:10px;padding:.48rem .7rem .48rem 2rem;font:inherit;font-size:.85rem;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238696b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:.65rem center}
.nav-find input::placeholder{color:var(--side-ink-dim)}
.nav-find input:focus{outline:none;border-color:rgba(233,98,43,.6);background-color:rgba(255,255,255,.1)}
.nav{padding:0 .55rem .8rem;display:flex;flex-direction:column;gap:.1rem}
.nav-sec{border-radius:12px}
.nav-sec-head{all:unset;box-sizing:border-box;display:flex;align-items:center;gap:.4rem;width:100%;padding:.55rem .6rem .35rem;cursor:pointer;color:var(--side-ink-dim);font-size:.68rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;border-radius:8px}
.nav-sec-head:hover{color:#fff}
.nav-sec-head:focus-visible{box-shadow:0 0 0 2px rgba(233,98,43,.6)}
.nav-sec-label{flex:1}
.nav-sec.is-current .nav-sec-head{color:#fff}
.nav-sec-count{background:var(--orange);color:#fff;border-radius:99px;font-size:.62rem;padding:.05rem .4rem;letter-spacing:0}
.nav-sec-head[aria-expanded=true] .nav-sec-count{display:none}
.nav-chev{width:.45rem;height:.45rem;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(-45deg);transition:transform .18s ease;margin-right:.2rem;opacity:.75}
.nav-sec-head[aria-expanded=true] .nav-chev{transform:rotate(45deg)}
.nav-sec-body{display:grid;grid-template-rows:1fr;transition:grid-template-rows .2s ease}
.nav-sec-body>*{min-height:0}
.nav-sec-head[aria-expanded=false]+.nav-sec-body{display:none}
.nav a{display:flex;align-items:center;gap:.65rem;padding:.48rem .65rem;margin:1px 0;border-radius:9px;color:var(--side-ink);text-decoration:none;font-size:.9rem;font-weight:500;position:relative;transition:background .15s ease,color .15s ease}
.nav a svg{width:17px;height:17px;flex-shrink:0;opacity:.78}
.nav a:hover{background:var(--side-hover);color:#fff}
.nav a.active{background:var(--side-active);color:#fff;font-weight:600}
.nav a.active::before{content:"";position:absolute;left:-.55rem;top:.42rem;bottom:.42rem;width:3px;border-radius:0 3px 3px 0;background:var(--orange)}
.nav a.active svg{opacity:1;color:#ffb38f}
.nav .nav-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nav .badge{background:var(--orange);font-size:.66rem;padding:.06rem .42rem;border-radius:99px;font-weight:700;color:#fff}
.nav .nav-ext{opacity:.55;font-size:.75em}
.nav a.is-hidden,.nav-sec.is-hidden{display:none}
.sidebar-foot{border-top:1px solid rgba(255,255,255,.06)}

/* ---- top bar ---- */
.topbar{position:sticky;top:0;z-index:30;background:color-mix(in srgb,var(--card) 82%,transparent);backdrop-filter:saturate(1.4) blur(12px);-webkit-backdrop-filter:saturate(1.4) blur(12px);border-bottom:1px solid var(--line);box-shadow:none;min-height:60px}
.topbar-title{font-weight:700;letter-spacing:-.015em;color:var(--ink)}
.topsearch input{border-radius:10px;background:var(--surface-2);border:1px solid var(--line)}
.user-chip{border-radius:12px;padding:.2rem .5rem .2rem .25rem}
.user-chip:hover{background:var(--hover)}

/* ---- page ---- */
.content{padding:1.35rem clamp(.9rem,2.2vw,2rem) 2rem;width:100%;max-width:1680px;margin:0 auto}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:1.1rem 1.2rem;margin-bottom:1rem;transition:box-shadow .2s ease,border-color .2s ease}
.card:hover{box-shadow:var(--shadow-hover)}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:.8rem;flex-wrap:wrap;margin:-.1rem 0 .85rem}
.card-head h2,.card>h2:first-child{margin:0}
.grid-2,.grid-3,.grid-4{display:grid;gap:1rem}
.grid-2{grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr))}
.grid-3{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr))}
.grid-4{grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr))}

/* ---- KPI tiles: a colour code per state ---- */
.stat{position:relative;overflow:hidden;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:1rem 1.1rem 1rem 1.25rem;transition:transform .15s ease,box-shadow .2s ease}
.stat::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--c-brand)}
.stat:hover{transform:translateY(-1px);box-shadow:var(--shadow-hover)}
.stat .label{font-size:.7rem;font-weight:700;letter-spacing:.09em;color:var(--muted)}
.stat .value{font-size:1.7rem;font-weight:750;color:var(--ink);font-variant-numeric:tabular-nums;letter-spacing:-.025em}
.stat .sub{font-size:.8rem}
.stat.ok::before{background:var(--c-ok)}.stat.ok .value{color:var(--c-ok)}
.stat.warn::before{background:var(--c-warn)}.stat.warn .value{color:var(--c-warn)}
.stat.bad::before{background:var(--c-bad)}.stat.bad .value{color:var(--c-bad)}
.stat.info::before{background:var(--c-info)}.stat.info .value{color:var(--c-info)}

/* ---- status pills: the colour codes ---- */
.pill{display:inline-flex;align-items:center;gap:.3rem;border-radius:99px;padding:.14rem .6rem;font-size:.74rem;font-weight:650;line-height:1.5;white-space:nowrap;background:var(--c-neutral-bg);color:var(--c-neutral)}
.pill::before{content:"";width:.42rem;height:.42rem;border-radius:50%;background:currentColor;opacity:.85}
.pill-green{background:var(--c-ok-bg);color:var(--c-ok)}
.pill-amber,.pill-gold{background:var(--c-warn-bg);color:var(--c-warn)}
.pill-red{background:var(--c-bad-bg);color:var(--c-bad)}
.pill-blue{background:var(--c-info-bg);color:var(--c-info)}
.pill-navy{background:var(--c-brand-bg);color:var(--c-brand)}
.pill-grey{background:var(--c-neutral-bg);color:var(--c-neutral)}
.pill-purple{background:var(--c-violet-bg);color:var(--c-violet)}
.pill-teal{background:var(--c-teal-bg);color:var(--c-teal)}
.tone-ok{color:var(--c-ok)}.tone-warn{color:var(--c-warn)}.tone-bad{color:var(--c-bad)}.tone-info{color:var(--c-info)}

/* ---- buttons & fields ---- */
.btn{min-height:2.3rem;border-radius:10px;font-weight:600;font-size:.88rem;padding:.42rem .95rem;border:1px solid var(--line);background:var(--card);color:var(--ink);box-shadow:0 1px 1px rgba(15,27,51,.04);transition:background .15s ease,border-color .15s ease,transform .1s ease,box-shadow .15s ease}
.btn:hover{background:var(--hover);border-color:color-mix(in srgb,var(--line) 60%,var(--c-brand))}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--c-accent);border-color:var(--c-accent);color:#fff}
.btn-primary:hover{background:color-mix(in srgb,var(--c-accent) 88%,#000);border-color:transparent;color:#fff}
.btn-dark{background:var(--navy-2);border-color:var(--navy-2);color:#fff}
.btn-danger{background:var(--c-bad-bg);border-color:transparent;color:var(--c-bad)}
.btn-ghost{background:transparent;border-color:transparent;box-shadow:none}
.btn-ghost:hover{background:var(--hover)}
.btn-sm{min-height:1.95rem;padding:.25rem .7rem;font-size:.8rem;border-radius:8px}
/* :where() keeps these generic: any component style wins */
:where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),select,textarea){border-radius:10px;border:1px solid var(--line);background:var(--card);color:var(--ink);min-height:2.4rem;transition:border-color .15s ease,box-shadow .15s ease}
:where(input:not([type=checkbox]):not([type=radio]),select,textarea):focus{outline:none;border-color:var(--c-brand);box-shadow:var(--ring)}
label{font-weight:550}

/* ---- tables ---- */
.table-wrap{border-radius:var(--radius-sm);border:1px solid var(--line-2)}
.table th{font-size:.7rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);background:var(--surface-2)}
.table td{font-variant-numeric:tabular-nums}
.table tbody tr:hover td,.table tr:hover>td{background:var(--hover)}

/* ---- notices & flashes ---- */
.flash{border-radius:12px;border:1px solid transparent;border-left-width:4px;box-shadow:var(--shadow)}
.flash-ok{background:var(--c-ok-bg);border-color:var(--c-ok);color:var(--ink)}
.flash-warn{background:var(--c-warn-bg);border-color:var(--c-warn);color:var(--ink)}
.flash-err{background:var(--c-bad-bg);border-color:var(--c-bad);color:var(--ink)}
.badge{font-variant-numeric:tabular-nums}

/* ---- motion: respectful ---- */
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ---- mobile ---- */
@media (max-width:900px){
  .content{padding:1rem .85rem calc(var(--nav-h) + 1.4rem)}
  .card{padding:.95rem .95rem;border-radius:12px}
  .stat .value{font-size:1.45rem}
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .topbar{min-height:54px}
  .btn{min-height:2.6rem}.btn-sm{min-height:2.25rem}
  .nav a{padding:.62rem .7rem;font-size:.95rem}
  .table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;background:linear-gradient(90deg,var(--card) 30%,transparent),linear-gradient(90deg,transparent,var(--card) 70%) 100% 0,radial-gradient(farthest-side at 0 50%,rgba(15,27,51,.14),transparent),radial-gradient(farthest-side at 100% 50%,rgba(15,27,51,.14),transparent) 100% 0;background-repeat:no-repeat;background-size:40px 100%,40px 100%,12px 100%,12px 100%;background-attachment:local,local,scroll,scroll}
  .bottom-nav{background:color-mix(in srgb,var(--card) 88%,transparent);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid var(--line)}
}
@media (max-width:760px){.sidebar{width:min(86vw,320px);left:calc(-1 * min(86vw,320px) - 24px);z-index:60}.sidebar.open{left:0;box-shadow:0 0 48px rgba(0,0,0,.4)}.drawer-overlay{z-index:55;backdrop-filter:blur(2px)}}
@media (max-width:520px){.grid-4{grid-template-columns:1fr 1fr;gap:.6rem}.stat{padding:.8rem .8rem .8rem 1rem}.stat .value{font-size:1.25rem}h1{font-size:1.25rem}}
/* v4: grids never push the page wider than the screen (minmax(0,…)); long figures may wrap on phones */
.card,.stat{min-width:0}
.fin-stats{grid-template-columns:repeat(4,minmax(0,1fr))}.fin-tables{grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width:1200px){.fin-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:760px){.fin-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.fin-tables{grid-template-columns:minmax(0,1fr)}.fin-stats .stat .value{white-space:normal;overflow-wrap:anywhere;font-size:1.05rem}}
.sidebar .nav{padding:0 .55rem .8rem}.sidebar .nav-sec-head{padding:.6rem .65rem .35rem}
html[data-theme=dark] .btn-primary{background:var(--c-accent);border-color:var(--c-accent);color:#1d0f07}
html[data-theme=dark] .sidebar .nav-find input,.sidebar .nav-find input{background:rgba(255,255,255,.07) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238696b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat .65rem center;color:#fff;border:1px solid rgba(255,255,255,.08)}
