/* ============================================
   NITISH PRINTS & SUPPLIES — Design System v5
   "Obsidian" — Clean, refined dark theme
   Inspired by Linear, Vercel, Raycast
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Brand Colors — refined, less saturated */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);

  /* Variant Accent Colors */
  --v1-accent: #10b981;
  --v1-accent-light: #34d399;
  --v1-accent-glow: rgba(16, 185, 129, 0.2);

  --v2-accent: #3b82f6;
  --v2-accent-light: #60a5fa;
  --v2-accent-glow: rgba(59, 130, 246, 0.2);

  --v3-accent: #8b5cf6;
  --v3-accent-light: #a78bfa;
  --v3-accent-glow: rgba(139, 92, 246, 0.2);

  /* Semantic Colors */
  --success: #22c55e;
  --success-light: #4ade80;
  --success-bg: rgba(34, 197, 94, 0.1);
  --danger: #ef4444;
  --danger-light: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --info: #06b6d4;
  --info-light: #22d3ee;
  --info-bg: rgba(6, 182, 212, 0.1);
  --holiday: #fb923c;
  --holiday-light: #fdba74;
  --holiday-bg: rgba(251, 146, 60, 0.1);

  /* Surfaces — Neutral charcoal, not blue-tinted */
  --bg-primary: #09090b;
  --bg-secondary: #111113;
  --bg-card: #18181b;
  --bg-card-hover: #1f1f23;
  --bg-elevated: #27272a;
  --bg-input: #111113;
  --bg-overlay: rgba(0, 0, 0, 0.6);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-hover: rgba(255, 255, 255, 0.05);

  /* Text — high contrast hierarchy */
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --text-inverse: #09090b;

  /* Borders — clean, subtle */
  --border: #27272a;
  --border-light: #3f3f46;
  --border-focus: var(--primary);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px var(--primary-glow);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius — slightly rounder for modern feel */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 350ms;

  /* Layout */
  --nav-height: 56px;
  --bottom-nav-height: 60px;
  --sidebar-width: 260px;
  --max-width: 1200px;
}

/* ── Light Theme ── */
[data-theme="light"] {
  /* Surfaces */
  --bg-primary: #ffffff;
  --bg-secondary: #f4f4f5;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --bg-elevated: #f4f4f5;
  --bg-input: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.3);

  /* Glass */
  --glass-bg: rgba(0, 0, 0, 0.02);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-hover: rgba(0, 0, 0, 0.04);

  /* Text */
  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --text-inverse: #fafafa;

  /* Borders */
  --border: #e4e4e7;
  --border-light: #d4d4d8;

  /* Shadows — softer for light mode */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 20px var(--primary-glow);

  /* Semantic — slightly deeper tones */
  --success-bg: rgba(34, 197, 94, 0.08);
  --danger-bg: rgba(239, 68, 68, 0.08);
  --warning-bg: rgba(245, 158, 11, 0.08);
  --info-bg: rgba(6, 182, 212, 0.08);
  --holiday-bg: rgba(251, 146, 60, 0.08);

  /* Accent glows — softer */
  --primary-glow: rgba(99, 102, 241, 0.15);
  --v1-accent-glow: rgba(16, 185, 129, 0.12);
  --v2-accent-glow: rgba(59, 130, 246, 0.12);
  --v3-accent-glow: rgba(139, 92, 246, 0.12);
}

/* Hide noise texture in light mode */
[data-theme="light"] body::after {
  display: none;
}

