:root {
  --primary: #1e3a8a;
  --primary-soft: #3b82f6;
  --success: #198754;
  --success-soft: #22c55e;
  --warning: #f59f00;
  --warning-soft: #f59e0b;
  --danger: #dc2626;
  --danger-soft: #ef4444;
  --info: #0dcaf0;
  --info-soft: #06b6d4;
  --dark: #1f2937;
  --light: #f8fafc;
  --sidebar-bg: rgba(44, 62, 80, 0.97);
  --sidebar-hover: #34495e;
  --sidebar-active: #3498db;
  --text-light: #ecf0f1;
  --card-bg: rgba(255, 255, 255, 0.95);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.04);
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
}

body {
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  min-height: 100vh;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.card {
  background: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.btn {
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-lg {
  border-radius: var(--radius);
}

.table {
  vertical-align: middle;
}

.table thead th {
  font-weight: 600;
  letter-spacing: 0.01em;
  border-bottom-width: 2px;
}

.table tbody td {
  padding: 0.75rem 1rem;
}

.alert {
  border-radius: var(--radius);
  border: none;
  box-shadow: var(--shadow-sm);
}

.badge {
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Header / page titles */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.page-header h1 {
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

/* Stats cards */
.stats-card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.stats-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Home page cards */
.home-card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.home-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.home-card .card-header {
  border-bottom: none;
  padding: 1rem 1.25rem;
  font-weight: 600;
}

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

.home-card .card-body p {
  color: #64748b;
  margin-bottom: 1rem;
}

/* Form improvements */
.form-label {
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.35rem;
}

.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  padding: 0.6rem 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state p {
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

/* Action group */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.action-bar .btn-group {
  gap: 0.5rem;
}

/* Sidebar */
.sidebar .nav-link {
  border-radius: var(--radius-sm);
  margin: 0.15rem 0.75rem;
  padding: 0.6rem 1rem;
  transition: background 0.2s ease;
}

.sidebar .nav-link.active {
  background: var(--sidebar-active);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.35);
}

.sidebar .nav-link i {
  width: 1.4rem;
  text-align: center;
  margin-right: 0.5rem;
}

/* Badges */
.badge {
  border-radius: 999px;
  padding: 0.35em 0.65em;
}

/* Table responsive */
.table-responsive {
  border-radius: var(--radius);
  overflow: hidden;
}

.table-responsive .table {
  margin-bottom: 0;
}

/* Import page */
.import-matrix {
  font-size: 0.9rem;
}

.import-matrix th {
  background: #f1f5f9;
  font-weight: 600;
}

/* Detail page profile */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
}

.profile-info h2 {
  margin: 0;
  font-weight: 700;
  color: #0f172a;
}

.profile-info p {
  margin: 0.25rem 0 0;
  color: #64748b;
}

/* Financial */
.financial-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.financial-card {
  border: none;
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
  box-shadow: var(--shadow-sm);
}

.financial-card .amount {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0 0;
}

/* Notes / CC */
.grade-card {
  border-left: 4px solid var(--primary-soft);
}

.grade-card.grade-success {
  border-left-color: var(--success-soft);
}

.grade-card.grade-danger {
  border-left-color: var(--danger-soft);
}

/* Responsive */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-card .card-body {
    padding: 1rem;
  }
}
