:root {
  --navy: #111b35;
  --navy-soft: #1a2748;
  --purple: #6258e6;
  --purple-dark: #4e45ca;
  --mint: #8ff3d7;
  --green: #259b74;
  --amber: #bc781b;
  --red: #c83c5a;
  --ink: #17243e;
  --muted: #748096;
  --canvas: #f5f7fb;
  --panel: #ffffff;
  --line: #e2e7ef;
  --radius: 16px;
  --shadow: 0 18px 45px rgba(21, 33, 61, 0.07);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(98, 88, 230, .25); outline-offset: 2px; }
.hidden { display: none !important; }
.mobile-only { display: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 250px; display: flex; flex-direction: column; padding: 24px 18px 18px; overflow-y: auto; background: var(--navy); color: #fff; box-shadow: 12px 0 36px rgba(10, 20, 48, .08); }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 24px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand > div { display: flex; flex-direction: column; }
.brand strong { font-size: 18px; letter-spacing: -.02em; }
.brand small { margin-top: 1px; color: #9caac4; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 12px; background: linear-gradient(135deg, var(--mint), #7d83ff); color: var(--navy); font-weight: 900; }
.brand-dark { color: var(--ink); }
.workspace-picker { display: block; margin: 0 10px 18px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.workspace-picker > span { display: block; margin-bottom: 7px; color: #9aa8c0; font-size: 12px; font-weight: 700; }
.workspace-picker select { width: 100%; height: 41px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 0 34px 0 11px; background: var(--navy-soft); color: #fff; }
.sidebar nav > p { margin: 2px 12px 10px; color: #6f7e9a; font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.sidebar nav button { position: relative; display: flex; width: 100%; align-items: center; gap: 11px; margin: 3px 0; border: 0; border-radius: 11px; padding: 11px 12px; background: transparent; color: #aeb9ce; text-align: left; transition: .16s ease; }
.sidebar nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav button.active { background: linear-gradient(90deg, rgba(117,104,255,.22), rgba(117,104,255,.07)); color: #fff; }
.sidebar nav button.active::after { content: ""; position: absolute; right: 0; width: 3px; height: 24px; border-radius: 4px; background: var(--mint); }
.nav-icon { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: rgba(255,255,255,.07); color: #a9ffe8; font-size: 10px; font-weight: 900; }
.workspace-status { display: flex; flex-direction: column; gap: 3px; margin-top: auto; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; padding: 13px; background: rgba(255,255,255,.035); }
.workspace-status .status-dot { width: 7px; height: 7px; margin-bottom: 4px; border-radius: 99px; background: #35d6a2; box-shadow: 0 0 0 4px rgba(53,214,162,.12); }
.workspace-status small, .workspace-status span:last-child { color: #8492ad; font-size: 10px; }
.workspace-status strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.main-column { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 25; height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 0 30px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); }
.topbar-context { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; }
.topbar-actions, .admin-account { display: flex; align-items: center; gap: 12px; }
.admin-account > div { display: flex; flex-direction: column; }
.admin-account strong { font-size: 12px; }
.admin-account small { color: var(--muted); font-size: 10px; }
.avatar { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 11px; background: #eceaff; color: var(--purple-dark); font-size: 11px; font-weight: 900; }
.main-content { max-width: 1520px; margin: auto; padding: 30px clamp(18px, 3vw, 42px) 50px; }
.page-stack { display: grid; gap: 18px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.page-heading h1 { margin: 2px 0 7px; font-size: clamp(27px, 3vw, 38px); letter-spacing: -.04em; }
.page-heading p:last-child { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.6; }
.eyebrow { margin: 0; color: var(--purple); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--panel); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-heading h2 { margin: 2px 0 0; font-size: 18px; letter-spacing: -.02em; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 27px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: #f8f9fc; color: #5d6980; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge-success { border-color: #c8eadf; background: #eaf9f3; color: #218767; }
.badge-warning { border-color: #f0d6af; background: #fff6e7; color: #a96b16; }
.badge-danger { border-color: #f0c7d0; background: #fff0f3; color: #b93653; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 13px; background: #fff; color: #34415a; font-weight: 750; text-decoration: none; }
.button:hover { border-color: #c8c3f6; background: #faf9ff; }
.button-primary { border-color: var(--purple); background: var(--purple); color: #fff; }
.button-primary:hover { background: var(--purple-dark); color: #fff; }
.button-danger { border-color: #f2c4ce; color: var(--red); }
.button-small { min-height: 31px; padding: 5px 9px; font-size: 11px; }
.button-wide { width: 100%; }
.icon-button { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.notice { border: 1px solid #d8d4f7; border-radius: 12px; padding: 12px 14px; background: #f7f6ff; color: #554bc7; font-size: 12px; line-height: 1.5; }
.notice.warning { border-color: #f0d6af; background: #fff8ed; color: #9a6319; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.metric-card { position: relative; overflow: hidden; min-height: 135px; }
.metric-card::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 110px; height: 110px; border-radius: 50%; background: #7568ff0b; }
.metric-card > span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.metric-card > strong { display: block; margin: 11px 0 4px; font-size: 32px; letter-spacing: -.04em; }
.metric-card > small { color: #8a95a8; }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.funnel-list, .score-list, .attention-list { display: grid; gap: 13px; }
.funnel-row > div:first-child, .score-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.funnel-row span, .score-row span { color: #536078; font-size: 12px; font-weight: 750; }
.funnel-row b, .score-row b { font-size: 13px; }
.track { height: 7px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: #edf0f5; }
.track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), #2bc496); }
.attention-list button { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 10px; border: 1px solid #e8ebf1; border-radius: 11px; padding: 11px; background: #fafbfd; color: #435069; text-align: left; }
.attention-list button > i { width: 9px; height: 9px; border-radius: 50%; background: #e6a43e; }
.attention-list button.danger > i { background: var(--red); }
.attention-list button span { display: flex; flex-direction: column; }
.attention-list button small { margin-top: 2px; color: var(--muted); }

.split-layout { display: grid; grid-template-columns: minmax(290px,.72fr) minmax(0,1.28fr); gap: 18px; align-items: start; }
.sticky-panel { position: sticky; top: 90px; }
.form-stack { display: grid; gap: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label.field { display: flex; flex-direction: column; gap: 6px; }
label.field > span { color: #526079; font-size: 11px; font-weight: 800; }
input, select, textarea { width: 100%; border: 1px solid #dce2ec; border-radius: 10px; padding: 10px 11px; background: #fbfcfe; color: var(--ink); }
textarea { min-height: 88px; resize: vertical; }
.field-hint { color: #8792a5; font-size: 10px; line-height: 1.45; }
.card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.entity-card { display: grid; gap: 11px; }
.entity-card h3 { margin: 0; font-size: 16px; }
.entity-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.entity-meta { display: flex; gap: 7px; flex-wrap: wrap; }
.entity-actions { display: flex; gap: 7px; flex-wrap: wrap; padding-top: 4px; }
.college-monogram { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 15px; background: linear-gradient(145deg,#7568ff,#5044d8); color: #fff; font-size: 12px; font-weight: 900; }
.college-card-head { display: flex; align-items: center; gap: 12px; }

.table-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.search { max-width: 410px; }
.table-wrap { overflow-x: auto; border: 1px solid #e9ecf2; border-radius: 13px; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th { padding: 11px 13px; background: #f8f9fc; color: #7b879a; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .05em; }
td { border-top: 1px solid #eceff4; padding: 12px 13px; color: #4a576f; font-size: 12px; vertical-align: top; }
td strong { color: #26344d; }
.subtext { display: block; margin-top: 4px; color: #8994a6; font-size: 10px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-state { display: flex; min-height: 180px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); text-align: center; }
.empty-state strong { color: #3d4a62; }

.import-box { border: 1.5px dashed #c9c5ed; border-radius: 14px; padding: 18px; background: #faf9ff; color: #5c52ce; }
.import-box input { margin-top: 10px; background: #fff; }
.question-list { display: grid; gap: 8px; max-height: 650px; overflow-y: auto; padding-right: 4px; }
.question-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; border: 1px solid #e7eaf0; border-radius: 12px; padding: 13px; background: #fbfcfd; }
.question-row strong { display: block; color: #35425a; font-size: 12px; line-height: 1.5; }
.question-row small { display: block; margin-top: 5px; color: var(--muted); }
.switch { position: relative; width: 42px; height: 23px; flex: 0 0 auto; border: 0; border-radius: 99px; background: #cbd2de; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: .15s ease; }
.switch.on { background: var(--purple); }
.switch.on::after { left: 22px; }
.audit-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.audit-summary article { display: flex; min-height: 125px; flex-direction: column; justify-content: center; }
.audit-summary small { color: #8b96a8; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.audit-summary strong { margin: 7px 0 3px; color: var(--purple-dark); font-size: 30px; }
.audit-summary span { color: var(--muted); font-size: 11px; }
.audit-detail { max-width: 450px; line-height: 1.5; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 20%, #352b6d 0, transparent 29%), linear-gradient(135deg,#101a34,#192b50 60%,#113446); }
.login-card { width: min(100%, 460px); border: 1px solid rgba(255,255,255,.12); border-radius: 24px; padding: 34px; background: #fff; box-shadow: 0 35px 90px rgba(4,10,28,.32); }
.login-card .eyebrow { margin-top: 35px; }
.login-card h1 { margin: 8px 0 12px; font-size: 39px; line-height: 1.04; letter-spacing: -.05em; }
.login-card > p:last-of-type { color: var(--muted); line-height: 1.6; }
.login-card .button { margin: 20px 0 12px; }
.login-card > small { display: block; color: #8c97a9; line-height: 1.55; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: grid; gap: 8px; }
.toast { max-width: 390px; border: 1px solid #d8d4f7; border-radius: 12px; padding: 12px 14px; background: #fff; color: #455269; box-shadow: 0 18px 45px rgba(20,31,58,.18); font-size: 12px; animation: toast-in .2s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid, .split-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
}
@media (max-width: 820px) {
  .mobile-only { display: grid; }
  .app-shell { display: block; }
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-column { min-width: 0; }
  .topbar { padding: 0 18px; }
  .admin-account > div, .topbar .badge { display: none; }
  .page-heading { flex-direction: column; }
  .heading-actions { width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .main-content { padding: 22px 14px 40px; }
  .metric-grid, .form-grid, .audit-summary { grid-template-columns: 1fr; }
  .table-tools { align-items: stretch; flex-direction: column; }
  .search { max-width: none; }
  .panel { padding: 16px; }
  .login-card { padding: 26px 21px; }
  .login-card h1 { font-size: 34px; }
}
