/* ============================================================
   American Councils – Vacation Tracker
   Sophisticated · Motion · Elegant
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --primary: #0a4d8c;
  --primary-dark: #063566;
  --primary-mid: #1565a8;
  --primary-light: #eaf3fb;
  --accent: #1a7fd4;
  --success: #0d7a45;
  --warning: #b86e00;
  --danger: #c0392b;
  --bg: #f0f4f8;
  --card: #ffffff;
  --text: #0f1c2e;
  --text-muted: #5a6b7d;
  --border: #d4deea;
  --shadow: 0 4px 24px rgba(10, 40, 80, 0.06);
  --shadow-lg: 0 16px 48px rgba(10, 40, 80, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Instrument Serif', Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --glass: rgba(255, 255, 255, 0.72);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes floatSlow {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(8px, -10px); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulseSoft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(10, 77, 140, 0.25); }
  50% { box-shadow: 0 0 0 12px rgba(10, 77, 140, 0); }
}
@keyframes countPop {
  0% { transform: scale(0.7); opacity: 0; }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes confettiFall {
  to { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #042a54 0%, #0a4d8c 40%, #1565a8 70%, #1a7fd4 100%);
  background-size: 200% 200%;
  animation: gradientShift 14s ease infinite;
}
.login-page::before,
.login-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.login-page::before {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 68%);
  top: -140px; right: -100px;
  animation: float 8s ease-in-out infinite;
}
.login-page::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  bottom: -100px; left: -80px;
  animation: floatSlow 11s ease-in-out infinite;
}
.login-card {
  position: relative;
  z-index: 2;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 24px;
  padding: 40px 42px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 32px 64px rgba(0,20,50,0.28), inset 0 1px 0 rgba(255,255,255,0.6);
  animation: scaleIn 0.6s var(--ease) both;
}
.login-logo { text-align: center; margin-bottom: 18px; }
.logo-img {
  max-width: 280px; height: auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15)) contrast(1.05) saturate(1.1);
  animation: float 5s ease-in-out infinite;
  background: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--primary-dark);
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.login-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.company-line {
  text-align: center;
  font-size: 0.72rem;
  color: #7a8fa3;
  margin: 6px 0 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.mode-hint { text-align: center; margin-top: 18px; font-size: 0.78rem; color: #8a9aab; }
.feature-pills {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-top: 18px; margin-bottom: 8px;
}
.feature-pill {
  background: rgba(10, 77, 140, 0.08);
  color: var(--primary);
  font-size: 0.72rem; font-weight: 600;
  padding: 5px 11px; border-radius: 20px;
  border: 1px solid rgba(10, 77, 140, 0.12);
  transition: transform 0.2s var(--ease), background 0.2s;
}
.feature-pill:hover {
  transform: translateY(-2px);
  background: rgba(10, 77, 140, 0.14);
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 0.8rem; font-weight: 600;
  margin-bottom: 6px; color: var(--text); letter-spacing: 0.01em;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.94rem; font-family: var(--font);
  background: #fff; color: var(--text);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.form-group input:hover, .form-group select:hover { border-color: #b8c9db; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(10, 77, 140, 0.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; font-family: var(--font);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s, border-color 0.2s;
  position: relative; overflow: hidden;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: white; width: 100%;
  box-shadow: 0 4px 14px rgba(10, 77, 140, 0.28);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(10, 77, 140, 0.35);
}
.btn-primary:active { transform: translateY(0); }
.btn-success {
  background: linear-gradient(135deg, #0d7a45, #119956);
  color: white; box-shadow: 0 3px 10px rgba(13, 122, 69, 0.25);
}
.btn-success:hover { transform: translateY(-1px); }
.btn-danger {
  background: linear-gradient(135deg, #c0392b, #e74c3c); color: white;
}
.btn-danger:hover { transform: translateY(-1px); }
.btn-outline {
  background: transparent; border: 1.5px solid var(--border); color: var(--text);
}
.btn-outline:hover {
  background: var(--primary-light); border-color: var(--primary);
  color: var(--primary); transform: translateY(-1px);
}
.btn-sm { padding: 7px 13px; font-size: 0.8rem; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.error-msg {
  background: #fef2f1; color: var(--danger); padding: 11px 14px;
  border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 14px;
  display: none; border: 1px solid rgba(192, 57, 43, 0.15);
  animation: slideDown 0.3s var(--ease);
}
.error-msg.show { display: block; }
.success-msg {
  background: #ecf8f1; color: var(--success); padding: 11px 14px;
  border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 14px;
  border: 1px solid rgba(13, 122, 69, 0.15);
}

.app { display: none; min-height: 100vh; flex-direction: column; }
.app.active { display: flex; animation: fadeIn 0.35s var(--ease); }

.header {
  background: linear-gradient(105deg, #042a54 0%, #0a4d8c 45%, #0d5a9e 100%);
  color: white; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  box-shadow: 0 4px 24px rgba(4, 30, 60, 0.2);
  position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.header-logo {
  height: 42px; width: auto;
  background: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  object-fit: contain;
}
.header-title {
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 400;
  letter-spacing: -0.01em;
}
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-info {
  font-size: 0.85rem; font-weight: 500; opacity: 0.95;
  padding: 6px 12px; background: rgba(255,255,255,0.1);
  border-radius: 20px; border: 1px solid rgba(255,255,255,0.15);
}
.live-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  color: white; padding: 6px 12px; border-radius: 20px;
  font-size: 0.78rem; font-weight: 500;
}
.lang-toggle, .dark-toggle, .btn-logout {
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
  color: white; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  font-size: 0.82rem; font-weight: 600; font-family: var(--font);
  transition: background 0.2s, transform 0.2s var(--ease);
}
.lang-toggle:hover, .dark-toggle:hover, .btn-logout:hover {
  background: rgba(255,255,255,0.22); transform: translateY(-1px);
}

.tabs {
  display: flex; gap: 4px; padding: 12px 20px 0; background: var(--bg);
  overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: thin;
}
.tab {
  padding: 11px 16px; font-size: 0.86rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2.5px solid transparent; white-space: nowrap;
  transition: color 0.2s, border-color 0.25s var(--ease), background 0.2s;
  border-radius: 8px 8px 0 0;
}
.tab:hover { color: var(--primary); background: rgba(10, 77, 140, 0.04); }
.tab.active {
  color: var(--primary); border-bottom-color: var(--primary);
  background: rgba(10, 77, 140, 0.06);
}

.main {
  flex: 1; padding: 22px 24px 40px; max-width: 1280px; width: 100%;
  margin: 0 auto; animation: fadeUp 0.4s var(--ease) both;
}

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); border: 1px solid rgba(212, 222, 234, 0.8);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  animation: fadeUp 0.45s var(--ease) both;
}
.stat-card:nth-child(1) { animation-delay: 0.04s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.16s; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-card .label {
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px;
}
.stat-card .value {
  font-size: 1.75rem; font-weight: 700; color: var(--primary);
  letter-spacing: -0.02em; animation: countPop 0.5s var(--ease) both;
}
.stat-card .value.warning { color: var(--warning); }
.stat-card .value.danger { color: var(--danger); }

.table-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid rgba(212, 222, 234, 0.8); overflow: hidden; margin-bottom: 18px;
  animation: fadeUp 0.5s var(--ease) both;
  transition: box-shadow 0.3s var(--ease);
}
.table-card:hover { box-shadow: 0 8px 32px rgba(10, 40, 80, 0.08); }
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fafcfe 0%, #f5f8fb 100%);
  gap: 12px; flex-wrap: wrap;
}
.table-header h2 {
  font-size: 1.05rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em;
}
.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 12px 16px; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--primary);
  background: var(--primary-light); border-bottom: 1px solid var(--border); white-space: nowrap;
}
td {
  padding: 13px 16px; font-size: 0.9rem; border-bottom: 1px solid #eef2f7; vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.2s; }
tbody tr:hover td { background: rgba(10, 77, 140, 0.03); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 20px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
}
.badge-approved { background: #e6f7ed; color: var(--success); }
.badge-pending { background: #fff6e5; color: var(--warning); }
.badge-rejected { background: #fdecea; color: var(--danger); }
.badge-critical { background: #fce8e6; color: #a93226; }
.badge-info { background: var(--primary-light); color: var(--primary); }

.greet-banner {
  background: linear-gradient(120deg, #042a54 0%, #0a4d8c 50%, #1565a8 100%);
  background-size: 150% 150%;
  animation: gradientShift 12s ease infinite, fadeUp 0.4s var(--ease) both;
  color: white; border-radius: var(--radius); padding: 22px 26px;
  margin-bottom: 20px; display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 14px;
  box-shadow: 0 12px 32px rgba(10, 50, 100, 0.22);
  position: relative; overflow: hidden;
}
.greet-banner::before {
  content: ''; position: absolute; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  top: -60px; right: 10%; animation: float 7s ease-in-out infinite; pointer-events: none;
}
.greet-banner h2 {
  font-family: var(--font-display); font-size: 1.45rem; font-weight: 400;
  margin-bottom: 4px; position: relative;
}
.greet-banner p { font-size: 0.88rem; opacity: 0.88; position: relative; }

.balance-big {
  font-size: 2.8rem; font-weight: 700; color: var(--primary);
  letter-spacing: -0.03em; animation: countPop 0.55s var(--ease) both;
}
.balance-big.low { color: var(--warning); }
.balance-big.negative { color: var(--danger); }

.ring-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 28px; flex-wrap: wrap; padding: 16px 0;
}
.ring {
  width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center;
  position: relative;
  background: conic-gradient(var(--primary) calc(var(--pct) * 1%), #e4ebf3 0);
  box-shadow: 0 0 0 6px rgba(10, 77, 140, 0.06);
  animation: scaleIn 0.5s var(--ease) both;
}
.ring::before {
  content: ''; position: absolute; inset: 11px; background: white; border-radius: 50%;
}
.ring-inner { position: relative; z-index: 1; text-align: center; }
.ring-inner strong { display: block; font-size: 1.4rem; color: var(--primary); font-weight: 700; }
.ring-inner span {
  font-size: 0.7rem; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}

.calendar-grid { padding: 12px 16px 8px; }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px;
}
.cal-weekdays div {
  text-align: center; font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 0;
}
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-day {
  min-height: 72px; background: #f7fafc; border-radius: 10px; padding: 6px 8px;
  font-size: 0.78rem; border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s;
}
.cal-day:not(.empty):hover {
  transform: scale(1.04); box-shadow: 0 4px 14px rgba(10, 40, 80, 0.1);
  z-index: 2; border-color: var(--border);
}
.cal-day.empty { background: transparent; }
.cal-day.today { border: 2px solid var(--primary); background: var(--primary-light); }
.cal-day.holiday { background: #fef6e8; }
.cal-day.has-leave { background: #dbeafe; }
.cal-day.heat1 { background: #dbeafe !important; }
.cal-day.heat2 { background: #93c5fd !important; }
.cal-day.heat3 { background: #3b82f6 !important; color: #fff; }
.cal-day.heat3 .cal-num, .cal-day.heat3 .cal-leave { color: #fff; }
.cal-num { font-weight: 700; font-size: 0.85rem; display: block; margin-bottom: 2px; }
.cal-leave {
  font-size: 0.65rem; line-height: 1.25; opacity: 0.9; display: block;
  overflow: hidden; text-overflow: ellipsis;
}

.rule-box {
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.88rem;
  margin: 10px 0; animation: slideDown 0.3s var(--ease);
}
.rule-box.ok {
  background: #ecf8f1; color: var(--success);
  border: 1px solid rgba(13, 122, 69, 0.18);
}
.rule-box.bad {
  background: #fef6e8; color: #8a5a00;
  border: 1px solid rgba(184, 110, 0, 0.2);
}
.note-item {
  padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.88rem;
  transition: background 0.15s;
}
.note-item:hover { background: rgba(10, 77, 140, 0.03); }
.section-title {
  font-size: 0.95rem; font-weight: 700; margin: 16px 0 10px;
  color: var(--text); letter-spacing: -0.01em;
}
.cost-highlight { color: var(--primary); font-weight: 700; font-size: 1.05em; }

.file-upload {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 22px; text-align: center; cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.2s;
  background: #fafcfe; position: relative;
}
.file-upload:hover, .file-upload.dragover {
  border-color: var(--primary); background: var(--primary-light); transform: scale(1.01);
}
.file-upload input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.file-upload p { font-size: 0.88rem; color: var(--text-muted); font-weight: 500; }
.file-name { margin-top: 8px; font-size: 0.85rem; color: var(--primary); font-weight: 600; }

.bulk-bal-area {
  width: 100%; min-height: 120px;
  font-family: ui-monospace, monospace; font-size: 0.84rem;
  padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  resize: vertical;
}
.bulk-bal-area:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(10, 77, 140, 0.1);
}

.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(8, 20, 40, 0.45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 1000; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.25s var(--ease);
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--card); border-radius: 20px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 20, 50, 0.25);
  animation: scaleIn 0.35s var(--ease) both;
  border: 1px solid rgba(255,255,255,0.5);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fafcfe, #f5f8fb);
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.modal-close {
  background: none; border: none; font-size: 1.4rem; cursor: pointer;
  color: var(--text-muted); line-height: 1; padding: 4px 8px; border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px 22px; }
.modal-footer {
  padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid var(--border); background: #fafcfe;
}

.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: var(--text); color: white; padding: 14px 22px;
  border-radius: 12px; font-size: 0.9rem; font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,0.2); z-index: 2000;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none; max-width: 360px;
}
.toast.show { opacity: 1; transform: translateY(0); }

.confetti-burst { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.confetti-piece {
  position: absolute; width: 8px; height: 8px; top: -12px;
  animation: confettiFall 2.4s ease-in forwards;
}

body.dark {
  --bg: #0b1219; --card: #151e2a; --text: #e8eef5; --text-muted: #8b9aab;
  --border: #243040; --primary-light: #1a2f45;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.45);
  --glass: rgba(21, 30, 42, 0.85);
}
body.dark .header {
  background: linear-gradient(105deg, #061018 0%, #0a1628 50%, #0d2137 100%);
}
body.dark th { background: #1a2f45; color: #7eb8e8; }
body.dark .cal-day { background: #1a2332; }
body.dark .cal-day.today { background: #1a2f45; }
body.dark .login-card { color: var(--text); }
body.dark .ring::before { background: var(--card); }
body.dark .table-header, body.dark .modal-header, body.dark .modal-footer { background: #121a26; }
body.dark td { border-bottom-color: #1e2a38; }
body.dark .file-upload { background: #121a26; }
body.dark .greet-banner {
  background: linear-gradient(120deg, #061018, #0a1628, #0d2137);
}

code {
  background: var(--primary-light); padding: 2px 7px; border-radius: 5px;
  font-size: 0.85em; font-family: ui-monospace, monospace;
}
a { color: var(--primary); transition: color 0.15s; }
a:hover { color: var(--accent); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5d0dc; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #a8b8c8; }
body.dark ::-webkit-scrollbar-thumb { background: #3a4a5c; }

.main > .table-card:nth-child(1) { animation-delay: 0.05s; }
.main > .table-card:nth-child(2) { animation-delay: 0.1s; }
.main > .table-card:nth-child(3) { animation-delay: 0.15s; }
.main > .table-card:nth-child(4) { animation-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   v2 — components for new features + previously unstyled classes
   ============================================================ */
