/* ══════════════════════════════════════════════════════════════
   Generation Schools Purchase Portal — Design System
   ══════════════════════════════════════════════════════════════ */

:root {
  /* Palette */
  --navy:       #0f1e3d;
  --navy-mid:   #172645;
  --navy-light: #1e3060;
  --navy-muted: #2a3f6f;
  --gs-teal:    #1a6b8a;
  --gs-teal-lt: #7dc4d8;
  --gold:       #c9a84c;
  --gold-light: #e2c472;
  --gold-pale:  #fdf6e3;
  --success:    #16a34a;
  --success-bg: #dcfce7;
  --danger:     #dc2626;
  --danger-bg:  #fee2e2;
  --warning:    #d97706;
  --warning-bg: #fef3c7;
  --info:       #0284c7;
  --info-bg:    #e0f2fe;
  --purple:     #7c3aed;
  --purple-bg:  #ede9fe;
  --gray-50:    #f8fafc;
  --gray-100:   #f1f5f9;
  --gray-200:   #e2e8f0;
  --gray-300:   #cbd5e1;
  --gray-400:   #94a3b8;
  --gray-500:   #64748b;
  --gray-600:   #475569;
  --gray-700:   #334155;
  --gray-800:   #1e293b;
  --gray-900:   #0f172a;
  --white:      #ffffff;

  /* Layout */
  --sidebar-w: 256px;
  --topbar-h:  60px;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.14);

  /* Typography */
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.sidebar-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gs-teal), var(--gs-teal-lt));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: var(--white);
  flex-shrink: 0;
}
.brand-name { font-size: 13px; font-weight: 700; color: var(--white); line-height: 1.2; display: block; }
.brand-sub  { font-size: 10px; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .06em; }

.sidebar-close { display: none; background: none; border: none; color: rgba(255,255,255,.5); cursor: pointer; padding: 4px; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar-img  { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: block; }
.avatar-initials {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-muted), var(--navy-light));
  border: 1.5px solid rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--white);
}
.avatar-status {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--navy);
}
.avatar-status.online { background: #22c55e; }
.user-name { font-size: 13px; font-weight: 600; color: var(--white); line-height: 1.3; }
.user-role { font-size: 11px; color: rgba(255,255,255,.45); margin-top: 1px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 12px 0;
  overflow-y: auto;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(255,255,255,.3);
  padding: 14px 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}
.nav-item:hover  { background: rgba(255,255,255,.07); color: var(--white); }
.nav-item.active { background: rgba(26,107,138,.25); color: var(--gs-teal-lt); }
.nav-item.active .nav-icon { stroke: var(--gs-teal-lt); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; }
.nav-item--logout {
  color: rgba(255,100,100,.8);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  margin: 4px 0;
}
.nav-item--logout:hover { background: rgba(255,80,80,.15); color: #ff6464; border-color: rgba(255,80,80,.3); }

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,.06); }