/* Light mode structural overrides */
[data-theme="light"] .card,
[data-theme="light"] .card-glass,
[data-theme="light"] .calendar,
[data-theme="light"] .att-row,
[data-theme="light"] .emp-card,
[data-theme="light"] .sal-card,
[data-theme="light"] .adv-card,
[data-theme="light"] .stat-card,
[data-theme="light"] .login-card,
[data-theme="light"] .summary-card {
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .page-header {
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}

[data-theme="light"] .bottom-nav {
  box-shadow: 0 -1px 0 rgba(0,0,0,0.05);
}

[data-theme="light"] .form-input {
  border-color: #d4d4d8;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #d4d4d8;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #a1a1aa;
}

[data-theme="light"] .login-screen {
  background: var(--bg-secondary);
}

/* ── Theme Toggle ── */
.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--duration-fast);
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle noise texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* Selection */
::selection { background: var(--primary); color: white; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-muted { color: var(--text-secondary); }
.text-mono { font-family: var(--font-mono); }

.currency {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.currency-lg {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Layout — App Shell ── */
html, body {
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height — accounts for mobile browser address bar */
  overflow: hidden;
}

.hidden { display: none !important; }

/* Screens fill viewport */
[data-screen] {
  height: 100vh;
  height: 100dvh;
}

/* Main app shell — fixed header, scrollable content, fixed bottom nav */
[data-screen="main"] {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Scrollable content area between header and bottom nav */
.page {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-lg);
  overscroll-behavior: contain;
}

.page-header {
  flex-shrink: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) var(--space-md);
}

.page-header .header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header .brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: white;
}

.page-header .brand-name {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.page-header .brand-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
  padding-top: var(--space-lg);
}

.section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

/* ── Grid ── */
.grid { display: grid; gap: var(--space-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ── Cards — Clean solid surfaces ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.card:hover {
  border-color: var(--border-light);
}

.card-glass {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.card-glass:hover {
  border-color: var(--border-light);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:active {
  transform: scale(0.98);
  transition: transform 80ms;
}

/* Stat Cards */
.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: var(--space-md);
}

.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.03;
}

/* ── Buttons — Clean, purposeful ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  min-height: 36px;
  text-decoration: none;
  line-height: 1.2;
}

.btn:active {
  transform: scale(0.97);
  transition: transform 60ms;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-light);
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover:not(:disabled) {
  background: var(--success-light);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-light);
}

.btn-warning {
  background: var(--warning);
  color: var(--text-inverse);
}
.btn-warning:hover:not(:disabled) {
  background: var(--warning-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.78rem;
  min-height: 28px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
  min-height: 44px;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
}

/* Quick Action Buttons (for attendance) */
.btn-quick {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  padding: 0;
  font-size: 1.1rem;
  border: 1px solid transparent;
  transition: all var(--duration-fast) var(--ease-out);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.btn-quick.active {
  transform: scale(1.05);
}

.btn-quick-present {
  background: var(--success-bg);
  color: var(--success);
}
.btn-quick-present:hover, .btn-quick-present.active {
  background: var(--success);
  color: white;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.btn-quick-absent {
  background: var(--danger-bg);
  color: var(--danger);
}
.btn-quick-absent:hover, .btn-quick-absent.active {
  background: var(--danger);
  color: white;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.btn-quick-halfday {
  background: var(--warning-bg);
  color: var(--warning);
}
.btn-quick-halfday:hover, .btn-quick-halfday.active {
  background: var(--warning);
  color: var(--text-inverse);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.btn-quick-leave {
  background: var(--info-bg);
  color: var(--info);
}
.btn-quick-leave:hover, .btn-quick-leave.active {
  background: var(--info);
  color: white;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.btn-quick-holiday {
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
}
.btn-quick-holiday:hover, .btn-quick-holiday.active {
  background: #fb923c;
  color: white;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.15);
}

/* ── Inputs — Clean and minimal ── */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color var(--duration-fast);
  min-height: 38px;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input-mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2352525b' viewBox='0 0 16 16'%3E%3Cpath d='M8 12L2 6h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: flex;
  gap: var(--space-md);
}

.form-row > * {
  flex: 1;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.form-error {
  font-size: 0.72rem;
  color: var(--danger);
  margin-top: var(--space-xs);
}

/* ── Status Badges — Pill-shaped, minimal ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-present { background: var(--success-bg); color: var(--success); }
.badge-absent { background: var(--danger-bg); color: var(--danger); }
.badge-halfday { background: var(--warning-bg); color: var(--warning); }
.badge-leave { background: var(--info-bg); color: var(--info); }
.badge-holiday { background: var(--holiday-bg); color: var(--holiday); }
.badge-draft { background: rgba(82,82,91,0.2); color: var(--text-secondary); }
.badge-finalized { background: var(--primary-glow); color: var(--primary-light); }
.badge-paid { background: var(--success-bg); color: var(--success); }
.badge-pending { background: var(--warning-bg); color: var(--warning); }

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

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

.table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.table tr:last-child td { border-bottom: none; }

.table tr:hover td {
  background: var(--bg-card-hover);
}

.table .col-money {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text-primary);
}

.table .col-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ── Calendar ── */
.calendar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.calendar-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.calendar-nav {
  display: flex;
  gap: var(--space-sm);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day-name {
  padding: var(--space-sm);
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration-fast);
  border: 1px solid transparent;
  position: relative;
  min-height: 44px;
}

.calendar-day:hover {
  background: var(--bg-card-hover);
}

.calendar-day.empty {
  cursor: default;
}

.calendar-day.today {
  font-weight: 700;
}

.calendar-day.today::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  bottom: 4px;
}

.calendar-day.present {
  background: var(--success-bg);
  color: var(--success);
}
.calendar-day.present:hover { background: rgba(34, 197, 94, 0.18); }

.calendar-day.absent {
  background: var(--danger-bg);
  color: var(--danger);
}
.calendar-day.absent:hover { background: rgba(239, 68, 68, 0.18); }

.calendar-day.halfday {
  background: var(--warning-bg);
  color: var(--warning);
}
.calendar-day.halfday:hover { background: rgba(245, 158, 11, 0.18); }

.calendar-day.leave {
  background: var(--info-bg);
  color: var(--info);
}
.calendar-day.leave:hover { background: rgba(6, 182, 212, 0.18); }

.calendar-day.holiday {
  background: var(--holiday-bg);
  color: var(--holiday);
}
.calendar-day.holiday:hover { background: rgba(251, 146, 60, 0.18); }

.calendar-day.sunday {
  color: var(--text-muted);
  opacity: 0.5;
}

.calendar-day .day-hours {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── Bottom Navigation ── */
.bottom-nav {
  flex-shrink: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  position: sticky;
  bottom: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--duration-fast);
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  text-decoration: none;
  min-width: 56px;
}

.bottom-nav-item:hover {
  color: var(--text-secondary);
}

.bottom-nav-item.active {
  color: var(--text-primary);
}

.bottom-nav-item .nav-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.bottom-nav-item .nav-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Tab Navigation (for V3) — Segmented control ── */
.tab-nav {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

.tab-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.tab-nav-item.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.tab-nav-item .tab-icon {
  font-size: 1rem;
}

/* ── Modal — Clean overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(0,0,0,0.5);
  transform: scale(0.96) translateY(8px);
  transition: transform var(--duration-normal) var(--ease-out);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--duration-fast);
}

.modal-close:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 400px;
  pointer-events: all;
  animation: toastIn var(--duration-slow) var(--ease-out) forwards;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-message {
  font-size: 0.85rem;
  font-weight: 500;
  flex: 1;
}

.toast.removing {
  animation: toastOut var(--duration-normal) var(--ease-out) forwards;
}

@media (max-width: 480px) {
  .toast-container {
    top: var(--space-md);
    right: var(--space-md);
    left: var(--space-md);
  }
  .toast { min-width: auto; }
}

/* ── Loading States ── */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal);
}

.loader-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loader-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.shimmer {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.shimmer-line {
  height: 14px;
  margin-bottom: var(--space-sm);
}

.shimmer-line:last-child {
  width: 60%;
}

.shimmer-box {
  height: 80px;
}

/* ── Employee Card ── */
.employee-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color var(--duration-fast);
}

.employee-card:hover {
  border-color: var(--border-light);
}

.employee-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

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

.employee-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.employee-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.employee-actions {
  display: flex;
  gap: var(--space-sm);
}

/* ── Attendance Summary Bar ── */
.summary-bar {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  min-width: 70px;
}

.summary-item .summary-count {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
}

.summary-item .summary-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.summary-present { background: var(--success-bg); }
.summary-present .summary-count { color: var(--success); }
.summary-absent { background: var(--danger-bg); }
.summary-absent .summary-count { color: var(--danger); }
.summary-halfday { background: var(--warning-bg); }
.summary-halfday .summary-count { color: var(--warning); }
.summary-leave { background: var(--info-bg); }
.summary-leave .summary-count { color: var(--info); }
.summary-holiday { background: var(--holiday-bg); }
.summary-holiday .summary-count { color: var(--holiday); }

/* ── Payslip — Print-ready ── */
.payslip {
  background: white;
  color: #18181b;
  padding: 32px;
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
}

.payslip-header {
  text-align: center;
  border-bottom: 2px solid #e4e4e7;
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.payslip-company {
  font-size: 1.3rem;
  font-weight: 700;
  color: #18181b;
  letter-spacing: -0.01em;
}

.payslip-sub {
  font-size: 0.8rem;
  color: #71717a;
}

.payslip-info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin-bottom: 24px;
  font-size: 0.85rem;
}

.pi-label { color: #71717a; font-weight: 500; }
.pi-value { font-weight: 600; }

.payslip-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.payslip-table th, .payslip-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e4e4e7;
  font-size: 0.85rem;
}

.payslip-table th {
  background: #fafafa;
  font-weight: 600;
  color: #52525b;
}

.payslip-table .money {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 600;
}

.payslip-total {
  font-weight: 700;
  background: #f4fdf7 !important;
}

.payslip-net td {
  font-weight: 700;
  font-size: 1.05rem;
  background: #f0f9ff !important;
  color: #0369a1;
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.empty-state-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 280px;
}

/* ── Login Screen ── */
.login-screen {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* Subtle gradient orb */
.login-screen::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: bgFloat 25s ease-in-out infinite;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-xl);
  position: relative;
  z-index: 1;
}

.login-brand {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-brand-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  margin: 0 auto var(--space-md);
}

.login-brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-btn {
  width: 100%;
  padding: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 42px;
  margin-top: var(--space-sm);
}

.login-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: var(--space-lg);
  padding: var(--space-sm);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

/* ── Confirm Dialog ── */
.confirm-body {
  padding: var(--space-lg);
  text-align: center;
}

.confirm-body p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

/* ── Connection Indicator ── */
.connection-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

.connection-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.connection-dot.offline {
  background: var(--danger);
}

/* ── Animations ── */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

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

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-30px, 20px) scale(1.05); }
  66% { transform: translate(20px, -15px) scale(0.95); }
}

.animate-in {
  animation: fadeUp var(--duration-slow) var(--ease-out) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

/* Tablet (768px) */
@media (max-width: 768px) {
  .page-header { padding: var(--space-sm) var(--space-md); }
  .page-header .brand-name { font-size: 0.85rem; }
  .page-title { font-size: 1.1rem; padding-top: var(--space-md); margin-bottom: var(--space-md); }

  /* Bottom nav — already fine */

  /* Forms */
  .form-row { flex-direction: column; gap: var(--space-sm); }

  /* Summary bar */
  .summary-item { min-width: 60px; padding: var(--space-xs) var(--space-sm); }

  /* Calendar */
  .calendar-day { font-size: 0.82rem; min-height: 44px; }

  /* Modal */
  .modal { max-width: 100%; border-radius: var(--radius-lg); }
}

/* Mobile (480px) */
@media (max-width: 480px) {
  .container { padding: 0 var(--space-sm); }
  h1 { font-size: 1.3rem; }
  .page-title { font-size: 1rem; }

  /* Buttons */
  .btn-quick { width: 38px; height: 38px; font-size: 1rem; }

  /* Stat cards */
  .stat-card .stat-value { font-size: 1.4rem; }
  .stat-card .stat-label { font-size: 0.72rem; }

  /* Employee card */
  .employee-avatar { width: 36px; height: 36px; font-size: 0.8rem; }
  .employee-name { font-size: 0.85rem; }
  .employee-role { font-size: 0.7rem; }

  /* Badges */
  .badge { padding: 2px 6px; font-size: 0.62rem; }

  /* Grids */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* Empty state */
  .empty-state { padding: var(--space-xl); }
  .empty-state-icon { font-size: 2rem; }
}

/* Small phones (360px) */
@media (max-width: 360px) {
  .container { padding: 0 var(--space-xs); }
  .btn-quick { width: 34px; height: 34px; font-size: 0.9rem; }
  .login-card { padding: var(--space-lg); }
  .page-title { font-size: 0.95rem; }
  .stat-card .stat-value { font-size: 1.1rem; }
}

/* Touch feedback */
@media (hover: none) and (pointer: coarse) {
  .btn:active { transform: scale(0.95); }
  .btn-quick:active { transform: scale(0.85); }
  .card-interactive:active { transform: scale(0.97); }
  .bottom-nav-item:active { transform: scale(0.9); opacity: 0.7; }
  .tab-nav-item:active { transform: scale(0.95); }
  .calendar-day:active { background: var(--bg-elevated); }

  .btn:hover:not(:disabled) { transform: none; }
  .card:hover { border-color: var(--border); }
  .att-row:hover { border-color: var(--border); }
}

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

/* Print */
@media print {
  body { background: white; color: black; }
  body::after { display: none; }
  .page-header, .bottom-nav, .tab-nav, .toast-container, .modal-overlay, .loader-overlay { display: none !important; }
  .card, .card-glass { background: white; border-color: #e4e4e7; box-shadow: none; }
}
