/* ===== CSS VARIABLES ===== */
:root {
  /* Balance Due Brand Colors */
  --primary: #2e7dba;
  --primary-dark: #1f6096;
  --primary-light: #eff7ff;
  --success: #0e9f6e;
  --success-light: #ecfdf5;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #c7151c;
  --danger-light: #fff0f0;
  --info: #0891b2;
  --info-light: #ecfeff;
  --bd-red: #c7151c;

  --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-bg: #1a2433;
  --sidebar-hover: rgba(255,255,255,0.07);
  --sidebar-active-bg: rgba(46,125,186,0.2);
  --sidebar-active-border: #2e7dba;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-width: 256px;
  --header-height: 64px;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

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

ul { list-style: none; }

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

/* ===== LOGIN PAGE ===== */
#login-screen,
#request-screen,
#setup-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a2433 0%, #1f3a5f 50%, #2e7dba 100%);
  padding: 1rem;
}

.login-box {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .logo-icon {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.login-logo .logo-icon svg { width: 36px; height: 36px; fill: #fff; }

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

.login-logo p {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.login-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}

.login-error.show { display: block; }

.login-demo {
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.login-demo strong { color: var(--gray-800); }

/* ===== APP LAYOUT ===== */
#app-screen {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
#sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

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

.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand .brand-icon svg { width: 20px; height: 20px; fill: #fff; }

.sidebar-brand .brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sidebar-brand .brand-sub {
  font-size: 0.7rem;
  color: var(--sidebar-text);
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  flex: 1;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-600);
  padding: 0.75rem 0.5rem 0.4rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-left: 3px solid transparent;
  margin-bottom: 2px;
}

.nav-item svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  border-left-color: var(--sidebar-active-border);
}

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

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.user-info { flex: 1; min-width: 0; }

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: var(--sidebar-text);
  text-transform: capitalize;
}

.btn-logout {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  transition: color 0.15s;
}

.btn-logout:hover { color: var(--danger); }
.btn-logout svg { width: 18px; height: 18px; fill: currentColor; }

/* Sidebar overlay (mobile) */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}

/* ===== MAIN CONTENT ===== */
#main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== HEADER ===== */
#app-header {
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
}

.hamburger:hover { background: var(--gray-100); }
.hamburger svg { width: 22px; height: 22px; fill: currentColor; display: block; }

#breadcrumb {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-700);
  flex: 1;
}

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

/* ===== PAGE CONTENT ===== */
#page-content {
  padding: 1.75rem;
  flex: 1;
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-header-left {}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.page-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg { width: 26px; height: 26px; fill: currentColor; }

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

/* ===== CARDS ===== */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  margin-bottom: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.card-body { padding: 1.25rem; }

/* ===== LEAVE BALANCE CARDS ===== */
.balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.balance-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.balance-card.annual::before { background: var(--primary); }
.balance-card.sick::before { background: var(--danger); }
.balance-card.family::before { background: var(--success); }
.balance-card.study::before { background: var(--warning); }
.balance-card.maternity::before { background: #8b5cf6; }

.balance-days {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.balance-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 500;
}

.balance-unit {
  font-size: 0.7rem;
  color: var(--gray-400);
}

/* ===== TABLES ===== */
.table-responsive { overflow-x: auto; }

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

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

.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--gray-50); }

.table .text-center { text-align: center; }

.table-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ===== FILTERS / TOOLBAR ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.search-input {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: #fff;
  color: var(--gray-800);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.1rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.4rem;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  display: block;
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--gray-800);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.form-control:disabled {
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
}

.form-control.is-invalid { border-color: var(--danger); }

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.3rem;
  display: none;
}

.form-error.show { display: block; }

.form-hint {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: 0.3rem;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 1rem;
  margin-top: 1.25rem;
}

/* File upload */
.file-upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--gray-50);
}