/* ── Main wrap ────────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  background: rgba(248,250,252,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
}
.topbar-title { flex: 1; font-size: 15px; font-weight: 600; color: var(--gray-700); }
.topbar-actions { display: flex; gap: 10px; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--gray-600); padding: 6px; border-radius: 8px; }
.menu-toggle:hover { background: var(--gray-100); }

.page-content { padding: 28px; flex: 1; }

/* ── Flash messages ───────────────────────────────────────── */
.flash-container { padding: 0 28px; padding-top: 12px; }
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  gap: 12px;
}
.flash--success { background: var(--success-bg); color: var(--success); border-left: 3px solid var(--success); }
.flash--danger  { background: var(--danger-bg); color: var(--danger); border-left: 3px solid var(--danger); }
.flash--warning { background: var(--warning-bg); color: var(--warning); border-left: 3px solid var(--warning); }
.flash--info    { background: var(--info-bg); color: var(--info); border-left: 3px solid var(--info); }
.flash-close { background: none; border: none; cursor: pointer; font-size: 20px; line-height: 1; color: currentColor; opacity: .6; }
.flash-close:hover { opacity: 1; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.card-body  { padding: 24px; }

/* ── Stat cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-400); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--gs-teal); line-height: 1; }
.stat-value.gold   { color: var(--gs-teal); }
.stat-value.green  { color: var(--success); }
.stat-value.red    { color: var(--danger); }
.stat-value.orange { color: var(--warning); }
.stat-sub { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  line-height: 1;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm  { padding: 7px 14px; font-size: 13px; }
.btn-lg  { padding: 16px 24px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

.btn-primary   { background: var(--gs-teal); color: var(--white); }
.btn-primary:hover { background: #1a6b8a; }
.btn-gold      { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); }
.btn-success   { background: var(--success); color: var(--white); }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger    { background: var(--danger); color: var(--white); }
.btn-danger:hover { filter: brightness(1.1); }
.btn-warning   { background: var(--warning); color: var(--white); }
.btn-outline   { background: transparent; color: var(--gray-700); border: 1.5px solid var(--gray-300); }
.btn-outline:hover { border-color: var(--gray-400); background: var(--gray-50); }
.btn-ghost     { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }

/* ── Badges / Status chips ────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-info     { background: var(--info-bg);    color: var(--info); }
.badge-navy     { background: rgba(15,30,61,.1); color: var(--navy); }
.badge-gold     { background: var(--gold-pale);  color: #92640a; }
.badge-purple   { background: var(--purple-bg);  color: var(--purple); }
.badge-gray     { background: var(--gray-100);   color: var(--gray-500); }

/* Priority indicators */
.priority-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.priority-dot.immediate { background: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.2); }
.priority-dot.high      { background: var(--warning); }
.priority-dot.medium    { background: var(--info); }
.priority-dot.low       { background: var(--gray-400); }

/* ── Request cards ────────────────────────────────────────── */
.request-list { display: flex; flex-direction: column; gap: 14px; }

.request-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: box-shadow .15s, border-color .15s;
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}
.request-card:hover { box-shadow: var(--shadow); border-color: var(--gray-300); }
.request-card.immediate { border-left: 4px solid var(--danger); }
.request-card.high      { border-left: 4px solid var(--warning); }
.request-card.medium    { border-left: 4px solid var(--info); }
.request-card.low       { border-left: 4px solid var(--gray-300); }

.request-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.request-thumb {
  width: 52px; height: 52px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.request-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.request-main { flex: 1; min-width: 0; }
.request-title { font-size: 15px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.request-desc  { font-size: 13px; color: var(--gray-500); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.request-meta  { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--gray-500); }
.request-price { font-size: 18px; font-weight: 800; color: var(--navy); white-space: nowrap; }
.request-price.monthly::after { content: '/mo'; font-size: 12px; font-weight: 400; color: var(--gray-400); }

.request-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Priority groups ──────────────────────────────────────── */
.priority-group { margin-bottom: 32px; }
.priority-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--gray-200);
}
.priority-group-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.priority-group-label.immediate { color: var(--danger); }
.priority-group-label.high      { color: var(--warning); }
.priority-group-label.medium    { color: var(--info); }
.priority-group-label.low       { color: var(--gray-400); }
.priority-group-desc { font-size: 12.5px; color: var(--gray-400); margin-top: 2px; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 7px;
}
.form-label .required { color: var(--danger); margin-left: 3px; }
.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 5px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--gray-800);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15,30,61,.08);
}
.form-control::placeholder { color: var(--gray-400); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.form-check { display: flex; align-items: center; gap: 9px; }
.form-check input[type=checkbox] { width: 17px; height: 17px; border: 1.5px solid var(--gray-300); border-radius: 4px; accent-color: var(--navy); cursor: pointer; }
.form-check label { font-size: 14px; color: var(--gray-700); cursor: pointer; font-weight: 500; }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gray-500);
  padding: 10px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Approval workflow ────────────────────────────────────── */
