/* ============================================================
   EMPLOYEE TRAVEL PLANNER — Styles
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #dbeafe;
  --green:         #16a34a;
  --green-light:   #dcfce7;
  --red:           #dc2626;
  --red-light:     #fee2e2;
  --amber:         #d97706;
  --amber-light:   #fef3c7;
  --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;
  --white:         #ffffff;
  --shadow-sm:     0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow:        0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-md:     0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg:     0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --radius:        0.5rem;
  --radius-lg:     0.75rem;
  --radius-full:   9999px;
  --transition:    0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ── Layout ────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 28px;
  height: 28px;
  stroke: var(--primary);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.header-nav {
  display: flex;
  gap: 0.375rem;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--gray-600);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.nav-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.nav-btn.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Main & Panels ─────────────────────────────────────────── */
.site-main { flex: 1; padding: 2rem 0 3rem; }

.panel { display: none; }
.panel.active { display: block; }
.hidden { display: none !important; }

/* ── Panel Intro ───────────────────────────────────────────── */
.panel-intro {
  margin-bottom: 1.75rem;
}

.panel-intro h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.03em;
  margin-bottom: 0.375rem;
}

.panel-intro p {
  color: var(--gray-500);
  font-size: 0.9375rem;
}

/* ── How It Works ──────────────────────────────────────────── */
.how-it-works {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  overflow: hidden;
}

.hiw-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1.25rem 1.5rem;
  background: var(--white);
  transition: background var(--transition);
}

.hiw-step:hover { background: var(--gray-50); }

.hiw-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hiw-icon svg { width: 20px; height: 20px; }

.hiw-icon-1 { background: var(--primary-light); }
.hiw-icon-1 svg { stroke: var(--primary); }
.hiw-icon-2 { background: var(--green-light); }
.hiw-icon-2 svg { stroke: var(--green); }
.hiw-icon-3 { background: var(--amber-light); }
.hiw-icon-3 svg { stroke: var(--amber); }

.hiw-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
}

.hiw-text strong {
  font-size: 0.875rem;
  color: var(--gray-800);
}

.hiw-text span { color: var(--gray-500); line-height: 1.5; }
.hiw-text em   { font-style: normal; font-weight: 500; color: var(--gray-700); }

.hiw-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--gray-300);
  flex-shrink: 0;
  padding: 0 0.25rem;
  border-left: 1px solid var(--gray-100);
  border-right: 1px solid var(--gray-100);
}

/* ── Status Key ────────────────────────────────────────────── */
.status-key {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.625rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
}

.key-label {
  font-weight: 600;
  color: var(--gray-600);
  flex-shrink: 0;
}

.key-item { color: var(--gray-600); }
.key-office { color: #15803d; }
.key-travel { color: var(--primary-dark); }
.key-leave  { color: #92400e; }
.key-sep    { color: var(--gray-300); }

/* ── Back Office Guide ─────────────────────────────────────── */
.bo-guide {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.bo-guide-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-right: 1px solid #bfdbfe;
  font-size: 0.8125rem;
  color: var(--gray-600);
  line-height: 1.5;
}

.bo-guide-item:last-child { border-right: none; }

.bo-guide-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--primary);
  flex-shrink: 0;
}

.bo-guide-item strong {
  color: var(--primary-dark);
  font-size: 0.8125rem;
}

.bo-guide-item em {
  font-style: normal;
  font-weight: 500;
  color: var(--gray-700);
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  gap: 1rem;
}

.card-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.card-header h3 svg { width: 18px; height: 18px; stroke: var(--primary); }

.card-sub {
  font-size: 0.8125rem;
  color: var(--gray-400);
  margin-top: 0.125rem;
}

.card-body { padding: 1.5rem; }
.card-body.no-pad { padding: 0; }

.card-header.clickable {
  cursor: pointer;
  user-select: none;
}
.card-header.clickable:hover { background: var(--gray-50); }

.toggle-icon {
  width: 20px;
  height: 20px;
  stroke: var(--gray-400);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.toggle-icon.open { transform: rotate(180deg); }

/* ── Form Grid ─────────────────────────────────────────────── */
.form-grid {
  display: grid;
  gap: 1rem;
}
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ── Fields ────────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 0.375rem; }

.field-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-700);
}

.req { color: var(--red); }

.field-input,
.field-select,
.field-textarea {
  padding: 0.5625rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  font-family: inherit;
}

.field-input::placeholder,
.field-textarea::placeholder { color: var(--gray-400); }

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / .15);
}

