:root {
  --sidebar-width: 260px;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-hover: rgba(255,255,255,.08);
  --sidebar-active: #2563eb;
  --topbar-height: 56px;
  --primary: #2563eb;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
}

/* ── Layout ──────────────────────────────────────────── */
body { background: #f8fafc; font-family: 'Inter', system-ui, sans-serif; }

#app-wrapper { min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-brand i { font-size: 1.3rem; color: #60a5fa; }

.sidebar-user {
  display: flex;
  align-items: center;
  padding: .75rem 1rem;
  color: var(--sidebar-text);
}

.avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  color: #fff;
}

.sidebar-divider {
  border-color: rgba(255,255,255,.08);
  margin: 0 1rem .5rem;
}

.sidebar-section {
  padding: .5rem 1rem .25rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: #64748b;
  text-transform: uppercase;
  list-style: none;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--sidebar-text);
  padding: .55rem 1rem;
  border-radius: .5rem;
  margin: .1rem .5rem;
  font-size: .875rem;
  transition: background .15s, color .15s;
}

.sidebar .nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar .nav-link.active { background: var(--primary); color: #fff; }
.sidebar .nav-link i { font-size: 1rem; flex-shrink: 0; }
.sidebar .nav-link .badge { font-size: .65rem; }

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.content-area { min-height: calc(100vh - var(--topbar-height)); }

/* ── Cards ───────────────────────────────────────────── */
.card {
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  border-radius: .75rem .75rem 0 0 !important;
  font-weight: 600;
}

.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  padding: 1.25rem;
  transition: box-shadow .2s;
}

.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: #64748b; margin-top: .25rem; }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: .75rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}

/* ── Status badges ───────────────────────────────────── */
.badge-draft    { background: #e2e8f0; color: #475569; }
.badge-submitted{ background: #dbeafe; color: #1d4ed8; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-cancelled{ background: #f1f5f9; color: #64748b; }

/* ── Timesheet grid ──────────────────────────────────── */
.ts-grid { overflow-x: auto; }

.ts-table { min-width: 800px; border-collapse: separate; border-spacing: 0; }
.ts-table th { background: #1e293b; color: #cbd5e1; font-size: .78rem; font-weight: 600;
               letter-spacing: .03em; padding: .6rem .75rem; position: sticky; top: 0; }
.ts-table th.day-header { text-align: center; min-width: 80px; }
.ts-table td { padding: .4rem .5rem; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.ts-table tr:hover td { background: #f8fafc; }

.ts-table .holiday-col { background: #fff7ed !important; }
.ts-table .weekend-col { background: #f8fafc !important; }
.ts-table .today-col   { background: #eff6ff !important; border-top: 2px solid var(--primary) !important; }

.hour-input {
  width: 64px;
  text-align: center;
  border: 1px solid #e2e8f0;
  border-radius: .375rem;
  padding: .3rem .25rem;
  font-size: .875rem;
  transition: border-color .15s;
}
.hour-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

.row-total { font-weight: 700; color: var(--primary); text-align: center; }
.day-total { font-weight: 700; text-align: center; background: #f8fafc !important; }

/* ── Auth pages ──────────────────────────────────────── */
body.auth-mode {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  min-height: 100vh;
}

.auth-inner {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 2.5rem;
}

.auth-logo { font-size: 2rem; color: var(--primary); }

/* ── Tables ──────────────────────────────────────────── */
.table { font-size: .875rem; }
.table thead th { background: #f8fafc; font-weight: 600; font-size: .78rem;
                  text-transform: uppercase; letter-spacing: .05em; color: #475569; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ── Status dot ──────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: .4rem;
}

/* ── Responsive sidebar ──────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: -var(--sidebar-width); z-index: 200;
             transition: transform .25s; transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  #main-content { margin-left: 0 !important; }
}

/* ── Misc ────────────────────────────────────────────── */
.page-title { font-size: 1.4rem; font-weight: 700; color: #0f172a; }
.section-title { font-size: .9rem; font-weight: 700; color: #64748b;
                 text-transform: uppercase; letter-spacing: .06em; }

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

.holiday-badge {
  display: inline-block;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  font-size: .65rem;
  padding: .15rem .4rem;
  border-radius: .25rem;
  font-weight: 600;
}

.leave-badge {
  display: inline-block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-size: .65rem;
  padding: .15rem .4rem;
  border-radius: .25rem;
  font-weight: 600;
}

/* Invoice hours highlight */
.invoice-highlight { background: #eff6ff; color: #1d4ed8; font-weight: 700; }

/* ── Public landing page ─────────────────────────────── */
.public-page { min-height: 100vh; background: #fff; }

.hero-section {
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
}

.feature-card {
  background: #fff;
  border-color: #e2e8f0 !important;
  transition: box-shadow .2s, transform .2s;
}
.feature-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }

.feature-icon {
  width: 48px; height: 48px;
  border-radius: .75rem;
  background: #eff6ff;
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}

.step-number {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
