@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;1,14..32,400&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

/* ═══════════════════════════════════════════════════════════════════════════
   BVM Financial — Design System v3.0
   Monochrome Palette
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Core Palette */
  --bg:            #f8fafc;
  --bg-card:       #ffffff;
  --text:          #0f172a;
  --subtext:       #64748b;
  --border:        #e2e8f0;

  /* Premium Emerald & Slate Brand */
  --emerald:       #0f766e;
  --emerald-dark:  #0f514c;
  --emerald-light: #f0fdf4;
  --emerald-glow:  rgba(15, 118, 110, 0.15);

  /* Secondary Slate */
  --indigo:        #1e293b;
  --indigo-dark:   #0f172a;
  --indigo-light:  #f8fafc;

  /* Amber & Gold */
  --amber:         #d97706;
  --amber-light:   #fffbeb;

  /* Status Colors */
  --success:       #16a34a;
  --warning:       #d97706;
  --danger:        #dc2626;
  --info:          #2563eb;

  /* Dark Premium Sidebar */
  --sidebar-bg:        #0f172a;
  --sidebar-text:      #94a3b8;
  --sidebar-heading:   #ffffff;
  --sidebar-active-bg: #1e293b;
  --sidebar-hover-bg:  rgba(255, 255, 255, 0.08);
  --sidebar-border:    rgba(255, 255, 255, 0.10);
  --sidebar-accent:    #0d9488;

  /* Glassmorphism Tokens */
  --glass-bg:          rgba(255, 255, 255, 0.82);
  --glass-border:      rgba(255, 255, 255, 0.5);

  /* Shadows */
  --shadow-xs:   0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:   0 2px 8px -2px rgba(15, 23, 42, 0.05), 0 1px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-md:   0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg:   0 20px 35px -10px rgba(15, 23, 42, 0.12), 0 8px 15px -3px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 0 3px rgba(15, 118, 110, 0.15);

  /* Geometry */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  /* Transitions */
  --ease:        cubic-bezier(0.25, 0.8, 0.25, 1);
  --duration:    0.2s;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
               "Helvetica Neue", "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

a, a:hover, a:focus, a:active {
  text-decoration: none !important;
}

/* ═══ Layout ═════════════════════════════════════════════════════════════════ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ═══ Sidebar ════════════════════════════════════════════════════════════════ */
.sidebar {
  width: 252px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 0;
  transition: width var(--duration) var(--ease);
  border-right: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  z-index: 20;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar.collapsed { width: 72px; }

/* ── Logo Area ── */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}

.logo img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.logo-text {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "Helvetica Neue", "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--sidebar-heading);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.sidebar.collapsed .logo-text { display: none; }
.sidebar.collapsed .menu-btn  { margin-left: 0; }

.menu-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: color var(--duration), background var(--duration);
}
.menu-btn:hover { color: #fff; background: rgba(255,255,255,0.06); }
.menu-btn .material-icons { font-size: 20px; }

/* ── Nav Label ── */
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148,163,184,0.5);
  padding: 20px 20px 6px;
}
.sidebar.collapsed .nav-section-label { display: none; }

/* ── Nav Links ── */
.nav {
  display: flex;
  flex-direction: column;
  padding: 10px 8px;
  gap: 2px;
  flex: 1;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  letter-spacing: -0.01em;
}

.nav a .material-icons {
  font-size: 19px;
  flex-shrink: 0;
  transition: color var(--duration);
}

.nav a span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .nav a span:last-child { display: none; }

.nav a:hover {
  background: var(--sidebar-hover-bg);
  color: #ffffff;
}
.nav a:hover .material-icons { color: #ffffff; }

.nav a.active {
  background: var(--sidebar-active-bg);
  color: #ffffff;
  font-weight: 600;
}
.nav a.active .material-icons { color: #ffffff; }

.nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: #ffffff;
  border-radius: 0 2px 2px 0;
}

/* ─ Nav Tooltip for collapsed sidebar ─ */
.sidebar.collapsed .nav a {
  justify-content: center;
  padding: 12px;
  position: relative;
}
.sidebar.collapsed .nav a:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #f8fafc;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: 12px 10px 20px;
  border-top: 1px solid var(--sidebar-border);
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--duration);
}
.sidebar-footer a:hover { color: #ef4444; background: rgba(239,68,68,0.08); }
.sidebar.collapsed .sidebar-footer a { justify-content: center; }
.sidebar.collapsed .sidebar-footer a span:last-child { display: none; }

/* ═══ Main Content Area ══════════════════════════════════════════════════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Top Navbar ── */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}