.field-input.invalid { border-color: var(--red); }
.field-input.invalid:focus { box-shadow: 0 0 0 3px rgb(220 38 38 / .15); }

.field-err {
  font-size: 0.75rem;
  color: var(--red);
  min-height: 1rem;
}

.field-textarea {
  resize: vertical;
  min-height: 64px;
}

/* ── Days Grid ─────────────────────────────────────────────── */
.days-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.875rem;
}

/* ── Day Card ──────────────────────────────────────────────── */
.day-card {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}

/* Day card status states */
.day-card[data-status="traveling"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.day-card[data-status="office"] {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-light);
}
.day-card[data-status="leave"] {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-light);
}

.day-card-head {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  transition: background var(--transition), border-color var(--transition);
}

.day-card[data-status="traveling"] .day-card-head { background: var(--primary-light); border-bottom-color: #bfdbfe; }
.day-card[data-status="office"]    .day-card-head { background: var(--green-light);   border-bottom-color: #86efac; }
.day-card[data-status="leave"]     .day-card-head { background: var(--amber-light);   border-bottom-color: #fcd34d; }

.day-head-top { display: flex; align-items: center; justify-content: space-between; }

.day-name-wrap { display: flex; flex-direction: column; gap: 0.125rem; }

.day-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--gray-800);
  transition: color var(--transition);
}

.day-card[data-status="traveling"] .day-name { color: var(--primary-dark); }
.day-card[data-status="office"]    .day-name { color: #15803d; }
.day-card[data-status="leave"]     .day-name { color: #92400e; }

.day-date { font-size: 0.75rem; color: var(--gray-400); }

/* Status selector */
.status-selector { display: flex; flex-wrap: wrap; gap: 0.25rem; }

.status-opt {
  flex: 1 1 auto;
  padding: 0.3125rem 0.375rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--white);
  color: var(--gray-500);
  transition: all var(--transition);
  white-space: nowrap;
  text-align: center;
  font-family: inherit;
  line-height: 1.4;
}

.status-opt:hover { border-color: var(--gray-400); color: var(--gray-700); background: var(--gray-50); }

.status-opt[data-status-val="office"].selected    { background: var(--green-light);   border-color: var(--green);   color: #15803d; font-weight: 600; }
.status-opt[data-status-val="wfh"].selected       { background: #eff6ff;              border-color: #93c5fd;        color: #1d4ed8; font-weight: 600; }
.status-opt[data-status-val="traveling"].selected { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.status-opt[data-status-val="leave"].selected     { background: var(--amber-light);   border-color: var(--amber);   color: #92400e; font-weight: 600; }

/* Day fields — hidden until a status is chosen */
.day-fields {
  padding: 1rem;
  display: none;
  flex-direction: column;
  gap: 0.625rem;
}

.day-card[data-status="office"] .day-fields,
.day-card[data-status="wfh"] .day-fields,
.day-card[data-status="traveling"] .day-fields,
.day-card[data-status="leave"] .day-fields { display: flex; }

/* Travel-specific fields — only visible when status = traveling */
.travel-only { display: none; flex-direction: column; gap: 0.625rem; }
.day-card[data-status="traveling"] .travel-only { display: flex; }

.day-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.day-field-row.single { grid-template-columns: 1fr; }

.day-fields .field-label { font-size: 0.75rem; }

.day-fields .field-input,
.day-fields .field-select,
.day-fields .field-textarea {
  font-size: 0.8125rem;
  padding: 0.4375rem 0.625rem;
}

.transport-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.375rem;
  margin-top: 0.25rem;
}

.transport-opt {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--gray-600);
  transition: all var(--transition);
  user-select: none;
}

.transport-opt:hover { border-color: var(--primary); color: var(--primary); }

.transport-opt input { display: none; }

.transport-opt.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}

/* Hotel checkbox */
.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-600);
  cursor: pointer;
  margin-top: 0.125rem;
}

.check-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── Form Actions ──────────────────────────────────────────── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow); }
.btn-primary:active { background: #1e40af; }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover { background: var(--primary-light); }

.btn-sm { padding: 0.4375rem 0.875rem; font-size: 0.8125rem; }
.btn-sm svg { width: 13px; height: 13px; }

.full-width { width: 100%; justify-content: center; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Success Banner ────────────────────────────────────────── */
.success-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--green-light);
  border: 1px solid #86efac;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1rem;
}

