/* Shared workspace presentation. Login and inspection validation remain independent. */
.app-shell {
  --bg: #f7f7f8;
  --panel: #fff;
  --line: #e6e5e9;
  --line-strong: #d3d0d8;
  --ink: #28232e;
  --muted: #716c78;
  --shadow: 0 1px 2px rgba(31, 24, 39, .025);
  --sidebar-width: 244px;
  color: var(--ink);
  background: var(--bg);
}
.app-shell .sidebar {
  padding: 0 14px 18px;
  border-right: 1px solid #402b47;
  background: #322038;
  box-shadow: none;
}
.app-shell .brand { min-height: 108px; padding: 24px 12px 20px; gap: 10px; border-bottom: 1px solid #503c56; }
.app-shell .brand-logo-full { width: 138px; height: auto; max-height: 48px; object-fit: contain; }
.app-shell .brand-product { font-size: 10px; font-weight: 500; letter-spacing: .065em; color: #c8b8cd; }
.app-shell .nav { padding: 0; margin-top: 16px; gap: 4px; align-content: start; }
.app-shell .side-label { margin: 16px 12px 8px; color: #bcaac2; font-size: 10px; font-weight: 550; letter-spacing: .09em; }
.app-shell .nav-item { min-height: 42px; padding: 10px 12px; gap: 11px; border: 1px solid transparent; border-radius: 7px; color: #d8cddd; background: transparent; box-shadow: none; font-size: 13px; font-weight: 500; }
.app-shell .nav-item .nav-icon { width: 18px; height: 18px; flex-basis: 18px; color: #bcaac2; stroke-width: 1.65; }
.app-shell .nav-item:hover:not(:disabled) { color: #fff; background: #44304b; border-color: transparent; filter: none; }
.app-shell .nav-item.active { color: #fff; background: #594060; border-color: #6c5273; box-shadow: none; font-weight: 600; }
.app-shell .nav-item.active .nav-icon { color: #f3e7f6; }
.app-shell .nav-children { margin-left: 21px; padding-left: 10px; border-color: #65506c; }
.app-shell .nav-child { min-height: 36px; font-size: 12px; }
.app-shell .nav-expander { min-height: 40px; color: #c8b8cd; }
.app-shell .sidebar .user-card { margin: auto 4px 0; padding-top: 18px; }
.app-shell .sidebar .user-card::before { background: #503c56; }
.app-shell .sidebar .user-card strong { font-size: 12px; font-weight: 550; }
.app-shell .sidebar .user-card small { font-size: 11px; color: #c8b8cd; }
.app-shell .sidebar .sidebar-access-badge { color: #bcaac2; font-size: 10px; letter-spacing: 0; text-transform: none; }
.app-shell .topbar { min-height: 92px; padding: 20px 32px; gap: 20px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: none; backdrop-filter: none; }
.app-shell .top-title { min-width: 0; gap: 16px; }
.app-shell .top-title > div { min-width: 0; }
.app-shell .top-title h1 { color: #2c2532; font-size: 25px; font-weight: 600; line-height: 1.25; letter-spacing: -.035em; }
.app-shell .top-title p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.app-shell .top-actions { gap: 8px; flex-shrink: 0; }
.app-shell .topbar :is(.icon-button,.round-button) { width: 36px; height: 36px; min-height: 36px; border: 1px solid var(--line); border-radius: 7px; box-shadow: none; background: #fff; color: #746a7c; }
.app-shell .topbar :is(.icon-button,.round-button):hover { background: #f4f0f5; border-color: #c9bdce; }
.app-shell .workspace > section { margin-top: 28px; margin-bottom: 36px; }
.app-shell .dashboard-view { width: min(calc(100% - 64px), 1440px); margin-inline: auto; }
/* Control sizes are shared; specialized compact editors keep their own dimensions. */
.app-shell :where(button) { border-radius: 7px; box-shadow: none; font-weight: 550; }
.app-shell :where(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea) { border-color: var(--line-strong); border-radius: 7px; box-shadow: none; color: #39313f; background-color: #fff; }
.app-shell :where(.toolbar input,.toolbar select,.job-search input,.job-search button,.toolbar > button) { min-height: 40px; font-size: 13px; }
.app-shell :where(button.secondary,.secondary,.text-button) { box-shadow: none; }
.app-shell :is(input,select,textarea):focus { border-color: #86698e; box-shadow: 0 0 0 3px #eee7f1; outline: none; }
.app-shell :is(button,a,[tabindex]):focus-visible { outline: 3px solid #93749c; outline-offset: 3px; }
.app-shell .sidebar :is(button,a):focus-visible { outline-color: #ddc7e6; outline-offset: 1px; }
.app-shell :is(.section-header,.access-header,.audit-log-header) h2 { color: #302736; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.app-shell :is(.content-card,.access-card,.audit-log-card,.supervisor-card,.search-panel) { border-color: var(--line); box-shadow: var(--shadow); }
.app-shell .mini-table th { background: #faf9fb; color: #746b7b; font-size: 11px; font-weight: 550; text-transform: none; letter-spacing: 0; }
.app-shell .mini-table td { font-size: 12px; color: #4a4052; border-bottom-color: #efedf1; }
.app-shell .table-shell { border-color: var(--line); }
.app-shell .status-chip { box-shadow: none; font-size: 11px; font-weight: 550; }
/* Dashboard: actions first, four primary metrics, then records and context. */
.dashboard-view .dashboard-commandbar { min-height: 84px; padding: 20px 24px; margin-bottom: 28px; border: 1px solid #e4dce7; border-radius: 10px; background: #f1ecf3; box-shadow: none; }
.dashboard-view .workspace-status-icon { display: none; }
.dashboard-view .workspace-status strong { font-size: 16px; font-weight: 600; color: #45324e; letter-spacing: -.015em; }
.dashboard-view .workspace-status div > span { display: block; margin-top: 5px; font-size: 12px; color: #76697e; line-height: 1.5; }
.dashboard-view .command-action { width: auto; min-height: 42px; padding: 11px 16px; border: 1px solid #56335f; border-radius: 7px; color: #fff; background: #56335f; box-shadow: 0 1px 2px #39223f14; font-size: 12px; font-weight: 550; }
.dashboard-view .command-action:hover { background: #402648; border-color: #402648; }
.dashboard-view .command-action span { display: inline; }
.dashboard-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.dashboard-section-heading h2 { margin: 0; color: #392f42; font-size: 15px; font-weight: 600; letter-spacing: -.015em; }
.dashboard-section-heading > span { color: #7d7483; font-size: 11px; }
.dashboard-view .kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; border: 0; border-radius: 0; overflow: visible; box-shadow: none; background: transparent; }
.dashboard-view .kpi-card { min-height: 148px; padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.dashboard-view .kpi-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dashboard-view .kpi-label span { margin: 0; color: #64596c; font-size: 12px; line-height: 1.4; font-weight: 550; }
.dashboard-view .kpi-label svg { width: 17px; height: 17px; flex: 0 0 17px; color: #9b8da4; stroke-width: 1.5; }
.dashboard-view .kpi-review .kpi-label svg { color: #a87436; }
.dashboard-view .kpi-card > strong { display: block; margin: 20px 0 10px; color: #392d42; font-size: 34px; font-weight: 550; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.dashboard-view .kpi-card > small { display: block; margin: 0; color: #7d7483; font-size: 11px; line-height: 1.5; }
.dashboard-context-strip { display: flex; gap: 24px; flex-wrap: wrap; padding: 18px 2px 24px; }
.dashboard-context-strip > span { display: inline-flex; gap: 8px; align-items: center; font-size: 11px; color: #7d7483; }
.dashboard-context-strip svg { width: 15px; height: 15px; color: #94839d; }
.dashboard-context-strip strong { color: #4f3d5a; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dashboard-view .dashboard-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin: 0; }
.dashboard-view .dash-card { min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.dashboard-view .dash-card.wide { grid-column: 1 / -1; grid-row: auto; }
.dashboard-view .dash-card-header { padding: 20px 22px 18px; display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.dashboard-view .dash-card-header h3 { margin: 0; color: #392f42; font-size: 14px; font-weight: 600; letter-spacing: -.015em; }
.dashboard-view .dash-card-header .muted { color: #827887; font-size: 11px; }
.dashboard-view .table-shell { margin: 0; border: 0; border-top: 1px solid #efedf1; border-radius: 0; }
.dashboard-view .mini-table { min-width: 0; width: 100%; }
.dashboard-view .mini-table :is(th,td) { padding: 13px 22px; line-height: 1.5; }
.dashboard-view .mini-table th { background: #fcfbfd; }
.dashboard-view .mini-table td { font-size: 12px; }
.dashboard-view .mini-table td strong { font-weight: 600; color: #4e3759; }
.dashboard-view .mini-table tbody tr:last-child td { border-bottom: 0; }
.dashboard-view .mini-table .muted-cell { padding: 38px 22px; text-align: center; color: #867c8b; font-size: 12px; }
.dashboard-view .dashboard-empty-slot > .empty-state-card { padding: 16px 20px; background: #fff; color: #65556e; border: 1px dashed #d9cedf; border-radius: 8px; margin: 0 0 24px; }
.dashboard-view .dashboard-empty-slot .empty-state-card strong { font-size: 13px; font-weight: 550; }
.dashboard-view .dashboard-empty-slot .empty-state-card p { color: #827489; font-size: 12px; }
@media (min-width:961px) {
  body.sidebar-collapsed .app-shell .brand { min-height: 108px; padding: 24px 0; }
  body.sidebar-collapsed .app-shell .sidebar { padding-inline: 10px; }
  body.sidebar-collapsed .app-shell .nav-item { padding-inline: 0; }
}
@media (max-width:1200px) {
  .dashboard-view .kpi-grid { gap: 10px; }
  .dashboard-view .kpi-card { padding: 16px; }
  .dashboard-view .dash-card-header { flex-wrap: wrap; gap: 5px; }
}
@media (max-width:960px) {
  .app-shell .topbar { min-height: 80px; padding: 16px 22px; }
  .app-shell .dashboard-view { width: calc(100% - 44px); }
  .dashboard-view .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:600px) {
  .app-shell .topbar { min-height: 72px; padding: 14px 16px; gap: 10px; }
  .app-shell .top-title { gap: 10px; }
  .app-shell .top-title h1 { font-size: 20px; }
  .app-shell .top-title p { display: none; }
  .app-shell .dashboard-view { width: calc(100% - 32px); margin-top: 20px; }
  .dashboard-view .dashboard-commandbar { flex-direction: column; align-items: stretch; gap: 16px; padding: 18px; margin-bottom: 24px; }
  .dashboard-view .command-action { justify-content: center; min-height: 44px; }
  .dashboard-section-heading { flex-direction: column; gap: 4px; }
  .dashboard-view .kpi-card { min-height: 156px; padding: 16px; }
  .dashboard-view .kpi-label svg { display: none; }
  .dashboard-context-strip { gap: 12px 20px; }
  .dashboard-view .dashboard-grid { grid-template-columns: minmax(0,1fr); }
  .dashboard-view .dash-card-header { padding: 18px; }
  .dashboard-view .dash-card.wide .mini-table { min-width: 570px; }
  .dashboard-view .mini-table :is(th,td) { padding: 12px 16px; }
  .app-shell .topbar-job-search { max-width: 120px; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell .sidebar, .app-shell { transition: none; }
}

.app-shell .nav-item.nav-child { min-height: 36px; padding-block: 8px; }
.dashboard-view .dashboard-row-arrow { display: inline-block; vertical-align: middle; margin-left: 10px; }
.dashboard-view .dashboard-record-updated { display: inline; }

.app-shell :is(.audit-log-filters,.supervisor-toolbar,.access-header) :is(input,select) { min-height: 40px; font-size: 13px; }
.app-shell .audit-log-filters label { font-size: 11px; font-weight: 550; letter-spacing: .025em; }
/* Let the page header stay sticky while tables retain their own scroll containers. */
.app-shell .workspace { overflow-x: clip; overflow-y: visible; }
/* Consistent primary actions and compact filter groups across workspace pages. */
.app-shell button.primary:not(.danger) { color: #fff; background: #56335f; border-color: #56335f; box-shadow: none; }
.app-shell button.primary:not(.danger):hover:not(:disabled) { background: #402648; border-color: #402648; filter: none; }
.app-shell :is(.supervisor-month-controls,.supervisor-job-search) :is(input,button) { min-height: 40px; font-size: 13px; }
.app-shell .supervisor-month-controls { gap: 8px; }
.app-shell .supervisor-month-controls button { flex: 0 0 auto; white-space: nowrap; }
