/* ==========================================
   Mashgh Sabz Charity Management System
   Main Stylesheet
   ========================================== */

:root {
  --primary-50: #ecfdf5;
  --primary-100: #d1fae5;
  --primary-200: #a7f3d0;
  --primary-300: #6ee7b7;
  --primary-400: #34d399;
  --primary-500: #10b981;
  --primary-600: #059669;
  --primary-700: #047857;
  --primary-800: #065f46;
  --primary-900: #064e3b;

  --teal-50: #f0fdfa;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;

  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;

  --green-50: #f0fdf4;
  --green-500: #22c55e;
  --green-600: #16a34a;

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

  --purple-50: #faf5ff;
  --purple-100: #f3e8ff;
  --purple-500: #a855f7;
  --purple-600: #9333ea;

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

  --sidebar-width: 280px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.04);
  --transition: all .2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button {
  font-family: 'Vazirmatn', sans-serif;
  outline: none;
}

/* ==========================================
   Utilities
   ========================================== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.grid { display: grid; }

.hidden { display: none !important; }

.w-full { width: 100%; }
.w-fit { width: fit-content; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mr-2 { margin-left: 8px; }
.ml-2 { margin-right: 8px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }

.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-green { background: #dcfce7; color: #166534; }
.badge-green .badge-dot { background: #22c55e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-red .badge-dot { background: #ef4444; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-yellow .badge-dot { background: #eab308; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-blue .badge-dot { background: #3b82f6; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.badge-purple .badge-dot { background: #a855f7; }
.badge-gray { background: #f3f4f6; color: #374151; }
.badge-gray .badge-dot { background: #9ca3af; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-orange .badge-dot { background: #f97316; }

/* Status map */
.status-pending { background: #fef9c3; color: #854d0e; }
.status-under_review { background: #dbeafe; color: #1e40af; }
.status-approved { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-completed { background: #f3e8ff; color: #6b21a8; }
.status-cancelled { background: #f3f4f6; color: #374151; }
.status-active { background: #dcfce7; color: #166534; }
.status-inactive { background: #fee2e2; color: #991b1b; }
.status-graduated { background: #dbeafe; color: #1e40af; }

/* ==========================================
   Buttons
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 6px 14px; font-size: .8125rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-xl { padding: 16px 36px; font-size: 1.0625rem; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--teal-600));
  color: #fff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, .3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(5, 150, 105, .4);
}

.btn-secondary {
  background: #fff;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-outline {
  background: transparent;
  color: var(--primary-600);
  border: 1.5px solid var(--primary-600);
}
.btn-outline:hover:not(:disabled) {
  background: var(--primary-50);
}

.btn-success {
  background: var(--green-600);
  color: #fff;
}
.btn-success:hover:not(:disabled) { background: var(--green-700); }

.btn-danger {
  background: var(--red-500);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: var(--red-600); }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
}
.btn-icon.btn-sm { width: 32px; height: 32px; border-radius: 8px; }

/* ==========================================
   Forms
   ========================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--gray-700);
}
.form-group label .required {
  color: var(--red-500);
  margin-right: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: .875rem;
  background: #fff;
  color: var(--gray-800);
  transition: var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .12);
}
.form-input::placeholder { color: var(--gray-400); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='1.5'%3E%3Cpath d='M5 7l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 36px;
}

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

/* ==========================================
   Cards
   ========================================== */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.04);
  transition: var(--transition);
}
.card-hover:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-100);
}
.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-800);
}
.card-body { padding: 24px; }
.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.kpi-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.04);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.kpi-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.kpi-card .kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.kpi-card .kpi-icon svg { width: 24px; height: 24px; }
.kpi-card .kpi-label {
  font-size: .8125rem;
  color: var(--gray-500);
  font-weight: 500;
}
.kpi-card .kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gray-800);
  line-height: 1.2;
  margin-top: 4px;
}
.kpi-card .kpi-value .currency {
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-right: 4px;
}
.kpi-card .kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .75rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 20px;
}
.kpi-card .kpi-trend.up { background: #dcfce7; color: #166534; }
.kpi-card .kpi-trend.down { background: #fee2e2; color: #991b1b; }

.kpi-accent-1 .kpi-icon { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: var(--primary-600); }
.kpi-accent-2 .kpi-icon { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: var(--blue-600); }
.kpi-accent-3 .kpi-icon { background: linear-gradient(135deg, #fef3c7, #fde68a); color: var(--amber-600); }
.kpi-accent-4 .kpi-icon { background: linear-gradient(135deg, #fce7f3, #fbcfe8); color: #db2777; }
.kpi-accent-5 .kpi-icon { background: linear-gradient(135deg, #f3e8ff, #e9d5ff); color: var(--purple-600); }
.kpi-accent-6 .kpi-icon { background: linear-gradient(135deg, #f0fdfa, #ccfbf1); color: var(--teal-600); }
.kpi-accent-7 .kpi-icon { background: linear-gradient(135deg, #fff7ed, #ffedd5); color: #ea580c; }
.kpi-accent-8 .kpi-icon { background: linear-gradient(135deg, #fef2f2, #fecaca); color: var(--red-500); }

/* ==========================================
   Tables
   ========================================== */
.table-container {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.04);
  overflow: hidden;
}
.table-container .table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-100);
}
.table-container .table-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}
.table-container .table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.table-toolbar .search-box {
  position: relative;
}
.table-toolbar .search-box svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.table-toolbar .search-box input {
  padding: 8px 36px 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: .8125rem;
  width: 220px;
  background: var(--gray-50);
  transition: var(--transition);
}
.table-toolbar .search-box input:focus {
  width: 280px;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .1);
  background: #fff;
}
.table-toolbar .filter-select {
  padding: 8px 32px 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: .8125rem;
  background: var(--gray-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='1.5'%3E%3Cpath d='M5 7l5 5 5-5'/%3E%3C/svg%3E") no-repeat left 10px center;
  appearance: none;
  cursor: pointer;
  min-width: 130px;
}

table {
  width: 100%;
  border-collapse: collapse;
}
table thead th {
  background: var(--gray-50);
  padding: 12px 16px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--gray-500);
  text-align: right;
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}
table tbody td {
  padding: 12px 16px;
  font-size: .875rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
table tbody tr:last-child td { border-bottom: none; }
table tbody tr:hover { background: var(--gray-50); }
table tbody tr.clickable { cursor: pointer; }

.table-empty {
  text-align: center;
  padding: 48px 24px !important;
  color: var(--gray-400);
}
.table-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: .5;
}
.table-empty p { font-size: .9375rem; }

/* ==========================================
   Pagination
   ========================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
}
.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: #fff;
  color: var(--gray-600);
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pagination button:hover:not(:disabled):not(.active) {
  background: var(--gray-50);
  border-color: var(--gray-300);
}
.pagination button.active {
  background: linear-gradient(135deg, var(--primary-500), var(--teal-600));
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}
.pagination button:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.form-input[disabled],
.form-select[disabled],
.form-textarea[disabled] {
  opacity: .45;
  pointer-events: none;
  user-select: none;
}
.pagination .page-info {
  font-size: .8125rem;
  color: var(--gray-500);
  padding: 0 8px;
}

/* ==========================================
   Layout
   ========================================== */
.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overscroll-behavior: none;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ==========================================
   App Header — Public / Compact / Dashboard
   ========================================== */
.app-header {
  width: 100%;
  z-index: 100;
}
.app-header--fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

/* Public header (landing page) */
.app-header--public {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-100);
  height: 72px;
  transition: box-shadow .3s ease;
}
.app-header--public.scrolled {
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.app-header--public .app-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.app-header--public .app-header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-header--public .app-header-nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: var(--transition);
  text-decoration: none;
}
.app-header--public .app-header-nav-link:hover {
  background: var(--gray-50);
  color: var(--primary-600);
}
.app-header--public .app-header-nav-link.active {
  color: var(--primary-600);
  font-weight: 600;
}
.app-header--public .app-header-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-700);
  padding: 4px;
}
.app-header--public .app-header-mobile-menu {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--gray-100);
  padding: 12px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  z-index: 99;
}
.app-header--public .app-header-mobile-menu.hidden {
  display: none;
}
.app-header--public .app-header-mobile-link {
  display: block;
  padding: 12px 24px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
  transition: var(--transition);
}
.app-header--public .app-header-mobile-link:hover {
  background: var(--gray-50);
  color: var(--primary-600);
}
.app-header--public .app-header-mobile-logout {
  color: var(--red-500);
  width: 100%;
  text-align: right;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: .9rem;
}
.app-header--public .app-header-mobile-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 8px 0;
}
.app-header--public .app-header-mobile-role {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px 12px;
  border-bottom: 1px solid var(--gray-50);
  margin-bottom: 4px;
  font-size: .875rem;
  color: var(--gray-600);
}

/* Compact header (auth pages) */
.app-header--compact {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-100);
  height: 64px;
}
.app-header--compact .app-header-inner {
  max-width: 480px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

/* Dashboard header (admin/student layouts) */
.app-header--dashboard {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
  padding: 10px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header--dashboard .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8125rem;
  color: var(--gray-500);
}
.app-header--dashboard .breadcrumb a { color: var(--gray-600); }
.app-header--dashboard .breadcrumb a:hover { color: var(--primary-600); }
.app-header--dashboard .breadcrumb .separator { color: var(--gray-300); }
.app-header--dashboard .breadcrumb .current { color: var(--gray-800); font-weight: 600; }

/* Logo */
.app-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.app-header-logo-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.app-header-logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gray-800);
  letter-spacing: -.02em;
}

/* Shared left/right sections */
.app-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-home-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--gray-500);
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  flex-shrink: 0;
  text-decoration: none;
}
.header-home-btn svg {
  flex-shrink: 0;
}
.header-home-btn:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}
.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Actions (login/register buttons or user info) */
.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Username display */
.app-header-username {
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-700);
}

