/* USTP OneCenter PPDJB: design system */
:root {
  --primary: #1d4ed8;
  --primary-600: #1e40af;
  --primary-50: #eff4ff;
  --primary-100: #dbe6fe;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --border-strong: #cbd3df;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --good: #15803d;   --good-bg: #e7f6ec;   --good-solid: #22a45a;
  --att: #a15c00;    --att-bg: #fff4dc;    --att-solid: #f2a20c;
  --crit: #b91c1c;   --crit-bg: #fde9e9;   --crit-solid: #dc3a3a;
  --info: #1d4ed8;   --info-bg: #e8effd;
  --prog: #6d28d9;   --prog-bg: #f1eafe;
  --mon: #0e7490;    --mon-bg: #e2f5f9;
  --none-solid: #cbd3df;
  --sidebar: #0f2747;
  --sidebar-2: #163564;
  --sidebar-text: #c8d4e6;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --yel: #8a6100;    --yel-bg: #fef6c7;    --yel-solid: #eab308;
  --org: #b4470b;    --org-bg: #ffedd5;    --org-solid: #f97316;
  --bottom-nav-h: 0px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --primary: #6b9cff;
  --primary-600: #8db2ff;
  --primary-50: #16233d;
  --primary-100: #1d3157;
  --bg: #0b1220;
  --surface: #111a2c;
  --surface-2: #0e1626;
  --border: #22304a;
  --border-strong: #31415f;
  --text: #e6ecf5;
  --text-2: #b4c0d3;
  --muted: #8b98ad;
  --good: #5fd08c;   --good-bg: #12301f;
  --att: #f4be55;    --att-bg: #352a10;
  --crit: #ff8a8a;   --crit-bg: #3a1717;
  --info: #8db2ff;   --info-bg: #17284a;
  --prog: #c4a6ff;   --prog-bg: #2a1d47;
  --mon: #6fd3e6;    --mon-bg: #0f3039;
  --none-solid: #3a4964;
  --sidebar: #0a1426;
  --sidebar-2: #13213b;
  --yel: #f5d565; --yel-bg: #352f0e;
  --org: #ffae73; --org-bg: #3a2210;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.45rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
small { font-size: .8rem; }
.muted { color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- Shell */
.has-shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: none; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; text-decoration: none !important; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); display: grid; place-items: center; font-weight: 800; letter-spacing: -.5px; color: #fff; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text small { color: var(--sidebar-text); font-size: .75rem; }
.nav { padding: 4px 10px 16px; flex: 1; }
.nav-header { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #7f93b3; margin: 14px 10px 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--sidebar-text); text-decoration: none !important; font-weight: 500; }
.nav-link:hover { background: var(--sidebar-2); color: #fff; }
.nav-link.active { background: #2554b8; color: #fff; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .08); }
.tagline { font-size: .72rem; color: #8ea2c3; line-height: 1.5; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; padding: 8px 0; font: inherit; color: var(--text); outline: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); text-decoration: none; }
.icon-btn .dot { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--crit-solid); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-100); color: var(--primary); display: grid; place-items: center; font-weight: 700; }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-meta small { color: var(--muted); }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; z-index: 50; }
.user-menu .menu a, .user-menu .menu button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--surface-2); text-decoration: none; }
.demo-banner { background: var(--att-bg); color: var(--att); padding: 7px 24px; font-size: .85rem; border-bottom: 1px solid var(--border); }
.demo-banner .icon { margin-right: 4px; }
.content { padding: 20px 24px 40px; flex: 1; }
.footer { padding: 14px 24px; color: var(--muted); font-size: .78rem; border-top: 1px solid var(--border); }
.only-mobile { display: none; }
.sidebar-backdrop { display: none; }

