/* ============================================================
   Entre Portal — Styles (Fakturly Design System)
   Light theme, brand blue, Space Grotesk + Inter
   Mobile-first (375px base)
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Epilogue:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,600;9..144,700&display=swap');

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

/* ── Design Tokens ── */
:root {
  /* Brand Blue */
  --color-brand-50:   #F0F4FF;
  --color-brand-100:  #EBF2FF;
  --color-brand-200:  #BFCFFF;
  --color-brand-300:  #93AEFF;
  --color-brand-400:  #6B8EF7;
  --color-brand-500:  #3470F5;
  --color-brand-600:  #1A56DB;
  --color-brand-700:  #1447B8;
  --color-brand-800:  #0E3590;
  --color-brand-900:  #092268;

  /* Backgrounds */
  --color-bg-app:     #FAF9F7;
  --color-bg-card:    #FFFFFF;
  --color-bg-subtle:  #F0EDE8;
  --color-bg-muted:   #E8E5E0;
  --color-bg-inverse: #0F1923;
  --color-bg-overlay: rgba(15, 25, 35, 0.48);

  /* Success */
  --color-success-50:  #ECFDF5;
  --color-success-100: #D1FAE5;
  --color-success-500: #10A060;
  --color-success-600: #0C7B4E;
  --color-success-700: #065F38;

  /* Warning */
  --color-warning-50:  #FFFBEB;
  --color-warning-100: #FEF3C7;
  --color-warning-500: #F59E0B;
  --color-warning-600: #B45309;
  --color-warning-700: #92400E;

  /* Error */
  --color-error-50:  #FFF5F5;
  --color-error-100: #FEE2E2;
  --color-error-500: #EF4444;
  --color-error-600: #DC2626;
  --color-error-700: #B91C1C;

  /* Neutral */
  --color-neutral-50:  #F9FAFB;
  --color-neutral-100: #F3F4F6;
  --color-neutral-200: #E5E7EB;
  --color-neutral-300: #D1D5DB;
  --color-neutral-400: #9CA3AF;
  --color-neutral-500: #6B7280;
  --color-neutral-600: #4B5563;
  --color-neutral-700: #374151;
  --color-neutral-800: #1F2937;
  --color-neutral-900: #111827;

  /* Semantic text */
  --color-text-primary:   #111827;
  --color-text-secondary: #374151;
  --color-text-tertiary:  #6B7280;
  --color-text-disabled:  #9CA3AF;
  --color-text-inverse:   #F9FAFB;
  --color-text-brand:     #1A56DB;

  /* Borders */
  --color-border-default: #E5E7EB;
  --color-border-strong:  #D1D5DB;
  --color-border-brand:   #1A56DB;
  --color-border-error:   #DC2626;

  /* Legacy aliases (for JS that may use these) */
  --bg:        var(--color-bg-app);
  --bg2:       var(--color-bg-card);
  --bg3:       var(--color-bg-subtle);
  --border:    var(--color-border-default);
  --amber:     var(--color-brand-600);
  --amber-dim: var(--color-brand-700);
  --text:      var(--color-text-primary);
  --text-dim:  var(--color-text-tertiary);
  --green:     var(--color-success-600);
  --red:       var(--color-error-600);
  --blue:      var(--color-brand-600);

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Epilogue', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --font:         var(--font-body);

  /* Spacing */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;

  /* Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  20px;
  --radius-pill: 100px;
  --r:    var(--radius-lg);
  --r-sm: var(--radius-md);

  /* Animation */
  --duration-fast:   150ms;
  --duration-normal: 250ms;
  --duration-slow:   400ms;
  --ease-out:  cubic-bezier(0.0, 0.0, 0.2, 1.0);
  --ease-both: cubic-bezier(0.4, 0.0, 0.2, 1.0);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--color-bg-app);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ============================================================
   App Shell & Screens
   ============================================================ */

#app { display: flex; flex-direction: column; min-height: 100vh; }

.screen { display: none; flex-direction: column; min-height: 100vh; background: var(--color-bg-app); }
.screen.active { display: flex; }

/* Page enter animation */
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen.active { animation: page-in var(--duration-normal) var(--ease-out); }

/* Scrollable area */
.content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(80px + env(safe-area-inset-bottom));
}