:root { --amber: #e09a1a; --amber-bg: #fff6e5; --ok-bg: #ecf8f1; --row-alt: #f7fafc; --wk: #f3f6fa; --hol: #fff3dc; }
body.dark { --amber: #f5b94a; --amber-bg: #3a2c12; --ok-bg: #13301f; --row-alt: #182230; --wk: #18212d; --hol: #3a2f18; }

/* Previously unstyled */
.dashboard-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
@media (max-width: 960px) { .dashboard-grid { grid-template-columns: 1fr; } }
.warning-item { padding: 9px 12px; border-radius: 8px; font-size: 0.86rem; margin-bottom: 6px; background: var(--row-alt); border-left: 3px solid var(--amber); }
.warning-item a { font-weight: 600; margin-left: 4px; }
.search-input { padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px; font: inherit; font-size: 0.85rem; background: var(--card); color: var(--text); min-width: 0; }
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,77,140,0.12); }
.checklist-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
td.actions { white-space: nowrap; }
td.actions .btn { margin: 2px 0; }
.mode-badge { display: inline-block; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.25); }
.header h1 { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; line-height: 1.1; }
.badge-muted { background: var(--row-alt); color: var(--text-muted); }
.print-area { display: none; }
@media print {
  body:has(.print-area[style*="block"]) > *:not(.print-area) { display: none !important; }
  .print-area { background: #fff; color: #000; }
}
.form-group input, .form-group select, .form-group textarea { background: var(--card); }

/* Tabs as real buttons (keyboard-accessible) */
button.tab { background: none; border: none; border-bottom: 2.5px solid transparent; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; }
button.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tab.active { border-bottom-color: var(--primary); }
.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 700; vertical-align: middle; }
.tab-badge.warn { background: var(--amber); }
.tab-search { margin-left: auto; }
kbd { font-family: ui-monospace, monospace; font-size: 0.72rem; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--card); color: var(--text-muted); }

