/* ============================================
   ABSENCE - Main Stylesheet
   Aesthetic: Deep Obsidian + Warm Amber accents
   Font: Fraunces (display) + DM Sans (body)
   ============================================ */

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

/* ── CSS Variables ─────────────────────────── */
:root {
  --bg-base:       #0d0f12;
  --bg-surface:    #141720;
  --bg-card:       #1a1e2a;
  --bg-hover:      #21273a;
  --bg-input:      #1e2332;

  --border:        #2a3045;
  --border-subtle: #1e2435;

  --text-primary:  #f0efea;
  --text-secondary:#8a96b0;
  --text-muted:    #515c75;

  --accent:        #f5a623;
  --accent-dim:    #c27d10;
  --accent-glow:   rgba(245, 166, 35, 0.15);
  --accent-soft:   rgba(245, 166, 35, 0.08);

  --blue:          #4f8ef7;
  --green:         #34c98e;
  --red:           #f05c5c;
  --purple:        #9b7ff4;

  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --shadow-card:   0 4px 24px rgba(0,0,0,0.4);
  --shadow-float:  0 8px 40px rgba(0,0,0,0.6);
  --shadow-glow:   0 0 30px rgba(245, 166, 35, 0.12);

  --transition:    all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-w:     240px;
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Typography ─────────────────────────────── */
h1, h2, h3, h4 { font-family: 'Fraunces', serif; font-weight: 400; letter-spacing: -0.02em; }
h1 { font-size: 2.4rem; line-height: 1.2; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }

a { color: inherit; text-decoration: none; }

/* ── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Layout ─────────────────────────────────── */
#app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--bg-surface); border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; transition: var(--transition); }
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { height: 60px; background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; position: sticky; top: 0; z-index: 50; }
.page { padding: 2rem; flex: 1; }

/* ── Sidebar ────────────────────────────────── */
.sidebar-logo { padding: 1.5rem 1.25rem 1rem; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border-subtle); }
.sidebar-logo .logo-mark { width: 32px; height: 32px; background: var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: 'Fraunces', serif; font-size: 0.85rem; color: var(--bg-base); font-weight: 600; }
.sidebar-logo .logo-text { font-family: 'Fraunces', serif; font-size: 1.15rem; color: var(--text-primary); }

.sidebar-nav { flex: 1; padding: 1rem 0.75rem; overflow-y: auto; }
.nav-group { margin-bottom: 1.5rem; }
.nav-label { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); padding: 0 0.75rem; margin-bottom: 0.5rem; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 0.55rem 0.75rem; border-radius: var(--radius); color: var(--text-secondary); font-size: 0.875rem; cursor: pointer; transition: var(--transition); margin-bottom: 2px; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-user { padding: 1rem; border-top: 1px solid var(--border-subtle); }
.sidebar-user .user-card { display: flex; align-items: center; gap: 10px; padding: 0.5rem; border-radius: var(--radius); cursor: pointer; transition: var(--transition); }
.sidebar-user .user-card:hover { background: var(--bg-hover); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600; color: var(--bg-base); overflow: hidden; flex-shrink: 0; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info .user-name { font-size: 0.8rem; font-weight: 500; color: var(--text-primary); }
.user-info .user-role { font-size: 0.7rem; color: var(--text-muted); text-transform: capitalize; }

/* ── Topbar ─────────────────────────────────── */
.topbar-title { font-family: 'Fraunces', serif; font-size: 1.1rem; color: var(--text-primary); }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.notif-btn { position: relative; width: 36px; height: 36px; border-radius: var(--radius); background: transparent; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); color: var(--text-secondary); }
.notif-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.notif-badge { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; border: 2px solid var(--bg-surface); }