.user-nav {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-nav::before {
  content: '';
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), var(--indigo));
  display: inline-flex;
  flex-shrink: 0;
}

/* ── Scrollable Content ── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.content::-webkit-scrollbar { width: 4px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ═══ Welcome Header ════════════════════════════════════════════════════════ */
.welcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtext);
  margin-bottom: 3px;
}

.welcome-header h1 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "Helvetica Neue", "Inter", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 550;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.welcome-header p { color: var(--subtext); font-size: 14px; margin-top: 4px; }

/* ═══ Stats Row ══════════════════════════════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration), transform var(--duration);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: #111111;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtext);
}
.stat-card strong {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "Helvetica Neue", "Inter", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 550;
  color: var(--text);
  letter-spacing: -0.03em;
}

/* ═══ Cards ══════════════════════════════════════════════════════════════════ */
.card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration);
}
.card:hover { box-shadow: var(--shadow-md); }

.card h3 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "Helvetica Neue", "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--subtext);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.card h3::before {
  content: '';
  width: 3px;
  height: 14px;
  background: #111111;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ═══ Detail Grid ════════════════════════════════════════════════════════════ */
.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 16px;
  font-size: 14px;
}
.detail-grid.wide { grid-template-columns: 180px 1fr; }
.detail-grid span { color: var(--subtext); font-weight: 500; }
.detail-grid strong { color: var(--text); font-weight: 600; word-break: break-word; }


/* ═══ Tables ═════════════════════════════════════════════════════════════════ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

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

thead th {
  background: #f8fafc;
  padding: 14px 20px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--subtext);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  transition: background var(--duration);
  border-bottom: 1px solid var(--border);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

tbody td {
  padding: 16px 20px;
  color: var(--text);
  vertical-align: middle;
  font-size: 13.5px;
}

td.empty, tr.empty td {
  text-align: center;
  color: var(--subtext);
  font-style: italic;
  padding: 32px 16px;
}

/* ═══ Document List ══════════════════════════════════════════════════════════ */
.document-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.document-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fafafa;
  color: var(--text);
  font-size: 14px;
  transition: all var(--duration);
}
.document-item:hover {
  border-color: var(--emerald);
  background: var(--emerald-light);
  box-shadow: var(--shadow-sm);
}
.document-item small { color: var(--subtext); font-size: 12px; margin-left: auto; }

/* ═══ Buttons ════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #111111;
  background: #111111;
  color: #ffffff;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  text-decoration: none !important;
  letter-spacing: 0.01em;
}
.btn:hover {
  background: #000000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.btn:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}
.btn-outline:hover {
  border-color: #111111;
  color: #111111;
  background: var(--bg);
}

.btn-small {
  padding: 5px 12px;
  font-size: 12.5px;
  border-radius: var(--radius-xs);
}

.btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ═══ Alerts ═════════════════════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.alert.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.alert.warning {
  background: var(--amber-light);
  border-color: #fde68a;
  color: #92400e;
}
.alert.info {
  background: #eff6ff;
  border-color: #e4e4e7;
  color: #27272a;
}

/* ═══ Forms ══════════════════════════════════════════════════════════════════ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #ffffff;
  transition: border-color var(--duration), box-shadow var(--duration);
  outline: none;
  -webkit-font-smoothing: antialiased;
}
input:focus, select:focus, textarea:focus {
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--subtext);
  margin-bottom: 5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ═══ Badge / Status Pills ═══════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-success  { background: #e5e5e5; color: #111111; }
.badge-warning  { background: #ebebeb; color: #404040; }
.badge-danger   { background: #d4d4d4; color: #000000; }
.badge-info     { background: #e5e5e5; color: #1a1a1a; }
.badge-neutral  { background: #f0f0f0; color: #595959; }

/* ═══ Universal Admin Control Center Design System ═════════════════════════════ */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background-color: #f4f4f5;
  color: #18181b;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
}