/* Small helpers */
.muted-line { color: var(--text-muted); font-size: 0.82rem; font-weight: 400; }
.stat-sub { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; margin-left: 6px; }
.mood-note { margin-top: 8px; background: rgba(255,255,255,0.14); padding: 6px 12px; border-radius: 8px; display: inline-block; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-weight: 700; font-size: 0.95rem; flex-shrink: 0; }
.avatar.xs { width: 28px; height: 28px; font-size: 0.68rem; }
.who { display: flex; align-items: center; gap: 10px; }
.who small, .tl-who small { display: block; color: var(--text-muted); font-size: 0.75rem; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state div { font-size: 2.2rem; margin-bottom: 6px; }
.req-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; max-width: 260px; }

/* My Leave */
.hero-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius); margin-bottom: 18px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); animation: fadeUp 0.45s var(--ease) both; flex-wrap: wrap; }
.hero-card.ok { background: var(--ok-bg); border-color: rgba(13,122,69,0.25); }
.hero-card.info { background: var(--primary-light); border-color: rgba(10,77,140,0.2); }
.hero-card.warn { background: var(--amber-bg); border-color: rgba(184,110,0,0.25); }
.hero-icon { font-size: 2rem; }
.hero-text { flex: 1; min-width: 200px; }
.hero-title { font-size: 1.1rem; font-weight: 700; }
.hero-sub { color: var(--text-muted); font-size: 0.9rem; margin-top: 2px; }
.year-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 18px; }
.year-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: grid; grid-template-columns: auto 1fr; grid-template-areas: "head head" "ring meta" "pill pill"; gap: 12px 18px; align-items: center; }
.year-card.current { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,77,140,0.08), var(--shadow); }
.year-card-head { grid-area: head; display: flex; justify-content: space-between; align-items: center; }
.year-card .ring { grid-area: ring; }
.year-card .pill { grid-area: pill; }
.ring.sm { width: 92px; height: 92px; }
.ring.sm::before { inset: 9px; }
.ring.sm .ring-inner strong { font-size: 1.25rem; }
.year-meta { grid-area: meta; display: grid; gap: 6px; }
.year-meta div { display: flex; justify-content: space-between; font-size: 0.86rem; border-bottom: 1px dashed var(--border); padding-bottom: 4px; }
.year-meta span { color: var(--text-muted); }
.pill { font-size: 0.8rem; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.pill.ok { background: var(--ok-bg); color: var(--success); }
.pill.warn { background: var(--amber-bg); color: var(--warning); }

/* Request form: two columns with a live summary */
.req-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.req-aside { position: sticky; top: 84px; }
@media (max-width: 980px) { .req-layout { grid-template-columns: 1fr; } .req-aside { position: static; order: -1; } }
.req-summary { padding: 16px 18px; font-size: 0.88rem; }
.sum-empty { color: var(--text-muted); padding: 6px 0 12px; line-height: 1.5; }
.sum-big { font-size: 1rem; color: var(--text-muted); }
.sum-big strong { font-size: 2.2rem; color: var(--primary); font-weight: 800; letter-spacing: -0.03em; margin-right: 4px; }
.sum-dates { font-weight: 600; margin: 4px 0 12px; line-height: 1.5; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.sum-row span { color: var(--text-muted); }
.sum-row strong { text-align: right; }
.sum-gift { background: var(--ok-bg); color: var(--success); border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 0.84rem; }
.sum-note { font-size: 0.78rem; color: var(--text-muted); margin: -2px 0 6px; }
.sum-note.warn { color: var(--danger, #c62828); }
.accrual-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.sum-balance { margin: 8px 0; }
.sum-balance small { color: var(--text-muted); }
.sum-bar { height: 8px; border-radius: 6px; background: var(--row-alt); overflow: hidden; margin: 6px 0 4px; }
.sum-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 6px; transition: width 0.4s var(--ease); }
.sum-bar i.neg, b.neg, strong.neg { background: var(--danger); color: var(--danger); }
b.neg, strong.neg { background: none; }
.sum-checks { display: grid; gap: 6px; margin-top: 10px; font-size: 0.84rem; font-weight: 600; }
.sum-checks .ok { color: var(--success); }
.sum-checks .warn { color: var(--warning); }

/* Smart date suggestions */
.suggest-box { padding: 14px 18px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--primary-light), transparent); animation: slideDown 0.3s var(--ease); }
.suggest-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 0.9rem; }
.suggest-head small { display: block; color: var(--text-muted); font-size: 0.78rem; }
.suggest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.suggest-card { text-align: left; background: var(--card); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; font: inherit; color: var(--text); transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s; }
.suggest-card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow-lg); }
.suggest-card.picked { border-color: var(--success); box-shadow: 0 0 0 3px rgba(13,122,69,0.15); }
.suggest-rank { font-size: 1.3rem; }
.suggest-dates { font-weight: 700; margin: 4px 0 8px; }
.suggest-meta { display: grid; gap: 3px; font-size: 0.78rem; color: var(--text-muted); }
.suggest-meta .ok { color: var(--success); }
.suggest-meta .warn { color: var(--warning); }
.suggest-use { margin-top: 8px; font-size: 0.8rem; font-weight: 700; color: var(--primary); }