/* ── Top Bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border-default);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 56px;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}
.topbar-back {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) var(--ease-out);
}
.topbar-back:hover { background: var(--color-bg-subtle); }
.topbar-action {
  background: none;
  border: none;
  color: var(--color-text-brand);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 10px;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) var(--ease-out);
}
.topbar-action:hover { background: var(--color-brand-50); }

/* ── Bottom Navigation ── */
.bottom-nav {
  display: flex;
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border-default);
  position: sticky;
  bottom: 0;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}
.nav-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  padding: 10px 4px 12px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: color var(--duration-fast) var(--ease-out);
  min-height: 60px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn .nav-icon { font-size: 20px; line-height: 1; }
.nav-btn.active { color: var(--color-brand-600); }

/* Top indicator line on active tab */
.nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--color-brand-600);
  border-radius: 0 0 2px 2px;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

/* Interactive card (tiles) */
.card-interactive {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}
.card-interactive:hover {
  border-color: var(--color-border-strong);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: block;
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 20px;
  text-align: center;
  transition: all var(--duration-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  text-decoration: none;
}
.btn:active  { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--color-brand-500); outline-offset: 2px; }

.btn-primary {
  background: var(--color-brand-600);
  color: #FFFFFF;
}
.btn-primary:hover  { background: var(--color-brand-700); box-shadow: 0 2px 8px rgba(26,86,219,0.30); }

.btn-secondary {
  background: transparent;
  color: var(--color-brand-600);
  border: 1.5px solid var(--color-brand-600);
}
.btn-secondary:hover { background: var(--color-brand-50); }

.btn-danger {
  background: var(--color-error-600);
  color: #FFFFFF;
}
.btn-danger:hover { background: var(--color-error-700); }

.btn-success {
  background: var(--color-success-600);
  color: #FFFFFF;
}
.btn-success:hover { background: var(--color-success-700); }

/* Small inline variant */
.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 36px;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
}

/* ============================================================
   Tiles (Home screen)
   ============================================================ */

.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.tile {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-height: 108px;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.tile:hover, .tile:active {
  border-color: var(--color-brand-600);
  box-shadow: 0 4px 12px rgba(26,86,219,0.12);
  transform: translateY(-1px);
}

.tile.tile-main {
  grid-column: 1 / -1;
  background: var(--color-brand-600);
  border-color: var(--color-brand-600);
  min-height: 80px;
  flex-direction: row;
  gap: 12px;
  justify-content: center;
  padding: 18px 24px;
  box-shadow: 0 4px 12px rgba(26,86,219,0.25);
}
.tile.tile-main:hover {
  background: var(--color-brand-700);
  border-color: var(--color-brand-700);
  box-shadow: 0 6px 20px rgba(26,86,219,0.35);
  transform: translateY(-1px);
}

.tile-icon  { font-size: 28px; line-height: 1; }
.tile-label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.3;
}
.tile.tile-main .tile-icon  { font-size: 26px; }
.tile.tile-main .tile-label {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: #FFFFFF;
}

/* ============================================================
   Forms
   ============================================================ */

.form-group { margin-bottom: 16px; }

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 48px;
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-border-strong);
  color: var(--color-text-primary);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 16px;
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-border-brand);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-disabled);
}

/* Select arrow */
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-textarea {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}

/* Date/time inputs */
input[type="date"],
input[type="time"],
input[type="month"] { color-scheme: light; }

/* ============================================================
   Progress bar & week dots
   ============================================================ */

.progress-wrap {
  background: var(--color-bg-subtle);
  border-radius: 99px;
  height: 6px;
  margin: 10px 0 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--color-brand-600);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.week-status { font-size: 14px; color: var(--color-text-secondary); font-weight: 500; }
.week-dots   { display: flex; gap: 6px; margin-top: 10px; }
.week-dot    {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--color-bg-muted);
  transition: background 0.3s;
}
.week-dot.filled { background: var(--color-success-500); }
.week-dot.today  { background: var(--color-brand-600); }

/* ============================================================
   Live calculation display
   ============================================================ */

.hour-calc {
  background: var(--color-brand-50);
  border: 1px solid var(--color-brand-200);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  margin-bottom: 16px;
}
.hour-calc-num   {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-brand-700);
  line-height: 1;
}
.hour-calc-label { font-size: 13px; color: var(--color-text-tertiary); margin-top: 4px; }

/* ============================================================
   Tables
   ============================================================ */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left;
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border-default);
  white-space: nowrap;
  background: var(--color-bg-subtle);
}
td {
  padding: 13px 8px;
  border-bottom: 1px solid var(--color-border-default);
  vertical-align: middle;
  color: var(--color-text-primary);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--color-bg-subtle); }