.admin-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 24px;
  border-right: 1px solid #e4e4e7;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}
.admin-sidebar::-webkit-scrollbar { display: none; }

.admin-sidebar.collapsed {
  width: 76px;
}

.admin-sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 18px;
  border-bottom: 1px solid #e4e4e7;
  margin-bottom: 12px;
  position: relative;
}

.admin-sidebar .avatar-wrapper {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.admin-sidebar .avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50% !important;
  object-fit: cover;
  border: 2px solid #e4e4e7;
  padding: 2px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.admin-sidebar .status-indicator.online {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 11px;
  height: 11px;
  background-color: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.admin-sidebar .brand-details {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.admin-sidebar.collapsed .avatar-wrapper,
.admin-sidebar.collapsed .brand-details,
.admin-sidebar.collapsed .beta-notice,
.admin-sidebar.collapsed .nav-category,
.admin-sidebar.collapsed a span:last-child {
  display: none !important;
}

.admin-sidebar .sidebar-brand-text {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #000000;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.admin-sidebar .sidebar-brand-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.admin-sidebar .sidebar-toggle-btn {
  background: none;
  border: none;
  color: #71717a;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: all 0.2s ease;
}

.admin-sidebar .sidebar-toggle-btn:hover {
  background: #f4f4f5;
  color: #000000;
}

.admin-sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding-bottom: 14px;
}

.admin-sidebar.collapsed .sidebar-toggle-btn {
  margin-left: 0;
}

.admin-sidebar .nav-category {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a1a1aa;
  padding: 16px 10px 4px;
}

.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #52525b;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.18s ease;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
  text-decoration: none !important;
  position: relative;
}

.admin-sidebar.collapsed a {
  justify-content: center;
  padding: 12px 0;
}

.admin-sidebar a .material-icons {
  font-size: 21px;
  flex-shrink: 0;
  color: #71717a;
  transition: color 0.18s ease;
}

.admin-sidebar a:hover {
  background: #f4f4f5;
  color: #000000;
}

.admin-sidebar a:hover .material-icons {
  color: #000000;
}

.admin-sidebar a.active {
  background: #000000;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.admin-sidebar a.active .material-icons {
  color: #ffffff;
}

/* Tooltips when Collapsed */
.admin-sidebar.collapsed a[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #000000;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.admin-sidebar a.logout-link:hover {
  background: #fee2e2;
  color: #991b1b;
}

.admin-sidebar a.logout-link:hover .material-icons {
  color: #991b1b;
}

/* ── Main Canvas ── */
.admin-main {
  flex: 1;
  min-width: 0;
  padding: 36px 48px;
  overflow-y: auto;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 32px;
}

.page-head .eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #71717a;
  margin-bottom: 4px;
}

.page-head h1 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
  font-size: 1.875rem;
  font-weight: 700;
  color: #000000;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0;
}

/* ── Card Containers ── */
.card, .stat-card {
  background: #ffffff !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.card:hover, .stat-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05) !important;
}

/* ── Universal Admin Table ── */
table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  background: #f4f4f5 !important;
  color: #000000 !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  padding: 0.75rem 1rem !important;
  border-bottom: 1px solid #e4e4e7 !important;
}

table td {
  padding: 0.75rem 1rem !important;
  font-size: 0.9375rem !important;
  color: #27272a !important;
  border-bottom: 1px solid #f4f4f5 !important;
  vertical-align: middle !important;
}

table tr:hover td {
  background: #fafafa !important;
}

