/* ===================================================
   E-Clearance Payment Engine — Framework UI Design
   Emerald Theme · Analogous Split Neutral
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --brand-50: #ECFDF5;
  --brand-100: #D1FAE5;
  --brand-200: #A7F3D0;
  --brand-500: #10B981;
  --brand-600: #059669;
  --brand-700: #047857;

  --neutral-50: #F8FAFC;
  --neutral-100: #F1F5F9;
  --neutral-200: #E2E8F0;
  --neutral-300: #CBD5E1;
  --neutral-400: #94A3B8;
  --neutral-500: #64748B;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1E293B;
  --neutral-900: #0F172A;

  --danger-50: #FFF1F2;
  --danger-500: #E11D48;
  --danger-600: #BE123C;

  --amber-50: #FFFBEB;
  --amber-500: #F59E0B;

  --sidebar-bg: #0F172A;
  --sidebar-width: 260px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--neutral-100);
  color: var(--neutral-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

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

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}

.sidebar-brand-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  line-height: 1.3;
}

.sidebar-brand-sub {
  font-size: 0.65rem;
  color: var(--neutral-500);
  font-weight: 400;
}

.sidebar-nav {
  padding: 0.75rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 1.125rem;
  padding: 1.375rem 1.25rem;
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--neutral-400);
  transition: all 0.2s ease;
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--neutral-200);
  border-color: rgba(255,255,255,0.06);
  box-shadow:
    0 4px 16px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.sidebar-nav a.active {
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(16,185,129,0.03));
  color: var(--brand-500);
  border-color: rgba(16,185,129,0.15);
  font-weight: 600;
  box-shadow:
    0 2px 16px rgba(16,185,129,0.1),
    0 2px 8px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(16,185,129,0.08);
}

.sidebar-nav a .nav-icon-wrapper {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  border: 1px solid rgba(255,255,255,0.03);
}

.sidebar-nav a.active .nav-icon-wrapper {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.15);
}

.sidebar-nav a .nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.4;
  transition: all 0.2s ease;
}

.sidebar-nav a:hover .nav-icon { opacity: 0.7; }
.sidebar-nav a.active .nav-icon { opacity: 1; }

.sidebar-nav a .nav-label-text {
  font-size: 0.85rem;
  font-weight: 500;
}

.sidebar-nav a.active .nav-label-text {
  font-weight: 600;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-footer .officer-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.5rem;
}

.sidebar-footer .officer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.sidebar-footer .officer-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}

.sidebar-footer .officer-role {
  font-size: 0.65rem;
  color: var(--neutral-500);
}

.sidebar-footer .sign-out-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  margin-top: 0.75rem;
  padding: 1rem 0.75rem;
  border-radius: 10px;
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.1);
  color: #EF4444;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.sidebar-footer .sign-out-btn:hover {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.2);
  color: #DC2626;
}

.sidebar-footer .sign-out-btn:active {
  background: rgba(239,68,68,0.16);
  transform: scale(0.98);
}

.sidebar-footer .sign-out-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.8;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  background: linear-gradient(135deg, #fff 0%, var(--neutral-50) 60%, rgba(16,185,129,0.03) 100%);
  border-bottom: 1px solid var(--neutral-200);
  padding: 2.5rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16,185,129,0.05) 0%, transparent 65%);
  pointer-events: none;
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16,185,129,0.15) 50%, transparent);
}

.hero-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.hero-left {
  display: flex;
  align-items: flex-start;
  gap: 1.125rem;
}

.hero-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-50), rgba(16,185,129,0.06));
  border: 1px solid rgba(16,185,129,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-600);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.hero-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.hero:hover .hero-icon {
  transform: scale(1.05) rotate(-3deg);
  box-shadow: 0 4px 14px rgba(16,185,129,0.12);
}

.hero-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--neutral-900);
  line-height: 1.25;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.hero-subtitle {
  font-size: 0.85rem;
  color: var(--neutral-500);
  font-weight: 400;
  line-height: 1.5;
  max-width: 480px;
}

.hero-subtitle span {
  color: var(--brand-600);
  font-weight: 600;
}

.hero-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.hero-stat {
  text-align: right;
}

.hero-stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--neutral-900);
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.2;
}

.hero-stat-label {
  font-size: 0.7rem;
  color: var(--neutral-400);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-700);
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-500);
  box-shadow: 0 0 4px rgba(16,185,129,0.4);
}

.page-content {
  padding: 1.5rem 2rem;
  flex: 1;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  border: 1px solid var(--neutral-200);
  transition: box-shadow 0.2s ease;
}

.card-header {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--neutral-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body { padding: 1.25rem 1.5rem; }

/* ============================================
   METRIC CARDS
   ============================================ */

