/* ============================================================
   RESET & VARIABLES
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --sidebar-w: 240px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.15);
}

html, body { height: 100%; overflow-x: hidden; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.5;
}

/* ============================================================
   AUTH SCREENS
============================================================ */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  padding: 16px;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 60px rgba(0,0,0,.3);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon { font-size: 48px; margin-bottom: 12px; }
.auth-logo h1 { font-size: 24px; font-weight: 700; color: var(--gray-900); }
.auth-logo p { color: var(--gray-500); margin-top: 4px; font-size: 13px; }

/* ============================================================
   LAYOUT
============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  height: 100dvh;
  width: var(--sidebar-w);
  background: var(--gray-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform 0.3s;
}

.sidebar-header {
  flex-shrink: 0;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  border-bottom: 1px solid var(--gray-700);
}

.sidebar-title {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  line-height: 1.3;
  word-break: break-word;
}

.sidebar-user {
  flex-shrink: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-700);
}

.sidebar-user-name { font-weight: 600; font-size: 14px; }
.sidebar-user-role { color: var(--gray-400); font-size: 12px; margin-top: 2px; }

.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--gray-300);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
  user-select: none;
}

.nav-item:hover { background: var(--gray-700); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }

.sidebar-footer {
  flex-shrink: 0;
  padding: 10px 8px;
  border-top: 1px solid var(--gray-700);
}

.sidebar-btn {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--gray-400);
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
  font-size: 13px;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.sidebar-btn:hover { background: var(--gray-700); color: #fff; }

.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--gray-900);
  color: #fff;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 150;
  font-size: 15px;
}

.offline-banner {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--warning);
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: calc(8px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) 8px calc(16px + env(safe-area-inset-left, 0px));
}
.offline-banner.show { display: block; }

.hamburger {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
}

.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 24px;
}

/* ============================================================
   PAGE ELEMENTS
============================================================ */
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.page-header p { color: var(--gray-500); margin-top: 4px; }

.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
  font-size: 15px;
}

/* ============================================================
   CARDS
============================================================ */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 16px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon { font-size: 30px; }
.stat-label { color: var(--gray-500); font-size: 12px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--gray-900); line-height: 1.1; }
.stat-sub { color: var(--gray-400); font-size: 11px; margin-top: 2px; }

/* ============================================================
   GRID
============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ============================================================
   FORMS
============================================================ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-group small { color: var(--gray-400); font-size: 12px; display: block; margin-top: 4px; }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
  color: var(--gray-800);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* WebKit (iOS Safari and Chromium-on-iOS browsers like Brave, which all use WebKit's
   rendering engine on iOS) sizes <input type="date"> using its own internal day/month/year
   layout, which can render wider than width:100% asks for regardless of box-sizing --
   min-width:0 alone doesn't stop it. Stripping the native appearance forces it to size
   like a plain box, matching sibling .form-control fields (selects, text inputs). */
input[type="date"].form-control {
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover:not(:disabled) { background: #b45309; }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-300); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; padding: 11px; font-size: 15px; margin-top: 4px; }

/* ============================================================
   BADGES
============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}
.badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-approved { background: var(--success-light); color: var(--success); }
.badge-rejected { background: var(--danger-light); color: var(--danger); }
.badge-cancelled { background: var(--gray-100); color: var(--gray-500); }
.badge-cleared { background: var(--success-light); color: var(--success); }
.badge-uncleared { background: var(--warning-light); color: var(--warning); }
.badge-manager { background: #fdf4ff; color: #7e22ce; }
.badge-employee { background: var(--primary-light); color: var(--primary); }
.badge-active { background: var(--success-light); color: var(--success); }
.badge-inactive { background: var(--gray-100); color: var(--gray-500); }

/* ============================================================
   ALERTS
============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #bbf7d0; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fde68a; }
.alert-info { background: var(--primary-light); color: var(--primary); border: 1px solid #bfdbfe; }

/* ============================================================
   TABLE
============================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th {
  background: var(--gray-50);
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }
.empty-row td { text-align: center; color: var(--gray-400); padding: 40px; font-size: 14px; }

/* ============================================================
   BALANCE BAR
============================================================ */
.balance-bar-wrap {
  background: var(--gray-200);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-top: 8px;
}
.balance-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.6s ease;
}
.balance-bar.low { background: var(--warning); }
.balance-bar.critical { background: var(--danger); }

/* ============================================================
   CALENDAR
============================================================ */
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.cal-header h3 { font-size: 18px; font-weight: 700; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--gray-200);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}

.cal-day-header {
  background: var(--gray-100);
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
}