/* Responsive */
@media (max-width: 768px) {
  .app-header--public .app-header-nav { display: none; }
  .app-header--public .app-header-actions { display: none; }
  .app-header--public .app-header-mobile-toggle { display: flex; align-items: center; }
}

/* ==========================================
   Admin Sidebar (vertical right-side navigation)
   ========================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
  overscroll-behavior: none;
}
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-700);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--gray-100);
}
.sidebar-role {
  font-size: .7rem;
  font-weight: 400;
  color: var(--gray-400);
  background: var(--gray-50);
  padding: 2px 8px;
  border-radius: 4px;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
}
.sidebar-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 16px 12px 6px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--gray-600);
  border-radius: 8px;
  transition: var(--transition);
  text-decoration: none;
}
.sidebar-item:hover {
  background: var(--gray-50);
  color: var(--gray-800);
}
.sidebar-item.active {
  background: var(--primary-50);
  color: var(--primary-600);
  font-weight: 600;
}
.sidebar-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.sidebar-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 4px 0;
}
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--gray-100);
}
.sidebar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-size: .8125rem;
  color: var(--gray-500);
  text-decoration: none;
  border-radius: 8px;
  transition: var(--transition);
}
.sidebar-back:hover {
  background: var(--gray-50);
  color: var(--gray-700);
}

/* ── Admin Main Area ────────────────── */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid var(--gray-100);
}
.admin-content {
  flex: 1;
  padding: 24px 28px;
}
.admin-main .app-header {
  display: none;
}