.metric-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--neutral-200);
  padding: 1.25rem 1.5rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-600));
}

.metric-card.amber::before {
  background: linear-gradient(90deg, var(--amber-500), #D97706);
}

.metric-card.blue::before {
  background: linear-gradient(90deg, #3B82F6, #2563EB);
}

.metric-card.violet::before {
  background: linear-gradient(90deg, #8B5CF6, #6D28D9);
}

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

.metric-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.625rem;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--brand-50);
  color: var(--brand-600);
}

.metric-card.amber .metric-icon {
  background: var(--amber-50);
  color: #D97706;
}

.metric-card.blue .metric-icon {
  background: #EFF6FF;
  color: #2563EB;
}

.metric-card.violet .metric-icon {
  background: #F5F3FF;
  color: #6D28D9;
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--neutral-900);
  line-height: 1.2;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group { margin-bottom: 1.125rem; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--neutral-700);
  margin-bottom: 0.375rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--neutral-200);
  border-radius: 10px;
  background: #fff;
  color: var(--neutral-900);
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}

.form-input::placeholder { color: var(--neutral-400); }

.form-input-icon-wrapper { position: relative; }

.form-input-icon-wrapper .form-input { padding-left: 2.5rem; }

.form-input-icon-wrapper .input-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--neutral-400);
  font-size: 0.9rem;
  pointer-events: none;
}

.form-input-icon-wrapper .input-toggle {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--neutral-400);
  background: none;
  border: none;
  padding: 4px;
  border-radius: 4px;
}

.form-input-icon-wrapper .input-toggle:hover { color: var(--neutral-600); }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.4;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--brand-500);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-600);
  box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}

.btn-secondary {
  background: #fff;
  color: var(--neutral-700);
  border: 1.5px solid var(--neutral-200);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--neutral-50);
  border-color: var(--neutral-300);
}

.btn-ghost {
  background: transparent;
  color: var(--neutral-500);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--neutral-100);
  color: var(--neutral-700);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  border-radius: 12px;
}

/* ============================================
   SPINNER
   ============================================ */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-dark {
  border-color: rgba(0,0,0,0.08);
  border-top-color: var(--brand-500);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-success {
  background: var(--brand-50);
  color: var(--brand-700);
}

.badge-success .badge-dot {
  background: var(--brand-500);
  box-shadow: 0 0 4px rgba(16,185,129,0.4);
}

.badge-pending {
  background: var(--amber-50);
  color: #92400E;
}

.badge-pending .badge-dot {
  background: var(--amber-500);
  box-shadow: 0 0 4px rgba(245,158,11,0.4);
}

.badge-failed {
  background: var(--danger-50);
  color: var(--danger-600);
}

.badge-failed .badge-dot {
  background: var(--danger-500);
  box-shadow: 0 0 4px rgba(225,29,72,0.4);
}

/* ============================================
   TABLES
   ============================================ */

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

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table.data-table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-500);
  background: var(--neutral-50);
  border-bottom: 1px solid var(--neutral-200);
  white-space: nowrap;
}

.sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.sort-link:hover {
  color: var(--brand-600);
}

table.data-table tbody tr {
  border-bottom: 1px solid var(--neutral-100);
  background: #fff;
  transition: background 0.12s ease;
}

table.data-table tbody tr:last-child { border-bottom: none; }

table.data-table tbody tr:hover {
  background: var(--neutral-50);
}

table.data-table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  color: var(--neutral-900);
}

table.data-table .text-muted {
  color: var(--neutral-500);
  font-size: 0.8rem;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 1.25rem;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--neutral-200);
  background: #fff;
  color: var(--neutral-700);
  transition: all 0.15s ease;
}

.pagination a:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-300);
}

.pagination .active {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}

.pagination .disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ============================================
   FLASH MESSAGES
   ============================================ */

.flash {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.flash-error {
  background: var(--danger-50);
  color: var(--danger-600);
  border: 1px solid #FFE4E6;
}

.flash-success {
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-container {
  min-height: 100vh;
  display: flex;
  background: #fff;
}

.login-panel-left {
  width: 40%;
  background: linear-gradient(160deg, #0F172A 0%, #1E293B 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.login-panel-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(16,185,129,0.08) 0%, transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(16,185,129,0.04) 0%, transparent 50%);
}

.login-panel-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(255,255,255,0.012) 40px, rgba(255,255,255,0.012) 41px),
    repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,255,255,0.012) 40px, rgba(255,255,255,0.012) 41px);
}