.cal-day {
  background: #fff;
  min-height: 80px;
  padding: 6px;
  font-size: 12px;
}
.cal-day.other-month { background: var(--gray-50); }
.cal-day.today { background: var(--primary-light); }
.cal-day.weekend { background: #fafafa; }
.cal-day.holiday { background: #f0fdf4; }
.cal-date { font-weight: 600; font-size: 13px; color: var(--gray-700); margin-bottom: 4px; }
.cal-day.today .cal-date { color: var(--primary); font-weight: 800; }

.cal-event {
  display: block;
  padding: 2px 4px;
  border-radius: 3px;
  margin-bottom: 2px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}
.cal-event.vacation { background: #dbeafe; color: #1e40af; }
.cal-event.sick { background: #fee2e2; color: #991b1b; }
.cal-event.holiday { background: #dcfce7; color: #166534; }
.cal-event.birthday { background: #fce7f3; color: #9d174d; }

.cal-legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-600); }
.legend-dot { width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }

/* ============================================================
   MODAL
============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 20px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: #fff;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 4px;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px 8px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--gray-100); }
.modal-body { padding: 16px 20px; }
.modal-footer {
  padding: 0 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   TOAST
============================================================ */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  max-width: 340px;
  animation: toastIn 0.3s ease;
}
.toast-success { background: #15803d; }
.toast-danger { background: var(--danger); }
.toast-warning { background: var(--warning); }
@keyframes toastIn {
  from { transform: translateX(80px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================================
   OVERLAY (mobile sidebar)
============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 190;
}
.sidebar-overlay.open { display: block; }

/* ============================================================
   SIDEBAR SECTION LABELS
============================================================ */
.nav-section-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 14px 12px 4px;
  margin-top: 2px;
}

/* ============================================================
   CALENDAR — HOLIDAY DOTS
============================================================ */
.cal-date-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}
.cal-hol-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.cal-hol-tip {
  display: none;
  position: absolute;
  left: 12px;
  top: -4px;
  background: var(--gray-800);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 100;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.cal-hol-dot:hover .cal-hol-tip,
.cal-hol-dot.show-tip .cal-hol-tip { display: block; }

/* ============================================================
   TIMELINE
============================================================ */
.tl-outer {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}
.tl-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 65vh;
  -webkit-overflow-scrolling: touch;
}
.tl-table {
  border-collapse: collapse;
  white-space: nowrap;
  table-layout: fixed;
  width: max-content;
}
.tl-sticky {
  position: sticky;
  left: 0;
  z-index: 10;
}
.tl-name-col {
  min-width: 130px;
  max-width: 130px;
  width: 130px;
}
.tl-header-name {
  background: var(--gray-800);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  text-align: left;
  border-right: 2px solid var(--gray-600);
}
.tl-month-header {
  background: var(--gray-800);
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 4px;
  border-right: 2px solid var(--gray-600);
  border-bottom: 1px solid var(--gray-600);
}
.tl-day-num {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  text-align: center;
  font-size: 11px;
  color: var(--gray-500);
  padding: 3px 1px;
  border: 1px solid var(--gray-100);
  background: #fff;
  position: relative;
  vertical-align: middle;
}
.tl-day-num.tl-weekend    { background: var(--gray-100); color: var(--gray-400); }
.tl-day-num.tl-today-col  { background: var(--primary-light); color: var(--primary); font-weight: 800; }
.tl-day-num.tl-holiday-col { background: #dcfce7; }
.tl-emp-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  padding: 0 10px;
  background: #fff;
  border-bottom: 1px solid var(--gray-100);
  border-right: 2px solid var(--gray-200);
  height: 34px;
  vertical-align: middle;
}
.tl-cell {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  border: 1px solid var(--gray-100);
  text-align: center;
  vertical-align: middle;
  background: #fff;
  line-height: 0; /* so the 🎂 glyph can't stretch its row taller than the others */
}
.tl-cell.tl-weekend    { background: var(--gray-50); }
.tl-cell.tl-today-col   { background: rgba(37,99,235,0.06); border-color: rgba(37,99,235,0.2); }
.tl-cell.tl-holiday-col { background: rgba(22,163,74,0.06); }
.tl-cell.tl-vacation    { background: #dbeafe; }
.tl-cell.tl-sick        { background: #fee2e2; }
.tl-cell.tl-vacation.tl-holiday-col { background: #bfdbfe; }
.tl-sick-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.tl-bday-dot {
  display: inline-block;
  font-size: 13px;
  line-height: 14px;
  height: 14px;
  vertical-align: middle;
  margin-left: 1px;
}
.tl-hol-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  cursor: pointer;
  margin-left: 2px;
  vertical-align: middle;
}
.tl-hol-dot-leg {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}
.tl-tooltip {
  position: fixed;
  background: var(--gray-800);
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  z-index: 9999;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  max-width: 220px;
}
.tl-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.tl-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.tl-cycle-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
}

/* Custom scrollbar track/thumb (Premiere-style) */
.tl-scrollbar-track {
  height: 12px;
  background: var(--gray-100);
  border-radius: 999px;
  margin-top: 8px;
  position: relative;
  cursor: pointer;
}
.tl-scrollbar-thumb {
  position: absolute;
  top: 0;
  height: 12px;
  min-width: 40px;
  background: var(--primary);
  border-radius: 999px;
  cursor: grab;
  transition: background 0.15s;
}
.tl-scrollbar-thumb:hover { background: var(--primary-dark); }
.tl-scrollbar-thumb.dragging { cursor: grabbing; background: var(--primary-dark); }

/* Hide native horizontal scrollbar on the wrap since we have a custom one */
.tl-wrap::-webkit-scrollbar { height: 0; }
.tl-wrap { scrollbar-width: none; }

.view-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   PROFILE PAGE
============================================================ */
.profile-field {
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}
.profile-field:last-of-type { border-bottom: none; }
.profile-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.profile-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
}

/* ============================================================
   VERSION HISTORY
============================================================ */
.version-history {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.version-entry {
  border-left: 2px solid var(--gray-200);
  padding-left: 14px;
}
.version-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.version-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--gray-100);
  color: var(--gray-600);
}
.version-badge-current {
  background: var(--primary-light);
  color: var(--primary);
}
.version-date {
  font-size: 12px;
  color: var(--gray-400);
}
.version-notes {
  list-style: disc;
  padding-left: 18px;
  color: var(--gray-600);
  font-size: 13px;
  line-height: 1.7;
}

/* ============================================================
   ADMIN NOTES
============================================================ */
.admin-note {
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.admin-note:last-child { border-bottom: none; }
.admin-note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--gray-400);
  margin-bottom: 6px;
}
.admin-note-text {
  font-size: 14px;
  color: var(--gray-800);
  white-space: pre-wrap;
  line-height: 1.5;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
  /* iOS Safari auto-zooms the page when a focused input has font-size < 16px.
     Forcing 16px here prevents that zoom-in-and-stuck-zoomed behavior. */
  .form-control, select.form-control, textarea.form-control, input, select, textarea {
    font-size: 16px !important;
  }
  input[type="date"].form-control {
    padding-left: 8px;
    padding-right: 8px;
  }
  .hide-mobile { display: none; }
  .sidebar {
    transform: translateX(-100%);
    width: 240px;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { display: flex; padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); }
  .main-content {
    margin-left: 0;
    padding-top: 72px;
    padding-bottom: 24px;
    padding-left: calc(18px + env(safe-area-inset-left));
    padding-right: calc(18px + env(safe-area-inset-right));
  }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .cal-day { min-height: 52px; }
  .cal-event { display: none; }
  .cal-day.has-events::after {
    content: '•';
    color: var(--primary);
    display: block;
    text-align: center;
    font-size: 14px;
  }
  .modal-box { max-width: 100%; margin: 0; border-radius: 16px 16px 0 0; }
  .modal-overlay { align-items: flex-end; }
  table { min-width: 0; }
  td, th { padding: 8px; font-size: 12px; }
  .btn-sm { padding: 5px 8px; font-size: 11px; }
  #toastContainer {
    bottom: calc(16px + env(safe-area-inset-bottom));
    right: calc(16px + env(safe-area-inset-right));
    left: calc(16px + env(safe-area-inset-left));
  }
  .toast { min-width: 0; }

  /* Timeline — mobile sizing */
  .tl-name-col       { min-width: 90px; max-width: 90px; width: 90px; }
  .tl-day-num        { width: 28px; min-width: 28px; max-width: 28px; font-size: 10px; }
  .tl-cell           { width: 28px; min-width: 28px; max-width: 28px; height: 30px; }
  .tl-emp-name       { font-size: 12px; padding: 0 6px; height: 30px; }
  .tl-wrap           { max-height: 55vh; }
  .tl-scrollbar-track{ height: 16px; }
  .tl-scrollbar-thumb{ height: 16px; }
  .tl-toolbar         { flex-direction: column; align-items: flex-start; }
  .view-toggle .btn  { flex: 1; }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .card { padding: 16px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
}