.success-check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.success-check svg {
  width: 24px;
  height: 24px;
  stroke: var(--white);
}

.success-body { flex: 1; }
.success-body h3 { font-size: 1.0625rem; font-weight: 600; color: #14532d; margin-bottom: 0.25rem; }
.success-body p { font-size: 0.875rem; color: #166534; }

/* ── Back Office Login ─────────────────────────────────────── */
.gate-container {
  display: flex;
  justify-content: center;
  padding: 4rem 1.5rem;
}

.login-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.login-icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--primary);
}

.login-card h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.375rem;
}

.login-card p {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

.login-card .field-group { text-align: left; margin-bottom: 1rem; }

.error-msg {
  font-size: 0.8125rem;
  color: var(--red);
  margin-top: 0.625rem;
  text-align: center;
}

/* ── Dashboard ─────────────────────────────────────────────── */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.dash-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.03em;
}

.dash-header p {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

/* ── Stats ─────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.stat-card.accent { border-top: 3px solid var(--primary); }

.stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.375rem;
}

.stat-card.accent .stat-num { color: var(--primary); }

.stat-lbl {
  font-size: 0.8125rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* ── Toolbar ───────────────────────────────────────────────── */
.toolbar-card .card-body { padding: 1rem 1.5rem; }

.toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.toolbar-filters {
  display: flex;
  align-items: flex-end;
  gap: 0.875rem;
  flex-wrap: wrap;
}

.toolbar-filters .field-group { min-width: 150px; }

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ── Badge ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: var(--gray-100);
  color: var(--gray-600);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

/* ── Table ─────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.plans-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.plans-table thead { background: var(--gray-50); }

.plans-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.plans-table td {
  padding: 0.875rem 1rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}

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

.plans-table tbody tr:hover td { background: var(--gray-50); }

.employee-name { font-weight: 600; color: var(--gray-900); }
.employee-email { font-size: 0.75rem; color: var(--gray-400); margin-top: 0.125rem; }

/* Day cell in table */
.day-cell { display: flex; flex-direction: column; gap: 0.125rem; max-width: 110px; }
.day-dest { font-weight: 500; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }
.day-transport, .day-note { font-size: 0.7rem; color: var(--gray-400); }
.day-none { color: var(--gray-300); font-style: italic; font-size: 0.75rem; }

/* Status badges in back-office table */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.badge-office    { background: var(--green-light);   color: #15803d; }
.badge-wfh       { background: #eff6ff;              color: #1d4ed8; }
.badge-leave     { background: var(--amber-light);   color: #92400e; }
.badge-traveling { background: var(--primary-light); color: var(--primary-dark); }

.empty-cell { text-align: center; padding: 3rem 1rem; }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--gray-400);
}
.empty-state svg { width: 36px; height: 36px; }
.empty-state p { font-size: 0.875rem; }

/* ── Report ────────────────────────────────────────────────── */
.report-section { margin-bottom: 1.75rem; }

.report-section h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.report-stat {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  text-align: center;
}

.report-stat .num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.report-stat .lbl {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

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

.report-table th {
  background: var(--gray-100);
  padding: 0.625rem 0.875rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

.report-table td {
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
}

.report-table tr:nth-child(even) td { background: var(--gray-50); }

/* Transport tag */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 500;
}

.tag-flight { background: #ede9fe; color: #7c3aed; }
.tag-driving { background: var(--green-light); color: var(--green); }
.tag-train { background: var(--amber-light); color: var(--amber); }
.tag-ferry { background: #e0f2fe; color: #0369a1; }
.tag-other { background: var(--gray-100); color: var(--gray-600); }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / .5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--gray-900);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0.25rem;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--gray-700); }

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

/* Wider modal variant for Settings */
.modal.modal-wide {
  max-width: 780px;
}

/* Dash header — multiple action buttons */
.dash-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Settings modal */
.settings-section {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.settings-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 0.5rem 0;
}
.settings-help {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.settings-help code {
  background: var(--gray-100);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.8125rem;
}
.settings-test {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.settings-result {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-right: 0.5rem;
}
.settings-result.ok  { color: #15803d; }
.settings-result.err { color: #b91c1c; }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--gray-200);
  background: var(--white);
  padding: 1rem 0;
}

.site-footer p {
  font-size: 0.8125rem;
  color: var(--gray-400);
  text-align: center;
}

/* ── Tour Button ───────────────────────────────────────────── */
.tour-nav-btn {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: var(--white) !important;
  border: none;
  box-shadow: var(--shadow-sm);
}
.tour-nav-btn:hover {
  background: linear-gradient(135deg, #6d28d9, #4338ca);
  color: var(--white) !important;
  box-shadow: var(--shadow);
}
.tour-nav-btn svg { stroke: var(--white); }

/* ── Tour Overlay Elements ─────────────────────────────────── */

/* Dark backdrop — used for centered (no-target) steps */
#tour-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 490;
  backdrop-filter: blur(2px);
}

/* Spotlight ring — used for targeted steps.
   The massive box-shadow creates the dim overlay;
   the ring itself outlines the highlighted element. */
#tour-ring {
  display: none;
  position: fixed;
  border-radius: 10px;
  box-shadow:
    0 0 0 3px #7c3aed,
    0 0 0 6px rgba(124, 58, 237, 0.25),
    0 0 0 9999px rgba(0, 0, 0, 0.62);
  z-index: 490;
  pointer-events: none;
  transition: top 0.32s cubic-bezier(.4,0,.2,1),
              left 0.32s cubic-bezier(.4,0,.2,1),
              width 0.32s cubic-bezier(.4,0,.2,1),
              height 0.32s cubic-bezier(.4,0,.2,1);
}

/* Tour card — shared base */
#tour-card {
  position: fixed;
  z-index: 500;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px -10px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.08);
  animation: tourPop .22s cubic-bezier(.34,1.56,.64,1) both;
  max-height: 88vh;
  overflow-y: auto;
}

/* Centered variant (welcome / summary steps) */
#tour-card.tour-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, calc(100vw - 2rem));
}

/* Floating variant (next to a target element) */
#tour-card.tour-float {
  /* top / left / width set by JS */
}

