/* =====================================================================   MERITIO — ENTERPRISE DESIGN SYSTEM
   Single source of truth. Implements "Meritio Dashboard UI/UX Redesign
   Specification v1.0" with the surface language of the approved reference:
   tinted canvas, borderless white cards, hairline dividers, one border budget.

   CONSOLIDATED: replaces all earlier override layers so no two rules compete on
   specificity. Scoped to #app-shell/.modal — the marketing landing page is
   untouched. Reversible by removing the <link>.
   ============================================================================ */

/* ─────────────────────────────────────────────────────────────── 01 TOKENS ── */
:root {
  --c-canvas:#F4F6FB;  --c-surface:#FFFFFF;  --c-inset:#F7F9FC;
  --c-line:#E8ECF3;    --c-line-soft:#EFF2F7;  --c-line-strong:#D6DDE8;
  --c-ink:#172033;  --c-text:#384457;  --c-muted:#6F7B8D;  --c-faint:#9AA5B4;
  --c-primary:#0E63C4; --c-primary-dark:#0B4F9E; --c-primary-soft:#E8F2FD;
  --c-brand:#0090FC; --c-brand-2:#00C0F0;
  --c-success:#14734B; --c-success-soft:#E6F4EE;
  --c-warning:#94540B; --c-warning-soft:#FBF1E1;
  --c-danger:#B73535;  --c-danger-soft:#FAEAEA;
  --c-info:#0B5FA8;    --c-info-soft:#E8F2FD;

  --s-05:4px; --s-1:8px; --s-15:12px; --s-2:16px; --s-3:24px; --s-4:32px; --s-5:40px; --s-6:48px;
  --r-1:6px; --r-2:8px; --r-3:10px; --r-4:12px; --r-5:16px; --r-pill:999px;
  --sh-1:0 1px 2px rgba(23,32,51,.05), 0 4px 12px rgba(23,32,51,.04);
  --sh-2:0 8px 24px rgba(23,32,51,.12);
  --sh-3:0 16px 48px rgba(23,32,51,.18);
  --h-ctl:40px; --h-sm:32px; --h-lg:48px;
  --rail-w:64px; --panel-w:248px;

  /* Back-compat aliases so any legacy rule resolves to the same system */
  --e-primary:var(--c-primary); --e-ink:var(--c-ink); --e-muted:var(--c-muted);
  --e-line:var(--c-line); --e-app-bg:var(--c-canvas);
}