/* Admin dashboard compact table */
.dash-table th { font-size: 10px; padding: 8px 5px; }
.dash-table td { padding: 10px 5px; }
.check-cell    { text-align: center; }
.check-yes     { color: var(--color-success-600); font-size: 15px; }
.check-no      { color: var(--color-error-600);   font-size: 15px; }

/* ============================================================
   Badges
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.6;
}
.badge-work     { background: var(--color-brand-100);    color: var(--color-brand-700); }
.badge-sick     { background: var(--color-error-100);    color: var(--color-error-700); }
.badge-vacation { background: var(--color-success-100);  color: var(--color-success-700); }
.badge-pending  { background: var(--color-warning-100);  color: var(--color-warning-700); }
.badge-approved { background: var(--color-success-100);  color: var(--color-success-700); }
.badge-denied   { background: var(--color-error-100);    color: var(--color-error-700); }

/* ============================================================
   Icon buttons
   ============================================================ */

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  font-size: 18px;
  color: var(--color-text-tertiary);
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover        { background: var(--color-bg-subtle); color: var(--color-text-secondary); }
.icon-btn.danger:hover { background: var(--color-error-100); color: var(--color-error-600); }

/* ============================================================
   Login Screen — matches Fakturly admin login
   ============================================================ */

#screen-login {
  position: relative;
  background: #FAF9F7;
  justify-content: center;
  align-items: center;
  padding: 24px;
  min-height: 100vh;
  overflow: hidden;
}

/* Hide the matrix canvas */
#matrix-canvas { display: none; }

.login-bg-square {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  width: 520px;
  height: 520px;
  background: #1A56DB;
  border-radius: 80px;
  opacity: 0.033;
  pointer-events: none;
  z-index: 0;
}

/* Login card */
#screen-login .login-card {
  position: relative;
  z-index: 1;
  background: #FFFFFF;
  border: 1px solid #E4DFD8;
  border-radius: 24px;
  box-shadow: 0 4px 32px rgba(14,14,14,0.07);
  padding: 48px 44px 44px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 480px) {
  #screen-login .login-card {
    padding: 36px 24px 32px;
  }
}

/* Watermark F — huge faint letter centered behind form */
#screen-login .login-watermark {
  position: absolute;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 350px;
  font-weight: 700;
  font-variation-settings: 'opsz' 144;
  color: #1A56DB;
  opacity: 0.03;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
  line-height: 1;
  z-index: 0;
}

/* All card content sits above the watermark */
#screen-login .login-card > *:not(.login-watermark) { position: relative; z-index: 1; }

/* Form and button run full width, left-aligned */
#screen-login .login-form,
#screen-login .btn-login { align-self: stretch; }

/* Logo row */
#screen-login .login-logo-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
  align-self: center;
}

/* Blue square mark */
#screen-login .login-logo-mark {
  width: 32px;
  height: 32px;
  background: #1A56DB;
  border-radius: 9px;
  transform: rotate(-8deg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#screen-login .login-logo-f {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  font-variation-settings: 'opsz' 144;
  color: #FFFFFF;
  transform: rotate(8deg);
  line-height: 1;
  display: block;
}

/* "Fakturly" wordmark */
#screen-login .login-logo-name {
  font-family: 'Epilogue', 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #0E0E0E;
  letter-spacing: -0.01em;
}

/* Heading */
#screen-login .login-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 30px;
  font-weight: 300;
  color: #0E0E0E;
  letter-spacing: -0.025em;
  text-align: center;
  margin-bottom: 6px;
  line-height: 1.1;
  width: 100%;
}

/* Subtitle */
#screen-login .login-subtitle {
  font-family: 'Epilogue', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: #6E6762;
  text-align: center;
  margin-bottom: 32px;
  width: 100%;
}

/* Login form */
#screen-login .login-form { width: 100%; }

/* Labels */
#screen-login .form-label {
  font-family: 'Epilogue', 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 6px;
}

/* Inputs — transparent bg so watermark shows through */
#screen-login .form-input {
  background: transparent;
  border: 1.5px solid #E4DFD8;
  border-radius: 10px;
  color: #0E0E0E;
  font-family: 'Epilogue', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  height: auto;
  padding: 11px 14px;
}
#screen-login .form-input:focus {
  border-color: #1A56DB;
  box-shadow: 0 0 0 3px rgba(26,86,219,0.08);
  outline: none;
}
#screen-login .form-input::placeholder { color: #C0BAB4; }