.workflow-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 4px 0;
}
.workflow-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  position: relative;
}
.workflow-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
  z-index: 0;
}
.step-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px; font-weight: 700;
  border: 2px solid var(--gray-200);
  background: var(--white);
  z-index: 1;
  margin-top: 2px;
}
.step-icon.pending    { border-color: var(--warning); color: var(--warning); }
.step-icon.approved   { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.step-icon.rejected   { border-color: var(--danger);  background: var(--danger-bg);  color: var(--danger); }
.step-icon.discussion { border-color: var(--info);    background: var(--info-bg);    color: var(--info); }

.step-body  { padding-bottom: 22px; flex: 1; min-width: 0; }
.step-role  { font-size: 10px; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: .07em; line-height: 1.2; }
.step-name  { font-size: 13px; font-weight: 600; color: var(--gray-800); margin-top: 2px; }
.step-note  { font-size: 12px; color: var(--gray-500); margin-top: 3px; font-style: italic; }
.step-time  { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ── Comments ─────────────────────────────────────────────── */
.comments-list { display: flex; flex-direction: column; gap: 16px; }
.comment {
  display: flex;
  gap: 12px;
}
.comment.system {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 12px 14px;
  border-left: 3px solid var(--gray-300);
}
.comment.system .comment-body-text { color: var(--gray-600); font-style: italic; font-size: 13px; }
.comment-avatar { flex-shrink: 0; }
.comment-content { flex: 1; }
.comment-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.comment-author { font-size: 13.5px; font-weight: 700; color: var(--gray-800); }
.comment-time   { font-size: 12px; color: var(--gray-400); }
.comment-body-text { font-size: 14px; color: var(--gray-700); line-height: 1.6; }

/* ── Product alternatives ─────────────────────────────────── */
.alternatives-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.alt-card {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color .15s;
}
.alt-card:hover  { border-color: var(--navy); }
.alt-card.selected { border-color: var(--gold); background: var(--gold-pale); }
.alt-name   { font-size: 14px; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.alt-desc   { font-size: 12.5px; color: var(--gray-500); margin-bottom: 10px; line-height: 1.5; }
.alt-source { font-size: 12px; color: var(--gray-400); font-weight: 600; margin-bottom: 4px; }
.alt-price  { font-size: 18px; font-weight: 800; color: var(--navy); }

/* ── Deadline badge ───────────────────────────────────────── */
.deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
}
.deadline-badge.urgent  { background: var(--danger-bg); color: var(--danger); }
.deadline-badge.soon    { background: var(--warning-bg); color: var(--warning); }
.deadline-badge.ok      { background: var(--success-bg); color: var(--success); }
.deadline-badge.none    { background: var(--gray-100); color: var(--gray-400); }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-header-left {}
.page-header h1 { font-family: var(--font-display); font-size: 28px; color: var(--navy); margin-bottom: 4px; }
.page-header p  { font-size: 14px; color: var(--gray-500); }
.page-header-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ── User avatar in lists ─────────────────────────────────── */
.user-avatar-sm {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--navy-muted);
  color: var(--white);
  flex-shrink: 0;
  object-fit: cover;
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--gray-200); margin-bottom: 24px; }
.tab-item {
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  border-radius: 6px 6px 0 0;
  transition: color .15s;
}
.tab-item:hover  { color: var(--navy); }
.tab-item.active { color: var(--navy); border-bottom-color: var(--navy); }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .5; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
.empty-state p  { font-size: 14px; color: var(--gray-400); margin-bottom: 20px; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,30,61,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform .25s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--gray-900); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--gray-400); font-size: 24px; line-height: 1; padding: 2px; }
.modal-close:hover { color: var(--gray-700); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; gap: 10px; justify-content: flex-end; }