/* ---------------------------------------------------------------- Page */
.breadcrumbs { font-size: .82rem; color: var(--muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumbs .sep { color: var(--border-strong); }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-header .subtitle { color: var(--muted); margin: 2px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; }
.card-flush { padding: 0; }
.card-flush > .card-header { padding: 14px 18px 0; }
.card-sub { color: var(--muted); font-size: .82rem; margin-top: -8px; margin-bottom: 12px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid > .card { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mb { margin-bottom: 18px; }
.mt { margin-top: 18px; }

/* ---------------------------------------------------------------- Stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; }
a.stat-card:hover { border-color: var(--primary); }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-2); font-size: .82rem; }
.stat-hint { color: var(--muted); font-size: .74rem; }
.tone-critical .stat-icon { background: var(--crit-bg); color: var(--crit); }
.tone-attention .stat-icon { background: var(--att-bg); color: var(--att); }
.tone-good .stat-icon { background: var(--good-bg); color: var(--good); }
.tone-progress .stat-icon { background: var(--prog-bg); color: var(--prog); }

/* ---------------------------------------------------------------- COE cards */
.coe-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.coe-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; border-top: 4px solid var(--primary); }
.coe-card:hover { box-shadow: var(--shadow-lg); }
.coe-card h3 { margin-bottom: 2px; }
.coe-card .coe-meta { color: var(--muted); font-size: .8rem; margin-bottom: 10px; }
.coe-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; text-align: center; }
.coe-counts div { border-radius: 8px; padding: 6px 2px; }
.coe-counts b { display: block; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.coe-counts small { font-size: .7rem; }
.cg { background: var(--good-bg); color: var(--good); }
.cy { background: var(--att-bg); color: var(--att); }
.cr { background: var(--crit-bg); color: var(--crit); }
.coe-foot { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-2); border-top: 1px solid var(--border); padding-top: 8px; }

/* ---------------------------------------------------------------- Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.badge .icon { width: 13px; height: 13px; }
.badge-good { background: var(--good-bg); color: var(--good); }
.badge-attention { background: var(--att-bg); color: var(--att); }
.badge-critical { background: var(--crit-bg); color: var(--crit); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-progress { background: var(--prog-bg); color: var(--prog); }
.badge-monitor { background: var(--mon-bg); color: var(--mon); }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.sdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.sdot-green { background: var(--good-solid); } .sdot-yellow { background: var(--att-solid); } .sdot-red { background: var(--crit-solid); } .sdot-none { background: var(--none-solid); }
.tag-demo { display: inline-block; font-size: .62rem; font-weight: 800; letter-spacing: .06em; color: var(--att); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; vertical-align: 2px; }

.sbar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; background: var(--surface-2); min-width: 80px; }
.sbar span { display: block; height: 100%; }
.sbar .sg { background: var(--good-solid); } .sbar .sy { background: var(--att-solid); } .sbar .sr { background: var(--crit-solid); } .sbar .sn { background: var(--none-solid); }
.sbar-empty { border: 1px dashed var(--border-strong); }
.progress { height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress span { display: block; height: 100%; background: var(--primary); }
.progress.good span { background: var(--good-solid); } .progress.attention span { background: var(--att-solid); } .progress.critical span { background: var(--crit-solid); }

/* ---------------------------------------------------------------- Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; text-decoration: none !important; white-space: nowrap; line-height: 1.3; }
.btn:hover { background: var(--surface-2); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
:root[data-theme="dark"] .btn-primary { color: #0b1220; }
.btn-danger { background: var(--crit-bg); border-color: transparent; color: var(--crit); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-sm { padding: 4px 9px; font-size: .8rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline-form { display: inline; margin: 0; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: .8rem; font-weight: 600; color: var(--text-2); }
.field .help { font-size: .75rem; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], input:not([type]), select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; min-width: 0;
}
input[type=file] { font: inherit; color: var(--text-2); max-width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
select[multiple] { min-height: 140px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 3px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 16px; }
.fieldset legend { font-weight: 650; padding: 0 6px; }
.checklist { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 12px; background: var(--surface-2); }
.checklist label { display: flex; gap: 6px; align-items: flex-start; font-size: .85rem; }

/* Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 14px; }
.filter-bar .field { min-width: 140px; flex: 1 1 140px; max-width: 240px; }
.filter-bar .field.wide { max-width: 320px; flex-basis: 220px; }
.filter-bar .actions { display: flex; gap: 6px; }

/* ---------------------------------------------------------------- Tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th { text-align: left; font-weight: 600; color: var(--text-2); background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .center { text-align: center; }
.table .nowrap { white-space: nowrap; }
.table .actions { white-space: nowrap; text-align: right; }
.table td.ok { color: var(--good); } .table td.warn { color: var(--att); } .table td.bad { color: var(--crit); }
.table-compact td, .table-compact th { padding: 6px 9px; }
.cell-sub { display: block; color: var(--muted); font-size: .76rem; }
tr.row-failed td { background: var(--crit-bg); }
tr.row-warning td { background: var(--att-bg); }
tr.row-skipped td { color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0 0; flex-wrap: wrap; }
.pager-links { display: flex; gap: 4px; flex-wrap: wrap; }
.card-flush .pager { padding: 12px 18px 14px; }

/* Heatmap */
.heatmap td.hm { text-align: center; padding: 4px; min-width: 52px; font-variant-numeric: tabular-nums; font-size: .78rem; }
.hm-green { background: var(--good-bg) !important; color: var(--good); }
.hm-yellow { background: var(--att-bg) !important; color: var(--att); }
.hm-red { background: var(--crit-bg) !important; color: var(--crit); }
.hm-none { color: var(--muted); }

/* ---------------------------------------------------------------- Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 9px 14px; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 550; text-decoration: none !important; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: .72rem; text-align: center; }

/* ---------------------------------------------------------------- Alerts */
.alert { position: relative; padding: 10px 40px 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--good-bg); color: var(--good); }
.alert-error { background: var(--crit-bg); color: var(--crit); }
.alert-warning { background: var(--att-bg); color: var(--att); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-close { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; }
.callout { border-left: 4px solid var(--primary); background: var(--primary-50); padding: 10px 14px; border-radius: 0 8px 8px 0; margin-bottom: 14px; color: var(--text-2); font-size: .86rem; }
.callout.warn { border-color: var(--att-solid); background: var(--att-bg); }
.callout.ai { border-color: var(--prog); background: var(--prog-bg); }

/* ---------------------------------------------------------------- Empty states */
.empty-state { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty-icon { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.empty-state h3 { color: var(--text); }
.empty-actions { display: flex; gap: 8px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Detail */
.dl { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 8px 14px; margin: 0; font-size: .88rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.profile-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.profile-head .big-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; }
.profile-head .big-icon .icon { width: 28px; height: 28px; }
.meta-row { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-2); font-size: .85rem; margin-top: 4px; }
.summary-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.summary-box { border: 1px solid var(--border); border-radius: 9px; padding: 12px; background: var(--surface-2); }
.summary-box h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.summary-box ul { margin: 0; padding-left: 18px; font-size: .85rem; }
.summary-box.good h4 { color: var(--good); } .summary-box.att h4 { color: var(--att); } .summary-box.crit h4 { color: var(--crit); } .summary-box.prog h4 { color: var(--prog); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 16px 14px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.timeline .tl-head { font-size: .8rem; color: var(--muted); }
.workflow { display: flex; gap: 0; overflow-x: auto; padding-bottom: 4px; margin-bottom: 6px; }
.wf-step { flex: 1 0 90px; text-align: center; position: relative; font-size: .72rem; color: var(--muted); padding-top: 26px; }
.wf-step::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 3px; background: var(--border); }
.wf-step::after { content: ""; position: absolute; top: 3px; left: calc(50% - 8px); width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--border-strong); }
.wf-step.done { color: var(--text); font-weight: 600; }
.wf-step.done::before { background: var(--good-solid); }
.wf-step.done::after { background: var(--good-solid); border-color: var(--good-solid); }
.wf-step.current::after { border-color: var(--primary); background: var(--primary-100); }

.file-list { list-style: none; margin: 0 0 12px; padding: 0; }
.file-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.file-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); flex: none; }
.file-meta { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.upload-box > summary { list-style: none; display: inline-flex; }
.upload-box > summary::-webkit-details-marker { display: none; }
.upload-box[open] > summary { margin-bottom: 12px; }
.upload-box form { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 14px; background: var(--surface-2); }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }
.chart-box.short { height: 200px; }
.legend-inline { display: flex; gap: 12px; font-size: .78rem; color: var(--text-2); flex-wrap: wrap; }
.legend-inline span { display: inline-flex; align-items: center; gap: 5px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.list-plain li:last-child { border-bottom: 0; }
.kv-mini { font-size: .78rem; color: var(--muted); }
.delta-up { color: var(--good); font-weight: 600; }
.delta-down { color: var(--crit); font-weight: 600; }
.matrix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.matrix .cell { border-radius: 10px; padding: 12px; min-height: 120px; border: 1px solid var(--border); }
.matrix .cell h4 { margin-bottom: 8px; display: flex; justify-content: space-between; }
.matrix .cell.high { background: var(--crit-bg); } .matrix .cell.medium { background: var(--att-bg); } .matrix .cell.low { background: var(--good-bg); }
.matrix .cell a { display: block; font-size: .82rem; padding: 2px 0; }

/* ---------------------------------------------------------------- Auth */
.no-shell { background: linear-gradient(160deg, #0f2747 0%, #1d4ed8 55%, #3b82f6 100%); min-height: 100vh; }
.auth-main { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 16px; box-shadow: 0 25px 60px rgba(0, 0, 0, .25); padding: 32px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .brand-mark { width: 54px; height: 54px; border-radius: 14px; margin: 0 auto 12px; font-size: 1.2rem; }
.auth-brand h1 { font-size: 1.5rem; margin-bottom: 2px; }
.auth-brand .org { color: var(--text-2); font-weight: 600; }
.auth-brand .tag { color: var(--muted); font-size: .8rem; margin-top: 8px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn-primary { width: 100%; justify-content: center; padding: 10px; }
.auth-foot { text-align: center; margin-top: 14px; font-size: .85rem; }
.auth-legal { color: rgba(255, 255, 255, .75); font-size: .75rem; text-align: center; margin-top: 16px; }

/* ---------------------------------------------------------------- OPR (A4) */
.opr-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.opr-page { width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto 24px; background: #fff; color: #111; padding: 14mm 14mm 12mm; box-shadow: var(--shadow-lg); font-size: 10.5pt; line-height: 1.4; display: flex; flex-direction: column; }
.opr-page h2 { font-size: 15pt; margin: 0; }
.opr-head { display: flex; align-items: center; gap: 12px; border-bottom: 3px solid #1d4ed8; padding-bottom: 8px; margin-bottom: 10px; }
.opr-logo { width: 60px; height: 60px; border: 1px dashed #9aa5b5; display: grid; place-items: center; font-size: 7pt; color: #7a8698; text-align: center; flex: none; }
.opr-logo img { max-width: 100%; max-height: 100%; }
.opr-org { font-size: 8.5pt; color: #444; }
.opr-title { font-size: 14pt; font-weight: 800; margin: 2px 0 0; color: #0f2747; }
.opr-label { font-size: 8pt; text-transform: uppercase; letter-spacing: .06em; color: #1d4ed8; font-weight: 700; margin: 8px 0 3px; }
.opr-info { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 6px; }
.opr-info div { background: #f2f5fa; border-radius: 6px; padding: 5px 8px; }
.opr-info b { display: block; font-size: 7.5pt; color: #5b6576; font-weight: 600; text-transform: uppercase; }
.opr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opr-box { border: 1px solid #dfe5ee; border-radius: 6px; padding: 6px 9px; }
.opr-box p { margin: 0; white-space: pre-line; }
.opr-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.opr-photos img { width: 100%; height: 42mm; object-fit: cover; border-radius: 4px; }
.opr-photos .ph { height: 42mm; border: 1px dashed #b7c0cd; border-radius: 4px; display: grid; place-items: center; color: #8b95a5; font-size: 8pt; }
.opr-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.opr-kpis div { background: #0f2747; color: #fff; border-radius: 6px; padding: 7px 9px; }
.opr-kpis b { display: block; font-size: 15pt; }
.opr-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid #dfe5ee; display: flex; justify-content: space-between; font-size: 8pt; color: #555; }
.opr-sign { font-size: 9pt; margin-top: 8px; }
.opr-tpl-corporate .opr-head { background: #0f2747; color: #fff; border: 0; padding: 10px 12px; border-radius: 6px; }
.opr-tpl-corporate .opr-head .opr-title, .opr-tpl-corporate .opr-head .opr-org { color: #fff; }
.opr-tpl-corporate .opr-label { color: #0f2747; }
.opr-tpl-minimal .opr-head { border-bottom: 1px solid #222; }
.opr-tpl-minimal .opr-box { border: 0; padding: 0; }
.opr-tpl-minimal .opr-info div { background: none; border-bottom: 1px solid #e3e3e3; border-radius: 0; }
.opr-tpl-minimal .opr-label { color: #111; }
.opr-tpl-photo .opr-photos img, .opr-tpl-photo .opr-photos .ph { height: 62mm; }
.opr-tpl-photo .opr-photos { grid-template-columns: repeat(2, 1fr); }
.opr-tpl-data .opr-kpis div { background: #1d4ed8; }

/* Report print */
.report-doc { background: var(--surface); }
.report-head { text-align: center; border-bottom: 2px solid var(--text); padding-bottom: 10px; margin-bottom: 14px; }
.report-head h2 { margin: 4px 0 0; }
.report-meta { font-size: .8rem; color: var(--muted); }

/* ---------------------------------------------------------------- Logo, navigasi tambahan */
.brand-logo { width: 40px; height: 40px; border-radius: 50%; background: #fff; padding: 0; object-fit: contain; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15); }
.auth-logo { width: 120px; height: 120px; border-radius: 50%; display: block; margin: 0 auto 12px; box-shadow: 0 6px 20px rgba(15, 39, 71, .18); }
.topbar-logo img { width: 32px; height: 32px; border-radius: 50%; display: block; }
.topbar-year { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
.nav-group > summary { list-style: none; cursor: pointer; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group .chev { margin-left: auto; width: 14px; height: 14px; transition: transform .15s; }
.nav-group[open] .chev { transform: rotate(90deg); }
.nav-sublink { display: block; padding: 6px 10px 6px 38px; border-radius: 7px; color: var(--sidebar-text); font-size: .86rem; text-decoration: none !important; }
.nav-sublink:hover { background: var(--sidebar-2); color: #fff; }
.nav-sublink.active { color: #fff; background: rgba(37, 84, 184, .6); }
.menu-who { padding: 6px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-who small { color: var(--muted); }
.bottom-nav { display: none; }
.ios-hint { position: fixed; left: 12px; right: 12px; bottom: calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 60; background: #0f2747; color: #fff; border-radius: 12px; padding: 12px 40px 12px 14px; font-size: .85rem; box-shadow: var(--shadow-lg); }
.ios-hint button { position: absolute; right: 8px; top: 6px; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }

/* ---------------------------------------------------------------- Status Scoreboard (5 tahap) */
.badge-yellow { background: var(--yel-bg); color: var(--yel); }
.badge-orange { background: var(--org-bg); color: var(--org); }
.trend { font-weight: 700; white-space: nowrap; font-size: .85rem; }
.trend-up { color: var(--good); } .trend-down { color: var(--crit); } .trend-same, .trend-na { color: var(--muted); }
.sdot-orange { background: var(--org-solid); }
.sbar .so { background: var(--org-solid); }
.sbar .syl { background: var(--yel-solid); }
.commentary { margin: 0; padding-left: 20px; }
.commentary li { margin-bottom: 6px; }
.sb-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.sb-head h1 { margin: 0; letter-spacing: .01em; }
.sb-head .eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .1em; color: var(--primary); text-transform: uppercase; }
.sb-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--text-2); }
.sb-meta span { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; display: inline-flex; gap: 5px; align-items: center; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none !important; min-width: 0; }
a.kpi:hover { border-color: var(--primary); }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kpi-label { font-size: .8rem; color: var(--text-2); font-weight: 600; }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.kpi-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: .85rem; font-weight: 600; color: var(--muted); }
.kpi-sub { display: flex; justify-content: space-between; gap: 6px; font-size: .76rem; color: var(--muted); flex-wrap: wrap; align-items: center; }
.kpi .progress { height: 6px; }
.kpi.st-green .kpi-icon { background: var(--good-bg); color: var(--good); }
.kpi.st-yellow .kpi-icon { background: var(--yel-bg); color: var(--yel); }
.kpi.st-orange .kpi-icon { background: var(--org-bg); color: var(--org); }
.kpi.st-red .kpi-icon { background: var(--crit-bg); color: var(--crit); }
.progress.yellow span { background: var(--yel-solid); } .progress.orange span { background: var(--org-solid); }
.sb-table th { white-space: nowrap; }
.sb-table td:first-child { min-width: 190px; }
.sb-table td small { white-space: nowrap; }
.sb-table td.focus-cell { font-weight: 600; }
.sb-table .num strong { font-size: 1rem; }
.pkg-card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); border-top: 4px solid var(--primary); }
.pkg-card h3 { margin: 0; }
.pkg-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px; font-size: .82rem; }
.pkg-stats div { display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px dashed var(--border); padding-bottom: 3px; }
.pkg-stats b { font-variant-numeric: tabular-nums; }
.hm-orange { background: var(--org-bg) !important; color: var(--org); }
.hm-sb-yellow { background: var(--yel-bg) !important; color: var(--yel); }
.heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.heat-cell { display: block; border-radius: 8px; padding: 8px; font-size: .74rem; line-height: 1.25; text-decoration: none !important; color: inherit; border: 1px solid transparent; min-height: 58px; }
.heat-cell strong { display: block; font-size: .95rem; }
.heat-cell:hover { border-color: var(--text); }
.heat-cell.st-green { background: var(--good-bg); color: var(--good); } .heat-cell.st-yellow { background: var(--yel-bg); color: var(--yel); }
.heat-cell.st-orange { background: var(--org-bg); color: var(--org); } .heat-cell.st-red { background: var(--crit-bg); color: var(--crit); }
.heat-cell.st-none { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.warn-list { list-style: none; margin: 0; padding: 0; }
.warn-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.warn-list li:last-child { border-bottom: 0; }
.sb-filter-wrap > summary { display: none; list-style: none; margin-bottom: 10px; }
.sb-filter-wrap > summary::-webkit-details-marker { display: none; }
@media (max-width: 760px) { .sb-filter-wrap > summary { display: inline-flex; } }
.legend-sb { display: flex; gap: 10px; flex-wrap: wrap; font-size: .76rem; }
.rank-note { font-size: .76rem; color: var(--muted); }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1200px) {
  .coe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; }
  .only-mobile { display: inline-grid; }
  .grid-2, .grid-3, .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
  .user-meta { display: none; }
  .topbar { padding: 8px 16px; }
  .content { padding: 16px 16px 32px; }
  .demo-banner { padding: 7px 16px; }
  .hide-sm { display: none !important; }
}
@media (max-width: 760px) {
  :root { --bottom-nav-h: 62px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(15, 23, 42, .06); }
  .bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--bottom-nav-h);
    font: inherit; font-size: .68rem; font-weight: 600; color: var(--muted); background: none; border: 0; text-decoration: none !important; cursor: pointer; }
  .bottom-nav .icon { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--primary); }
  .has-shell .main { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  .topbar { padding-top: max(8px, env(safe-area-inset-top)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 1.25rem; }
  .pkg-stats { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .coe-grid, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-icon { width: 34px; height: 34px; }
  .stat-value { font-size: 1.2rem; }
  .filter-bar .field { max-width: none; flex-basis: 100%; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .matrix { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 1.25rem; }
  .search { max-width: none; }
  .card { padding: 14px; }
  /* Jadual → kad pada mobile */
  table.table-cards thead { display: none; }
  table.table-cards, table.table-cards tbody, table.table-cards tr, table.table-cards td { display: block; width: 100%; }
  table.table-cards tr { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; padding: 6px 4px; background: var(--surface); }
  table.table-cards td { border: 0; padding: 4px 10px; text-align: left !important; }
  table.table-cards td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .opr-page { width: 100%; min-height: auto; padding: 16px; }
  .opr-info { grid-template-columns: repeat(2, 1fr); }
  .opr-cols { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- Print */
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body { background: #fff !important; color: #000; font-size: 10pt; }
  .bottom-nav, .ios-hint, .sb-filters,
  .sidebar, .topbar, .footer, .breadcrumbs, .page-actions, .no-print, .filter-bar, .alert, .demo-banner, .tabs, .pager, .opr-toolbar, .upload-box, .btn, .icon-btn { display: none !important; }
  .has-shell { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .opr-page { box-shadow: none; margin: 0; width: auto; min-height: auto; padding: 0; }
  .opr-page.opr-print-a4 { min-height: 270mm; }
  .print-only { display: block !important; }
  a { color: #000; text-decoration: none; }
  .table th { position: static; }
  .chart-box { height: 220px; }
}
.print-only { display: none; }