@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    border-left: none;
    border-bottom: 1px solid var(--gray-100);
    max-height: 50vh;
    overflow-y: auto;
  }
  .sidebar-brand { padding: 14px 16px 12px; font-size: 1rem; }
  .sidebar-nav { padding: 8px; }
  .sidebar-item { padding: 8px 10px; font-size: .75rem; }
  .sidebar-item svg { width: 16px; height: 16px; }
  .admin-header { padding: 12px 16px; }
  .admin-content { padding: 16px; }
}

/* ==========================================
   Legacy .main-header (kept for compatibility)
   ========================================== */
.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
  padding: 0 28px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.main-header .header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.main-header .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.main-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8125rem;
  color: var(--gray-500);
}
.main-header .breadcrumb a { color: var(--gray-600); }
.main-header .breadcrumb a:hover { color: var(--primary-600); }
.main-header .breadcrumb .separator { color: var(--gray-300); }
.main-header .breadcrumb .current { color: var(--gray-800); font-weight: 600; }

.main-body {
  flex: 1;
  padding: 24px 28px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 700;
}
.role-badge.admin {
  background: linear-gradient(135deg, var(--amber-100), var(--amber-200));
  color: #92400e;
}
.role-badge.student {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
}

/* ==========================================
   Auth Pages
   ========================================== */