@keyframes tourPop {
  from { opacity: 0; transform: scale(.92) translateY(6px); }
  to   { opacity: 1; transform: scale(1)  translateY(0);    }
}

#tour-card.tour-center {
  animation: tourFade .25s ease both;
}
@keyframes tourFade {
  from { opacity: 0; transform: translate(-50%,-48%); }
  to   { opacity: 1; transform: translate(-50%,-50%); }
}

/* ── Tour Card Interior ────────────────────────────────────── */
.tour-inner { padding: 1.5rem; }

.tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
}

.tour-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  background: #ede9fe;
  color: #6d28d9;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.tour-x {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem 0.375rem;
  border-radius: var(--radius);
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}
.tour-x:hover { color: var(--gray-700); background: var(--gray-100); }

.tour-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.tour-body {
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.65;
}

.tour-body p   { margin-bottom: 0.625rem; }
.tour-body p:last-child { margin-bottom: 0; }
.tour-body ul  { padding-left: 1.25rem; margin-bottom: 0.625rem; }
.tour-body li  { margin-bottom: 0.3rem; }
.tour-body strong { color: var(--gray-800); }

/* Benefit callout line */
.tour-benefit {
  display: block;
  margin-top: 0.75rem !important;
  padding: 0.5rem 0.75rem;
  background: #f0fdf4;
  border-left: 3px solid var(--green);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #166534 !important;
  font-size: 0.8125rem !important;
  font-style: italic;
}

/* Small note line */
.tour-note {
  margin-top: 0.625rem !important;
  color: var(--gray-400) !important;
  font-size: 0.8125rem !important;
}

/* ── Tour Footer ───────────────────────────────────────────── */
.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
  gap: 0.75rem;
}

.tour-dots {
  display: flex;
  gap: 0.3125rem;
  align-items: center;
  flex-wrap: wrap;
  max-width: 180px;
}

.tdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray-200);
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.tdot.done { background: #c4b5fd; }
.tdot.cur  { background: #7c3aed; transform: scale(1.4); }

.tour-btns {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* ── Before/After comparison table ────────────────────────── */
.tour-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.25rem;
}

.tour-compare-col {
  border-radius: var(--radius);
  padding: 1rem;
  font-size: 0.8125rem;
}

.tour-compare-bad  { background: #fef2f2; border: 1px solid #fecaca; }
.tour-compare-good { background: #f0fdf4; border: 1px solid #86efac; }

.tour-compare-head {
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.625rem;
}

.tour-compare-bad  .tour-compare-head { color: #991b1b; }
.tour-compare-good .tour-compare-head { color: #14532d; }

.tour-compare-col ul {
  padding-left: 1.1rem;
  color: var(--gray-600);
  line-height: 1.7;
}

.tour-compare-bad  ul { color: #7f1d1d; }
.tour-compare-good ul { color: #166534; }

/* ── Print Styles ──────────────────────────────────────────── */
@media print {
  .site-header,
  .site-footer,
  .toolbar-card,
  .btn,
  #bo-login-gate,
  .days-grid,
  #submit-panel { display: none !important; }

  .site-main { padding: 0; }
  #backoffice-panel,
  #bo-dashboard { display: block !important; }

  .stats-row { grid-template-columns: repeat(4, 1fr); break-inside: avoid; }
  .card { break-inside: avoid; box-shadow: none; }
  .plans-table { font-size: 0.75rem; }

  #report-body { display: block !important; }
  #report-output { display: block !important; }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .days-grid  { grid-template-columns: repeat(3, 1fr); }
  .stats-row  { grid-template-columns: repeat(2, 1fr); }
  .bo-guide   { grid-template-columns: repeat(2, 1fr); }
  .bo-guide-item:nth-child(2) { border-right: none; }
  .bo-guide-item:nth-child(1),
  .bo-guide-item:nth-child(2) { border-bottom: 1px solid #bfdbfe; }
}

@media (max-width: 768px) {
  .form-grid.cols-3,
  .form-grid.cols-2 { grid-template-columns: 1fr; }
  .days-grid { grid-template-columns: 1fr 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-filters { flex-direction: column; }
  .toolbar-filters .field-group { min-width: unset; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { justify-content: center; }
  .nav-btn span { display: none; }
  .success-banner { flex-direction: column; text-align: center; }
  .how-it-works { flex-direction: column; }
  .hiw-arrow { display: none; }
  .hiw-step { border-bottom: 1px solid var(--gray-100); }
  .hiw-step:last-child { border-bottom: none; }
  .bo-guide { grid-template-columns: 1fr; }
  .bo-guide-item { border-right: none; border-bottom: 1px solid #bfdbfe; }
  .bo-guide-item:last-child { border-bottom: none; }
  .status-key { flex-direction: column; gap: 0.375rem; }
  .key-sep { display: none; }
}

@media (max-width: 480px) {
  .days-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 1.75rem 1.25rem; }
  .panel-intro h2 { font-size: 1.375rem; }
}

/* ── Edit-mode banner ─────────────────────────────────────── */
.edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  background: var(--amber-light);
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  color: #78350f;
  font-size: .9rem;
}

/* ── Row actions in the back-office table ─────────────────── */
.row-actions {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
}
.row-actions .delete-btn { color: var(--red); }
.row-actions .delete-btn:hover { background: var(--red-light); }

/* ── My Submissions panel ─────────────────────────────────── */
.my-lookup {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  max-width: 540px;
  margin: 0 auto 1.5rem;
}
.my-lookup .field-group { flex: 1; }
#my-results .empty-cell { padding: 2rem; text-align: center; color: var(--gray-400); }

/* ════════════════════════════════════════════════════════════════
   PHASE 1: AUTH SHELL + USER UI
   ════════════════════════════════════════════════════════════════ */

/* Login & accept-invite full-screen layout */
.auth-shell,
body.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f3f4f6 0%, #e0e7ff 100%);
  padding: 1.5rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
}
.auth-brand .brand-name {
  font-size: 1.125rem;
  font-weight: 700;
}
.auth-card h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0 0 .5rem 0;
  color: var(--gray-900);
}
.auth-help {
  font-size: .875rem;
  color: var(--gray-500);
  margin: 0 0 1.25rem 0;
  line-height: 1.5;
}
.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
  font-size: .8125rem;
  color: var(--gray-500);
}

/* Header right: user chip + logout */
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.header-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .625rem;
  background: var(--gray-100);
  border-radius: 999px;
  font-size: .8125rem;
  color: var(--gray-700);
  font-weight: 500;
}

/* Role / status badges */
.role-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--gray-200);
  color: var(--gray-700);
  vertical-align: middle;
}
.badge-role-employee { background: #dbeafe; color: #1e40af; }
.badge-role-bo       { background: #ede9fe; color: #5b21b6; }
.badge-role-fire     { background: #fee2e2; color: #991b1b; }
.badge-active        { background: #dcfce7; color: #166534; }
.badge-disabled      { background: #f3f4f6; color: #6b7280; }

/* Role select inside users table */
.role-select {
  font-size: .8125rem;
  padding: .25rem .375rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--white);
}
