/* ============================================================
   WIUT University Platform — Enterprise UI Stylesheet
   Design: Clean SaaS / ERP — Refined Indigo Palette
   Font: DM Sans (display) + Inter (body data)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ============================================================ CSS VARIABLES */
:root {
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;
  --brand-900: #312e81;

  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-150:  #eceef2;
  --gray-200:  #e5e7eb;
  --gray-300:  #d1d5db;
  --gray-400:  #9ca3af;
  --gray-500:  #6b7280;
  --gray-600:  #4b5563;
  --gray-700:  #374151;
  --gray-800:  #1f2937;
  --gray-900:  #111827;

  --success-50:  #f0fdf4;
  --success-100: #dcfce7;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;

  --warning-50:  #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;

  --danger-50:   #fef2f2;
  --danger-100:  #fee2e2;
  --danger-500:  #ef4444;
  --danger-600:  #dc2626;
  --danger-700:  #b91c1c;

  --info-50:   #eff6ff;
  --info-100:  #dbeafe;
  --info-500:  #3b82f6;
  --info-600:  #2563eb;

  --sidebar-width: 256px;
  --topbar-height: 60px;
  --card-radius: 12px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-xs: 0 1px 2px 0 rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,.08), 0 1px 2px -1px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.07), 0 4px 6px -4px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);

  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', 'Cascadia Code', monospace;

  --transition: 0.18s ease;
  --transition-slow: 0.3s ease;
}

/* ============================================================ RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  background: #f4f5f9;
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================================ APP LAYOUT */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================================ SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition-slow);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-100);
  min-height: var(--topbar-height);
}

.sidebar-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}

.sidebar-logo-text {
  display: flex; flex-direction: column;
}
.sidebar-logo-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.sidebar-logo-sub {
  font-size: 10.5px;
  color: var(--gray-400);
  letter-spacing: 0.3px;
}

.sidebar-section {
  padding: 12px 12px 4px;
}
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-400);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 4px;
}

.sidebar-nav {
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin: 1px 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-600);
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}
.nav-item:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}
.nav-item.active {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
}
.nav-item.active .nav-icon { color: var(--brand-600); }

.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-badge {
  margin-left: auto;
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}
.nav-badge.danger {
  background: var(--danger-100);
  color: var(--danger-700);
}
.nav-badge.warning {
  background: var(--warning-100);
  color: var(--warning-700);
}

.sidebar-bottom {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid var(--gray-100);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}
.sidebar-user:hover { background: var(--gray-50); }
.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.user-name { font-size: 12.5px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--gray-400); }

/* ============================================================ MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================ TOPBAR */
.topbar {
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.topbar-title { font-size: 15px; font-weight: 600; color: var(--gray-900); }
.topbar-subtitle { font-size: 12.5px; color: var(--gray-400); }

.topbar-search {
  display: flex; align-items: center;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  gap: 8px;
  max-width: 280px; flex: 1;
  transition: border-color var(--transition);
}
.topbar-search:focus-within {
  border-color: var(--brand-400);
  background: white;
  box-shadow: 0 0 0 3px rgba(99,102,241,.08);
}
.topbar-search input {
  border: none; background: transparent;
  font-size: 13px; color: var(--gray-700);
  outline: none; flex: 1;
}
.topbar-search input::placeholder { color: var(--gray-400); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  background: white;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  transition: all var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--gray-50); color: var(--gray-700); border-color: var(--gray-300); }

.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--danger-500);
  border-radius: 50%;
  border: 1.5px solid white;
}

.semester-badge {
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  color: var(--brand-700);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

/* ============================================================ PAGE BODY */
.page-body {
  padding: 28px;
  flex: 1;
}

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-left {}
.page-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.page-subheading {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 3px;
}
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ============================================================ STAT CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border-radius: var(--card-radius);
  padding: 20px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 12px;
}
.stat-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.stat-card-icon.indigo { background: var(--brand-50); }
.stat-card-icon.green  { background: var(--success-50); }
.stat-card-icon.yellow { background: var(--warning-50); }
.stat-card-icon.red    { background: var(--danger-50); }
.stat-card-icon.blue   { background: var(--info-50); }