.page-with-header {
  padding-top: 64px;
  min-height: 100vh;
}

.auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0fdfa 0%, #f0f9ff 50%, #f5f3ff 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.auth-bg-circle {
  position: absolute;
  border-radius: 50%;
  opacity: .08;
  pointer-events: none;
}
.auth-bg-circle.c1 {
  width: 500px;
  height: 500px;
  background: var(--primary-500);
  top: -150px;
  left: -150px;
}
.auth-bg-circle.c2 {
  width: 400px;
  height: 400px;
  background: var(--teal-500);
  bottom: -100px;
  right: -100px;
}
.auth-bg-circle.c3 {
  width: 300px;
  height: 300px;
  background: var(--amber-400);
  top: 30%;
  right: -80px;
}

.auth-container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-2xl);
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.08);
  border: 1px solid rgba(255,255,255,.5);
}
.auth-card .auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.auth-card .auth-logo .logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary-500), var(--teal-600));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.auth-card .auth-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gray-800);
  margin-bottom: 4px;
}
.auth-card .auth-subtitle {
  text-align: center;
  font-size: .875rem;
  color: var(--gray-500);
  margin-bottom: 28px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--gray-400);
  font-size: .8125rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.auth-links {
  text-align: center;
  font-size: .875rem;
  color: var(--gray-500);
  margin-top: 20px;
}
.auth-links a {
  color: var(--primary-600);
  font-weight: 600;
}
.auth-links a:hover { color: var(--primary-700); }

/* Password strength */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.password-strength .bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--gray-200);
  transition: var(--transition);
}
.password-strength .bar.weak { background: var(--red-500); }
.password-strength .bar.medium { background: var(--amber-500); }
.password-strength .bar.strong { background: var(--green-500); }

/* ==========================================
   Page Sections
   ========================================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.page-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gray-800);
}
.page-header .page-subtitle {
  font-size: .875rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.section-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.04);
  overflow: hidden;
  margin-bottom: 20px;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.spinner.dark {
  border-color: var(--gray-200);
  border-top-color: var(--primary-600);
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--gray-400);
  gap: 12px;
}
.loading-center p { font-size: .875rem; }

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

/* ==========================================
   Alerts & Toasts
   ========================================== */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 16px;
  animation: slideDown .3s ease;
}
.alert svg { width: 20px; height: 20px; flex-shrink: 0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-dismiss {
  margin-right: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: .5;
  padding: 2px;
}
.alert-dismiss:hover { opacity: 1; }

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

/* Toast notification */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  animation: toastIn .3s ease;
  pointer-events: all;
  min-width: 250px;
  justify-content: center;
}
.toast-success { background: #166534; color: #fff; }
.toast-error { background: #991b1b; color: #fff; }
.toast-info { background: #1e40af; color: #fff; }
.toast svg { width: 20px; height: 20px; flex-shrink: 0; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================
   Animations
   ========================================== */
.fade-in { animation: fadeIn .4s ease; }
.slide-up { animation: slideUp .4s ease; }
.scale-in { animation: scaleIn .35s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================
   Modal
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.modal-content {
  background: #fff;
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 25px 60px rgba(0,0,0,.2);
  animation: scaleIn .25s ease;
}
.modal-content.modal-lg { max-width: 680px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 1.15rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
  border-radius: 8px;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-600); }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}

/* ==========================================
   Detail Page Tabs
   ========================================== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--gray-100);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab-item {
  padding: 10px 20px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.tab-item:hover { color: var(--gray-700); }
.tab-item.active {
  color: var(--primary-600);
  border-bottom-color: var(--primary-500);
}

/* ==========================================
   Status Flow (Requests)
   ========================================== */
.status-flow {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 16px 0;
  flex-wrap: wrap;
}
.status-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 500;
  color: var(--gray-400);
  padding: 4px 8px;
}
.status-step .step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-200);
}
.status-step.done { color: var(--green-500); }
.status-step.done .step-dot { background: var(--green-500); }
.status-step.current { color: var(--amber-500); font-weight: 700; }
.status-step.current .step-dot { background: var(--amber-500); box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.status-connector {
  width: 20px;
  height: 2px;
  background: var(--gray-200);
}
.status-connector.done { background: var(--green-500); }

/* ==========================================
   Quick Links Grid
   ========================================== */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 16px;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  transition: var(--transition);
  cursor: pointer;
  text-align: center;
}
.quick-link:hover {
  border-color: var(--primary-200);
  box-shadow: 0 8px 24px rgba(5, 150, 105, .1);
  transform: translateY(-3px);
}
.quick-link svg {
  width: 32px;
  height: 32px;
  color: var(--primary-600);
}
.quick-link span {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--gray-700);
}