.login-panel-left .crest {
  width: 88px;
  height: 88px;
  background: rgba(16,185,129,0.12);
  border: 2px solid rgba(16,185,129,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand-500);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.login-panel-left .school-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  position: relative;
  z-index: 1;
  line-height: 1.4;
}

.login-panel-left .school-tagline {
  font-size: 0.85rem;
  color: var(--neutral-400);
  text-align: center;
  margin-top: 0.75rem;
  position: relative;
  z-index: 1;
}

.login-panel-right {
  width: 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: #fff;
}

.login-form-wrapper {
  width: 100%;
  max-width: 380px;
}

.login-form-wrapper h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.login-form-wrapper .login-subtitle {
  color: var(--neutral-500);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

/* ============================================
   STUDENT CARD
   ============================================ */

.student-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--neutral-200);
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.student-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border-color: var(--neutral-300);
}

.student-card .avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--brand-50);
  color: var(--brand-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  flex-shrink: 0;
}

/* ============================================
   RECEIPT
   ============================================ */

.a4-sheet {
  background: #FAF6F0;
  width: 210mm;
  min-height: 297mm;
  padding: 2.5rem 3rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border: 1px solid #EDE9E0;
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #1E293B;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.receipt-school {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: #1E293B;
}

.receipt-title {
  font-size: 0.8rem;
  color: var(--neutral-500);
  font-weight: 500;
}

.receipt-ref {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--neutral-900);
  font-size: 0.85rem;
}

.receipt-student-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background: rgba(0,0,0,0.015);
  border: 1px solid #EDE9E0;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.receipt-student-grid .label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-500);
}

.receipt-student-grid .value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--neutral-900);
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.receipt-table thead th {
  text-align: left;
  padding: 0.5rem 0;
  border-bottom: 2px solid #1E293B;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-500);
  font-weight: 600;
}

.receipt-table thead th:last-child { text-align: right; }

.receipt-table tbody td {
  padding: 0.75rem 0;
  border-bottom: 1px solid #EDE9E0;
  font-size: 0.875rem;
}

.receipt-table tbody td:last-child {
  text-align: right;
  font-weight: 700;
}

.receipt-table tfoot td {
  padding: 0.75rem 0;
  font-weight: 700;
  font-size: 1rem;
}

.receipt-table tfoot td:last-child {
  text-align: right;
  font-size: 1.125rem;
  color: var(--neutral-900);
}

.receipt-footer {
  border-top: 1px solid #EDE9E0;
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.receipt-footer-left { font-size: 0.75rem; color: var(--neutral-500); }

.receipt-footer-right {
  text-align: center;
  border-top: 1px dashed var(--neutral-400);
  padding-top: 0.5rem;
  width: 160px;
  font-size: 0.75rem;
  color: var(--neutral-500);
}

/* ============================================
   SKELETON
   ============================================ */

.skeleton {
  background: linear-gradient(90deg, var(--neutral-200) 25%, var(--neutral-100) 50%, var(--neutral-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   ANIMATIONS
   ============================================ */

.fade-in { animation: fadeIn 0.25s ease-out; }
.slide-up { animation: slideUp 0.3s ease-out; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.checkmark-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-50);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  animation: scaleIn 0.4s ease-out;
}

.checkmark-circle svg {
  width: 36px;
  height: 36px;
  stroke: var(--brand-500);
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
  animation: drawCheck 0.5s ease-out 0.15s forwards;
}

@keyframes scaleIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

/* ============================================
   CONFIRMATION MODAL
   ============================================ */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
  padding: 1rem;
}

.confirm-dialog {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(15,23,42,0.2);
  padding: 2rem 2rem 1.5rem;
  width: 100%;
  max-width: 440px;
  animation: slideUp 0.25s ease-out;
  text-align: center;
}

.confirm-dialog .confirm-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.confirm-dialog .confirm-icon svg {
  width: 32px;
  height: 32px;
}

.confirm-dialog .confirm-icon.warning { background: var(--amber-50); color: #D97706; }
.confirm-dialog .confirm-icon.danger { background: var(--danger-50); color: var(--danger-500); }
.confirm-dialog .confirm-icon.info { background: var(--brand-50); color: var(--brand-600); }

.confirm-dialog .confirm-title {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--neutral-900);
  margin-bottom: 0.5rem;
}

.confirm-dialog .confirm-body {
  font-size: 1rem;
  color: var(--neutral-500);
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.confirm-dialog .confirm-body strong {
  color: var(--neutral-800);
  font-weight: 700;
}

.confirm-dialog .confirm-actions {
  display: flex;
  gap: 0.75rem;
}

.confirm-dialog .confirm-actions .btn {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border-radius: 10px;
}

.confirm-dialog .confirm-actions .btn-confirm {
  background: var(--brand-500);
  color: #fff;
  border: none;
}

.confirm-dialog .confirm-actions .btn-confirm:hover { background: var(--brand-600); }

.confirm-dialog .confirm-actions .btn-confirm.danger {
  background: var(--danger-500);
}

.confirm-dialog .confirm-actions .btn-confirm.danger:hover { background: var(--danger-600); }

.confirm-dialog .confirm-actions .btn-cancel {
  background: #fff;
  color: var(--neutral-700);
  border: 1.5px solid var(--neutral-200);
}

.confirm-dialog .confirm-actions .btn-cancel:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-300);
}

/* ============================================
   UTILITIES
   ============================================ */

.text-muted { color: var(--neutral-500); }
.text-primary { color: var(--brand-500); }
.text-danger { color: var(--danger-500); }
.font-heading { font-family: 'Plus Jakarta Sans', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

.grid-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--neutral-500);
}