/* ── Cards ──────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-card); }
.card-sm { padding: 1.25rem; border-radius: var(--radius); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.card-title { font-family: 'Fraunces', serif; font-size: 1rem; color: var(--text-primary); }

/* ── Stat Cards ─────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.stat-value { font-family: 'Fraunces', serif; font-size: 2.2rem; color: var(--text-primary); line-height: 1; }
.stat-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── Buttons ────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 1.1rem; border-radius: var(--radius); font-family: 'DM Sans', sans-serif; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: var(--transition); border: none; white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--bg-base); }
.btn-primary:hover { background: #f0b040; box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3); }
.btn-secondary { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger { background: rgba(240, 92, 92, 0.15); color: var(--red); border: 1px solid rgba(240, 92, 92, 0.3); }
.btn-danger:hover { background: rgba(240, 92, 92, 0.25); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-icon { padding: 0.5rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Badges / Status ────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.65rem; border-radius: 20px; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.02em; }
.badge-pending  { background: rgba(245, 166, 35, 0.12); color: var(--accent); }
.badge-approved { background: rgba(52, 201, 142, 0.12); color: var(--green); }
.badge-declined { background: rgba(240, 92, 92, 0.12); color: var(--red); }
.badge-cancelled{ background: rgba(138, 150, 176, 0.12); color: var(--text-secondary); }

/* ── Form Elements ──────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.4rem; letter-spacing: 0.02em; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select { cursor: pointer; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-error { font-size: 0.75rem; color: var(--red); margin-top: 0.25rem; }

/* ── Table ──────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--bg-surface); padding: 0.75rem 1rem; text-align: left; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); }
tbody tr { border-bottom: 1px solid var(--border-subtle); transition: var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
tbody td { padding: 0.9rem 1rem; font-size: 0.875rem; color: var(--text-secondary); }
tbody td.cell-primary { color: var(--text-primary); font-weight: 500; }

/* ── Calendar ───────────────────────────────── */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border-subtle); border-radius: var(--radius); overflow: hidden; }
.cal-day-header { background: var(--bg-surface); padding: 0.5rem; text-align: center; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.cal-day { background: var(--bg-card); min-height: 90px; padding: 0.4rem; position: relative; }
.cal-day.other-month { background: var(--bg-surface); opacity: 0.5; }
.cal-day.today { background: var(--bg-hover); }
.cal-day.today .cal-day-num { background: var(--accent); color: var(--bg-base); border-radius: 50%; }
.cal-day-num { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.cal-event { padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.68rem; margin-bottom: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; transition: var(--transition); color: white; font-weight: 500; }
.cal-event:hover { opacity: 0.85; }

/* ── Avatar ─────────────────────────────────── */
.avatar { border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 600; background: var(--accent); color: var(--bg-base); }
.avatar-sm { width: 28px; height: 28px; font-size: 0.65rem; }
.avatar-md { width: 36px; height: 36px; font-size: 0.8rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Modal ──────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; transition: var(--transition); pointer-events: none; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 2rem; width: 100%; max-width: 520px; box-shadow: var(--shadow-float); transform: translateY(20px) scale(0.98); transition: var(--transition); }
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title { font-family: 'Fraunces', serif; font-size: 1.25rem; color: var(--text-primary); }
.modal-footer { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border-subtle); }

/* ── Progress Bar ───────────────────────────── */
.progress-bar { background: var(--bg-input); border-radius: 99px; height: 6px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width 0.6s ease; }

/* ── Leave Balance Card ─────────────────────── */
.balance-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 1rem 1.25rem; }
.balance-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.balance-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.balance-type { font-size: 0.85rem; font-weight: 500; color: var(--text-primary); }
.balance-numbers { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5rem; }
.balance-used { font-size: 1.5rem; font-family: 'Fraunces', serif; }
.balance-total { font-size: 0.8rem; color: var(--text-muted); }

/* ── Tag ────────────────────────────────────── */
.tag { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.72rem; font-weight: 500; }

/* ── Loader ─────────────────────────────────── */
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem; gap: 1rem; color: var(--text-muted); }

/* ── Empty State ────────────────────────────── */
.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 1rem; opacity: 0.3; }
.empty-title { font-size: 1rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-subtitle { font-size: 0.875rem; }

/* ── Toast ──────────────────────────────────── */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 300; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; box-shadow: var(--shadow-float); min-width: 280px; animation: slideIn 0.3s ease; }
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }
.toast-info { border-left: 3px solid var(--blue); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Auth / Login page ──────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-base); padding: 2rem; }
.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 3rem; width: 100%; max-width: 420px; box-shadow: var(--shadow-glow); }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .logo-mark { width: 52px; height: 52px; background: var(--accent); border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-family: 'Fraunces', serif; font-size: 1.2rem; color: var(--bg-base); font-weight: 600; margin-bottom: 0.75rem; }
.auth-title { font-family: 'Fraunces', serif; font-size: 1.6rem; text-align: center; margin-bottom: 0.5rem; }
.auth-sub { font-size: 0.875rem; color: var(--text-muted); text-align: center; margin-bottom: 2rem; }
.ms-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 0.85rem; background: #2f6ed5; color: white; border: none; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: var(--transition); font-family: 'DM Sans', sans-serif; }
.ms-btn:hover { background: #2457b0; box-shadow: 0 4px 15px rgba(47, 110, 213, 0.3); }
.auth-divider { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin: 1.25rem 0; position: relative; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border); }
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page { padding: 1rem; }
}

/* ── Page transitions ───────────────────────── */
.page-enter { animation: pageIn 0.25s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Color-coded leave type dots ───────────── */
.leave-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; flex-shrink: 0; }