/* ── AI suggestion loader ─────────────────────────────────── */
.ai-loading { display: flex; align-items: center; gap: 10px; color: var(--gray-500); font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--gray-200); border-top-color: var(--navy); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive / Mobile ──────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-close { display: flex; }
  .sidebar-overlay.open { display: block; }
  .main-wrap { margin-left: 0; }
  .menu-toggle { display: flex; }
  .page-content { padding: 16px; }
  .flash-container { padding: 0 16px; padding-top: 10px; }
  .topbar { padding: 0 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; }
  .page-header-actions { width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .btn-lg { width: 100%; justify-content: center; }
}

/* ── Login page ───────────────────────────────────────────── */
/* ── Login page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: stretch;
}
.login-left {
  flex: 0 0 36%;
  background: linear-gradient(160deg, #0f1e3d 0%, #1a4a6b 60%, #1a6b8a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 50px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  top: -20%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(125,196,216,.15) 0%, transparent 65%);
  pointer-events: none;
}
.login-brand { display: flex; align-items: center; margin-bottom: 60px; }
.login-logo {
  height: 120px;
  width: auto;
  background: #ffffff;
  padding: 10px 20px;
  border-radius: 12px;
}
.login-headline { font-family: var(--font-display); font-size: 46px; color: var(--white); line-height: 1.15; margin-bottom: 18px; }
.login-sub { font-size: 16px; color: rgba(255,255,255,.8); line-height: 1.7; max-width: 440px; }
.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 60px;
  background: url('/static/images/gened-campus.jpg') center/cover no-repeat;
  position: relative;
}
.login-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #1a4a6b 0%, rgba(26,74,107,.5) 25%, rgba(10,25,55,.25) 60%, rgba(10,25,55,.15) 100%);
  pointer-events: none;
}
.login-form-wrap {
  width: 100%;
  max-width: 380px;
  background: var(--white);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  position: relative;
  z-index: 1;
}
.login-form-wrap h2 { font-size: 24px; font-weight: 800; color: var(--gs-teal); margin-bottom: 6px; }
.login-form-wrap p  { font-size: 14px; color: var(--gray-400); margin-bottom: 32px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--gray-400); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }

.btn-google {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  width: 100%; padding: 11px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  font-size: 14px; font-weight: 600; color: var(--gray-700);
  cursor: pointer; text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--font-body);
}
.btn-google:hover { border-color: var(--gray-300); box-shadow: var(--shadow-sm); }

@media (max-width: 900px) {
  .login-left { display: none; }
  .login-right { flex: 1; padding: 24px; }
}

/* ── Role widgets ─────────────────────────────────────────── */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.widget-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
a.widget-card:hover {
  box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,.10));
  transform: translateY(-2px);
  border-color: var(--gray-300);
  cursor: pointer;
}
.widget-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gs-teal), var(--gs-teal-lt));
}
.widget-card.accent-warning::before { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.widget-card.accent-success::before { background: linear-gradient(90deg, var(--success), #4ade80); }
.widget-card.accent-danger::before  { background: linear-gradient(90deg, var(--danger), #f87171); }
.widget-icon { font-size: 28px; margin-bottom: 12px; display: block; }
.widget-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--gray-400); margin-bottom: 6px; }
.widget-value { font-size: 30px; font-weight: 800; color: var(--gs-teal); line-height: 1; margin-bottom: 4px; }
.widget-value.warning { color: var(--warning); }
.widget-value.danger  { color: var(--danger); }
.widget-value.success { color: var(--success); }
.widget-sub { font-size: 12px; color: var(--gray-400); }

.cat-bar-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.cat-bar-row { display: flex; flex-direction: column; gap: 4px; }
.cat-bar-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--gray-600); }
.cat-bar-track { height: 6px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.cat-bar-fill  { height: 100%; background: linear-gradient(90deg, var(--gs-teal), var(--gs-teal-lt)); border-radius: 99px; transition: width .4s ease; }

/* ── Misc utilities ───────────────────────────────────────── */
.text-muted { color: var(--gray-400); }
.text-sm    { font-size: 13px; }
.text-right { text-align: right; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.flex  { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