/* ───────────────────────────────────────────────────────── 02 BASE / TYPE ── */
#app-shell { background:var(--c-canvas); color:var(--c-text); -webkit-font-smoothing:antialiased; }
#app-shell, .modal { letter-spacing:-.006em; }
:is(#app-shell,.modal) :is(h1,h2,h3,h4,h5,h6){ color:var(--c-ink); font-weight:700; letter-spacing:-.015em; margin:0; }
.t-display{ font-size:30px; line-height:38px; font-weight:700; letter-spacing:-.02em; }
.t-h2{ font-size:20px; line-height:28px; font-weight:700; }
.t-h3{ font-size:16px; line-height:24px; font-weight:600; }
.t-caption{ font-size:12px; line-height:16px; color:var(--c-muted); }
.u-num{ font-variant-numeric:tabular-nums; }

/* ────────────────────────────────────────────────────────── 03 APP SHELL ── */
.app-rail{
  position:fixed; top:0; left:0; width:var(--rail-w); height:100vh; z-index:210;
  background:var(--c-surface); border-right:1px solid var(--c-line);
  display:flex; flex-direction:column; align-items:center; gap:var(--s-05); padding:var(--s-15) 0;
}
.rail-brand{ display:flex; align-items:center; justify-content:center; width:40px; height:40px; margin-bottom:var(--s-15); }
.rail-brand img{ width:30px; height:30px; border-radius:var(--r-2); }
.rail-nav{ display:flex; flex-direction:column; align-items:center; gap:var(--s-05); width:100%; }
.rail-spacer{ flex:1; }
.rail-item,.rail-btn{
  position:relative; display:flex; align-items:center; justify-content:center;
  width:40px; height:40px; border-radius:var(--r-3); border:none; background:transparent;
  color:var(--c-faint); cursor:pointer; text-decoration:none; transition:background .14s ease-out,color .14s ease-out;
}
.rail-item i,.rail-btn i{ font-size:19px; }
.rail-item:hover,.rail-btn:hover{ background:var(--c-canvas); color:var(--c-ink); }
.rail-item.is-active{ background:var(--c-primary); color:#fff; }
.rail-tip{
  position:absolute; left:calc(100% + 10px); top:50%; transform:translateY(-50%);
  background:var(--c-ink); color:#fff; font-size:12px; font-weight:600; white-space:nowrap;
  padding:5px 9px; border-radius:var(--r-2); opacity:0; pointer-events:none; transition:opacity .12s ease; z-index:300;
}
.rail-item:hover .rail-tip{ opacity:1; }

/* Account — pinned at the bottom of the rail, avatar only, menu on activation */
.rail-account{ position:relative; margin-top:var(--s-1); }
.rail-account .topbar-profile-btn{
  width:40px; height:40px; padding:0; border:none; background:transparent; border-radius:var(--r-3);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.rail-account .topbar-profile-btn:hover{ background:var(--c-canvas); }
.rail-account .topbar-avatar{
  width:32px; height:32px; border-radius:var(--r-pill); display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:700; font-size:13px; background:var(--c-primary);
}
.rail-account .topbar-user-info,.rail-account .topbar-chevron{ display:none; }
.topbar-dropdown--up{
  position:absolute; bottom:0; left:calc(100% + 10px); width:232px;
  background:var(--c-surface); border:1px solid var(--c-line); border-radius:var(--r-4);
  box-shadow:var(--sh-2); padding:var(--s-1); display:none; z-index:400;
}
.topbar-dropdown--up.open{ display:block; }
.topbar-dropdown--up .topbar-dropdown-header{ display:flex; align-items:center; gap:var(--s-1); padding:var(--s-1); }
.topbar-dropdown--up .topbar-dd-avatar{ width:32px; height:32px; border-radius:var(--r-pill); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:13px; }
.topbar-dropdown--up .topbar-dd-name{ font-size:13px; font-weight:700; color:var(--c-ink); }
.topbar-dropdown--up .topbar-dd-role{ font-size:12px; color:var(--c-muted); text-transform:capitalize; }
.topbar-dropdown--up .topbar-dropdown-divider{ height:1px; background:var(--c-line-soft); margin:var(--s-05) 0; }
.topbar-dropdown--up .topbar-dd-item{
  display:flex; align-items:center; gap:var(--s-1); width:100%; padding:var(--s-1) var(--s-15);
  border:none; background:transparent; border-radius:var(--r-2); cursor:pointer; text-align:left;
  font-size:13px; color:var(--c-text); text-decoration:none;
}
.topbar-dropdown--up .topbar-dd-item:hover{ background:var(--c-canvas); color:var(--c-ink); }
.topbar-dropdown--up .topbar-dd-item--danger{ color:var(--c-danger); }
.topbar-dropdown--up .topbar-dd-item--danger:hover{ background:var(--c-danger-soft); }

/* Contextual panel */
.app-sidebar{
  position:fixed; top:0; left:var(--rail-w); width:var(--panel-w); height:100vh; z-index:200;
  transition:transform .2s cubic-bezier(.2,.8,.2,1); will-change:transform;
  background:var(--c-surface); border-right:1px solid var(--c-line); box-shadow:none;
  display:flex; flex-direction:column; padding:var(--s-15) 0 0; overflow:hidden;
}
.app-sidebar .sidebar-nav,.app-sidebar .sidebar-brand-wrap,.app-sidebar .sidebar-account{ display:none!important; }
#app-content{ margin-left:calc(var(--rail-w) + var(--panel-w)); min-width:0; transition:margin-left .2s cubic-bezier(.2,.8,.2,1); will-change:margin-left; }
#app-shell.panel-hidden .app-sidebar{ transform:translateX(calc(-100% - var(--rail-w))); }
#app-shell.panel-hidden #app-content{ margin-left:var(--rail-w); }

.ws-switcher{
  display:flex; align-items:center; gap:var(--s-1); width:calc(100% - 24px); margin:0 var(--s-15) var(--s-2);
  background:var(--c-surface); border:1px solid var(--c-line); border-radius:var(--r-3);
  padding:var(--s-1); cursor:pointer; text-align:left;
}
.ws-switcher:hover{ border-color:var(--c-line-strong); }
.ws-switcher-badge{ width:28px; height:28px; flex:0 0 28px; border-radius:var(--r-2); display:flex; align-items:center; justify-content:center; background:var(--c-primary); color:#fff; font-weight:700; font-size:12px; }
.ws-switcher-name{ flex:1; font-size:13px; font-weight:700; color:var(--c-ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ws-switcher-chevron{ color:var(--c-faint); font-size:12px; }

.panel-head{ display:flex; align-items:center; justify-content:space-between; padding:0 var(--s-2) var(--s-15); }
.panel-title{ font-size:18px; line-height:26px; font-weight:700; color:var(--c-ink); }
.app-sidebar .sidebar-collapse-btn{ position:static; width:28px; height:28px; border:none; background:transparent; color:var(--c-faint); border-radius:var(--r-2); cursor:pointer; }
.app-sidebar .sidebar-collapse-btn:hover{ background:var(--c-canvas); color:var(--c-ink); }

.panel-context{ padding:0 var(--s-15); overflow-y:auto; flex:1; }
.panel-group{ margin-bottom:var(--s-1); }
.panel-group-head,.panel-item{
  display:flex; align-items:center; gap:var(--s-1); width:100%; height:36px; padding:0 var(--s-1);
  border:none; background:transparent; border-radius:var(--r-2); cursor:pointer;
  font-size:13px; line-height:18px; color:var(--c-text);
}
.panel-group-head{ font-weight:700; }
.panel-group-head:hover,.panel-item:hover{ background:var(--c-canvas); color:var(--c-ink); }
.panel-group-icon{ color:var(--c-faint); font-size:14px; }
.panel-group-label,.panel-item-label{ flex:1; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.panel-count{ min-width:20px; height:20px; padding:0 6px; border-radius:var(--r-pill); background:var(--c-inset); color:var(--c-muted); font-size:11px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; font-variant-numeric:tabular-nums; }
.panel-group-chev{ color:var(--c-faint); font-size:11px; transition:transform .14s ease; }
.panel-group.is-collapsed .panel-group-chev{ transform:rotate(180deg); }
.panel-group.is-collapsed .panel-group-body{ display:none; }
.panel-group-body{ padding:2px 0 var(--s-05) var(--s-1); display:flex; flex-direction:column; gap:1px; }
.panel-item-badge{ width:22px; height:22px; flex:0 0 22px; border-radius:var(--r-2); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; background:var(--c-primary-soft); color:var(--c-primary); }
.sidebar-powered-by{ padding:var(--s-15) var(--s-2); font-size:11px; color:var(--c-faint); display:flex; gap:4px; }
.sidebar-powered-brand{ font-weight:700; color:var(--c-muted); }
.sidebar-spacer{ flex:0; }

.app-topbar--mobile-only{ display:none; }
@media (max-width:1023px){
  .app-rail{ display:none; }
  .app-sidebar{ left:0; transform:translateX(-100%); transition:transform .22s ease; }
  .app-sidebar.sidebar-open{ transform:translateX(0); }
  .app-sidebar .sidebar-account{ display:block!important; margin:var(--s-1) var(--s-15); }
  #app-content,#app-shell.panel-hidden #app-content{ margin-left:0; }
  .app-topbar--mobile-only{
    display:flex; align-items:center; gap:var(--s-1); padding:var(--s-1) var(--s-2);
    background:var(--c-surface); border-bottom:1px solid var(--c-line); position:sticky; top:0; z-index:150;
  }
  .app-topbar-brand{ display:inline-flex; align-items:center; gap:var(--s-1); text-decoration:none; color:var(--c-ink); font-weight:700; }
  .app-topbar-brand img{ width:24px; height:24px; }
}

/* ──────────────────────────────────────────────────────────── 04 CONTROLS ── */
:is(#app-shell,.modal) .btn{
  height:var(--h-ctl); padding:0 var(--s-2); border-radius:var(--r-3);
  font-size:13px; line-height:18px; font-weight:600;
  display:inline-flex; align-items:center; justify-content:center; gap:var(--s-1);
  border:1px solid transparent; white-space:nowrap; cursor:pointer; text-decoration:none;
  transition:background .14s ease-out,border-color .14s ease-out,color .14s ease-out;
}
:is(#app-shell,.modal) .btn i{ font-size:16px; }
:is(#app-shell,.modal) .btn-sm{ height:var(--h-sm); padding:0 var(--s-15); font-size:12px; border-radius:var(--r-2); }
:is(#app-shell,.modal) .btn-sm i{ font-size:14px; }
:is(#app-shell,.modal) .btn-lg{ height:var(--h-lg); padding:0 var(--s-3); font-size:14px; border-radius:var(--r-4); }
:is(#app-shell,.modal) :is(.btn-primary,.sim-create-btn,.btn-save,.ws-btn--save,.ws-btn--run,.btn--primary){
  background:var(--c-primary); border-color:var(--c-primary); color:#fff;
}
:is(#app-shell,.modal) :is(.btn-primary,.sim-create-btn,.btn-save,.ws-btn--save,.ws-btn--run,.btn--primary):hover{
  background:var(--c-primary-dark); border-color:var(--c-primary-dark); color:#fff;
}
:is(#app-shell,.modal) :is(.btn-secondary,.btn-light,.btn-outline-secondary,.btn-outline-light,.btn-outline-primary,.ws-btn,.ws-btn--ghost,.btn--outline){
  background:var(--c-surface); border-color:var(--c-line); color:var(--c-ink);
}
:is(#app-shell,.modal) :is(.btn-secondary,.btn-light,.btn-outline-secondary,.btn-outline-light,.btn-outline-primary,.ws-btn,.ws-btn--ghost,.btn--outline):hover{
  background:var(--c-canvas); border-color:var(--c-line-strong); color:var(--c-ink);
}
:is(#app-shell,.modal) .btn-link{ background:transparent; border-color:transparent; color:var(--c-primary); height:auto; padding:0; }
:is(#app-shell,.modal) .btn-link:hover{ color:var(--c-primary-dark); text-decoration:underline; }
:is(#app-shell,.modal) .btn-danger{ background:var(--c-danger); border-color:var(--c-danger); color:#fff; }
:is(#app-shell,.modal) .btn-danger:hover{ background:#9d2c2c; border-color:#9d2c2c; }
:is(#app-shell,.modal) .btn-outline-danger{ background:var(--c-surface); border-color:var(--c-danger); color:var(--c-danger); }
:is(#app-shell,.modal) .btn-outline-danger:hover{ background:var(--c-danger); color:#fff; }
:is(#app-shell,.modal) :is(.btn-success,.btn-outline-success){ background:var(--c-surface); border-color:var(--c-success); color:var(--c-success); }
:is(#app-shell,.modal) :is(.btn-success,.btn-outline-success):hover{ background:var(--c-success); color:#fff; }
:is(#app-shell,.modal) :is(.btn-warning,.btn-outline-warning){ background:var(--c-surface); border-color:var(--c-warning); color:var(--c-warning); }
:is(#app-shell,.modal) :is(.btn-warning,.btn-outline-warning):hover{ background:var(--c-warning); color:#fff; }
:is(#app-shell,.modal) .btn:disabled,:is(#app-shell,.modal) .btn.disabled{ opacity:.4; }
:is(#app-shell,.modal) :is(.btn,button,a,input,select,textarea,[tabindex]):focus-visible{
  outline:2px solid var(--c-primary); outline-offset:2px; box-shadow:none;
}

.icon-btn{
  width:var(--h-ctl); height:var(--h-ctl); flex:0 0 var(--h-ctl); position:relative;
  border-radius:var(--r-3); border:1px solid var(--c-line); background:var(--c-surface);
  color:var(--c-text); display:inline-flex; align-items:center; justify-content:center; cursor:pointer;
}
.icon-btn i{ font-size:18px; }
.icon-btn:hover{ background:var(--c-canvas); border-color:var(--c-line-strong); }
.icon-btn--quiet{ border-color:transparent; background:transparent; color:var(--c-muted); width:32px; height:32px; flex:0 0 32px; }
.icon-btn--quiet:hover{ background:var(--c-canvas); color:var(--c-ink); }
.icon-btn--quiet i{ font-size:15px; }
.notif-dot{ position:absolute; top:9px; right:10px; width:8px; height:8px; border-radius:50%; background:var(--c-danger); border:2px solid var(--c-surface); }

#app-shell :is(.form-control,.form-select){
  height:var(--h-ctl); border:1px solid var(--c-line); border-radius:var(--r-3);
  padding:0 var(--s-15); font-size:14px; color:var(--c-ink); background:var(--c-surface); box-shadow:none;
}
#app-shell :is(.form-control,.form-select):hover{ border-color:var(--c-line-strong); }
#app-shell :is(.form-control,.form-select):focus{ border-color:var(--c-primary); box-shadow:0 0 0 3px rgba(14,99,196,.18); outline:none; }
#app-shell textarea.form-control{ height:auto; min-height:96px; padding:var(--s-15); }
#app-shell .form-label{ font-size:13px; font-weight:600; color:var(--c-text); margin-bottom:var(--s-05); }
#app-shell .form-control-sm,#app-shell .form-select-sm{ height:var(--h-sm); font-size:13px; border-radius:var(--r-2); }

/* Soft pastel semantic pills */
.pill{ display:inline-flex; align-items:center; gap:var(--s-05); height:24px; padding:0 10px; border-radius:var(--r-pill); font-size:12px; line-height:16px; font-weight:600; white-space:nowrap; }
.pill--neutral{ background:var(--c-inset); color:var(--c-muted); }
.pill--draft{ background:var(--c-inset); color:var(--c-text); }
.pill--progress{ background:var(--c-info-soft); color:var(--c-info); }
.pill--done,.pill--approved{ background:var(--c-success-soft); color:var(--c-success); }
.pill--final{ background:var(--c-primary-soft); color:var(--c-primary); }
.pill--warn{ background:var(--c-warning-soft); color:var(--c-warning); }

.avatar{ width:24px; height:24px; flex:0 0 24px; border-radius:var(--r-pill); display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color:#fff; background:var(--c-primary); }
.avatar--sm{ width:20px; height:20px; flex:0 0 20px; font-size:10px; }
.avatar--lg{ width:32px; height:32px; flex:0 0 32px; font-size:13px; }

/* ─────────────────────────────────────────────── 05 CARDS & SECTION RHYTHM ── */
#app-shell .surface{ background:var(--c-surface); border-radius:var(--r-5); padding:var(--s-3); border:none; box-shadow:none; }
#app-shell .surface--compact{ padding:var(--s-2); border-radius:var(--r-4); }
.section-head{ display:flex; align-items:center; gap:var(--s-1); margin-bottom:var(--s-2); }
.section-head > :is(h2,h3){ flex:1; min-width:0; }
#app-shell .card{ background:var(--c-surface); border:1px solid var(--c-line); border-radius:var(--r-5); box-shadow:none; }
#app-shell .card-header{ background:transparent; border-bottom:1px solid var(--c-line-soft); padding:var(--s-2) var(--s-3); }
#app-shell .card-body{ padding:var(--s-3); }

/* ─────────────────────────────────────────────────────────────── 06 TABLE ── */
#app-shell .tbl{ width:100%; border-collapse:separate; border-spacing:0; margin:0; }
#app-shell .tbl thead th{
  height:40px; padding:0 var(--s-15); text-align:left; white-space:nowrap;
  font-size:12px; line-height:16px; font-weight:600; color:var(--c-muted);
  text-transform:none; letter-spacing:0; background:transparent;
  border:none; border-bottom:1px solid var(--c-line); vertical-align:middle;
}
#app-shell .tbl tbody td{
  height:56px; padding:0 var(--s-15); font-size:13px; line-height:20px; color:var(--c-text);
  border:none; border-bottom:1px solid var(--c-line-soft); vertical-align:middle; background:transparent;
}
#app-shell .tbl tbody tr:last-child td{ border-bottom:none; }
#app-shell .tbl tbody tr:hover td{ background:var(--c-inset); }
#app-shell .tbl tbody tr:hover .row-actions{ opacity:1; }
#app-shell .tbl .col-num{ text-align:right; }
.row-actions{ opacity:0; transition:opacity .14s ease-out; display:inline-flex; }
.row-title{ font-size:13px; font-weight:600; color:var(--c-ink); text-decoration:none; }
.row-title:hover{ color:var(--c-primary); text-decoration:underline; }
.cell-stack{ display:flex; align-items:center; gap:var(--s-1); min-width:0; }
.mini-bar{ width:48px; height:6px; border-radius:var(--r-pill); background:var(--c-inset); overflow:hidden; display:inline-block; vertical-align:middle; }
.mini-bar > span{ display:block; height:100%; background:var(--c-primary); border-radius:var(--r-pill); }

/* ──────────────────────────────────────────────────────── 07 PAGE LAYOUT ── */
#app-shell .mds-page{ padding:var(--s-4); max-width:none; margin:0; width:100%; }
@media (max-width:1439px){ #app-shell .mds-page{ padding:var(--s-3); } }
@media (max-width:767px){ #app-shell .mds-page{ padding:var(--s-2); } }
.page-head{ display:flex; align-items:flex-start; gap:var(--s-2); margin-bottom:var(--s-4); }
.page-head-text{ flex:1; min-width:0; }
.page-head-actions{ display:flex; align-items:center; gap:var(--s-1); flex-shrink:0; }
.page-support{ font-size:14px; line-height:22px; color:var(--c-muted); margin:var(--s-05) 0 0; }
.mds-mobile-toggle{ display:none; }
@media (max-width:1023px){ .mds-mobile-toggle{ display:inline-flex; } }
@media (max-width:767px){
  .page-head{ flex-wrap:wrap; }
  .page-head-actions{ width:100%; }
  .t-display{ font-size:24px; line-height:32px; }
}
.dash-grid{ display:grid; grid-template-columns:minmax(0,1fr) 304px; gap:var(--s-3); align-items:start; }
@media (max-width:1279px){ .dash-grid{ grid-template-columns:1fr; } }
.dash-main{ display:flex; flex-direction:column; gap:var(--s-5); min-width:0; }
.dash-rail{ display:flex; flex-direction:column; gap:var(--s-5); min-width:0; }

/* ─────────────────────────────────────────────────── 08 RECENT EXERCISES ── */
.recent-grid{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--s-2); }
@media (max-width:1279px){ .recent-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:640px){ .recent-grid{ grid-template-columns:1fr; } }
.recent-card{
  display:flex; flex-direction:column; text-align:left; min-width:0;
  background:var(--c-surface); border:none; border-radius:var(--r-5); padding:0; overflow:hidden;
  cursor:pointer; transition:box-shadow .14s ease-out, transform .14s ease-out;
}
.recent-card:hover{ box-shadow:var(--sh-1); transform:translateY(-1px); }
.recent-top{
  position:relative; height:84px; background:linear-gradient(180deg,#EAF4FE 0%,#E1EEFB 100%);
  display:flex; align-items:flex-start; padding:var(--s-15); gap:var(--s-1); flex-wrap:wrap;
}
.recent-top .pill{ background:rgba(255,255,255,.94); }
.recent-glyph{ position:absolute; right:var(--s-15); bottom:var(--s-1); font-size:26px; color:rgba(14,99,196,.18); }
.recent-body{ padding:var(--s-2); display:flex; flex-direction:column; gap:var(--s-1); flex:1; }
.recent-title{ font-size:15px; line-height:22px; font-weight:600; color:var(--c-ink); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.recent-progress-label{ font-size:12px; line-height:16px; font-weight:600; color:var(--c-text); }
.recent-bar{ height:6px; border-radius:var(--r-pill); background:var(--c-inset); overflow:hidden; }
.recent-bar > span{ display:block; height:100%; background:var(--c-primary); border-radius:var(--r-pill); }
.recent-foot{ display:flex; align-items:center; gap:var(--s-1); margin-top:auto; padding-top:var(--s-15); border-top:1px solid var(--c-line-soft); }
.recent-updated{ font-size:12px; color:var(--c-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.recent-open{ margin-left:auto; font-size:12px; font-weight:600; color:var(--c-primary); display:inline-flex; align-items:center; gap:4px; white-space:nowrap; }

/* ───────────────────────────────────────────────────────────── 09 TOOLBAR ── */
.toolbar{ display:flex; align-items:center; gap:var(--s-1); flex-wrap:wrap; margin-bottom:var(--s-2); }
.search{ position:relative; width:300px; max-width:100%; }
@media (max-width:1023px){ .search{ width:240px; } }
.search-icon{ position:absolute; left:var(--s-15); top:50%; transform:translateY(-50%); color:var(--c-muted); font-size:15px; pointer-events:none; }
#app-shell .search-input{
  width:100%; height:var(--h-ctl); border:1px solid var(--c-line); border-radius:var(--r-3);
  padding:0 var(--s-15) 0 36px; font-size:13px; color:var(--c-ink); background:var(--c-surface);
}
#app-shell .search-input:focus{ border-color:var(--c-primary); box-shadow:0 0 0 3px rgba(14,99,196,.18); outline:none; }
.toolbar-right{ margin-left:auto; display:flex; align-items:center; gap:var(--s-1); }
#app-shell .segment{ display:inline-flex; gap:2px; height:var(--h-ctl); padding:3px; background:var(--c-surface); border:1px solid var(--c-line); border-radius:var(--r-3); }
#app-shell .segment .btn{ height:32px; padding:0 var(--s-15); border:none; background:transparent; color:var(--c-muted); border-radius:var(--r-2); }
#app-shell .segment .btn:hover{ background:var(--c-canvas); color:var(--c-ink); }
#app-shell .segment .btn-check:checked + .btn{ background:var(--c-primary-soft); color:var(--c-primary); }
.chips{ display:flex; flex-wrap:wrap; gap:var(--s-1); margin-bottom:var(--s-2); }
#app-shell .filter-chip{
  height:32px; padding:0 var(--s-15); border-radius:var(--r-pill); border:1px solid var(--c-line);
  background:var(--c-surface); color:var(--c-text); font-size:13px; font-weight:600;
  display:inline-flex; align-items:center; gap:var(--s-05); cursor:pointer; transition:background .14s,border-color .14s,color .14s;
}
#app-shell .filter-chip:hover{ background:var(--c-canvas); border-color:var(--c-line-strong); }
#app-shell .filter-chip.active{ background:var(--c-primary); border-color:var(--c-primary); color:#fff; }
#app-shell .filter-chip .chip-count{ min-width:18px; height:18px; padding:0 5px; border-radius:var(--r-pill); background:var(--c-inset); color:var(--c-muted); font-size:11px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; font-variant-numeric:tabular-nums; }
#app-shell .filter-chip.active .chip-count{ background:rgba(255,255,255,.25); color:#fff; }
#app-shell .filter-chip.chip-empty{ opacity:.5; }
.results-meta{ display:flex; align-items:center; gap:var(--s-1); margin-bottom:var(--s-15); }

/* ──────────────────────────────────────────────────── 10 ACTIVITY + STATS ── */
.activity{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:var(--s-05); }
.activity-group{ font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--c-faint); padding:var(--s-1) var(--s-1) var(--s-05); }
.activity-item{ display:flex; gap:var(--s-15); align-items:flex-start; padding:var(--s-1); border-radius:var(--r-3); background:var(--c-inset); }
.activity-copy{ font-size:13px; line-height:19px; color:var(--c-text); }
.activity-copy strong{ color:var(--c-ink); font-weight:600; }
.activity-time{ font-size:11px; color:var(--c-muted); margin-top:2px; }
.stat-primary{ margin-bottom:var(--s-15); }
.stat-label{ font-size:12px; font-weight:600; color:var(--c-muted); }
.stat-value{ font-size:28px; line-height:36px; font-weight:700; color:var(--c-ink); }
.stat-context{ font-size:12px; color:var(--c-muted); }
.stat-bar{ height:6px; border-radius:var(--r-pill); background:var(--c-inset); overflow:hidden; margin-bottom:var(--s-2); }
.stat-bar > span{ display:block; height:100%; background:var(--c-primary); border-radius:var(--r-pill); }
.stat-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:var(--s-15); }
.stat-list li{ display:flex; align-items:center; gap:var(--s-1); font-size:13px; color:var(--c-text); }
.stat-dot{ width:8px; height:8px; border-radius:50%; flex:0 0 8px; }
.stat-val{ margin-left:auto; font-weight:700; color:var(--c-ink); font-variant-numeric:tabular-nums; }

/* ────────────────────────────────────────────────────────────── 11 STATES ── */
.empty-state{ padding:var(--s-6) var(--s-3); text-align:center; }
.empty-state i{ font-size:24px; color:var(--c-faint); }
.empty-state h4{ font-size:16px; line-height:24px; font-weight:600; color:var(--c-ink); margin:var(--s-15) 0 var(--s-05); }
.empty-state p{ font-size:14px; line-height:22px; color:var(--c-muted); margin:0 0 var(--s-2); }
.skel-row{ height:56px; border-bottom:1px solid var(--c-line-soft); background:linear-gradient(90deg,#F2F5FA 25%,#E9EEF6 37%,#F2F5FA 63%); background-size:400% 100%; animation:skel 1.4s ease-in-out infinite; }
@keyframes skel{ 0%{background-position:100% 0} 100%{background-position:0 0} }

.modal .modal-content{ border:none; border-radius:var(--r-5); box-shadow:var(--sh-3); }
.modal .modal-header,.modal .modal-footer{ border-color:var(--c-line-soft); padding:var(--s-3); }
.modal .modal-body{ padding:var(--s-3); }
#app-shell ::-webkit-scrollbar{ width:10px; height:10px; }
#app-shell ::-webkit-scrollbar-thumb{ background:#CBD4E1; border-radius:6px; border:2px solid var(--c-canvas); }

/* Superseded page chrome */
#app-shell .sim-page-header,#app-shell #exercises-stats,#app-shell #filter-bar,#app-shell #org-dashboard{ display:none!important; }

/* ════════════════════════════════════════════════════════════════════════════
   WORKSPACE PAGES — previously approved modules, kept on the same token system
   ════════════════════════════════════════════════════════════════════════════ */
/* Sticky stage stepper */
.ws-stage-nav{
  position:sticky; top:0; z-index:120; display:flex; align-items:center; justify-content:center;
  gap:var(--s-05); overflow-x:auto; padding:var(--s-1) var(--s-3);
  background:rgba(255,255,255,.94); backdrop-filter:saturate(180%) blur(8px);
  border-bottom:1px solid var(--c-line);
}
.ws-stepper{ display:flex; align-items:center; gap:0; margin:0; padding:0; list-style:none; }
.ws-step{ display:flex; align-items:center; }
.ws-step:not(:last-child)::after{ content:''; width:26px; height:2px; margin:0 var(--s-05); background:var(--c-line); border-radius:2px; }
.ws-step.is-complete:not(:last-child)::after{ background:var(--c-primary); }
.ws-step__btn{ display:inline-flex; align-items:center; gap:var(--s-1); background:transparent; border:none; padding:6px var(--s-1); border-radius:var(--r-2); cursor:pointer; color:var(--c-muted); font-weight:600; font-size:13px; white-space:nowrap; }
.ws-step__btn:hover{ background:var(--c-canvas); color:var(--c-ink); }
.ws-step__marker{ display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; font-size:11px; font-weight:700; background:var(--c-inset); color:var(--c-muted); border:2px solid transparent; }
.ws-step.is-active .ws-step__btn{ color:var(--c-ink); }
.ws-step.is-active .ws-step__marker{ background:#fff; color:var(--c-primary); border-color:var(--c-primary); }
.ws-step.is-complete .ws-step__marker{ background:var(--c-primary); color:#fff; }
@media (max-width:720px){ .ws-step__label{ display:none; } .ws-step:not(:last-child)::after{ width:16px; } }

/* Collapsible panel control */
.ws-collapse-btn{ background:transparent!important; border-color:transparent!important; color:var(--c-muted)!important; padding:0 var(--s-1)!important; }
.ws-collapse-btn:hover{ background:var(--c-canvas)!important; color:var(--c-ink)!important; }
.ws-collapse-btn i{ transition:transform .14s ease; }
.card.ws-collapsed > :not(.card-header){ display:none!important; }
.card.ws-collapsed .ws-collapse-btn i{ transform:rotate(180deg); }

/* Employee Data upload — compact */
#employee-data-upload-section .edu-panel{ min-height:0; padding:var(--s-15) var(--s-2); gap:var(--s-1); border-radius:var(--r-4); }
#employee-data-upload-section .edu-icon-wrap{ width:42px; height:42px; border-radius:var(--r-4); font-size:1.1rem; }
#employee-data-upload-section .edu-title{ font-size:15px; }
#employee-data-upload-section .edu-desc{ font-size:12px; line-height:1.4; max-width:320px; }
#employee-data-upload-section .edu-divider{ padding:0 var(--s-2); }
#employee-data-upload-section .card-body{ padding:var(--s-2) var(--s-3); }
#employee-data-upload-section.edu-has-data > .card{ border-color:#BBF7D0; }
#employee-data-upload-section.edu-has-data .card-header{ display:flex; align-items:center; }
#employee-data-upload-section.edu-has-data .card-header::after{
  content:'\2713  Employee data loaded'; margin-left:auto; font-size:12px; font-weight:700;
  color:var(--c-success); background:var(--c-success-soft); border-radius:var(--r-pill); padding:3px 10px;
}
#employee-data-upload-section.edu-has-data .edu-panels{ opacity:.72; transition:opacity .15s ease; }
#employee-data-upload-section.edu-has-data .edu-panels:hover{ opacity:1; }

/* Final Reports read as outputs */
:is(#final-merit-matrices-section,#final-merit-increases-section,#budget-summary-section) > .card{ border-top:3px solid var(--c-primary); }
:is(#final-merit-matrices-section,#final-merit-increases-section,#budget-summary-section) .card-header{ background:var(--c-inset); }
:is(#final-merit-matrices-section,#final-merit-increases-section,#budget-summary-section) .table-hover > tbody > tr:hover > *{ background:transparent; }
:is(#final-merit-matrices-section,#final-merit-increases-section,#budget-summary-section) .card-header :is(h5,h6)::after{
  content:'REPORT'; margin-left:var(--s-1); font-size:10px; font-weight:700; letter-spacing:.08em;
  color:var(--c-primary); background:var(--c-primary-soft); border-radius:var(--r-pill); padding:2px 8px; vertical-align:middle;
}

/* Planning vs Optimization path selector */
.path-select{ display:grid; grid-template-columns:1fr 1fr; gap:var(--s-15); }
@media (max-width:520px){ .path-select{ grid-template-columns:1fr; } }
.path-card{
  position:relative; text-align:left; cursor:pointer; display:flex; flex-direction:column; gap:6px;
  background:#fff; border:1.5px solid var(--c-line); border-radius:var(--r-4); padding:var(--s-2);
  transition:border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.path-card:hover{ border-color:var(--c-line-strong); box-shadow:var(--sh-1); }
.path-card.is-active{ border-color:var(--c-primary); background:var(--c-primary-soft); box-shadow:0 0 0 3px rgba(14,99,196,.16); }
.path-card-ic{ width:38px; height:38px; border-radius:var(--r-3); display:inline-flex; align-items:center; justify-content:center; font-size:1.05rem; background:var(--c-primary-soft); color:var(--c-primary); }
.path-card-title{ font-size:15px; font-weight:700; color:var(--c-ink); }
.path-card-desc{ font-size:12px; color:var(--c-muted); line-height:1.4; }
.path-card-check{ position:absolute; top:10px; right:10px; width:20px; height:20px; border-radius:50%; background:var(--c-primary); color:#fff; display:none; align-items:center; justify-content:center; font-size:11px; }
.path-card.is-active .path-card-check{ display:inline-flex; }

/* Mobile drawer reveals rail + panel together so the account stays reachable */
@media (max-width:1023px){
  .app-rail{ display:flex; left:0; transform:translateX(-100%); transition:transform .22s ease; z-index:260; }
  .app-sidebar{ left:var(--rail-w); transform:translateX(calc(-100% - var(--rail-w))); }
  #app-shell.drawer-open .app-rail{ transform:translateX(0); }
  #app-shell.drawer-open .app-sidebar,.app-sidebar.sidebar-open{ transform:translateX(0); }
  .app-sidebar .sidebar-account{ display:none!important; }
}

/* Panel starts with its title now that the workspace switcher is gone */
.app-sidebar .panel-head{ padding-top:var(--s-05); }
/* Content reflows smoothly with the panel; guard against any horizontal spill */
#app-content{ overflow-x:hidden; }
#app-shell .mds-page{ transition:none; }

/* Panel-hidden is a desktop-only concept; on mobile the drawer owns visibility */
@media (max-width:1023px){
  #app-shell.panel-hidden .app-sidebar{ transform:translateX(calc(-100% - var(--rail-w))); }
  #app-shell.panel-hidden.drawer-open .app-sidebar{ transform:translateX(0); }
}

/* Exercises panel — surface only in LIST view. In card view the container is a
   plain grid, so cards are never clipped by the panel's overflow/rounding. */
#app-shell #exercises-container.exercises-panel:not(.sim-cards-grid){
  background:var(--c-surface); border-radius:var(--r-5); overflow:hidden;
}
#app-shell #exercises-container.sim-cards-grid{
  background:transparent; border-radius:0; overflow:visible; padding:0;
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--s-2);
}
@media (max-width:1279px){ #app-shell #exercises-container.sim-cards-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:640px){ #app-shell #exercises-container.sim-cards-grid{ grid-template-columns:1fr; } }
/* Cards in that grid sit on their own surface */
#app-shell #exercises-container.sim-cards-grid .exercise-card,
#app-shell #exercises-container.sim-cards-grid > .card{
  background:var(--c-surface); border:1px solid var(--c-line); border-radius:var(--r-5);
  box-shadow:none; height:100%; margin:0; transition:box-shadow .14s ease-out, border-color .14s ease-out;
}
#app-shell #exercises-container.sim-cards-grid .exercise-card:hover{ box-shadow:var(--sh-1); border-color:var(--c-line-strong); }
/* Bootstrap column wrappers inside the grid would double-space it */
#app-shell #exercises-container.sim-cards-grid > [class*="col-"]{ width:100%; max-width:none; padding:0; flex:none; }

/* List and card view must occupy identical width — nothing may impose a wider
   intrinsic size that shrinks or offsets the page. */
#app-shell .dash-grid,
#app-shell .dash-main,
#app-shell .dash-rail{ min-width:0; max-width:100%; }
#app-shell .table-responsive{ width:100%; max-width:100%; overflow-x:auto; }
#app-shell #exercises-container{ width:100%; max-width:100%; }
#app-shell .tbl{ table-layout:fixed; }
#app-shell .tbl td,#app-shell .tbl th{ overflow:hidden; text-overflow:ellipsis; }
#app-shell .tbl .cell-stack{ overflow:hidden; }
#app-shell .tbl .row-title{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ── Rail as a first-class region ────────────────────────────────────────────
   The rail now uses the main column's structure exactly: heading on the canvas,
   surface beneath. Locking the section-head box model in both columns is what
   makes the two top lines and every following baseline agree. */
#app-shell .dash-main > section > .section-head,
#app-shell .dash-rail > section > .section-head{
  min-height:32px; margin-bottom:var(--s-2); align-items:center;
}
#app-shell .dash-rail > section > .section-head > h2,
#app-shell .dash-main > section > .section-head > h2{
  font-size:20px; line-height:28px; font-weight:700;
}
/* Surfaces in both columns share padding + radius so their inner content aligns */
#app-shell .dash-rail .surface--compact{ padding:var(--s-2); border-radius:var(--r-5); }

/* ── Panel: section navigator (Configurations / Users / workspace) ─────────── */
.panel-nav{ display:flex; flex-direction:column; gap:2px; }
.panel-navitem{
  display:flex; align-items:center; gap:var(--s-1); width:100%; min-height:36px;
  padding:var(--s-1) var(--s-1); border:none; background:transparent; border-radius:var(--r-2);
  cursor:pointer; text-align:left; font-size:13px; line-height:18px; color:var(--c-text);
  transition:background .14s ease-out, color .14s ease-out;
}
.panel-navitem:hover{ background:var(--c-canvas); color:var(--c-ink); }
.panel-navdot{
  width:6px; height:6px; flex:0 0 6px; border-radius:50%; background:var(--c-line-strong);
  transition:background .14s ease-out, transform .14s ease-out;
}
.panel-navitem .panel-item-label{ white-space:normal; overflow:visible; }
.panel-navitem.is-active{ background:var(--c-primary-soft); color:var(--c-primary); font-weight:600; }
.panel-navitem.is-active .panel-navdot{ background:var(--c-primary); transform:scale(1.25); }

/* Auto-hide: no meaningful context → content takes the full width */
#app-shell.panel-empty .app-sidebar{ transform:translateX(calc(-100% - var(--rail-w))); }
#app-shell.panel-empty #app-content{ margin-left:var(--rail-w); }
#app-shell.panel-empty #rail-panel-toggle{ display:none; }

/* Type/Status pills must never be clipped by the fixed table layout */
#app-shell .tbl td .pill{ max-width:100%; overflow:hidden; text-overflow:ellipsis; display:inline-flex; }
#app-shell .tbl td:last-child{ overflow:visible; }

/* Section navigator items are real controls — make that obvious and reliable */
.panel-navitem{ user-select:none; -webkit-user-select:none; }
.panel-navitem:active{ background:var(--c-primary-soft); }
/* Jump targets clear any sticky header instead of hiding under it */
#app [id^="psec-"], #app .container-fluid[id]{ scroll-margin-top:88px; }

/* ── Wide workspace tables: scroll, never squeeze ────────────────────────────
   The merit matrices have many zone columns. When the sidebar opens the content
   column narrows, and Bootstrap's width:100% was compressing the columns until
   the header labels ran into each other. Giving the table a max-content minimum
   makes the .table-responsive wrapper scroll instead, so the layout stays
   readable at any content width. .tbl (the dashboard table) is excluded — it is
   deliberately fixed-layout with ellipsis. */
#app-shell .table-responsive{ overflow-x:auto; max-width:100%; -webkit-overflow-scrolling:touch; }
#app-shell .table-responsive > table:not(.tbl){ min-width:max-content; }
#app-shell .table-responsive > table:not(.tbl) > thead th{ white-space:nowrap; }
#app-shell .table-responsive > table:not(.tbl) > tbody td{ white-space:nowrap; }
/* First column of a matrix (the rating label) may wrap — it carries long names */
#app-shell .table-responsive > table:not(.tbl) > tbody td:first-child,
#app-shell .table-responsive > table:not(.tbl) > thead th:first-child{ white-space:normal; }

/* Cards must not clip the scroller */
#app-shell .card-body:has(> .table-responsive){ overflow:visible; }

/* A quiet scrollbar so the affordance is visible without being loud */
#app-shell .table-responsive::-webkit-scrollbar{ height:10px; }
#app-shell .table-responsive::-webkit-scrollbar-thumb{ background:#CBD4E1; border-radius:6px; border:2px solid var(--c-surface); }
#app-shell .table-responsive::-webkit-scrollbar-track{ background:transparent; }
/* Budget Summary: the pay-element multi-select must not resize with its label */
#app-shell #budget-summary-elements-dropdown{
  width:260px; min-width:260px; max-width:260px;
  justify-content:space-between; text-align:left;
}
#app-shell #budget-summary-elements-label{
  flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block;
}

/* ── Merit matrices: content-sized columns, not fixed ────────────────────────
   styles.css pins #resulting-merit-matrix-table and #final-merit-matrices-table
   to table-layout:fixed + width:100%. Fixed layout ignores content width, so a
   long header like "BELOW MINIMUM BY <10%" overflowed its cell and printed on
   top of the next column — visible with the sidebar open OR closed. Switching
   these two to auto layout with a max-content minimum lets each column size to
   its header and the wrapper scroll instead. */
#app-shell #resulting-merit-matrix-table,
#app-shell #final-merit-matrices-table{
  table-layout:auto !important;
  width:auto !important;
  min-width:100% !important;
}
#app-shell #resulting-merit-matrix-table th,
#app-shell #final-merit-matrices-table th{
  white-space:nowrap; padding-left:14px; padding-right:14px;
}
#app-shell #resulting-merit-matrix-table td,
#app-shell #final-merit-matrices-table td{ white-space:nowrap; }
/* Rating labels keep wrapping — they are long by nature */
#app-shell #resulting-merit-matrix-table :is(th,td):first-child,
#app-shell #final-merit-matrices-table :is(th,td):first-child{
  white-space:normal; min-width:180px;
}

/* ════════════════════════════════════════════════════════════════════════════
   EMPLOYEE DATA — compact workflow (density pass)
   One card, actions in the header, a slim 3-step workflow, and a single-row
   summary for the loaded state (the 99% case). Spacing uses the 4/8/12/16/24/32
   scale only. Replaces the two oversized panels.
   ════════════════════════════════════════════════════════════════════════════ */
#employee-data-upload-section .edu-head{
  display:flex; align-items:center; gap:var(--s-1); flex-wrap:wrap;
  padding:var(--s-15) var(--s-3);
}
#employee-data-upload-section .edu-head-title{
  display:flex; align-items:center; gap:var(--s-1); font-size:15px; line-height:22px; font-weight:700; margin:0;
}
#employee-data-upload-section .edu-head-actions{ margin-left:auto; display:flex; align-items:center; gap:var(--s-1); }
#employee-data-upload-section .edu-format{ width:132px; height:var(--h-sm); font-size:12px; }
#employee-data-upload-section .edu-head .ws-btn{ height:var(--h-sm); padding:0 var(--s-15); font-size:12px; }
.edu-status{
  display:inline-flex; align-items:center; gap:var(--s-05); height:24px; padding:0 10px;
  border-radius:var(--r-pill); background:var(--c-success-soft); color:var(--c-success);
  font-size:12px; font-weight:600;
}
#employee-data-upload-section .edu-body{ padding:var(--s-2) var(--s-3) var(--s-3); }

/* 3-step workflow strip */
.edu-steps{
  display:flex; align-items:center; gap:var(--s-1); list-style:none; margin:0 0 var(--s-2); padding:0;
  flex-wrap:wrap;
}
.edu-step{ display:inline-flex; align-items:center; gap:var(--s-1); font-size:12px; font-weight:600; color:var(--c-text); }
.edu-step-n{
  width:20px; height:20px; border-radius:var(--r-pill); background:var(--c-primary-soft); color:var(--c-primary);
  display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-weight:700;
}
.edu-step-sep{ color:var(--c-faint); font-size:11px; display:inline-flex; }

/* Slim dropzone — obvious but not dominant */
#employee-data-upload-section .edu-drop{
  display:flex; align-items:center; justify-content:center; gap:var(--s-1);
  height:72px; border:1px dashed var(--c-line-strong); border-radius:var(--r-4);
  background:var(--c-inset); cursor:pointer; padding:0 var(--s-2);
  transition:border-color .14s ease-out, background .14s ease-out;
}
#employee-data-upload-section .edu-drop:hover,
#employee-data-upload-section .edu-drop.dragover{ border-color:var(--c-primary); background:var(--c-primary-soft); }
#employee-data-upload-section .edu-drop i{ font-size:18px; color:var(--c-primary); }
.edu-drop-text{ font-size:13px; color:var(--c-text); }
.edu-drop-text strong{ color:var(--c-primary); font-weight:600; }
.edu-drop-hint{ font-size:11px; color:var(--c-muted); }

/* Selected file row */
.edu-selected{
  display:flex; align-items:center; gap:var(--s-15); height:56px; padding:0 var(--s-2);
  border:1px solid var(--c-line); border-radius:var(--r-4); background:var(--c-surface);
}
.edu-selected-icon{ font-size:18px; color:var(--c-primary); }
.edu-selected-name{ font-size:13px; font-weight:600; color:var(--c-ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.edu-selected-size{ font-size:11px; color:var(--c-muted); }
.edu-selected-actions{ margin-left:auto; display:flex; gap:var(--s-1); }

/* Loaded state — one compact summary row */
.edu-summary{
  display:flex; align-items:center; gap:var(--s-15); height:56px; padding:0 var(--s-2);
  border:1px solid var(--c-line); border-radius:var(--r-4); background:var(--c-inset);
}
.edu-summary-icon{ font-size:18px; color:var(--c-success); }
.edu-summary-meta{ display:flex; flex-direction:column; min-width:0; }
.edu-summary-name{ font-size:13px; font-weight:600; color:var(--c-ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.edu-summary-sub{ font-size:11px; color:var(--c-muted); }
.edu-summary-count{ margin-left:auto; font-size:13px; font-weight:700; color:var(--c-ink); font-variant-numeric:tabular-nums; }
.edu-summary + .ws-btn, .edu-summary .ws-btn{ height:var(--h-sm); padding:0 var(--s-15); font-size:12px; }

/* Loaded: hide the empty-state chrome entirely */
#employee-data-upload-section.edu-has-data .edu-steps,
#employee-data-upload-section.edu-has-data .edu-drop{ display:none !important; }
#employee-data-upload-section.edu-has-data .edu-summary{ display:flex !important; }
/* The old "data loaded" pseudo-badge is replaced by the header chip */
#employee-data-upload-section.edu-has-data .card-header::after{ content:none !important; }
#employee-data-upload-section.edu-has-data > .card{ border-color:var(--c-line); }
#employee-data-upload-section.edu-has-data .edu-panels{ opacity:1; }

/* ── Uploaded Employees: Stripe-style stat tiles (80–100px) ────────────────── */
#employees-section .stat-grid{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:var(--s-15);
}
#employees-section .stat-tile{
  min-height:84px; display:flex; flex-direction:column; justify-content:center; gap:var(--s-05);
  padding:var(--s-2); border:1px solid var(--c-line); border-radius:var(--r-4); background:var(--c-surface);
}
#employees-section .stat-tile-num{
  font-size:24px; line-height:30px; font-weight:700; color:var(--c-ink); font-variant-numeric:tabular-nums;
}
#employees-section .stat-tile-label{ font-size:12px; line-height:16px; color:var(--c-muted); }
#employees-section .card-header{ padding:var(--s-15) var(--s-3); }
#employees-section .card-body{ padding:var(--s-2) var(--s-3) var(--s-3); }
#employees-section .card-header .btn{ height:var(--h-sm); padding:0 var(--s-15); font-size:12px; }

/* ── Employee Data: minimum viable footprint ─────────────────────────────────
   Empty state = one header row + one 52px dropzone (~112px total).
   Loaded state = a SINGLE 48px row with no card header and no card padding —
   the upload is a one-time action and should not hold page real estate. */
#employee-data-upload-section{ margin-bottom:var(--s-2) !important; }
#employee-data-upload-section .edu-head{ padding:var(--s-1) var(--s-2); min-height:44px; }
#employee-data-upload-section .edu-head-title{ font-size:13px; line-height:18px; }
#employee-data-upload-section .edu-body{ padding:0 var(--s-2) var(--s-2); }
#employee-data-upload-section .edu-drop{ height:52px; border-radius:var(--r-3); gap:var(--s-1); }
#employee-data-upload-section .edu-drop i{ font-size:16px; }
#employee-data-upload-section .edu-drop-text{ font-size:12px; }
#employee-data-upload-section .edu-drop-hint{ font-size:11px; }
#employee-data-upload-section .edu-selected{ height:48px; border-radius:var(--r-3); }

/* LOADED: collapse the whole card to one row */
#employee-data-upload-section.edu-has-data .edu-head{ display:none !important; }
#employee-data-upload-section.edu-has-data .edu-body{ padding:0 !important; }
#employee-data-upload-section.edu-has-data > .card{ border:none; background:transparent; box-shadow:none; }
#employee-data-upload-section.edu-has-data .edu-summary{
  height:48px; border-radius:var(--r-4); background:var(--c-surface);
  border:1px solid var(--c-line); padding:0 var(--s-15); gap:var(--s-15);
}
.edu-summary .edu-summary-meta{ flex-direction:row; align-items:baseline; gap:var(--s-1); }
.edu-summary-sub{ font-size:11px; }
.edu-status--inline{ height:22px; font-size:11px; padding:0 8px; }
#employee-data-upload-section.edu-has-data .edu-summary .ws-btn{
  height:28px; padding:0 var(--s-15); font-size:12px;
}
/* When the AI mapping panel is open it needs its own breathing room back */
#employee-data-upload-section.edu-has-data #ai-mapping-panel:not(.d-none){
  background:var(--c-surface); border:1px solid var(--c-line); border-radius:var(--r-4);
  padding:var(--s-2); margin-top:var(--s-15) !important;
}

/* .upload-area carries min-height:200px + 2rem padding + column flex from
   styles.css, which a plain `height` cannot beat — that is why the dropzone
   stayed ~260px. Neutralise those three explicitly. */
#employee-data-upload-section .edu-drop.upload-area{
  min-height:0 !important;
  height:52px !important;
  padding:0 var(--s-2) !important;
  flex-direction:row !important;
  border-width:1px !important;
  border-radius:var(--r-3) !important;
}
#employee-data-upload-section .edu-drop.upload-area > *{ margin:0 !important; }

/* ════════════════════════════════════════════════════════════════════════════
   NAVIGATION — back to ONE labelled sidebar
   The contextual panel duplicated what the rail already showed and carried
   information (page sections / folders) that wasn't useful. The rail widens
   into the familiar labelled nav (Simulation, Optimization, Configurations,
   Users…) and the second panel is retired.
   ════════════════════════════════════════════════════════════════════════════ */
:root{ --rail-w:240px; }
#app-shell .app-sidebar{ display:none !important; }
#app-content{ margin-left:var(--rail-w) !important; }
#app-shell.panel-hidden #app-content,
#app-shell.panel-empty #app-content{ margin-left:var(--rail-w) !important; }

.app-rail{ width:var(--rail-w); align-items:stretch; padding:var(--s-15) var(--s-15) var(--s-2); }
.app-rail .rail-brand{ justify-content:flex-start; width:auto; padding:0 var(--s-1); margin-bottom:var(--s-3); }
.app-rail .rail-nav{ gap:2px; }
.app-rail .rail-item{
  width:100%; height:40px; justify-content:flex-start; gap:var(--s-15);
  padding:0 var(--s-15); border-radius:var(--r-2); font-size:13px; font-weight:600; color:var(--c-text);
}
.app-rail .rail-item i{ font-size:17px; flex:0 0 20px; }
.app-rail .rail-item:hover{ background:var(--c-canvas); color:var(--c-ink); }
.app-rail .rail-item.is-active{ background:var(--c-primary-soft); color:var(--c-primary); }
/* The tooltip becomes the inline label */
.app-rail .rail-tip{
  position:static; transform:none; opacity:1; background:transparent; color:inherit;
  padding:0; font-size:13px; font-weight:600; pointer-events:auto; white-space:nowrap;
}
.app-rail .rail-btn{ display:none; }              /* panel toggle no longer applies */
.app-rail .rail-account{ margin-top:var(--s-1); }
.app-rail .rail-account .topbar-profile-btn{
  width:100%; justify-content:flex-start; gap:var(--s-15); padding:0 var(--s-1); height:44px;
  border-radius:var(--r-2);
}
.app-rail .rail-account .topbar-user-info{ display:flex; flex-direction:column; min-width:0; }
.app-rail .rail-account .topbar-user-name{ font-size:13px; font-weight:700; color:var(--c-ink); }
.app-rail .rail-account .topbar-user-role{ font-size:11px; color:var(--c-muted); text-transform:capitalize; }
.app-rail .topbar-dropdown--up{ left:var(--s-15); right:var(--s-15); bottom:calc(100% + 6px); width:auto; }

@media (max-width:1023px){
  .app-rail{ transform:translateX(-100%); }
  #app-shell.drawer-open .app-rail{ transform:translateX(0); }
  #app-content, #app-shell.panel-hidden #app-content, #app-shell.panel-empty #app-content{ margin-left:0 !important; }
}