.empty-state .empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  opacity: 0.25;
}

/* ============================================
   TOAST
   ============================================ */

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--neutral-900);
  color: #fff;
  padding: 0.75rem 1.125rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 100;
  animation: slideUp 0.25s ease-out;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================
   SKELETON SHIMMER LOADER
   ============================================ */

.shimmer {
  background: linear-gradient(90deg, var(--neutral-100) 25%, var(--neutral-50) 50%, var(--neutral-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   PREMIUM STUDENT CARD
   ============================================ */

.student-card {
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--neutral-100);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
  animation: slideUp 0.3s ease-out;
}

.student-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, var(--neutral-900), #1E293B);
  position: relative;
  overflow: hidden;
}

.student-card-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(16,185,129,0.06);
  pointer-events: none;
}

.student-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(16,185,129,0.25);
  position: relative;
  z-index: 1;
}

.student-card-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.student-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.3;
}

.student-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.375rem;
  padding: 0.2rem 0.625rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}

.student-card-body {
  padding: 1.25rem 1.75rem;
}

.student-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.student-card-field-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.student-card-field-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--neutral-800);
  word-break: break-all;
}

.student-card-field-value.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

.student-card-footer {
  padding: 0.875rem 1.75rem;
  background: var(--neutral-50);
  border-top: 1px solid var(--neutral-100);
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.student-card-footer .btn {
  padding: 0.6rem 1.5rem;
  font-size: 0.8rem;
  border-radius: 10px;
  font-weight: 600;
}

.student-card-session-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--neutral-100);
}

.session-field .student-card-field-label {
  margin-bottom: 0.35rem;
}

.student-card-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  border: 1.5px solid var(--neutral-200);
  border-radius: 8px;
  background: #fff;
  color: var(--neutral-800);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
  appearance: auto;
}

.student-card-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}

/* Not found card */
.not-found-card {
  text-align: center;
  padding: 3rem 2rem;
  border: 1px dashed var(--neutral-200);
  border-radius: 16px;
  background: var(--neutral-50);
}

.not-found-card .icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: #D97706;
  box-shadow: 0 4px 12px rgba(217,119,6,0.1);
}

.not-found-card .icon-wrap svg {
  width: 28px;
  height: 28px;
}

.not-found-card .title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--neutral-800);
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin-bottom: 0.375rem;
}

.not-found-card .subtitle {
  font-size: 0.8rem;
  color: var(--neutral-400);
  margin: 0;
  line-height: 1.6;
}

.not-found-card .query-text {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.375rem 0.875rem;
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--neutral-600);
  letter-spacing: 0.01em;
}

/* Error card */
.error-card {
  text-align: center;
  padding: 2.5rem 2rem;
  border: 1px dashed var(--danger);
  border-radius: 16px;
  background: #FFF1F2;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .grid-metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-2-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .login-panel-left { display: none; }
  .login-panel-right { width: 100%; }
  .grid-metrics { grid-template-columns: 1fr; }
  .page-content { padding: 1rem; }
  .topbar { padding: 0.625rem 1rem; }
}

/* ============================================
   PRINT
   ============================================ */

@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; margin: 0; }
  .a4-sheet {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 2rem !important;
  }
  @page { size: A4 portrait; margin: 12mm; }
  .main-content { margin-left: 0 !important; }

  .badge-success { background: #fff !important; color: #000 !important; border: 1px solid #000 !important; }
  .badge-success .badge-dot { background: #000 !important; box-shadow: none !important; }
  .badge { border: 1px solid #000; color: #000 !important; }
  .badge-pending { background: #fff !important; color: #000 !important; }
  [class*="brand"] { color: #000 !important; }
  .receipt-footer-left p:last-child { color: #000 !important; }
}