.stat-card-trend {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 99px;
}
.stat-card-trend.up { background: var(--success-50); color: var(--success-600); }
.stat-card-trend.down { background: var(--danger-50); color: var(--danger-600); }
.stat-card-trend.neutral { background: var(--gray-100); color: var(--gray-600); }

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.8px;
  line-height: 1;
  margin-bottom: 4px;
  font-feature-settings: "tnum";
}
.stat-card-label {
  font-size: 12.5px;
  color: var(--gray-500);
  font-weight: 500;
}
.stat-card-sub {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ============================================================ GRID LAYOUTS */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }

@media(max-width:1100px) {
  .grid-2, .grid-3, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}

/* ============================================================ CARDS */
.card {
  background: white;
  border-radius: var(--card-radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card-header {
  padding: 18px 20px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--gray-900);
}
.card-subtitle {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}
.card-actions { display: flex; gap: 6px; align-items: center; }
.card-body { padding: 20px; }
.card-body-compact { padding: 12px 20px; }

/* ============================================================ TABLES */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--card-radius);
  background: white;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: var(--gray-50);
  padding: 11px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
  cursor: pointer;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }
tbody tr.selected { background: var(--brand-50); }

td {
  padding: 13px 16px;
  color: var(--gray-700);
  vertical-align: middle;
}
td.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray-600);
}
td.bold { font-weight: 600; color: var(--gray-900); }

/* ============================================================ BADGES / STATUS */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.1px;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-active    { background: var(--success-50);  color: var(--success-700); }
.badge-active::before { background: var(--success-500); }

.badge-pending   { background: var(--warning-50);  color: var(--warning-700); }
.badge-pending::before { background: var(--warning-500); }

.badge-review    { background: var(--info-50);     color: var(--info-600); }
.badge-review::before { background: var(--info-500); }

.badge-approved  { background: var(--success-50);  color: var(--success-700); }
.badge-approved::before { background: var(--success-500); }

.badge-rejected  { background: var(--danger-50);   color: var(--danger-700); }
.badge-rejected::before { background: var(--danger-500); }

.badge-blocked   { background: var(--danger-50);   color: var(--danger-700); }
.badge-blocked::before { background: var(--danger-500); }

.badge-completed { background: var(--brand-50);    color: var(--brand-700); }
.badge-completed::before { background: var(--brand-500); }

.badge-clearance { background: #fdf2fa;             color: #9333ea; }
.badge-clearance::before { background: #a855f7; }

.badge-suspended { background: var(--danger-50);   color: var(--danger-700); }
.badge-suspended::before { background: var(--danger-500); }

.badge-waived    { background: var(--gray-100);    color: var(--gray-600); }
.badge-waived::before { background: var(--gray-400); }

.badge-na        { background: var(--gray-100);    color: var(--gray-400); }
.badge-na::before { background: var(--gray-300); }

.badge-board     { background: #fefce8;             color: #854d0e; }
.badge-board::before { background: #eab308; }

.badge-repeat    { background: var(--warning-50);  color: var(--warning-700); border: 1px solid var(--warning-200); }
.badge-repeat::before { background: var(--warning-500); }

.badge-ilp       { background: #f0f9ff;             color: #0369a1; }
.badge-ilp::before { background: #0ea5e9; }

.badge-grant     { background: #f0fdf4; color: var(--success-700); }
.badge-grant::before { background: var(--success-500); }

.badge-debt      { background: var(--danger-50); color: var(--danger-700); font-weight: 700; }
.badge-debt::before { background: var(--danger-500); }

.badge-clear     { background: var(--success-50); color: var(--success-700); }
.badge-clear::before { background: var(--success-500); }

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--brand-600);
  color: white;
  box-shadow: 0 1px 3px rgba(79,70,229,.25), inset 0 1px 0 rgba(255,255,255,.1);
}
.btn-primary:hover { background: var(--brand-700); box-shadow: 0 2px 6px rgba(79,70,229,.35); }

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }

.btn-danger {
  background: var(--danger-600);
  color: white;
}
.btn-danger:hover { background: var(--danger-700); }

.btn-success {
  background: var(--success-600);
  color: white;
}
.btn-success:hover { background: var(--success-700); }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-sm svg { width: 13px; height: 13px; }

.btn-xs { padding: 3px 8px; font-size: 11.5px; }
.btn-icon {
  width: 32px; height: 32px;
  padding: 0; justify-content: center;
  border-radius: var(--radius-md);
}
.btn-icon svg { width: 15px; height: 15px; }

/* ============================================================ FORM ELEMENTS */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-input, .form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--gray-800);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
}

.filter-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .form-select { width: auto; min-width: 140px; }

.search-input-wrap {
  display: flex; align-items: center; gap: 8px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  flex: 1; max-width: 320px;
}
.search-input-wrap svg { color: var(--gray-400); flex-shrink: 0; }
.search-input-wrap input {
  border: none; outline: none; background: transparent;
  font-size: 13px; color: var(--gray-700); flex: 1;
}
.search-input-wrap input::placeholder { color: var(--gray-400); }

/* ============================================================ TABS */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 20px;
  gap: 0;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--gray-800); }