.file-upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.file-upload-area svg { width: 32px; height: 32px; fill: var(--gray-400); margin: 0 auto 0.5rem; }
.file-upload-area p { font-size: 0.875rem; color: var(--gray-500); }
.file-upload-area span { font-size: 0.75rem; color: var(--gray-400); }
.file-upload-area input[type="file"] { display: none; }

.file-list { margin-top: 0.75rem; }

.file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--gray-700);
  margin-bottom: 0.3rem;
}

.file-item svg { width: 16px; height: 16px; fill: var(--primary); flex-shrink: 0; }
.file-item .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .file-size { color: var(--gray-400); flex-shrink: 0; }
.file-item .remove-file { cursor: pointer; color: var(--gray-400); flex-shrink: 0; }
.file-item .remove-file:hover { color: var(--danger); }
.file-item .remove-file svg { fill: currentColor; }

/* Days counter */
.days-counter {
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--primary-dark);
  display: none;
}

.days-counter.show { display: block; }
.days-counter strong { font-size: 1.1rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(26,86,219,0.2); }

.btn svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #0b7a56; border-color: #0b7a56; }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #b45309; border-color: #b45309; }

.btn-outline {
  background: transparent;
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn-outline:hover { background: var(--gray-100); }

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover { background: var(--primary-light); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

.btn-block { width: 100%; justify-content: center; }

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

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger  { background: var(--danger-light); color: #991b1b; }
.badge-info    { background: var(--info-light); color: #164e63; }
.badge-gray    { background: var(--gray-100); color: var(--gray-600); }

/* ===== MODAL ===== */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}

#modal-overlay.active { display: flex; }

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  position: relative;
  margin: auto;
}

.modal-sm { max-width: 420px; }
.modal-lg { max-width: 780px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  display: flex;
}

.modal-close:hover { color: var(--gray-700); background: var(--gray-100); }
.modal-close svg { width: 20px; height: 20px; fill: currentColor; }

.modal-body { padding: 1.5rem; max-height: 65vh; overflow-y: auto; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  flex-wrap: wrap;
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--gray-900);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #065f46; border-left: 4px solid var(--success); }
.toast-error   { background: #991b1b; border-left: 4px solid var(--danger); }
.toast-warning { background: #92400e; border-left: 4px solid var(--warning); }
.toast-info    { background: #164e63; border-left: 4px solid var(--info); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  fill: var(--gray-300);
  margin: 0 auto 1rem;
}

.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--gray-600); margin-bottom: 0.25rem; }
.empty-state p  { font-size: 0.875rem; }

/* ===== DETAIL VIEW ===== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-item {}
.detail-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 0.25rem;
}
.detail-item .detail-value {
  font-size: 0.9rem;
  color: var(--gray-800);
  font-weight: 500;
}

.detail-reason {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--gray-700);
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Alert/Info box */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  line-height: 1.5;
}

.alert svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; margin-top: 1px; }

.alert-info    { background: var(--info-light);    color: #164e63; border: 1px solid #a5f3fc; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #6ee7b7; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-danger  { background: var(--danger-light);  color: #991b1b; border: 1px solid #fca5a5; }

/* ===== LEAVE STATUS BANNERS ===== */
.leave-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  border: 1px solid transparent;
  font-size: 0.875rem;
  line-height: 1.5;
}
.leave-banner-icon { flex-shrink: 0; margin-top: 1px; }
.leave-banner-body { flex: 1; min-width: 0; }
.leave-banner-title { font-weight: 500; }
.leave-banner-sub   { font-size: 0.8rem; margin-top: 0.15rem; opacity: 0.85; }
.leave-banner-close {
  background: none; border: none; cursor: pointer;
  padding: 0.2rem; border-radius: 4px;
  opacity: 0.6; display: flex; align-items: center;
  transition: opacity 0.15s;
}
.leave-banner-close:hover { opacity: 1; }