/* ── Team card in calendar view ─────────────── */
.team-member-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem; border-radius: var(--radius); transition: var(--transition); }
.team-member-row:hover { background: var(--bg-hover); }
.member-absences { display: flex; gap: 4px; flex-wrap: wrap; }
.member-absence-tag { padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.68rem; font-weight: 500; color: white; }

/* ── Dropdown ───────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; top: 100%; right: 0; margin-top: 6px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); min-width: 180px; box-shadow: var(--shadow-float); z-index: 100; overflow: hidden; animation: dropIn 0.15s ease; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dropdown-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; font-size: 0.875rem; color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.danger { color: var(--red); }
.dropdown-divider { height: 1px; background: var(--border-subtle); margin: 0.25rem 0; }

/* ── Tabs ───────────────────────────────────── */
.tabs { display: flex; gap: 2px; background: var(--bg-surface); border-radius: var(--radius); padding: 3px; margin-bottom: 1.5rem; }
.tab { flex: 1; padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: var(--transition); text-align: center; color: var(--text-muted); }
.tab.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-card); }

/* ── Page header ────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.75rem; gap: 1rem; }
.page-header-left h2 { margin-bottom: 0.25rem; }
.page-subtitle { font-size: 0.875rem; color: var(--text-muted); }

/* ============================================
   TIMELINE / GANTT CALENDAR  (absentify-style)
   Rows = users, Columns = days of month
   ============================================ */

/* ── Outer wrapper: horizontal scroll ───────── */
.tl-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* ── Shared layout: sticky user column + scrollable days ── */
.tl-header-row,
.tl-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border-subtle);
}
.tl-row:last-child { border-bottom: none; }
.tl-row:hover { background: rgba(255,255,255,0.015); }

/* ── User column (fixed, left-pinned) ───────── */
.tl-user-header {
  width: 200px;
  min-width: 200px;
  flex-shrink: 0;
  padding: 0.6rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  position: sticky;
  left: 0;
  z-index: 10;
}

.tl-user-cell {
  width: 200px;
  min-width: 200px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem 0.55rem 1rem;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-card);
  position: sticky;
  left: 0;
  z-index: 5;
}

.tl-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.tl-user-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-user-dept {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Days header area ────────────────────────── */
.tl-days-header {
  display: flex;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.tl-days-header::-webkit-scrollbar { display: none; }

.tl-day-header {
  flex: 1;
  min-width: 32px;
  max-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  cursor: default;
  user-select: none;
}
.tl-day-header:last-child { border-right: none; }

.tl-day-num {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1;
}
.tl-day-name {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ── Weekend columns ─────────────────────────── */
.tl-day-header.tl-weekend { background: var(--bg-base); }
.tl-day-header.tl-weekend .tl-day-num,
.tl-day-header.tl-weekend .tl-day-name { color: var(--text-muted); opacity: 0.5; }

/* ── Today column highlight ──────────────────── */
.tl-day-header.tl-today-col { background: var(--accent-soft) !important; }
.tl-day-header.tl-today-col .tl-day-num { color: var(--accent) !important; opacity: 1; }
.tl-day-header.tl-today-col .tl-day-name { color: var(--accent) !important; opacity: 1; }

/* ── Body rows: days area ────────────────────── */
.tl-body { overflow: hidden; }

.tl-days-row {
  display: flex;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.tl-days-row::-webkit-scrollbar { display: none; }

/* Individual day cell */
.tl-cell {
  flex: 1;
  min-width: 32px;
  max-width: 44px;
  height: 38px;
  border-right: 1px solid var(--border-subtle);
  position: relative;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.tl-cell:last-child { border-right: none; }

/* Weekend cell bg */
.tl-cell.tl-weekend {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 3px,
    rgba(255,255,255,0.015) 3px,
    rgba(255,255,255,0.015) 6px
  );
}

/* Today cell bg */
.tl-cell.tl-today-col { background: var(--accent-soft) !important; }
.tl-cell.tl-today-col.tl-cell-filled { background: none !important; }

/* Filled (absence) cell */
.tl-cell.tl-cell-filled {
  cursor: pointer;
  z-index: 2;
}
.tl-cell.tl-cell-filled:hover { opacity: 0.75; }

/* Label on the first day of an absence bar */
.tl-bar-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  padding: 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  max-width: 100%;
  letter-spacing: 0.02em;
}

/* ── Legend ──────────────────────────────────── */
.tl-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.tl-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Floating tooltip ────────────────────────── */
.cal-tooltip {
  position: fixed;
  z-index: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  box-shadow: var(--shadow-float);
  min-width: 180px;
  max-width: 220px;
  pointer-events: none;
  font-size: 0.82rem;
}

/* ── Sync horizontal scroll between header & body ─ */
/* JS syncs .tl-days-header scroll to each .tl-days-row */