/* ==========================================
   Timeline
   ========================================== */
.timeline {
  position: relative;
  padding-right: 32px;
}
.timeline::before {
  content: '';
  position: absolute;
  right: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}
.timeline-item {
  position: relative;
  padding-bottom: 24px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  right: -24px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.timeline-dot.received { border-color: var(--primary-400); background: #d1fae5; }
.timeline-dot.request { border-color: var(--blue-400); background: #dbeafe; }
.timeline-dot.review { border-color: var(--amber-400); background: #fef3c7; }
.timeline-dot svg { width: 12px; height: 12px; }

.timeline-content {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  border: 1px solid var(--gray-100);
}
.timeline-content .time {
  font-size: .75rem;
  color: var(--gray-400);
}
.timeline-content .title {
  font-size: .875rem;
  font-weight: 600;
  margin-top: 2px;
}
.timeline-content .desc {
  font-size: .8125rem;
  color: var(--gray-600);
  margin-top: 4px;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1024px) {
  .main-body { padding: 20px; }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (max-width: 640px) {
  .auth-card { padding: 28px 20px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card { padding: 16px; }
  .kpi-card .kpi-value { font-size: 1.3rem; }
  .table-container .table-header { flex-direction: column; align-items: stretch; }
  .table-toolbar { flex-direction: column; }
  .table-toolbar .search-box input { width: 100%; }
  .table-toolbar .search-box input:focus { width: 100%; }
  .page-header { flex-direction: column; align-items: stretch; }
  .main-body { padding: 16px; }
  .modal-content { padding: 20px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
}

/* ==========================================
   Scrollbar
   ========================================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ==========================================
   Chart support (simple bar charts)
   ========================================== */
.chart-bar-group {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 200px;
  padding-top: 10px;
}
.chart-bar-item {
  flex: 1;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  position: relative;
  transition: var(--transition);
}
.chart-bar-item:hover { opacity: .8; }
.chart-bar-label {
  text-align: center;
  font-size: .625rem;
  color: var(--gray-500);
  margin-top: 6px;
  white-space: nowrap;
}
.chart-bar-value {
  text-align: center;
  font-size: .625rem;
  font-weight: 700;
  color: var(--gray-600);
  margin-bottom: 2px;
}
.chart-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--gray-600);
}
.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* ==========================================
   Comparison chart (expense vs income)
   ========================================== */
.chart-groups {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 220px;
  padding: 10px 4px 0;
}
.chart-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}
.chart-group-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 100%;
  justify-content: center;
}
.chart-bar {
  width: 28px;
  max-width: 40%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: opacity .2s ease;
  position: relative;
}
.chart-bar:hover { opacity: .7; }
.chart-bar.income {
  background: linear-gradient(to top, var(--green-600), var(--green-500));
}
.chart-bar.expense {
  background: linear-gradient(to top, var(--red-500), var(--red-400));
}
.chart-groups .chart-bar-label {
  margin-top: 8px;
  font-size: .65rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
@media (max-width: 640px) {
  .chart-bar { width: 18px; }
}

/* ==========================================
   Enhanced chart bar value labels
   ========================================== */
.chart-bar .chart-bar-val {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: .55rem;
  font-weight: 700;
  color: var(--gray-600);
  white-space: nowrap;
  margin-bottom: 2px;
  opacity: 0;
  transition: opacity .2s ease;
}
.chart-bar:hover .chart-bar-val {
  opacity: 1;
}

/* ==========================================
   Ratio donut chart
   ========================================== */
.ratio-donut-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ratio-donut-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ==========================================
   Category horizontal bars
   ========================================== */
.cat-bar-track {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.cat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .6s ease;
}

/* ==========================================
   Jalali date picker
   ========================================== */
.jalali-date-picker {
  display: flex;
  gap: 6px;
  direction: ltr;
}
.jalali-date-picker select {
  min-width: 0;
  text-align: center;
  font-size: .8125rem;
}

/* ==========================================
   Field feedback (validation messages)
   ========================================== */
.field-feedback {
  min-height: 20px;
  margin-top: 2px;
}

/* ==========================================
   Form toggle switch
   ========================================== */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
  display: inline-block;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: 12px;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  right: 3px;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.toggle input:checked + .toggle-slider {
  background: var(--primary-500);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(-20px);
}

/* ==========================================
   Home / Landing Page
   ========================================== */
.home-page { min-height: 100vh; }

/* Header */
.home-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
}
.home-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.home-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.home-logo-icon { font-size: 1.75rem; line-height: 1; }
.home-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-700);
  letter-spacing: -.02em;
}
.home-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.home-nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: var(--transition);
}
.home-nav-link:hover { background: var(--gray-100); color: var(--gray-900); }
.home-nav-link.active { color: var(--primary-600); font-weight: 600; }
.home-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.home-user-greeting {
  font-size: .8125rem;
  color: var(--gray-500);
  font-weight: 500;
  white-space: nowrap;
}
.home-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gray-700);
  cursor: pointer;
  padding: 4px;
}
.home-mobile-menu {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 24px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 99;
}
.home-mobile-menu:not(.hidden) { display: block; }
.home-mobile-link {
  display: block;
  padding: 12px 0;
  font-size: .9375rem;
  color: var(--gray-700);
  font-weight: 500;
  border-bottom: 1px solid var(--gray-100);
}
.home-mobile-link:last-child { border-bottom: none; }
.home-mobile-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 8px 0;
}