/* Error */
#screen-login .login-error {
  font-family: 'Epilogue', 'Segoe UI', system-ui, sans-serif;
  color: #DC2626;
  font-size: 13px;
  margin-bottom: 12px;
  text-align: center;
  min-height: 18px;
}

/* Login button */
#screen-login .btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #1A56DB;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-family: 'Epilogue', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 20px;
  min-height: unset;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  margin-top: 4px;
  letter-spacing: -0.005em;
}
#screen-login .btn-login:hover   { background: #1447B8; box-shadow: 0 4px 14px rgba(26,86,219,0.30); }
#screen-login .btn-login:active  { transform: translateY(1px) scale(0.98); }
#screen-login .btn-login:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ============================================================
   Home screen
   ============================================================ */

.welcome-banner { padding: 4px 0 4px; margin-bottom: 4px; }
.welcome-name   {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.welcome-date   { font-size: 14px; color: var(--color-text-tertiary); margin-top: 4px; }

/* Quick repeat */
.quick-repeat {
  background: var(--color-success-50);
  border: 1px solid var(--color-success-100);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.quick-repeat-label {
  font-size: 11px;
  color: var(--color-success-600);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.quick-repeat-info {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 14px;
  line-height: 1.4;
}

/* ============================================================
   Month filter
   ============================================================ */

.month-filter { margin-bottom: 16px; }
.month-filter .form-input { margin: 0; }

/* ============================================================
   Toggle
   ============================================================ */

.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border-strong);
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-track              { background: var(--color-brand-600); border-color: var(--color-brand-600); }
.toggle input:checked + .toggle-track::after       { transform: translateX(22px); }

/* ============================================================
   Toast
   ============================================================ */

#toast {
  position: fixed;
  bottom: calc(68px + env(safe-area-inset-bottom) + 12px);
  left: 16px;
  right: 16px;
  background: var(--color-bg-inverse);
  color: var(--color-text-inverse);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.20);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.22s, transform 0.22s;
  z-index: 999;
  max-width: 480px;
  margin: 0 auto;
}
#toast.show    { opacity: 1; transform: translateY(0); }
#toast.success { border-left: 3px solid var(--color-success-500); }
#toast.error   { border-left: 3px solid var(--color-error-500); }

/* ============================================================
   Modals (Bottom Sheet)
   ============================================================ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-bg-overlay);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

@keyframes sheet-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  animation: sheet-in var(--duration-slow) var(--ease-out);
  box-shadow: 0 -4px 32px rgba(0,0,0,0.12);
}
.modal-title   {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* ============================================================
   Empty states
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 52px 16px;
  color: var(--color-text-tertiary);
}
.empty-state-icon { font-size: 48px; margin-bottom: 14px; opacity: 0.6; }
.empty-state-text { font-size: 15px; line-height: 1.6; color: var(--color-text-tertiary); }

/* ============================================================
   Utilities
   ============================================================ */

.divider       { height: 1px; background: var(--color-border-default); margin: 16px 0; }
.mt-sm         { margin-top: 10px; }
.mt-md         { margin-top: 18px; }
.fw-bold       { font-weight: 700; }
.text-dim      { color: var(--color-text-tertiary); }
.text-amber    { color: var(--color-brand-600); }    /* legacy alias → brand blue */
.text-green    { color: var(--color-success-600); }
.text-red      { color: var(--color-error-600); }
.text-blue     { color: var(--color-brand-600); }
.flex-row      { display: flex; align-items: center; gap: 10px; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Amount display */
.amount {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Admin stat numbers */
#stat-workers, #stat-projects, #stat-hours, #stat-vacations,
#sum-hours, #sum-sick, #sum-vac {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

/* Sticky admin month header */
#admin-week-header th:first-child { background: var(--color-bg-subtle); }

/* ============================================================
   Tablet ≥600px
   ============================================================ */

@media (min-width: 600px) {
  .content {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }
  .tile-grid { grid-template-columns: repeat(3, 1fr); }
  .tile.tile-main { grid-column: 1 / -1; }
  .modal { border-radius: var(--radius-xl); margin: auto; }
  #toast { left: auto; right: 24px; bottom: 24px; max-width: 360px; }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
