/* ==========================================================
   Tenax Leave Tracker - Corporate Stylesheet
   ========================================================== */

:root {
  --navy-900: #0a1f44;
  --navy-800: #14285a;
  --navy-700: #1e3a8a;
  --navy-600: #2647a4;
  --accent:   #2dd4bf;     /* echoes the cyan/teal swoosh in the logo */
  --accent-2: #f59e0b;     /* orange swoosh */
  --accent-3: #22c55e;     /* green swoosh */
  --bg:       #f4f6fb;
  --card:     #ffffff;
  --text:     #0f172a;
  --text-2:   #475569;
  --text-3:   #94a3b8;
  --border:   #e2e8f0;
  --danger:   #dc2626;
  --warn:     #f59e0b;
  --ok:       #16a34a;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow:    0 4px 16px rgba(15,23,42,.06);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.10);
  --radius:    14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--navy-900); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img { width: 44px; height: auto; filter: brightness(1.15); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font-weight: 800; font-size: 15px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: rgba(255,255,255,.6); margin-top: 2px; }

.nav { padding: 14px 12px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,.78);
  font-weight: 500;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: all .15s;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
  background: rgba(45,212,191,.12);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-item svg { flex-shrink: 0; opacity: .85; }
.nav-section {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.4);
  padding: 18px 12px 8px;
  font-weight: 700;
}
.badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--navy-900);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--navy-600));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #fff;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: rgba(255,255,255,.55); }
.footer-link {
  display: block;
  font-size: 12.5px;
  color: rgba(255,255,255,.7);
  padding: 6px 4px;
}
.footer-link:hover { color: #fff; }
.footer-link.logout { color: #fca5a5; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0; z-index: 10;
}
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); }
.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-900);
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  letter-spacing: .3px;
}
.topbar-meta { margin-left: auto; }
.date-pill {
  background: var(--bg);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 500;
}

.content { padding: 28px; max-width: 1400px; width: 100%; }

/* ---------- Flash messages ---------- */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-weight: 500;
  border-left: 4px solid;
}
.flash-success { background: #f0fdf4; color: #15803d; border-color: #16a34a; }
.flash-error   { background: #fef2f2; color: #b91c1c; border-color: #dc2626; }
.flash-info    { background: #eff6ff; color: #1d4ed8; border-color: #3b82f6; }

/* ---------- Cards / Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent-color, var(--navy-700));
}
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--navy-900); margin-top: 6px; font-family: 'DM Serif Display', serif; font-weight: 400; }
.stat-meta { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.stat-bar {
  height: 6px; background: var(--border); border-radius: 99px; margin-top: 10px; overflow: hidden;
}
.stat-bar > span { display: block; height: 100%; background: var(--accent-color, var(--navy-700)); border-radius: 99px; transition: width .6s; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}
.card h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card h2::before {
  content: ''; width: 4px; height: 18px; background: var(--accent); border-radius: 2px;
}

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(30,58,138,.1);
}
textarea { resize: vertical; min-height: 90px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-900); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-success { background: var(--ok); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; }
table { width: 100%; border-collapse: collapse; }
thead { background: #f8fafc; }
th, td { padding: 12px 16px; text-align: left; font-size: 13.5px; }
th { font-weight: 700; color: var(--text-2); text-transform: uppercase; font-size: 11px; letter-spacing: .8px; }
tbody tr { border-top: 1px solid var(--border); }
tbody tr:hover { background: #fafbff; }

.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.status-approved        { background: #dcfce7; color: #15803d; }
.status-rejected        { background: #fee2e2; color: #b91c1c; }
.status-cancelled       { background: #f1f5f9; color: #64748b; }
.status-pending_manager { background: #fef3c7; color: #b45309; }
.status-pending_admin   { background: #dbeafe; color: #1e40af; }

.empty { padding: 40px 20px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ---------- Auth pages ---------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.auth-side {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-side::before {
  content: ''; position: absolute; right: -120px; bottom: -80px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 60%);
  opacity: .25;
}
.auth-side::after {
  content: ''; position: absolute; left: -100px; top: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 60%);
  opacity: .2;
}
.auth-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth-brand img { width: 56px; }
.auth-brand h1 { font-size: 22px; font-weight: 800; }
.auth-brand p { font-size: 12px; opacity: .7; }
.auth-quote {
  position: relative; z-index: 1;
  font-family: 'DM Serif Display', serif;
  font-size: 30px;
  line-height: 1.25;
  max-width: 420px;
}
.auth-quote span { color: var(--accent); }
.auth-foot { position: relative; z-index: 1; font-size: 12px; opacity: .6; }

.auth-form-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.auth-form {
  width: 100%; max-width: 400px;
}
.auth-form h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 30px;
  color: var(--navy-900);
  margin-bottom: 6px;
}
.auth-form .lead { color: var(--text-2); margin-bottom: 28px; font-size: 14px; }
.auth-form .form-group { margin-bottom: 14px; }
.auth-form .btn { width: 100%; justify-content: center; padding: 12px; font-size: 14px; margin-top: 8px; }
.auth-form .alt { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-2); }

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .sidebar {
    position: fixed; left: -280px; top: 0; bottom: 0; z-index: 100;
    transition: left .25s;
  }
  .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
  .content { padding: 18px; }
}

/* ---------- Calendar / Holiday list ---------- */
.holiday-list { display: grid; gap: 10px; }
.holiday-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.holiday-row .date-block {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  text-align: center;
  min-width: 64px;
}
.holiday-row .date-day { font-size: 22px; font-weight: 800; line-height: 1; }
.holiday-row .date-month { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; opacity: .85; margin-top: 2px; }
.holiday-row .holiday-info { flex: 1; }
.holiday-row .holiday-info strong { font-size: 14.5px; }
.holiday-row .holiday-info span { display: block; font-size: 12.5px; color: var(--text-2); }

/* ---------- Section header ---------- */
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.section-head h2 { font-size: 18px; color: var(--navy-900); font-weight: 700; }

/* Highlight current page in sidebar via JS */