.tab-btn.active {
  color: var(--brand-700);
  border-bottom-color: var(--brand-600);
  font-weight: 650;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================ MODAL */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; visibility: hidden;
  transition: all var(--transition-slow);
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 680px; width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--transition-slow);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-lg { max-width: 880px; }
.modal-sm { max-width: 460px; }

.modal-header {
  padding: 22px 24px 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
  padding-bottom: 16px;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.modal-subtitle { font-size: 12.5px; color: var(--gray-400); margin-top: 2px; }

.modal-close {
  width: 30px; height: 30px;
  background: var(--gray-100); border: none;
  border-radius: var(--radius-sm);
  color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-700); }
.modal-close svg { width: 14px; height: 14px; }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}

/* ============================================================ PROFILE / DETAIL PANEL */
.detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}
@media(max-width:960px) { .detail-layout { grid-template-columns: 1fr; } }

.profile-card {
  background: white;
  border-radius: var(--card-radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  position: sticky; top: 80px;
}
.profile-banner {
  height: 64px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400));
}
.profile-card-body { padding: 0 20px 20px; }
.profile-avatar-wrap {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-top: -26px;
  margin-bottom: 14px;
}
.profile-avatar {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: white;
  border: 3px solid white;
  box-shadow: var(--shadow-sm);
}
.profile-name { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.profile-id { font-size: 11.5px; color: var(--gray-400); font-family: var(--font-mono); }
.profile-program { font-size: 12.5px; color: var(--gray-500); margin-top: 2px; }

.profile-badges { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0; }

.profile-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.profile-stat {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
}
.profile-stat-value { font-size: 18px; font-weight: 700; color: var(--gray-900); letter-spacing: -0.5px; }
.profile-stat-label { font-size: 10.5px; color: var(--gray-400); margin-top: 1px; }

.info-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-row-label { color: var(--gray-500); font-weight: 500; flex-shrink: 0; }
.info-row-value { color: var(--gray-800); font-weight: 500; text-align: right; max-width: 200px; }

.section-divider {
  font-size: 11px; font-weight: 650;
  color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.6px;
  margin: 18px 0 10px;
}

/* ============================================================ CLEARANCE STEPS */
.clearance-steps { display: flex; flex-direction: column; gap: 10px; }

.clearance-step {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: white;
  transition: all var(--transition);
}
.clearance-step.approved { border-color: var(--success-200); background: var(--success-50); }
.clearance-step.blocked  { border-color: var(--danger-200);  background: var(--danger-50); }
.clearance-step.pending  { border-color: var(--warning-200); background: var(--warning-50); }
.clearance-step.na       { border-color: var(--gray-200);    background: var(--gray-50); opacity: 0.75; }

.step-icon-wrap {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.approved .step-icon-wrap { background: var(--success-100); }
.blocked  .step-icon-wrap { background: var(--danger-100); }
.pending  .step-icon-wrap { background: var(--warning-100); }
.na       .step-icon-wrap { background: var(--gray-100); }

.step-content { flex: 1; min-width: 0; }
.step-dept { font-size: 13.5px; font-weight: 650; color: var(--gray-900); }
.step-notes { font-size: 12px; color: var(--gray-500); margin-top: 3px; }
.step-meta { font-size: 11px; color: var(--gray-400); margin-top: 3px; }
.step-status-wrap { flex-shrink: 0; display: flex; align-items: center; }

/* ============================================================ ACTIVITY LOG */
.activity-log { display: flex; flex-direction: column; }
.activity-item {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-dot.accounting { background: var(--brand-500); }
.activity-dot.board { background: #f59e0b; }
.activity-dot.dormitory { background: #10b981; }
.activity-dot.sas { background: #8b5cf6; }
.activity-dot.clearance { background: #ec4899; }

.activity-content { flex: 1; min-width: 0; }
.activity-action { font-size: 13px; font-weight: 500; color: var(--gray-800); }
.activity-detail { font-size: 12px; color: var(--gray-500); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-meta { display: flex; gap: 8px; margin-top: 4px; align-items: center; }
.activity-time { font-size: 11px; color: var(--gray-400); }
.activity-module-tag {
  font-size: 10px; font-weight: 650;
  padding: 2px 7px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.tag-accounting { background: var(--brand-50); color: var(--brand-700); }
.tag-board      { background: var(--warning-50); color: var(--warning-700); }
.tag-dormitory  { background: var(--success-50); color: var(--success-700); }
.tag-sas        { background: #faf5ff; color: #7c3aed; }
.tag-clearance  { background: #fdf2fa; color: #9333ea; }

/* ============================================================ MINI CHART / PROGRESS BAR */
.progress-bar-wrap { margin: 4px 0; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--gray-600); margin-bottom: 5px;
}
.progress-track {
  height: 6px; border-radius: 99px; background: var(--gray-100);
  overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 99px;
  transition: width 0.6s ease;
}
.fill-brand   { background: linear-gradient(90deg, var(--brand-500), var(--brand-400)); }
.fill-success { background: linear-gradient(90deg, var(--success-500), #4ade80); }
.fill-warning { background: linear-gradient(90deg, var(--warning-500), #fcd34d); }
.fill-danger  { background: linear-gradient(90deg, var(--danger-500), #f87171); }

/* ============================================================ SUMMARY CHIP */
.summary-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.summary-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 12.5px;
}
.summary-chip-label { color: var(--gray-500); }
.summary-chip-value { font-weight: 700; color: var(--gray-900); }

/* ============================================================ EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state-title { font-size: 15px; font-weight: 650; color: var(--gray-700); }
.empty-state-sub { font-size: 13px; color: var(--gray-400); margin-top: 4px; }

/* ============================================================ TOAST */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--gray-900);
  color: white;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 280px; max-width: 380px;
  font-size: 13px;
  animation: slideIn 0.25s ease, fadeOut 0.3s ease 3.5s forwards;
  border-left: 3px solid var(--brand-500);
}
.toast.success { border-left-color: var(--success-500); }
.toast.warning { border-left-color: var(--warning-500); }
.toast.danger  { border-left-color: var(--danger-500); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-weight: 650; }
.toast-msg { font-size: 12px; color: rgba(255,255,255,.65); margin-top: 2px; }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ============================================================ FINANCIAL LEDGER */
.ledger-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.ledger-row:last-child { border-bottom: none; }
.ledger-row.total {
  font-weight: 700;
  padding-top: 12px;
  border-top: 2px solid var(--gray-200);
}
.ledger-credit { color: var(--success-600); font-weight: 600; }
.ledger-debit  { color: var(--gray-900); font-weight: 500; }
.ledger-balance { color: var(--danger-600); font-weight: 700; }
.ledger-label  { color: var(--gray-600); }

.amount {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: -0.3px;
}
.amount-large {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.8px;
}
.amount.debt { color: var(--danger-600); }
.amount.paid { color: var(--success-600); }

/* ============================================================ PAGE TRANSITIONS */
.page-body { animation: pageFadeIn 0.2s ease; }
@keyframes pageFadeIn {
  from { opacity: 0.6; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================ MISC UTILITIES */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.p-0 { padding: 0 !important; }

.text-sm { font-size: 12px; }
.text-muted { color: var(--gray-400); }
.text-danger { color: var(--danger-600); }
.text-success { color: var(--success-600); }
.text-brand { color: var(--brand-600); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.mono { font-family: var(--font-mono); }

.w-full { width: 100%; }
.hidden { display: none !important; }

.divider {
  height: 1px; background: var(--gray-100);
  margin: 16px 0;
}

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
}

.list-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background var(--transition);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--gray-50); }
.list-item.selected { background: var(--brand-50); }

/* ============================================================ SIDEBAR COLLAPSE + RESPONSIVE */
@media(max-width:768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-body { padding: 16px; }
}