/* Hero */
.home-hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 120px 24px 80px;
}
.home-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-800) 0%, var(--primary-600) 40%, var(--teal-600) 100%);
  z-index: 0;
}
.home-hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(255,255,255,.12) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(255,255,255,.08) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 80%, var(--teal-700) 0%, transparent 50%);
}
.home-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(255,255,255,.06) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(255,255,255,.04) 0%, transparent 50%);
}
.home-hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  text-align: center;
  color: #fff;
}
.home-hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.home-hero-subtitle {
  font-size: 1.125rem;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  margin-bottom: 16px;
}
.home-hero-desc {
  font-size: 1rem;
  color: rgba(255,255,255,.7);
  line-height: 1.8;
  max-width: 560px;
  margin: 0 auto 36px;
}
.home-hero-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.home-hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 100px;
  z-index: 1;
  line-height: 0;
}
.home-hero-wave svg { width: 100%; height: 100%; }

/* Sections */
.home-section {
  padding: 80px 24px;
}
.home-section-alt { background: var(--gray-50); }
.home-section-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.home-section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}
.home-section-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 50px;
  background: var(--primary-100);
  color: var(--primary-700);
  font-size: .8125rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.home-section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 12px;
}
.home-section-desc {
  font-size: .9375rem;
  color: var(--gray-500);
  line-height: 1.8;
}

/* Features grid */
.home-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.home-feature-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  transition: var(--transition);
}
.home-feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-200);
}
.home-feature-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.home-feature-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 8px;
}
.home-feature-card p {
  font-size: .875rem;
  color: var(--gray-500);
  line-height: 1.7;
}

/* Contact */
.home-contact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.home-contact-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: var(--transition);
}
.home-contact-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.home-contact-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.home-contact-card h4 { font-size: 1rem; font-weight: 700; color: var(--gray-800); margin-bottom: 6px; }
.home-contact-card p { font-size: .875rem; color: var(--gray-500); direction: ltr; }