/* Review modal */
.review-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.review-name { font-weight: 700; font-size: 1.05rem; }
.review-sub { color: var(--text-muted); font-size: 0.85rem; }
.review-days { text-align: center; background: var(--primary-light); border-radius: 12px; padding: 6px 14px; }
.review-days strong { display: block; font-size: 1.5rem; color: var(--primary); line-height: 1.1; }
.review-days span { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
.review-dates, .balance-strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--row-alt); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.review-dates span, .balance-strip span { display: block; font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; letter-spacing: 0.03em; }
.review-dates .arrow, .balance-strip .arrow { color: var(--text-muted); font-size: 1.2rem; }
.balance-strip strong { font-size: 1.2rem; }
.checks { display: grid; gap: 6px; margin: 10px 0; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; padding: 7px 10px; border-radius: 8px; }
.check-row.ok { background: var(--ok-bg); color: var(--success); }
.check-row.bad { background: var(--amber-bg); color: var(--warning); }
.review-more { margin: 8px 0; font-size: 0.88rem; }
.review-more summary { cursor: pointer; font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.review-more p { margin: 4px 0; }

/* Calendar toolbar + team timeline */
.cal-toolbar .cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-title { min-width: 170px; text-align: center; text-transform: capitalize; }
.seg { display: inline-flex; border: 1.5px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg button { background: none; border: none; padding: 7px 12px; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.seg button.on { background: var(--primary); color: #fff; }
.tl-scroll { overflow-x: auto; }
.tl-grid { --name-w: 220px; min-width: calc(var(--name-w) + var(--days) * 34px); }
.tl-row { display: grid; grid-template-columns: var(--name-w) repeat(var(--days), minmax(34px, 1fr)); min-height: 44px; border-bottom: 1px solid var(--border); position: relative; }
.tl-row > * { grid-row: 1; }
.tl-name { grid-column: 1; position: sticky; left: 0; z-index: 3; background: var(--card); display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-right: 1px solid var(--border); font-size: 0.82rem; min-width: 0; }
.tl-who { min-width: 0; }
.tl-who strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crit-dot { margin-left: auto; font-size: 0.8rem; }
.tl-head { min-height: 52px; background: var(--primary-light); }
.tl-head .tl-name { background: var(--primary-light); font-weight: 700; color: var(--primary); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.05em; }
.tl-day { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.72rem; color: var(--text-muted); border-left: 1px solid transparent; position: relative; }
.tl-day strong { font-size: 0.85rem; color: var(--text); }
.tl-day.today strong { background: var(--primary); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.tl-day.bo::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--danger); }
.tl-cell { border-left: 1px solid rgba(212,222,234,0.45); }
.tl-cell.wk, .tl-day.wk, .tl-cov.wk { background: var(--wk); }
.tl-cell.hol, .tl-day.hol, .tl-cov.hol { background: var(--hol); }
.tl-cell.today { background: rgba(26,127,212,0.08); box-shadow: inset 1px 0 0 var(--accent), inset -1px 0 0 var(--accent); }
.tl-cell.bo { background-image: repeating-linear-gradient(135deg, rgba(192,57,43,0.07) 0 6px, transparent 6px 12px); }
.tl-bar { z-index: 1; align-self: center; height: 26px; margin: 0 2px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; color: #fff; overflow: hidden; white-space: nowrap; box-shadow: 0 2px 8px rgba(10,40,80,0.18); transition: transform 0.15s var(--ease), box-shadow 0.15s; }
.tl-bar[role="button"] { cursor: pointer; }
.tl-bar[role="button"]:hover, .tl-bar:focus-visible { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(10,40,80,0.28); outline: none; }
.tl-bar.approved { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.tl-bar.pending { background: repeating-linear-gradient(135deg, var(--amber) 0 8px, #f3b443 8px 16px); color: #3a2600; border: 1px dashed #a36a00; }
.tl-bar.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.tl-bar.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.tl-foot { background: var(--row-alt); min-height: 34px; }
.tl-foot .tl-name { background: var(--row-alt); font-weight: 700; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.tl-cov { display: grid; place-items: center; font-size: 0.72rem; font-weight: 700; }
.tl-cov.c1 { background: rgba(26,127,212,0.14); color: var(--primary); }
.tl-cov.c2 { background: rgba(224,154,26,0.25); color: var(--warning); }
.tl-cov.c3 { background: rgba(192,57,43,0.22); color: var(--danger); }
.tl-empty { padding: 30px; text-align: center; color: var(--text-muted); }
.tl-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 12px 16px; font-size: 0.78rem; color: var(--text-muted); }
.tl-legend .lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; border: 1px solid var(--border); }
.lg.approved { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.lg.pending { background: repeating-linear-gradient(135deg, var(--amber) 0 3px, #f3b443 3px 6px); }
.lg.wk { background: var(--wk); } .lg.hol { background: var(--hol); } .lg.bo { background: var(--danger); } .lg.c2 { background: rgba(224,154,26,0.35); }
body.dark .tl-cell { border-left-color: rgba(36,48,64,0.7); }
body.dark .cal-day.heat1, body.dark .cal-day.heat2 { color: #0f1c2e; }

/* Holidays */
.hol-form { display: grid; grid-template-columns: 170px 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 620px) { .hol-form { grid-template-columns: 1fr; } }
.hol-list { display: grid; gap: 4px; }
.hol-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; font-size: 0.88rem; }
.hol-item:nth-child(odd) { background: var(--row-alt); }
.hol-item > span:nth-child(2) { flex: 1; }
.hol-item.custom { border-left: 3px solid var(--accent); }
.hol-date { min-width: 120px; font-weight: 600; color: var(--primary); }

/* Dashboard insights */
.chart-box { position: relative; height: 260px; padding: 12px 16px; }
.radar-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.radar-row:last-child { border-bottom: none; }
.radar-main { flex: 1; min-width: 0; }
.radar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 0.84rem; flex-wrap: wrap; }
.radar-top span { color: var(--text-muted); font-size: 0.78rem; }
.radar-bar { height: 6px; border-radius: 4px; background: var(--row-alt); margin-top: 5px; overflow: hidden; }
.radar-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.radar-bar i.warm { background: var(--amber); }
.radar-bar i.hot { background: var(--danger); }

/* Notifications */
.notif-list { padding: 6px 0; }
.notif { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border); transition: background 0.2s; }
.notif:last-child { border-bottom: none; }
.notif.unread { background: var(--primary-light); box-shadow: inset 3px 0 0 var(--primary); }
.notif-icon { font-size: 1.3rem; width: 32px; text-align: center; }
.notif-body { flex: 1; font-size: 0.9rem; }
.notif-time { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }

/* Command palette */
.palette-overlay { display: none; position: fixed; inset: 0; z-index: 3000; background: rgba(8,20,40,0.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.palette-overlay.show { display: flex; animation: fadeIn 0.15s var(--ease); }
.palette { width: 100%; max-width: 620px; background: var(--card); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,20,50,0.35); overflow: hidden; border: 1px solid var(--border); animation: scaleIn 0.2s var(--ease) both; }
.palette input { width: 100%; border: none; outline: none; padding: 18px 20px; font: inherit; font-size: 1.05rem; background: transparent; color: var(--text); border-bottom: 1px solid var(--border); }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.palette-item.sel { background: var(--primary-light); }
.pi-icon { width: 28px; text-align: center; flex-shrink: 0; }
.pi-label { font-weight: 600; font-size: 0.92rem; }
.pi-hint { margin-left: auto; color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.palette-empty { padding: 24px; text-align: center; color: var(--text-muted); }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; font-size: 0.75rem; color: var(--text-muted); border-top: 1px solid var(--border); }

/* Phones */
@media (max-width: 640px) {
  .header { padding: 10px 14px; }
  .header-right { gap: 6px; }
  .live-chip, #changePassBtn { display: none; }
  .tabs { padding: 8px 10px 0; }
  .main { padding: 16px 12px 32px; }
  .greet-banner { padding: 18px; }
  .tl-grid { --name-w: 132px; }
  .tl-who small { display: none; }
  .tl-name .avatar { display: none; }
  .cal-title { min-width: 0; font-size: 0.95rem; }
  .tab-search kbd { display: none; }
}
/* Checkboxes inherited width:100% + padding from .form-group input */
.form-group input[type="checkbox"], .form-group input[type="radio"] { width: auto; padding: 0; margin: 0 8px 0 0; vertical-align: middle; accent-color: var(--primary); box-shadow: none; }
.form-group label:has(> input[type="checkbox"]) { display: flex; align-items: center; font-weight: 600; cursor: pointer; }