.leave-banner-pending  { background: var(--warning-light); color: #92400e; border-color: #fcd34d; }
.leave-banner-approved { background: var(--success-light); color: #065f46; border-color: #6ee7b7; }
.leave-banner-rejected { background: var(--danger-light);  color: #991b1b; border-color: #fca5a5; }

.leave-banner-pending  .leave-banner-close { color: #92400e; }
.leave-banner-approved .leave-banner-close { color: #065f46; }
.leave-banner-rejected .leave-banner-close { color: #991b1b; }

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

/* ── Trophy card animations ───────────────────────── */
@keyframes goldShimmer {
  0%        { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
  100%      { background-position: 0% 50%; }
}
@keyframes shimmerSweep {
  0%        { transform: translateX(-150%); }
  60%, 100% { transform: translateX(250%); }
}
@keyframes floatStar {
  0%, 100%  { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-5px) scale(1.15); }
}
@keyframes pulseBar {
  0%, 100%  { opacity: 1; box-shadow: 0 0 10px rgba(255,255,255,.6); }
  50%       { opacity: .8; box-shadow: 0 0 22px rgba(255,255,255,1); }
}
@keyframes pulseRedGlow {
  0%, 100%  { box-shadow: 0 0 0 0 rgba(199,21,28,0), 0 1px 3px rgba(0,0,0,.08); border-color: var(--danger); }
  50%       { box-shadow: 0 0 0 6px rgba(199,21,28,.15), 0 4px 18px rgba(199,21,28,.25); border-color: var(--danger); }
}
@keyframes pulseRedBar {
  0%, 100%  { opacity: 1; }
  50%       { opacity: .55; }
}
@keyframes pulseRedText {
  0%, 100%  { opacity: 1; transform: scale(1); }
  50%       { opacity: .65; transform: scale(1.06); }
}
@keyframes pulseRedBadge {
  0%, 100%  { background:#fef2f2; color:#991b1b; box-shadow: 0 0 0 0 rgba(199,21,28,0); }
  50%       { background:#ffd9d9; color:#7f1d1d; box-shadow: 0 0 0 5px rgba(199,21,28,.18); }
}

/* ===== REPORTS ===== */
.report-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  font-size: 0.875rem;
}

.report-bar-label { width: 140px; color: var(--gray-700); flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-bar-track { flex: 1; height: 10px; background: var(--gray-200); border-radius: 5px; overflow: hidden; }
.report-bar-fill { height: 100%; border-radius: 5px; background: var(--primary); transition: width 0.6s ease; }
.report-bar-value { width: 30px; text-align: right; color: var(--gray-500); flex-shrink: 0; }

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.25rem;
}

.tab-btn {
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover { color: var(--gray-800); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== PROFILE ===== */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.profile-name { font-size: 1.3rem; font-weight: 700; color: var(--gray-900); }

.name-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-align: left;
}
.name-link:hover { text-decoration: underline; }
.profile-role { font-size: 0.875rem; color: var(--gray-500); }
.profile-dept { font-size: 0.85rem; color: var(--gray-600); margin-top: 0.2rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #sidebar-overlay.show {
    display: block;
  }

  .hamburger {
    display: flex;
  }

  #main-wrapper {
    margin-left: 0;
  }

  #page-content {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table { font-size: 0.8rem; }
  .table th, .table td { padding: 0.65rem 0.75rem; }

  .modal { margin: 0.5rem; }
  .modal-body { max-height: 55vh; }

  #toast-container { left: 1rem; right: 1rem; bottom: 1rem; }
  .toast { max-width: 100%; }

  .balance-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .balance-grid { grid-template-columns: repeat(2, 1fr); }
  .login-box { padding: 1.75rem 1.25rem; }
}

/* ===== UTILITIES ===== */
.text-muted  { color: var(--gray-500); }
.text-small  { font-size: 0.8rem; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.fw-600 { font-weight: 600; }
.hidden { display: none !important; }
