@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Geist+Mono:wght@100..900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');

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

body {
  font-family: 'Geist Mono', 'Roboto Mono', 'Space Mono', monospace;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

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

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.sidebar {
  width: 240px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.28), transparent 32%),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(23, 59, 107, 0.88) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  scrollbar-gutter: stable;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  isolation: isolate;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(191, 219, 254, 0.38); border-radius: 99px; }

.sidebar::before,
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sidebar::before {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.18), transparent 18%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  opacity: 0.9;
}

.sidebar::after {
  inset: 18px 14px auto;
  height: 120px;
  border-radius: 28px;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.18), transparent 68%);
  filter: blur(20px);
  opacity: 0.9;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 14px 12px 8px;
  padding: 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 28px rgba(15, 23, 42, 0.18);
  flex-shrink: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(59, 130, 246, 0.92));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 10px 20px rgba(37, 99, 235, 0.28);
}

.sidebar-brand span {
  font-size: 15px;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  color: #dbeafe;
  font-size: 14px;
  font-weight: 500;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-item::before {
  content: "";
  position: absolute;
  inset: 1px auto 1px 1px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(125, 211, 252, 0), rgba(125, 211, 252, 0.92), rgba(34, 197, 94, 0));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.nav-item:hover,
.nav-item.open {
  transform: translateX(4px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
  border-color: rgba(125, 211, 252, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 22px rgba(15, 23, 42, 0.16);
  color: #ffffff;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.36), rgba(37, 99, 235, 0.3));
  border-color: rgba(191, 219, 254, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 14px 24px rgba(37, 99, 235, 0.2);
  color: #fff;
}

.nav-item:hover::before,
.nav-item.open::before,
.nav-item.active::before {
  opacity: 1;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.nav-item span {
  flex: 1;
  display: block;
  margin-right: auto;
  text-align: left;
}

.nav-item:hover svg,
.nav-item.open svg,
.nav-item.active svg {
  transform: scale(1.06);
}

.nav-dropdown-toggle {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.nav-dropdown-toggle .arrow {
  margin-left: auto;
}

.arrow {
  width: 14px !important;
  height: 14px !important;
  transition: transform 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
  display: block;
  opacity: 0.78;
}

.arrow.open {
  transform: rotate(90deg);
  opacity: 1;
}

.nav-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.2s ease;
  opacity: 0;
  margin-top: 0;
}

.nav-dropdown.open {
  max-height: 320px;
  opacity: 1;
  margin-top: 2px;
  padding: 8px 8px 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-sub {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 12px 8px 14px;
  border-radius: 12px;
  color: #bfdbfe;
  font-size: 13.5px;
  font-weight: 400;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
  border: 1px solid transparent;
}

.nav-sub:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  color: #eff6ff;
}

.nav-sub.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(59, 130, 246, 0.14));
  border-color: rgba(125, 211, 252, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 16px rgba(15, 23, 42, 0.12);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.72;
  box-shadow: 0 0 10px currentColor;
}

.sidebar-bottom {
  margin: 8px 12px 14px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-bottom .nav-item {
  justify-content: flex-start;
}

.sidebar-nav .nav-item,
.sidebar-nav .nav-sub {
  text-align: left;
}

/* ══════════════════════════════════════════
   MAIN WRAPPER
══════════════════════════════════════════ */
.main-wrapper {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ══════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════ */
.topbar {
  background: #fff;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h2 {
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-username {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: #dbeafe;
  color: #2563eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  background: #dbeafe;
  color: #2563eb;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   FLASH MESSAGES
══════════════════════════════════════════ */
.messages-wrap {
  padding: 12px 28px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: inherit;
  opacity: 0.6;
  padding: 0 0 0 12px;
  line-height: 1;
}
.alert-close:hover { opacity: 1; }

.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }

/* ══════════════════════════════════════════
   MAIN CONTENT & FOOTER
══════════════════════════════════════════ */
.main-content {
  flex: 1;
  padding: 28px;
}

.main-footer {
  text-align: center;
  padding: 16px 28px;
  font-size: 13px;
  color: #94a3b8;
  border-top: 1px solid #e2e8f0;
}

/* ══════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════ */
.page-header {
  padding: 0 0 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid #e2e8f0;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.page-header p {
  font-size: 14px;
  color: #64748b;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ══════════════════════════════════════════
   ROLE BADGES
══════════════════════════════════════════ */
.role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.role-admin   { background: #fee2e2; color: #b91c1c; }
.role-teacher { background: #dbeafe; color: #1d4ed8; }
.role-accountant { background: #dcfce7; color: #15803d; }
.role-librarian { background: #ede9fe; color: #6d28d9; }

/* ══════════════════════════════════════════
   BADGES
══════════════════════════════════════════ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green  { background: #dcfce7; color: #15803d; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-normal { border-radius: 6px; }
.exam-subject-badge {
  min-width: 120px;
  text-align: center;
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Geist Mono', 'Roboto Mono', 'Space Mono', monospace;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }

.btn-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.btn-warning:hover { background: #fcd34d; color: #78350f; }

.btn-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.btn-danger:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

.btn-ghost { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }
.btn-ghost:hover { background: #f1f5f9; color: #1e293b; }

.btn-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.btn-success:hover { background: #22c55e; color: #fff; border-color: #22c55e; }

.row-actions { display: flex; gap: 8px; align-items: center; }
.w-full { width: 100%; }

/* ══════════════════════════════════════════
   DASHBOARD — BANNER
══════════════════════════════════════════ */
.current-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
}

.current-banner svg {
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0;
  display: block;
}

/* ══════════════════════════════════════════
   DASHBOARD — SUMMARY CARDS
══════════════════════════════════════════ */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.dash-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dash-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-card-icon svg,
.quick-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.dash-card-blue   .dash-card-icon { background: #dbeafe; color: #2563eb; }
.dash-card-indigo .dash-card-icon { background: #e0e7ff; color: #4f46e5; }
.dash-card-pink   .dash-card-icon { background: #fce7f3; color: #db2777; }
.dash-card-teal   .dash-card-icon { background: #ccfbf1; color: #0d9488; }
.dash-card-amber  .dash-card-icon { background: #fef3c7; color: #d97706; }
.dash-card-green  .dash-card-icon { background: #dcfce7; color: #16a34a; }

.dash-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 3px;
}

.dash-card-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

.dash-card-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* ══════════════════════════════════════════
   DASHBOARD — SECTION CARD
══════════════════════════════════════════ */
.section-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.section-title-row .section-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.section-link { font-size: 12px; color: #2563eb; font-weight: 500; }
.section-link:hover { text-decoration: underline; }

.dashboard-mix-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-mix-grid-compact {
  grid-template-columns: repeat(2, minmax(340px, 500px));
  justify-content: space-between;
  gap: 10px;
}

.dashboard-mix-panel {
  min-width: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}

.dashboard-mix-panel-compact {
  border-radius: 10px;
  padding: 10px;
}

.dashboard-mix-panel-compact .section-title-row {
  margin-bottom: 8px;
  padding-bottom: 6px;
}

.dashboard-mix-panel-compact .dash-table thead th,
.dashboard-mix-panel-compact .dash-table tbody td,
.dashboard-mix-panel-compact .dash-table tfoot td {
  padding: 7px 9px;
}

.academic-dashboard-filter .dashboard-year-filter {
  min-width: 130px;
  max-width: 180px;
  height: 34px;
  font-size: 13px;
  padding: 0 10px;
}

.dashboard-mix-panel .section-title-row {
  margin-bottom: 10px;
}

.dashboard-mix-panel .course-table-wrap {
  margin-top: 2px;
}

.dashboard-mix-panel .empty-state {
  padding: 28px 0 10px;
}

/* ══════════════════════════════════════════
   DASHBOARD — GENDER BAR
══════════════════════════════════════════ */
.gender-bar-wrap {
  display: flex;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  gap: 2px;
  margin-bottom: 10px;
}

.gender-bar-seg {
  width: var(--w);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  min-width: 60px;
  white-space: nowrap;
  overflow: hidden;
}

.seg-male   { background: #3b82f6; }
.seg-female { background: #ec4899; }
.seg-other  { background: #94a3b8; }

.gender-legend { display: flex; gap: 16px; flex-wrap: wrap; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-male   { background: #3b82f6; }
.dot-female { background: #ec4899; }
.dot-other  { background: #94a3b8; }

/* ══════════════════════════════════════════
   DASHBOARD — COURSE TABLE
══════════════════════════════════════════ */
.course-table-wrap { overflow-x: auto; }

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  
}

.dash-table thead th {
  background: #ffffff;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.dash-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .15s; }
.dash-table tbody tr:last-child { border-bottom: none; }
.dash-table tbody tr:hover { background: #f8fafc; }
.dash-table tbody td { padding: 11px 12px; vertical-align: middle; }

.dash-table tfoot td {
  padding: 11px 12px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-weight: 600;
}

.course-name-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.course-code {
  background: #eff6ff;
  color: #2563eb;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}

.badge-num    { background: #f1f5f9; color: #0f172a; font-weight: 700; padding: 2px 10px; border-radius: 20px; font-size: 12px; display: inline-block; }
.badge-male   { background: #dbeafe; color: #1d4ed8; font-weight: 600; padding: 2px 10px; border-radius: 20px; font-size: 12px; display: inline-block; }
.badge-female { background: #fce7f3; color: #be185d; font-weight: 600; padding: 2px 10px; border-radius: 20px; font-size: 12px; display: inline-block; }

.bar-cell { display: flex; align-items: center; gap: 6px; }

.mini-bar-track {
  width: 100px;
  height: 6px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
  flex-shrink: 0;
}

.mini-bar-fill {
  width: var(--w);
  height: 100%;
  background: #3b82f6;
  border-radius: 99px;
}

.bar-pct  { font-size: 11px; color: #94a3b8; }
.bar-empty { font-size: 13px; color: #cbd5e1; }

/* ══════════════════════════════════════════
   DASHBOARD — QUICK LINKS
══════════════════════════════════════════ */
.quick-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.quick-link-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s;
  cursor: pointer;
}

.quick-link-card:hover { border-color: #93c5fd; }

.quick-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-icon-blue   { background: #dbeafe; color: #2563eb; }
.quick-icon-indigo { background: #e0e7ff; color: #4f46e5; }
.quick-icon-teal   { background: #ccfbf1; color: #0d9488; }
.quick-icon-amber  { background: #fef3c7; color: #d97706; }

.quick-title { font-size: 13px; font-weight: 600; color: #0f172a; margin-bottom: 1px; }
.quick-sub   { font-size: 11px; color: #94a3b8; }

/* ══════════════════════════════════════════
   SPLIT LAYOUT
══════════════════════════════════════════ */
.split-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}

/* ══════════════════════════════════════════
   FORM CARD
══════════════════════════════════════════ */
.form-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
}

.form-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.form-card-wide { max-width: 860px; }

.form-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
  margin: 24px 0 16px;
}

.form-section-title:first-child { margin-top: 0; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #475569;
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Geist Mono', 'Roboto Mono', 'Space Mono', monospace;
  background: #f8fafc;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  appearance: none;
  display: block;
}

.form-group textarea {
  height: auto;
  padding: 10px 14px;
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: #94a3b8; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2563eb;
  flex-shrink: 0;
}

.check-label {
  font-size: 14px !important;
  font-weight: 400 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: #1e293b !important;
  margin-bottom: 0 !important;
}

.error-msg {
  color: #dc2626;
  font-size: 12px;
  margin-top: 5px;
  display: block;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.optional { font-weight: 400; color: #94a3b8; text-transform: none; letter-spacing: 0; font-size: 12px; }
.field-hint { font-size: 12px; color: #94a3b8; margin-top: 4px; }

.student-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.student-form-card {
  max-width: none;
  padding: 28px;
}

.student-form-section + .student-form-section {
  margin-top: 28px;
}

.student-form-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.student-form-section-head h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.student-form-section-head p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.student-form-step {
  min-width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 1px solid #bfdbfe;
  flex-shrink: 0;
}

.student-form-field-full {
  grid-column: 1 / -1;
}

.student-form-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  margin-top: 4px;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.student-form-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #2563eb;
  flex-shrink: 0;
}

.student-form-toggle label {
  display: block;
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.student-form-toggle p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
}

.student-photo-card {
  position: sticky;
  top: 84px;
}

.student-photo-preview {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.student-photo-preview .is-hidden {
  display: none;
}

.student-photo-preview-image,
.student-photo-preview-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 18px;
  border: 1px solid #dbeafe;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.student-photo-preview-image {
  object-fit: cover;
  display: block;
  width: 100%;
  height: 100%;
}

.student-photo-preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  font-weight: 700;
  color: #1d4ed8;
}

.student-photo-upload label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #475569;
}

.student-photo-upload input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px dashed #bfdbfe;
  border-radius: 12px;
  background: #f8fbff;
  font-size: 13px;
  color: #1e293b;
}

.student-photo-upload p {
  margin: 8px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
}

.student-form-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
}

.student-form-actions {
  margin-top: 28px;
}

.student-list-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-list-photo,
.student-list-photo-img,
.student-list-photo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
}

.student-list-photo-img {
  object-fit: cover;
  display: block;
}

.student-list-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #334155;
  font-size: 16px;
  font-weight: 700;
}

.student-profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.student-profile-photo,
.student-profile-photo-img,
.student-profile-photo-placeholder {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  flex-shrink: 0;
}

.student-profile-photo-img {
  object-fit: cover;
  display: block;
  border: 1px solid #dbeafe;
}

.student-profile-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1d4ed8;
  font-size: 28px;
  font-weight: 700;
  border: 1px solid #bfdbfe;
}

/* ══════════════════════════════════════════
   LIST CARDS
══════════════════════════════════════════ */
.list-section { display: flex; flex-direction: column; gap: 10px; }

.list-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: box-shadow 0.15s;
}

.list-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.list-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.list-card-info strong { font-size: 15px; color: #0f172a; }
.sub { font-size: 12px; color: #94a3b8; }

/* ══════════════════════════════════════════
   STUDENT / GENERAL TABLE
══════════════════════════════════════════ */
.table-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

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

thead { 
  background: #0f172a; 

}

thead th {
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  padding: 13px 16px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tbody tr { border-bottom: 1px solid #f1f5f9; transition: background 0.15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody td { padding: 13px 16px; vertical-align: middle; }

.student-link { font-weight: 600; color: #1e293b; }
.student-link:hover { color: #2563eb; text-decoration: underline; }

.empty-td {
  text-align: center;
  color: #94a3b8;
  padding: 40px !important;
  font-size: 14px;
}

/* ══════════════════════════════════════════
   STUDENT DETAIL
══════════════════════════════════════════ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.detail-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 22px 24px;
}

.detail-card h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f8fafc;
  font-size: 14px;
  gap: 12px;
}

.detail-row:last-child { border-bottom: none; }
.detail-row span { color: #64748b; flex-shrink: 0; }
.detail-row strong { color: #0f172a; text-align: right; }

.course-list { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

/* ══════════════════════════════════════════
   DELETE CONFIRM
══════════════════════════════════════════ */
.delete-card {
  background: #fff;
  border: 2px solid #fca5a5;
  border-radius: 12px;
  padding: 48px 40px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.warning-icon { font-size: 44px; margin-bottom: 14px; }

.delete-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

.delete-card p {
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 28px;
  font-size: 15px;
}

.delete-name { font-weight: 700; color: #0f172a; }

.delete-actions { display: flex; gap: 12px; justify-content: center; }

/* ══════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════ */
.empty-state { text-align: center; padding: 48px 0; }
.empty-state p { font-size: 15px; margin-bottom: 16px; color: #64748b; }
.empty-text { color: #94a3b8; font-size: 13px; text-align: center; padding: 20px 0; }

/* ══════════════════════════════════════════
   PROFILE PAGE
══════════════════════════════════════════ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.profile-field { margin-bottom: 16px; }

.profile-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #475569;
  margin-bottom: 7px;
}

.profile-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Geist Mono', 'Roboto Mono', 'Space Mono', monospace;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  display: block;
  appearance: none;
}

.profile-input:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.profile-input::placeholder { color: #94a3b8; }

.profile-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 5px;
  display: block;
}

.library-ops-shell {
  display: grid;
  gap: 18px;
}

.library-ops-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.library-ops-summary-card,
.library-ops-panel {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
}

.library-ops-summary-card {
  padding: 12px 14px;
}

.library-ops-summary-card.is-alert {
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
  border-color: #fed7aa;
}

.library-ops-summary-label,
.library-ops-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  margin-bottom: 6px;
}

.library-ops-summary-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  color: #0f172a;
  margin-bottom: 4px;
}

.library-ops-summary-card p,
.library-field-hint,
.library-selection-summary {
  color: #64748b;
  line-height: 1.6;
}

.library-ops-summary-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.library-ops-grid {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.library-ops-panel {
  padding: 20px;
}

.library-ops-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.library-ops-panel-head {
  margin-bottom: 16px;
}

.library-ops-panel-head h3 {
  font-size: 22px;
  color: #0f172a;
  margin: 0;
}

.library-ops-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.library-issue-form {
  display: grid;
  gap: 2px;
}

.library-issue-form #student-search-input,
.library-issue-form #book-search-input {
  height: 38px;
  padding: 0 12px;
}

.library-list-select {
  min-height: 152px;
  height: auto;
  padding: 6px;
  font-size: 13px;
}

.library-list-select option {
  padding: 6px 8px;
}

.library-selection-summary {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  font-size: 12px;
}

.library-field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}

.library-issue-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.library-issued-by-field {
  grid-column: 1 / -1;
}

.library-issued-by-field .profile-input {
  height: 52px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 600;
}

.library-ops-filter-bar {
  margin-bottom: 16px;
}

.library-register-table {
  border: none;
  padding: 0;
}

/* Library dashboard */

/* ══════════════════════════════════════════
   AUTH — LOGIN PAGE
══════════════════════════════════════════ */
.auth-body {
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
}

.auth-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
}

.auth-top { text-align: center; margin-bottom: 32px; }

.auth-icon {
  width: 56px;
  height: 56px;
  background: #dbeafe;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 26px;
}

.auth-top h1 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.auth-top p { font-size: 14px; color: #64748b; }

.auth-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.auth-alert-success {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.field-wrap { margin-bottom: 18px; }

.field-wrap label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #475569;
  margin-bottom: 7px;
}

.field-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Geist Mono', 'Roboto Mono', 'Space Mono', monospace;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  display: block;
}

.field-wrap input:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.field-wrap input::placeholder { color: #94a3b8; }

.field-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 5px;
  display: block;
}

.auth-btn {
  width: 100%;
  height: 44px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Geist Mono', 'Roboto Mono', 'Space Mono', monospace;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}

.auth-btn:hover { background: #1d4ed8; }
.auth-btn:active { transform: scale(0.99); }

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: #94a3b8;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1200px) {
  .dash-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .sidebar { width: 200px; }
  .main-wrapper { margin-left: 200px; }
  .split-layout { grid-template-columns: 260px 1fr; }
  .student-form-layout { grid-template-columns: 1fr; }
  .student-photo-card { position: static; }
  .student-form-side-card { position: static; }
}

@media (max-width: 900px) {
  .dash-cards { grid-template-columns: repeat(2, 1fr); }
  .quick-links { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .dashboard-mix-grid { grid-template-columns: 1fr; }
  .student-form-section-head { flex-direction: column; }
  .student-profile-head { align-items: flex-start; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-wrapper { margin-left: 0; }
  .split-layout { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .messages-wrap { padding: 10px 16px 0; }
}

@media (max-width: 600px) {
  .dash-cards { grid-template-columns: 1fr 1fr; }
  .quick-links { grid-template-columns: 1fr 1fr; }
  .header-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .dash-cards { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: 1fr; }
}





/* ══════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════ */
.filter-bar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.filter-bar form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fee-history-filter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fee-history-filter-box {
  margin: 0 0 18px;
  padding: 18px 20px;
}

.fee-history-table-box {
  margin-top: 4px;
}

.fee-history-table-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.fee-history-filter-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.fee-history-filter-search {
  flex: 0 1 250px;
  max-width: 250px;
}

.fee-history-filter-select {
  min-width: 170px;
}

.fee-history-filter-row-secondary {
  justify-content: flex-start;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding-top: 12px;
}

.fee-history-date-group {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fee-history-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: 0;
}

.fee-history-date-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.filter-row-secondary {
  padding-top: 2px;
}

.filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 0 12px;
  flex: 1;
  min-width: 180px;
}

.student-list-search {
  flex: 0 1 250px;
  max-width: 250px;
}

.filter-search svg {
  color: #94a3b8;
  flex-shrink: 0;
}

.filter-search-input {
  border: none;
  background: transparent;
  height: 36px;
  font-size: 14px;
  font-family: 'Geist Mono', 'Roboto Mono', 'Space Mono', monospace;
  color: #1e293b;
  outline: none;
  width: 100%;
}

.filter-search-input::placeholder { color: #94a3b8; }

.filter-select {
  height: 36px;
  padding: 0 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Geist Mono', 'Roboto Mono', 'Space Mono', monospace;
  background: #f8fafc;
  color: #1e293b;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  min-width: 140px;
}

.filter-select:focus { border-color: #2563eb; background: #fff; }

.filter-date-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter-date-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.filter-date-input {
  min-width: 155px;
}

/* Remove native Apple/Safari date UI chrome so only custom picker appears */
input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
  font-variant-numeric: tabular-nums;
  color-scheme: light;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  pointer-events: none;
  width: 0;
  margin: 0;
  padding: 0;
}

input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

input[type="date"]::-webkit-date-and-time-value {
  min-height: 1.2em;
  text-align: left;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button {
  display: none;
}

@media (max-width: 960px) {
  .fee-history-filter-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .student-list-search {
    max-width: none;
  }

  .fee-history-filter-search {
    max-width: none;
  }

  .fee-history-filter-box {
    margin-bottom: 16px;
    padding: 14px 16px;
  }

  .fee-history-table-header {
    padding: 14px 16px;
  }

  .fee-history-filter-search,
  .fee-history-filter-select,
  .fee-history-date-group,
  .fee-history-date-field,
  .fee-history-filter-actions {
    width: 100%;
  }

  .fee-history-date-field {
    justify-content: space-between;
  }

  .filter-date-input {
    min-width: 0;
    flex: 1 1 auto;
  }

  .fee-history-filter-actions .btn {
    flex: 1 1 140px;
    justify-content: center;
  }
}

/* ══════════════════════════════════════════
   BULK ACTION BAR
══════════════════════════════════════════ */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #1d4ed8;
  flex-wrap: wrap;
}

.bulk-bar svg { flex-shrink: 0; }

/* Selected row highlight */
tr.row-selected td { background: #eff6ff !important; }

thead input[type="checkbox"],
tbody input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #2563eb;
}

/* ══════════════════════════════════════════
   COLUMN CHECKBOX IN TABLE HEADER
══════════════════════════════════════════ */
.th-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.col-cb {
  width: 13px;
  height: 13px;
  cursor: pointer;
  accent-color: #60a5fa;
  flex-shrink: 0;
}

.th-row-cb {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #60a5fa;
}

/* dim column cells when header checkbox unchecked */
td.col-dim {
  opacity: 0.25;
}

/* selected row */
tr.row-selected td { background: #eff6ff !important; }

/* hint text above table */
.col-hint {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.col-hint svg { color: #2563eb; flex-shrink: 0; }

/* Excel button */
.btn-excel {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.btn-excel:hover {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}


/* ══════════════════════════════════════════
   MARKS ENTRY ENHANCED STYLES
══════════════════════════════════════════ */
.marks-table-wrap {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.marks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1200px;
}

.marks-table thead tr:first-child th {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  padding: 20px 24px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.2);
}

.marks-table thead tr:first-child th:first-child {
  text-align: left;
}

.marks-table thead tr:last-child th {
  background: #f8fafc;
  color: #374151;
  padding: 16px 20px;
  font-size: 14px;
  text-align: center;
  font-weight: 700;
  border-right: 2px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.marks-table tbody tr {
  border-bottom: 2px solid #f3f4f6;
  transition: all 0.3s ease;
}

.marks-table tbody tr.even-row {
  background: linear-gradient(90deg, #fafbfc 0%, #f8fafc 100%);
}

.marks-table tbody tr:not(.even-row) {
  background: white;
}

.marks-table tbody tr:hover {
  background: linear-gradient(90deg, #f0f9ff 0%, #e0f2fe 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.marks-table tbody td {
  padding: 20px 20px;
  vertical-align: middle;
  border-right: 2px solid #e5e7eb;
  transition: all 0.2s ease;
}

.subject-header {
  font-size: 11px !important;
  text-align: center !important;
}

.subject-code {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 9px;
  margin-left: 4px;
}

.marks-sub-header {
  font-size: 13px !important;
  padding: 12px 16px !important;
}

.marks-cell {
  text-align: center;
  width: 120px;
  padding: 16px 12px;
  background: linear-gradient(135deg, #fefefe 0%, #fafafa 100%);
}

.absent-cell {
  text-align: center;
  width: 100px;
  padding: 16px 12px;
  background: linear-gradient(135deg, #fefefe 0%, #fafafa 100%);
}

.marks-input {
  width: 80px;
  height: 48px;
  text-align: center;
  border: 3px solid #d1d5db;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Geist Mono', 'Roboto Mono', 'Space Mono', monospace;
  background: white;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  color: #1f2937;
  padding: 12px 16px;
}

.marks-input:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  transform: scale(1.05);
}

.marks-input:disabled {
  background: #f9fafb;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.6;
  border-color: #e5e7eb;
}

.absent-cb {
  width: 24px;
  height: 24px;
  cursor: pointer;
  accent-color: #ef4444;
  border-radius: 4px;
}

/* Enhanced responsive design */
@media (max-width: 1200px) {
  .marks-table {
    min-width: 1000px;
  }

  .marks-input {
    width: 70px;
    height: 44px;
    font-size: 14px;
  }
}

@media (max-width: 900px) {
  .marks-table {
    min-width: 800px;
  }

  .marks-input {
    width: 60px;
    height: 40px;
    font-size: 13px;
  }

  .marks-table tbody td {
    padding: 16px 12px;
  }
}

/* ══════════════════════════════════════════
   RESULTS STATS CARDS
══════════════════════════════════════════ */
.results-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.result-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.result-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-stat-icon svg { display: block; }

.icon-total    { background: #dbeafe; color: #2563eb; }
.icon-pass     { background: #dcfce7; color: #15803d; }
.icon-fail     { background: #fee2e2; color: #b91c1c; }
.icon-subjects { background: #fef3c7; color: #d97706; }

.result-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #64748b;
  margin-bottom: 3px;
}

.result-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

/* ══════════════════════════════════════════
   RESULTS TABLE
══════════════════════════════════════════ */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 800px;
}

.results-table thead th {
  background: #0f172a;
  color: #e2e8f0;
  padding: 11px 12px;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  border-right: 1px solid #1e293b;
}

.results-table thead th:last-child { border-right: none; }

.subject-col-header {
  text-align: center !important;
  min-width: 80px;
  font-size: 11px !important;
}

.subj-code-small {
  display: block;
  font-size: 9px;
  opacity: .7;
  margin-top: 2px;
}

.subj-marks-hint {
  font-size: 9px;
  font-weight: 400;
  color: #94a3b8;
  margin-top: 3px;
  white-space: nowrap;
}

.results-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
}

.results-table tbody tr:last-child { border-bottom: none; }
.results-table tbody td {
  padding: 11px 12px;
  vertical-align: middle;
  border-right: 1px solid #f1f5f9;
}

.results-table tbody td:last-child { border-right: none; }

/* Pass/fail row tint */
.result-row-pass:hover td { background: #f0fdf4 !important; }
.result-row-fail:hover td { background: #fff7f7 !important; }

/* Student cell */
.res-student-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 13px;
}

.res-student-roll {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Marks cells */
.res-marks-pass {
  font-weight: 700;
  font-size: 14px;
  color: #15803d;
}

.res-marks-fail {
  font-weight: 700;
  font-size: 14px;
  color: #b91c1c;
}

.res-ab-tag {
  display: inline-block;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.res-empty { color: #cbd5e1; font-size: 13px; }

/* Total */
.res-total {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
}

.res-total-full {
  font-size: 11px;
  color: #94a3b8;
  margin-left: 2px;
}

/* Percentage */
.res-pct {
  font-weight: 600;
  font-size: 13px;
  color: #0f172a;
}

/* Result badge */
.res-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.res-badge-pass { background: #dcfce7; color: #15803d; }
.res-badge-fail { background: #fee2e2; color: #b91c1c; }

/* Responsive */
@media (max-width: 900px) {
  .results-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .results-stats { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   NEW RESULTS STATS CARDS
══════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card.total-students .stat-icon { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #1d4ed8; }
.stat-card.passed .stat-icon { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); color: #15803d; }
.stat-card.failed .stat-icon { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); color: #dc2626; }
.stat-card.subjects .stat-icon { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #d97706; }

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

/* ══════════════════════════════════════════
   NEW RESULTS TABLE
══════════════════════════════════════════ */
.results-container {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

.table-actions {
  display: flex;
  gap: 8px;
}

.table-wrapper {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.results-table thead th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.results-table thead th .subject-marks {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  white-space: normal;
}

.results-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.results-table tbody tr:hover {
  background: #f8fafc;
}

.result-row.pass {
  background: #f0fdf4;
}

.result-row.fail {
  background: #fef2f2;
}

.col-serial {
  width: 40px;
  text-align: center;
  color: #6b7280;
  font-weight: 500;
}

.col-select {
  width: 52px;
  text-align: center;
}

.col-select input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  cursor: pointer;
}

.col-student {
  min-width: 180px;
}

.student-info .student-name {
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}

.student-info .student-roll {
  font-size: 12px;
  color: #6b7280;
}

.col-subject {
  min-width: 100px;
  text-align: center;
}

.subject-header .subject-name {
  font-weight: 600;
  color: #374151;
  margin-bottom: 2px;
}

.subject-header .subject-code {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 2px;
}

.subject-header .subject-marks {
  font-size: 10px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.col-marks {
  text-align: center;
}

.mark {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
}

.mark.pass {
  background: #dcfce7;
  color: #166534;
}

.mark.fail {
  background: #fee2e2;
  color: #dc2626;
}

.mark-absent {
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
}

.mark-empty {
  color: #d1d5db;
  font-size: 13px;
}

.col-total .total-score {
  font-weight: 700;
  color: #111827;
  font-size: 15px;
}

.col-total .total-max {
  font-size: 12px;
  color: #6b7280;
  margin-left: 2px;
}

.col-percentage .percentage {
  font-weight: 600;
  color: #111827;
  font-size: 14px;
}

.col-result .result-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-badge.pass {
  background: #dcfce7;
  color: #166534;
}

.result-badge.fail {
  background: #fee2e2;
  color: #dc2626;
}

.col-theory {
  min-width: 100px;
  text-align: center;
}

.col-practical {
  min-width: 100px;
  text-align: center;
}

.col-total {
  min-width: 100px;
  text-align: center;
}

.col-percentage {
  min-width: 80px;
  text-align: center;
}

.col-result {
  min-width: 80px;
  text-align: center;
}

.col-actions {
  min-width: 100px;
  text-align: center;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.score {
  font-weight: 600;
  font-size: 15px;
  color: #111827;
}

.score-max {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
}

.score-pass {
  font-size: 10px;
  color: #d97706;
  font-weight: 600;
  display: block;
  margin-top: 2px;
}

.score-empty {
  color: #d1d5db;
  font-size: 14px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #6b7280;
  text-decoration: none;
  transition: all 0.2s ease;
  margin: 0 2px;
}

.btn-icon:hover {
  border-color: #9ca3af;
  background: #f9fafb;
  color: #374151;
}

.btn-icon.btn-primary {
  border-color: #3b82f6;
  background: #3b82f6;
  color: #fff;
}

.btn-icon.btn-primary:hover {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.marksheet-action {
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.18);
}

.empty-row .empty-message {
  padding: 60px 20px;
  text-align: center;
}

.empty-content svg {
  color: #d1d5db;
  margin-bottom: 16px;
}

.empty-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.empty-content p {
  color: #6b7280;
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px;
    gap: 12px;
  }
  
  .stat-number {
    font-size: 24px;
  }
  
  .table-header {
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .results-table thead th,
  .results-table tbody td {
    padding: 8px 12px;
  }
  
  .col-student {
    min-width: 140px;
  }
}

@media (max-width: 500px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .results-table {
    min-width: 600px;
  }
}

/* Settings page grid */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   PUBLISH TOGGLE SWITCH
══════════════════════════════════════════ */
.publish-toggle-wrap { margin-top: 4px; }

.publish-toggle-card {
  display: block;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #f8fafc;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.publish-toggle-card:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.publish-toggle-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

.publish-toggle-card.is-on {
  border-color: #86efac;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.08);
}

.publish-toggle-card.is-off {
  border-color: #fbcfe8;
  background: linear-gradient(135deg, #fff7ed, #fff1f2);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.05);
}

.publish-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  user-select: none;
}

.publish-toggle-card input[type="checkbox"],
.toggle-input-hidden {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  pointer-events: none;
}

.toggle-track {
  width: 48px;
  height: 28px;
  background: #fda4af;
  border-radius: 99px;
  position: relative;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}

.publish-toggle-card input:checked + .publish-toggle .toggle-track {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.publish-toggle-card input:checked + .publish-toggle .toggle-thumb {
  transform: translateX(20px);
}

.toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.toggle-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.publish-toggle-card.is-on .toggle-badge {
  background: #dcfce7;
  color: #166534;
}

.publish-toggle-card.is-off .toggle-badge {
  background: #ffe4e6;
  color: #be123c;
}

.toggle-label {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.toggle-subtext {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

/* ══════════════════════════════════════════
   EXAM INFO BOX
══════════════════════════════════════════ */
.exam-info-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #1d4ed8;
  margin-bottom: 8px;
}

.exam-info-box svg { flex-shrink: 0; }


/* ══════════════════════════════════════════
   EXAM SUBJECTS PAGE
══════════════════════════════════════════ */

/* Status strip */
.exam-status-strip {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}

.status-item svg { color: #2563eb; flex-shrink: 0; }

/* Theory / Practical section label */
.subject-marks-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.subject-marks-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.subject-marks-label .optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* Marks badges in table */
.subj-marks-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
}

.marks-full { background: #dbeafe; color: #1d4ed8; }
.marks-pass { background: #dcfce7; color: #15803d; }

/* Summary bar above table */
.subjects-summary {
  display: flex;
  gap: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}

.subj-sum-item {
  flex: 1;
  padding: 10px 16px;
  border-right: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.subj-sum-item:last-child { border-right: none; }
.subj-sum-label { color: #64748b; }
.subj-sum-value { font-weight: 700; color: #0f172a; }

/* When summary is above table-card */
.subjects-summary + .table-card {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Next step hint */
.next-step-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #1d4ed8;
  margin-top: 12px;
}

.next-step-hint svg { flex-shrink: 0; }
.next-step-hint a { font-weight: 600; color: #1d4ed8; text-decoration: underline; }


/* ══════════════════════════════════════════
   FEE MANAGEMENT
══════════════════════════════════════════ */
.fee-amount-badge {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 13px;
  display: inline-block;
}

.fee-due-amount {
  color: #b91c1c;
  font-weight: 700;
  font-size: 13px;
}

.fee-due-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
}

.pending-fee-totals {
  flex-wrap: wrap;
}

.pending-fee-total-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
}

/* Collect page */
.collect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}

.fee-struct-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.fee-struct-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s;
}

.fee-struct-item:hover { border-color: #93c5fd; }

.fee-struct-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #2563eb;
  flex-shrink: 0;
}

.fee-struct-info { flex: 1; }
.fee-struct-info strong { font-size: 14px; color: #0f172a; display: block; }

.fee-struct-amount {
  font-weight: 700;
  color: #2563eb;
  font-size: 13px;
  white-space: nowrap;
}

/* Student select list */
.student-select-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 400px;
  overflow-y: auto;
}

.student-select-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s;
}

.student-select-item:hover { border-color: #93c5fd; }

.student-select-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #2563eb;
  flex-shrink: 0;
}

.student-select-info { flex: 1; }
.student-select-info strong { font-size: 13px; color: #0f172a; display: block; }

/* Collect action bar */
.collect-action-bar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.collect-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
  flex: 1;
}

.collect-summary svg { color: #2563eb; flex-shrink: 0; }

/* Pay fee page */
.collect-payment-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
  align-items: start;
}

/* Fee structure page */
.fee-structure-layout {
  grid-template-columns: 270px minmax(0, 1fr);
}

.fee-structure-form-card {
  padding: 22px 20px;
}

.fee-structure-form-actions {
  flex-direction: column;
  align-items: stretch;
}

.fee-structure-form-actions .btn {
  justify-content: center;
}

.fee-structure-amount-field .profile-input {
  height: 48px;
  font-size: 15px;
}

.fee-structure-table-card {
  overflow-x: auto;
  overflow-y: hidden;
}

.fee-structure-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.fee-structure-table thead th,
.fee-structure-table tbody td {
  white-space: nowrap;
}

/* Confirm delete */
.confirm-delete-card {
  background: #fff;
  border: 2px solid #fca5a5;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .collect-grid          { grid-template-columns: 1fr; }
  .collect-payment-grid  { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .fee-structure-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .fee-structure-layout {
    grid-template-columns: 1fr;
  }
}

/* Glass Theme Overrides
   Keeps printable/student receipt templates untouched because they use standalone styles. */
:root {
  --glass-panel: rgba(255, 255, 255, 0.56);
  --glass-panel-strong: rgba(255, 255, 255, 0.72);
  --glass-panel-soft: rgba(255, 255, 255, 0.34);
  --glass-border: rgba(255, 255, 255, 0.46);
  --glass-border-soft: rgba(148, 163, 184, 0.24);
  --glass-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  --glass-shadow-strong: 0 26px 52px rgba(15, 23, 42, 0.14);
  --glass-glow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

body {
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.22), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(59, 130, 246, 0.16), transparent 18%),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.14), transparent 24%),
    linear-gradient(180deg, #eef6ff 0%, #e8f1fb 46%, #edf7f2 100%);
  background-attachment: fixed;
}

.layout {
  position: relative;
  z-index: 1;
}

.topbar,
.main-footer,
.dash-card,
.section-card,
.dashboard-mix-panel,
.quick-link-card,
.form-card,
.table-card,
.detail-card,
.filter-bar,
.collect-action-bar,
.results-container,
.stat-card,
.subjects-summary,
.exam-status-strip,
.subject-marks-section,
.publish-toggle-card,
.list-card,
.student-form-toggle,
.confirm-delete-card {
  background: linear-gradient(180deg, var(--glass-panel-strong), var(--glass-panel));
  border: 1px solid var(--glass-border-soft);
  box-shadow: var(--glass-glow), var(--glass-shadow);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.topbar,
.main-footer {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.28));
  border-color: rgba(255, 255, 255, 0.42);
}

.current-banner,
.bulk-bar,
.next-step-hint,
.exam-info-box,
.fee-due-badge {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.46), rgba(255, 255, 255, 0.34));
  border: 1px solid rgba(191, 219, 254, 0.46);
  box-shadow: var(--glass-glow), var(--glass-shadow);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.delete-card {
  background: linear-gradient(180deg, rgba(255, 245, 245, 0.78), rgba(255, 255, 255, 0.58));
  border-color: rgba(248, 113, 113, 0.34);
  box-shadow: var(--glass-glow), var(--glass-shadow-strong);
  backdrop-filter: blur(20px) saturate(155%);
  -webkit-backdrop-filter: blur(20px) saturate(155%);
}

.page-header,
.section-title,
.section-title-row,
.form-card h3,
.detail-card h3,
.form-section-title,
.form-actions,
.main-footer {
  border-color: rgba(148, 163, 184, 0.24);
}

.dash-card,
.quick-link-card,
.list-card,
.stat-card,
.publish-toggle-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.dash-card:hover,
.quick-link-card:hover,
.list-card:hover,
.stat-card:hover,
.publish-toggle-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--glass-glow), var(--glass-shadow-strong);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea,
.profile-input,
.filter-search,
.filter-select,
.student-photo-upload input[type="file"],
.field-wrap input {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.profile-input:focus,
.filter-select:focus,
.field-wrap input:focus,
.filter-search:focus-within {
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 0 0 3px rgba(59, 130, 246, 0.12);
}

.btn {
  border: 1px solid transparent;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
  margin-bottom: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(29, 78, 216, 0.86));
  border-color: rgba(147, 197, 253, 0.28);
}

.btn-success {
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.82), rgba(187, 247, 208, 0.72));
  border-color: rgba(134, 239, 172, 0.34);
}

.btn-warning {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.84), rgba(253, 230, 138, 0.72));
  border-color: rgba(252, 211, 77, 0.34);
}

.btn-danger {
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.84), rgba(252, 165, 165, 0.58));
  border-color: rgba(248, 113, 113, 0.3);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.34);
  color: #475569;
  border-color: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.52);
}

thead {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.84), rgba(30, 41, 59, 0.72));
}

.dash-table thead th,
.results-table thead th {
  background: rgba(255, 255, 255, 0.24);
  border-bottom-color: rgba(148, 163, 184, 0.22);
}

tbody tr,
.dash-table tbody tr,
.results-table tbody tr {
  border-bottom-color: rgba(148, 163, 184, 0.14);
}

tbody tr:hover,
.dash-table tbody tr:hover,
.results-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.3);
}

tr.row-selected td {
  background: rgba(191, 219, 254, 0.34) !important;
}

/* Keep dashboard year/course panels readable. */
.dashboard-mix-panel .section-title {
  color: #0f172a;
}

.dashboard-mix-panel .section-link {
  color: #1d4ed8;
}

.dashboard-mix-panel .dash-table thead th {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-mix-panel .dash-table tbody td,
.dashboard-mix-panel .dash-table tfoot td,
.dashboard-mix-panel .bar-pct,
.dashboard-mix-panel .bar-empty {
  color: #334155;
}

.dash-card-icon,
.quick-icon,
.user-avatar,
.user-avatar-sm {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 10px 22px rgba(15, 23, 42, 0.12);
}

/* Remove glass styling from the main content area and keep it only in the sidebar. */
body {
  background: #f1f5f9;
  background-attachment: scroll;
}

.topbar,
.main-footer,
.dash-card,
.section-card,
.quick-link-card,
.form-card,
.table-card,
.detail-card,
.filter-bar,
.collect-action-bar,
.results-container,
.subjects-summary,
.exam-status-strip,
.list-card,
.confirm-delete-card {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dashboard-mix-panel,
.subject-marks-section,
.publish-toggle-card,
.student-form-toggle {
  border-color: #e2e8f0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.dashboard-mix-panel,
.subject-marks-section,
.publish-toggle-card {
  background: #f8fafc;
}

.student-form-toggle {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.current-banner,
.bulk-bar,
.next-step-hint,
.exam-info-box {
  background: #eff6ff;
  border-color: #bfdbfe;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.fee-due-badge {
  background: #fee2e2;
  border-color: #fca5a5;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.delete-card {
  background: #fff;
  border-color: #fca5a5;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.page-header {
  border-color: #e2e8f0;
}

.section-title,
.section-title-row,
.form-card h3,
.detail-card h3,
.form-section-title,
.form-actions,
.main-footer {
  border-color: #f1f5f9;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea,
.profile-input,
.filter-search,
.filter-select,
.student-photo-upload input[type="file"],
.field-wrap input {
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.profile-input:focus,
.filter-select:focus,
.field-wrap input:focus,
.filter-search:focus-within {
  background: #fff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-ghost {
  background: transparent;
  color: #64748b;
  border-color: #e2e8f0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.btn-ghost:hover {
  background: #f1f5f9;
  color: #1e293b;
}

thead {
  background: #0f172a;
}

.dash-table thead th,
.results-table thead th {
  background: #f8fafc;
  color: #475569;
  border-bottom-color: #e2e8f0;
}

tbody tr,
.dash-table tbody tr,
.results-table tbody tr {
  border-bottom-color: #f1f5f9;
}

tbody tr:hover,
.dash-table tbody tr:hover,
.results-table tbody tr:hover {
  background: #f8fafc;
}

tr.row-selected td {
  background: #eff6ff !important;
}

/* Library dashboard layout refresh */
.library-dashboard-shell {
  --library-ink: #0f172a;
  --library-text: #334155;
  --library-muted: #64748b;
  --library-border: #dbe3ee;
  --library-panel: rgba(255, 255, 255, 0.88);
  --library-panel-strong: rgba(255, 255, 255, 0.96);
  --library-soft: #f7fafc;
  --library-cobalt: #2563eb;
  --library-cobalt-soft: #dbeafe;
  --library-teal: #0f766e;
  --library-teal-soft: #ccfbf1;
  --library-amber: #d97706;
  --library-amber-soft: #fef3c7;
  --library-rose: #dc2626;
  --library-rose-soft: #fee2e2;
  position: relative;
}

.library-stage {
  position: relative;
  overflow: hidden;
  padding: 12px 24px 20px;
  margin-bottom: 18px;
  border: 1px solid rgba(191, 219, 254, 0.7);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(191, 219, 254, 0.7), transparent 24%),
    radial-gradient(circle at left bottom, rgba(204, 251, 241, 0.8), transparent 28%),
    linear-gradient(135deg, #f8fbff 0%, #ffffff 48%, #f7fbf9 100%);
}

.library-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.library-stage-copy {
  position: relative;
  z-index: 1;
}

.library-stage-kicker,
.library-metric-label,
.library-panel-kicker,
.library-priority-top span,
.library-priority-stats span,
.library-note-label,
.library-health-head span {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.library-stage-kicker {
  color: var(--library-teal);
  margin-bottom: 8px;
}

.library-stage-copy h1 {
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.02;
  color: var(--library-ink);
  margin-bottom: 8px;
  max-width: 10ch;
}

.library-stage-copy p {
  max-width: 56ch;
  font-size: 15px;
  line-height: 1.7;
  color: var(--library-text);
}

.library-stage-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.library-priority-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--library-border);
  background: linear-gradient(180deg, var(--library-panel-strong), var(--library-panel));
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.library-priority-card.is-alert {
  border-color: rgba(248, 113, 113, 0.34);
  background: linear-gradient(180deg, #fff7f7 0%, #ffffff 100%);
}

.library-priority-card.is-calm {
  border-color: rgba(45, 212, 191, 0.32);
}

.library-priority-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.library-priority-top span {
  color: var(--library-muted);
}

.library-priority-top strong {
  font-size: 15px;
  color: var(--library-ink);
}

.library-priority-label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--library-muted);
}

.library-priority-body h2 {
  font-size: 56px;
  line-height: 0.95;
  color: var(--library-ink);
  margin: 0 0 10px;
}

.library-priority-text {
  margin: 0;
  color: var(--library-text);
  line-height: 1.6;
}

.library-priority-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.library-priority-stats article {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(219, 227, 238, 0.9);
  background: rgba(255, 255, 255, 0.78);
}

.library-priority-stats span {
  color: var(--library-muted);
  margin-bottom: 8px;
}

.library-priority-stats strong {
  display: block;
  font-size: 26px;
  line-height: 1;
  color: var(--library-ink);
}

.library-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.library-metric-card,
.library-panel {
  border: 1px solid var(--library-border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.05);
}

.library-metric-card {
  padding: 18px;
}

.library-metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.library-metric-label {
  color: var(--library-muted);
}

.library-metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--library-cobalt);
  background: linear-gradient(135deg, var(--library-cobalt-soft), #f8fbff);
}

.library-metric-card.is-urgent .library-metric-icon {
  color: var(--library-rose);
  background: linear-gradient(135deg, var(--library-rose-soft), #fff7f7);
}

.library-metric-card strong {
  display: block;
  font-size: 36px;
  line-height: 1;
  color: var(--library-ink);
  margin-bottom: 10px;
}

.library-metric-card p,
.library-issue-card p,
.library-health-card p,
.library-guidance-panel p {
  margin: 0;
  color: var(--library-muted);
  line-height: 1.6;
}

.library-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.95fr);
  gap: 18px;
}

.library-main-column,
.library-side-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.library-panel {
  padding: 20px;
}

.library-panel-feature {
  background:
    linear-gradient(180deg, rgba(255, 247, 237, 0.9), rgba(255, 255, 255, 0.96)),
    #ffffff;
}

.library-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.library-panel-kicker {
  color: var(--library-cobalt);
  margin-bottom: 6px;
}

.library-panel-head h3,
.library-guidance-panel h3 {
  margin: 0;
  font-size: 22px;
  color: var(--library-ink);
}

.library-issue-stack,
.library-health-stack {
  display: grid;
  gap: 12px;
}

.library-issue-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(219, 227, 238, 0.9);
  background: rgba(255, 255, 255, 0.92);
}

.library-issue-card.is-overdue {
  border-color: rgba(251, 146, 60, 0.34);
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
}

.library-issue-main {
  min-width: 0;
}

.library-issue-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.library-issue-heading strong {
  font-size: 16px;
  color: var(--library-ink);
}

.library-issue-main p {
  color: var(--library-text);
}

.library-issue-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 260px;
}

.library-issue-meta span {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(219, 227, 238, 0.92);
  background: rgba(248, 250, 252, 0.88);
  color: var(--library-text);
  font-size: 12px;
}

.library-health-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(219, 227, 238, 0.9);
  background: #f8fbff;
}

.library-health-card.is-warm {
  background: #fffaf2;
}

.library-health-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.library-health-head span {
  color: var(--library-text);
}

.library-health-head strong {
  font-size: 22px;
  color: var(--library-ink);
}

.library-health-progress {
  width: 100%;
  height: 10px;
  display: block;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: #dbeafe;
  margin-bottom: 10px;
}

.library-health-progress::-webkit-progress-bar {
  background: #dbeafe;
  border-radius: 999px;
}

.library-health-progress::-webkit-progress-value {
  background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
  border-radius: 999px;
}

.library-health-progress::-moz-progress-bar {
  background: linear-gradient(90deg, #2563eb 0%, #0ea5e9 100%);
  border-radius: 999px;
}

.library-health-progress.is-warm {
  background: #fde68a;
}

.library-health-progress.is-warm::-webkit-progress-bar {
  background: #fde68a;
}

.library-health-progress.is-warm::-webkit-progress-value {
  background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%);
  border-radius: 999px;
}

.library-health-progress.is-warm::-moz-progress-bar {
  background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%);
  border-radius: 999px;
}

.library-guidance-panel {
  background:
    radial-gradient(circle at top right, rgba(191, 219, 254, 0.34), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
}

.library-note-label {
  color: var(--library-teal);
  margin-bottom: 10px;
}

.library-guidance-panel p {
  margin-top: 10px;
}

.library-guidance-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.library-inline-link {
  color: var(--library-cobalt);
  font-weight: 600;
}

.library-empty-state {
  padding: 30px 0 8px;
}

@media (max-width: 1250px) {
  .library-stage-grid,
  .library-workspace {
    grid-template-columns: 1fr;
  }

  .library-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-ops-summary-grid,
  .library-issue-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-ops-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .library-stage {
    padding: 22px;
  }

  .library-stage-copy h1 {
    max-width: none;
  }

  .library-priority-stats {
    grid-template-columns: 1fr;
  }

  .library-issue-card,
  .library-panel-head {
    flex-direction: column;
  }

  .library-issue-meta {
    justify-content: flex-start;
    max-width: none;
  }

  .library-ops-panel {
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .library-stage,
  .library-panel,
  .library-metric-card {
    padding: 18px;
  }

  .library-metric-grid {
    grid-template-columns: 1fr;
  }

  .library-stage-actions,
  .library-guidance-links {
    gap: 10px;
  }

  .library-ops-summary-grid,
  .library-issue-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Scroll date picker */
:root {
  --wheel-date-surface: #ffffff;
  --wheel-date-border: rgba(0, 0, 0, 0.08);
  --wheel-date-text: #1f2937;
  --wheel-date-text-muted: #5f6b7b;
  --wheel-date-text-dim: #a3afbf;
  --wheel-date-disabled: #c6d0db;
  --wheel-date-accent: #1a3c5e;
  --wheel-date-accent-soft: rgba(26, 60, 94, 0.08);
  --wheel-date-accent-ring: rgba(26, 60, 94, 0.16);
  --wheel-date-accent-text: #ffffff;
  --wheel-date-hover: rgba(15, 23, 42, 0.05);
}

.wheel-date-field {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.wheel-date-field.profile-input,
.wheel-date-field.filter-select,
.wheel-date-field.filter-date-input {
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.wheel-date-field.filter-select,
.wheel-date-field.filter-date-input {
  width: auto;
}

.wheel-date-native {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.wheel-date-trigger,
.wheel-date-card,
.wheel-date-day,
.wheel-date-nav,
.wheel-date-clear,
.wheel-date-apply {
  font-family: 'DM Sans', 'Inter', 'Segoe UI', sans-serif;
}

.wheel-date-trigger {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 0 11px;
  border: 0.5px solid var(--wheel-date-border);
  border-radius: 6px;
  background: var(--wheel-date-surface);
  color: var(--wheel-date-text);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.wheel-date-trigger.filter-select,
.wheel-date-trigger.filter-date-input {
  min-height: 36px;
  height: 36px;
  padding: 0 11px;
}

.wheel-date-trigger:hover,
.wheel-date-trigger.is-open {
  border-color: rgba(0, 0, 0, 0.14);
  background: var(--wheel-date-surface);
}

.wheel-date-trigger:focus-visible {
  outline: none;
  border-color: var(--wheel-date-accent);
  box-shadow: 0 0 0 3px var(--wheel-date-accent-ring);
}

.wheel-date-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.wheel-date-trigger-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 100%;
}

/* Compatibility: hide legacy second-line trigger text from older picker markup */
.wheel-date-trigger-meta {
  display: none !important;
}

.wheel-date-trigger-value {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wheel-date-trigger.is-empty .wheel-date-trigger-value {
  font-weight: 400;
  color: var(--wheel-date-text-dim);
}

.wheel-date-trigger:not(.is-empty) .wheel-date-trigger-indicator {
  color: var(--wheel-date-accent);
}

.wheel-date-trigger-indicator {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0.5px solid var(--wheel-date-border);
  border-radius: 6px;
  background: transparent;
  color: var(--wheel-date-text-muted);
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.wheel-date-trigger:hover .wheel-date-trigger-indicator,
.wheel-date-trigger:focus-visible .wheel-date-trigger-indicator,
.wheel-date-trigger.is-open .wheel-date-trigger-indicator,
.wheel-date-trigger:not(.is-empty) .wheel-date-trigger-indicator {
  border-color: rgba(0, 0, 0, 0.16);
  background: var(--wheel-date-hover);
  color: var(--wheel-date-accent);
}

.wheel-date-layer {
  position: fixed;
  inset: 0;
  z-index: 320;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease;
  background: rgba(15, 23, 42, 0.08);
}

.wheel-date-layer.is-open {
  pointer-events: auto;
  opacity: 1;
}

.wheel-date-card {
  position: fixed;
  width: min(320px, calc(100vw - 24px));
  padding: 0;
  border: 0.5px solid var(--wheel-date-border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--wheel-date-text);
  box-shadow: none;
  overflow: hidden;
  opacity: 0;
  transform: none;
  transition: opacity 0.16s ease;
}

.wheel-date-layer.is-open .wheel-date-card {
  opacity: 1;
  transform: none;
}

.wheel-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 10px;
  border-bottom: 0.5px solid var(--wheel-date-border);
}

.wheel-date-navs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wheel-date-nav {
  width: 26px;
  height: 26px;
  border: 0.5px solid var(--wheel-date-border);
  border-radius: 6px;
  background: transparent;
  color: var(--wheel-date-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.wheel-date-nav:hover:not(:disabled),
.wheel-date-nav:focus-visible {
  outline: none;
  border-color: rgba(0, 0, 0, 0.16);
  background: #f3f4f6;
  color: #4b5563;
}

.wheel-date-nav:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.wheel-date-month-year {
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--wheel-date-text);
}

.wheel-date-weekdays,
.wheel-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.wheel-date-weekdays {
  padding: 10px 12px 4px;
  gap: 2px;
}

.wheel-date-weekday {
  width: 100%;
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--wheel-date-text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wheel-date-grid {
  padding: 4px 12px 12px;
  gap: 2px;
  grid-auto-rows: 30px;
}

.wheel-date-day {
  width: 100%;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--wheel-date-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

.wheel-date-day:hover:not(:disabled),
.wheel-date-day:focus-visible {
  outline: none;
  background: #f3f4f6;
}

.wheel-date-day.is-selected {
  background: var(--wheel-date-accent);
  color: var(--wheel-date-accent-text);
  font-weight: 500;
}

.wheel-date-day.is-today:not(.is-selected) {
  color: var(--wheel-date-accent);
  font-weight: 500;
}

.wheel-date-day.is-in-range:not(.is-selected) {
  background: var(--wheel-date-accent-soft);
  color: var(--wheel-date-accent);
}

.wheel-date-day.is-overflow {
  color: var(--wheel-date-text-dim);
  opacity: 0.95;
}

.wheel-date-day.is-disabled {
  color: var(--wheel-date-disabled);
  cursor: not-allowed;
  opacity: 0.7;
}

.wheel-date-day.is-disabled:hover,
.wheel-date-day.is-disabled:focus-visible {
  background: transparent;
}

.wheel-date-footer {
  padding: 10px 12px;
  border-top: 0.5px solid var(--wheel-date-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.wheel-date-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wheel-date-clear,
.wheel-date-apply {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    opacity 0.16s ease;
}

.wheel-date-clear {
  border: 0.5px solid var(--wheel-date-border);
  background: transparent;
  color: var(--wheel-date-text-muted);
}

.wheel-date-apply {
  border: 0;
  background: var(--wheel-date-accent);
  color: #ffffff;
}

.wheel-date-clear:hover,
.wheel-date-clear:focus-visible {
  outline: none;
  border-color: rgba(0, 0, 0, 0.16);
  background: #f3f4f6;
}

.wheel-date-apply:hover,
.wheel-date-apply:focus-visible {
  outline: none;
  background: #14314f;
}

.wheel-date-clear:disabled,
.wheel-date-apply:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 420px) {
  .wheel-date-card {
    width: calc(100vw - 24px);
  }

  .wheel-date-weekdays,
  .wheel-date-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .wheel-date-weekday,
  .wheel-date-day {
    width: 100%;
  }
}