/* Social */
.home-social {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}
.home-social-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: .9375rem;
  font-weight: 600;
  transition: var(--transition);
}
.home-social-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Footer */
.home-footer {
  background: var(--gray-900);
  color: rgba(255,255,255,.7);
  padding: 48px 24px 32px;
}
.home-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.home-footer-brand { margin-bottom: 20px; }
.home-footer-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}
.home-footer-brand p {
  font-size: .8125rem;
  margin-top: 6px;
  color: rgba(255,255,255,.5);
}
.home-footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 20px;
}
.home-footer-links a {
  font-size: .875rem;
  color: rgba(255,255,255,.6);
  transition: var(--transition);
}
.home-footer-links a:hover { color: #fff; }
.home-footer-copy {
  font-size: .75rem;
  color: rgba(255,255,255,.35);
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 16px;
}

/* ==========================================
   Blog Carousel (Horizontal scroll with glass caption)
   ========================================== */
.home-carousel-section {
  padding: 0;
  background: var(--gray-900);
  overflow: hidden;
}
.home-carousel-container {
  display: flex;
  align-items: center;
  position: relative;
}
.home-carousel-wrapper {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.home-carousel-wrapper::-webkit-scrollbar {
  display: none;
}
.home-carousel-track {
  display: flex;
  gap: 16px;
  padding: 20px 0;
}
.home-carousel-slide {
  min-width: calc(25% - 12px);
  height: 320px;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: flex-end;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,.2);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}

.home-carousel-caption {
  width: 100%;
  padding: 20px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.home-carousel-caption p {
  color: #fff;
  font-size: .8125rem;
  line-height: 1.7;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-carousel-btn {
  position: absolute;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.home-carousel-btn:hover {
  background: rgba(255,255,255,.3);
}
.home-carousel-btn svg {
  width: 22px;
  height: 22px;
}
.home-carousel-btn-right {
  right: 12px;
}
.home-carousel-btn-left {
  left: 12px;
}

/* Carousel post modal */
.blog-carousel-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.blog-modal-content {
  background: #fff;
  border-radius: var(--radius-xl);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: scaleIn .2s ease;
}
.blog-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.blog-modal-close:hover {
  background: rgba(0,0,0,.7);
}
.blog-modal-close svg {
  width: 20px;
  height: 20px;
}
.blog-modal-media {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.blog-modal-body {
  padding: 28px 32px;
}
.blog-modal-body p {
  font-size: .9375rem;
  line-height: 2;
  color: var(--gray-700);
  white-space: pre-wrap;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 640px) {
  .blog-modal-content { border-radius: var(--radius-lg); }
  .blog-modal-body { padding: 20px; }
  .blog-modal-body p { font-size: .875rem; }
}

@media (max-width: 1024px) {
  .home-carousel-slide { min-width: calc(33.333% - 11px); height: 260px; }
}
@media (max-width: 640px) {
  .home-carousel-slide { min-width: calc(50% - 8px); height: 220px; }
  .home-carousel-caption { padding: 14px; }
  .home-carousel-caption p { font-size: .75rem; }
  .home-carousel-btn { width: 36px; height: 36px; }
  .home-carousel-btn svg { width: 18px; height: 18px; }
}

/* ==========================================
   Blog / Resume Feed (LinkedIn-style)
   ========================================== */
.home-blog {
  background: var(--gray-50);
}
.home-blog .home-section-inner {
  max-width: 700px;
}
.blog-post-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  margin-bottom: 20px;
  overflow: hidden;
  transition: var(--transition);
}
.blog-post-card:hover {
  box-shadow: var(--shadow-md);
}
.blog-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}
.blog-post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.blog-post-author {
  flex: 1;
}
.blog-post-author-name {
  font-weight: 600;
  font-size: .875rem;
  color: var(--gray-800);
}
.blog-post-author-role {
  font-size: .75rem;
  color: var(--gray-500);
}
.blog-post-date {
  font-size: .7rem;
  color: var(--gray-400);
}
.blog-post-caption {
  padding: 0 20px 16px;
  font-size: .875rem;
  line-height: 1.7;
  color: var(--gray-700);
  white-space: pre-wrap;
}
.blog-post-media {
  width: 100%;
  max-height: 500px;
  overflow: hidden;
  background: var(--gray-100);
}
.blog-post-media img,
.blog-post-media video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 500px;
  object-fit: cover;
}
.blog-post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--gray-100);
}
.blog-comment-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: .8125rem;
  color: var(--gray-500);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.blog-comment-toggle:hover {
  background: var(--gray-50);
  color: var(--gray-700);
}
.blog-comment-toggle svg {
  width: 18px;
  height: 18px;
}
.blog-comments-section {
  border-top: 1px solid var(--gray-100);
  padding: 16px 20px;
  background: var(--gray-50);
}
.blog-comment {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.blog-comment:last-child {
  margin-bottom: 0;
}
.blog-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-300);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .75rem;
  flex-shrink: 0;
}
.blog-comment-body {
  flex: 1;
  background: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-100);
}
.blog-comment-author {
  font-weight: 600;
  font-size: .75rem;
  color: var(--gray-700);
  margin-bottom: 2px;
}
.blog-comment-text {
  font-size: .8125rem;
  color: var(--gray-600);
  line-height: 1.6;
}
.blog-comment-date {
  font-size: .65rem;
  color: var(--gray-400);
  margin-top: 4px;
}
.blog-comment-form {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: flex-start;
}
.blog-comment-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: .8125rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  background: #fff;
}
.blog-comment-form input:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px var(--primary-100);
}
.blog-comment-form button {
  padding: 10px 18px;
  background: var(--primary-500);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: .8125rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.blog-comment-form button:hover {
  background: var(--primary-600);
}
.blog-comment-form button:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.blog-show-all {
  text-align: center;
  margin-top: 24px;
}
.blog-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}
.blog-empty svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: .4;
}
.blog-empty h3 {
  font-size: 1.1rem;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.blog-empty p {
  font-size: .875rem;
}
.blog-loading {
  text-align: center;
  padding: 40px;
}

/* Admin blog page */
.blog-admin-form {
  max-width: 700px;
}
.blog-admin-form .form-group {
  margin-bottom: 20px;
}
.blog-admin-form label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.blog-admin-form textarea {
  width: 100%;
  min-height: 140px;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: var(--transition);
}
.blog-admin-form textarea:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px var(--primary-100);
}
.blog-admin-form input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  font-size: .8125rem;
  cursor: pointer;
}
.blog-admin-form .file-preview {
  margin-top: 10px;
  max-width: 300px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.blog-admin-form .file-preview img,
.blog-admin-form .file-preview video {
  width: 100%;
  display: block;
}
.blog-admin-list .blog-admin-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-100);
}
.blog-admin-item-thumb {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--gray-100);
  flex-shrink: 0;
}
.blog-admin-item-info {
  flex: 1;
  min-width: 0;
}
.blog-admin-item-caption {
  font-size: .875rem;
  color: var(--gray-700);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.blog-admin-item-meta {
  font-size: .75rem;
  color: var(--gray-400);
}
.blog-admin-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Animation */
@keyframes homeFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.home-page .fade-in {
  animation: homeFadeIn .6s ease forwards;
}

/* Mobile */
@media (max-width: 768px) {
  .home-nav { display: none; }
  .home-actions { display: none; }
  .home-mobile-toggle { display: block; }
  .home-hero { min-height: 70vh; padding: 100px 20px 60px; }
  .home-hero-title { font-size: 2.25rem; }
  .home-hero-subtitle { font-size: .9375rem; }
  .home-hero-desc { font-size: .875rem; }
  .home-features, .home-contact { grid-template-columns: 1fr; }
  .home-section { padding: 48px 20px; }
  .home-section-title { font-size: 1.5rem; }
  .home-social-link { padding: 12px 20px; font-size: .8125rem; }
  .home-footer-links { flex-direction: column; gap: 12px; }
  .blog-post-header { padding: 12px 16px; }
  .blog-post-caption { padding: 0 16px 12px; font-size: .8125rem; }
  .blog-post-actions { padding: 10px 16px; }
  .blog-comments-section { padding: 12px 16px; }
  .blog-comment-form { flex-direction: column; }
  .blog-comment-form button { width: 100%; }
}