/* ── Action Buttons & Badges ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #000000;
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 9999px;
  border: 1px solid #000000;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.18s ease;
}

.btn:hover {
  background: #27272a;
  border-color: #27272a;
  transform: translateY(-1px);
}

.btn-outline {
  background: #ffffff;
  color: #000000;
  border: 1px solid #e4e4e7;
}

.btn-outline:hover {
  background: #f4f4f5;
  border-color: #000000;
}

/* ═══ Color Utilities ════════════════════════════════════════════════════════ */
.text-emerald  { color: var(--emerald); }
.text-muted    { color: var(--subtext); }
.text-danger   { color: var(--danger); }
.bg-emerald-lt { background: var(--emerald-light); }

/* ═══ Responsive ═════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { width: 72px; }
  .sidebar .logo-text,
  .sidebar .nav a span:last-child,
  .nav-section-label { display: none; }
  .sidebar .nav a { justify-content: center; padding: 12px; }
  .sidebar .logo  { justify-content: center; padding: 18px 10px; }
  .menu-btn { display: none; }

  .content { padding: 16px; gap: 16px; }
  .admin-main { padding: 16px; }

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

  table { font-size: 13px; min-width: auto !important; }
  thead th, tbody td { padding: 12px 16px; }

  /* Card table responsive */
  table thead { display: none; }
  table tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
  }
  table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
  }
  table tbody td:last-child { border-bottom: none; }
  table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--subtext);
    margin-right: 12px;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .welcome-header h1 { font-size: 20px; }
}

/* ═══ Micro-Animations ════════════════════════════════════════════════════════ */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card, .stat-card {
  animation: fadeSlideUp 0.3s var(--ease) both;
}

/* Staggered animation for stat cards */
.stats-row .stat-card:nth-child(1) { animation-delay: 0.05s; }
.stats-row .stat-card:nth-child(2) { animation-delay: 0.10s; }
.stats-row .stat-card:nth-child(3) { animation-delay: 0.15s; }
.stats-row .stat-card:nth-child(4) { animation-delay: 0.20s; }

/* Button pulse for primary CTAs */
@keyframes pulseBorder {
  0%, 100% { box-shadow: 0 1px 4px rgba(16,185,129,0.25); }
  50%       { box-shadow: 0 0 0 4px rgba(16,185,129,0.12), 0 1px 4px rgba(16,185,129,0.25); }
}

/* ═══ Scrollbar Utilities ════════════════════════════════════════════════════ */
.scrollable {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.scrollable::-webkit-scrollbar { width: 4px; }
.scrollable::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ═══ Authentication Pages ══════════════════════════════════════════════════ */
.auth-page {
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  position: relative;
}

.auth-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  z-index: 1;
}

.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
  animation: fade-in-up 0.5s ease-out;
}

.auth-brand img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.auth-brand img:hover {
  transform: scale(1.03);
}

.auth-brand h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.auth-brand p {
  color: var(--subtext);
  font-size: 0.95rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  box-shadow: var(--shadow-sm);
  animation: fade-in-up 0.6s ease-out 0.1s both;
  position: relative;
}

.auth-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.auth-card > p {
  color: var(--subtext);
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-card label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.4rem;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus,
.auth-card input[type="text"]:focus {
  outline: none;
  border-color: var(--text);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.auth-card .btn {
  background: var(--text);
  color: var(--bg-card);
  border: none;
  padding: 0.85rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
  box-shadow: var(--shadow-xs);
}

.auth-card .btn:hover {
  background: #333333;
  transform: translateY(-1px);
}

.auth-card .btn:active {
  transform: translateY(0);
}

.auth-card .btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.auth-card .back-link,
.auth-card .forgot-link {
  color: var(--subtext) !important;
  font-size: 0.85rem;
  text-decoration: none !important;
  transition: color 0.2s;
  display: inline-block;
  font-weight: 500;
}

.auth-card .forgot-link {
  margin-top: 15px;
}

.auth-card .back-link {
  margin-bottom: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.auth-card .back-link::before {
  content: "←";
}

.auth-card .back-link:hover,
.auth-card .forgot-link:hover {
  color: var(--text) !important;
}

.auth-page .alert.error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #e11d48;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}
