/* StaffSwap — Design System
   #tokens #layout #components #views #animations */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }

/* === TOKENS === */
:root {
  /* Brand */
  --brand: #6366f1;
  --brand-dark: #4f46e5;
  --brand-light: #e0e7ff;
  --brand-text: #3730a3;

  /* Semantic */
  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-border: #86efac;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --warning-border: #fcd34d;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --danger-border: #fca5a5;
  --info: #0284c7;
  --info-bg: #e0f2fe;
  --info-border: #7dd3fc;

  /* Surface */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Text */
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --text-on-brand: #ffffff;

  /* Layout */
  --sidebar-w: 220px;
  --header-h: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 1px 4px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.1);
  --transition: 140ms ease;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #1e293b;
  --surface-3: #334155;
  --border: #334155;
  --border-strong: #475569;
  --text: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --brand-light: #1e1b4b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 1px 4px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.4);
}

/* === LAYOUT === */
#app {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--brand);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-logo-text { font-weight: 600; font-size: 15px; }
.sidebar-logo-sub { font-size: 11px; color: var(--text-3); }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 8px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-2);
  transition: background var(--transition), color var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-light); color: var(--brand-text); font-weight: 500; }
.nav-item .nav-icon { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}

/* === ENTRY GATE + PRODUCT TOUR === */
.entry-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 22% 12%, rgba(99,102,241,.24), transparent 34%),
    radial-gradient(circle at 80% 70%, rgba(14,165,233,.2), transparent 34%),
    rgba(2,6,23,.72);
  backdrop-filter: blur(20px);
}
.entry-gate.hidden { display: none; }
.entry-card {
  width: min(1080px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
  gap: 20px;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(241,245,249,.97));
  border: 1px solid rgba(255,255,255,.58);
  box-shadow: 0 28px 90px rgba(15,23,42,.38);
}
[data-theme="dark"] .entry-card {
  background: linear-gradient(145deg, rgba(15,23,42,.98), rgba(30,41,59,.96));
  border-color: rgba(148,163,184,.28);
}
.entry-copy {
  padding: clamp(18px, 4vw, 36px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.entry-kicker {
  width: fit-content;
  padding: 6px 10px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(99,102,241,.12);
  color: var(--brand-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
[data-theme="dark"] .entry-kicker { color: #c7d2fe; }
.entry-copy h1 {
  font-size: clamp(30px, 4.6vw, 56px);
  line-height: .98;
  letter-spacing: -.055em;
  color: var(--text);
  margin-bottom: 16px;
}
.entry-copy p {
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.65;
  max-width: 610px;
}
.entry-trust-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 24px;
}
.entry-trust-grid span {
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.14);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.entry-demo {
  min-height: 430px;
  border-radius: 20px;
  border: 1px solid rgba(99,102,241,.2);
  background:
    linear-gradient(180deg, rgba(99,102,241,.1), transparent 40%),
    var(--surface);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.entry-demo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.entry-demo-top span {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}
.entry-demo-top strong {
  color: var(--success);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  white-space: nowrap;
}
.entry-demo-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 98px repeat(7, minmax(44px, 1fr));
  align-content: start;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.entry-demo-cell {
  min-height: 40px;
  padding: 7px 6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.entry-demo-cell:nth-child(8n) { border-right: 0; }
.entry-demo-head { background: var(--surface-2); font-weight: 800; color: var(--text); }
.entry-demo-name { justify-content: flex-start; font-weight: 700; color: var(--text); background: var(--surface-2); }
.entry-demo-work {
  display: block;
  margin: 0 auto;
  width: 100%;
  padding: 5px 4px;
  border-radius: 8px;
  background: #dbeafe;
  color: #1d4ed8;
  border-left: 3px solid #3b82f6;
  font-weight: 800;
}
.entry-demo-work.morning { background: #fef9c3; color: #854d0e; border-color: #eab308; }
.entry-demo-work.night { background: #ede9fe; color: #5b21b6; border-color: #8b5cf6; }
.entry-demo-off { color: var(--text-3); font-weight: 800; letter-spacing: .04em; }
.entry-demo p {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.45;
}
.tour-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  width: min(380px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(15,23,42,.26);
  padding: 18px;
}
.tour-step-label {
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 6px;
}
.tour-panel h3 {
  font-size: 18px;
  line-height: 1.2;
  margin-bottom: 8px;
  color: var(--text);
}
.tour-panel p {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
}
.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.tour-highlight {
  position: relative;
  z-index: 9998 !important;
  outline: 3px solid rgba(99,102,241,.58) !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 9999px rgba(15,23,42,.46), 0 16px 50px rgba(99,102,241,.28) !important;
}
.local-download-strip {
  margin: 24px auto 0;
  max-width: 760px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.local-download-strip strong,
.local-download-strip span {
  display: block;
}
.local-download-strip strong {
  font-size: 13px;
  color: var(--text);
}
.local-download-strip span {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-2);
}

/* Main */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 16px; font-weight: 600; flex: 1; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.content { padding: 28px 24px; flex: 1; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }
.btn-icon.btn-sm { padding: 5px; width: 28px; height: 28px; }

/* === CARDS === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title { font-size: 15px; font-weight: 600; }
.card-subtitle { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* Stat cards */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-card-label { font-size: 12px; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-card-value { font-size: 28px; font-weight: 700; margin: 6px 0 4px; color: var(--text); }
.stat-card-sub { font-size: 12px; color: var(--text-2); }

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-border); }
.badge-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info-border); }
.badge-neutral { background: var(--surface-2);  color: var(--text-2);  border-color: var(--border); }

/* === FORM ELEMENTS === */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.form-hint { font-size: 12px; color: var(--text-3); }

.input, .select, .textarea {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.select { appearance: none; cursor: pointer; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
.textarea { resize: vertical; min-height: 80px; }

.input-error { border-color: var(--danger) !important; }

/* Toggle switch */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: 20px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider { background: var(--brand); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* === SCHEDULE GRID === */
.schedule-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.schedule-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  font-size: 12px;
}

.schedule-table th, .schedule-table td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.schedule-table thead th {
  background: var(--surface-2);
  padding: 8px 4px;
  text-align: center;
  white-space: nowrap;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-2);
  position: sticky;
  top: 0;
  z-index: 2;
}

.sched-emp-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface-2) !important;
  min-width: 130px;
  max-width: 130px;
  padding: 6px 10px !important;
  font-weight: 500;
  white-space: nowrap;
}

.sched-emp-row td.sched-emp-col { z-index: 1; }

.sched-day-head { min-width: 72px; }
.sched-day-head.today { background: var(--brand-light) !important; color: var(--brand-text) !important; }
.sched-day-head.weekend { color: var(--danger) !important; }

.sched-cell {
  min-width: 72px;
  height: 52px;
  padding: 3px 4px;
  vertical-align: middle;
  cursor: pointer;
  transition: background var(--transition);
}
.sched-cell:hover { background: var(--surface-2); }

.shift-pill {
  background: var(--brand-light);
  color: var(--brand-text);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  text-align: center;
  line-height: 1.3;
  height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 3px solid var(--brand);
  font-size: 11px;
}
.shift-pill.morning { background: #fef9c3; color: #854d0e; border-color: #eab308; }
.shift-pill.afternoon { background: #dbeafe; color: #1e40af; border-color: #3b82f6; }
.shift-pill.night { background: #1e1b4b; color: #a5b4fc; border-color: #6366f1; }
.shift-pill.custom { background: #f3e8ff; color: #6b21a8; border-color: #a855f7; }

.shift-time { font-weight: 600; font-size: 11px; }
.shift-name { font-size: 10px; opacity: .8; }

.rest-pill {
  color: var(--text-3);
  font-size: 11px;
  text-align: center;
  font-weight: 500;
  letter-spacing: .03em;
}

.warning-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
  position: absolute;
  top: 4px;
  right: 4px;
}

.sched-cell { position: relative; }

/* Employee color stripe */
.emp-stripe {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.emp-row { display: flex; align-items: center; gap: 8px; }

/* === WIZARD === */
.wizard-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.wizard-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
}

.wizard-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
}

.wizard-step-dot {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  transition: background var(--transition);
}
.wizard-step-dot.done { background: var(--brand); }
.wizard-step-dot.active { background: var(--brand); opacity: .4; }

.wizard-step-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.wizard-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.wizard-subtitle { font-size: 15px; color: var(--text-2); margin-bottom: 28px; }

.option-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }

.option-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  text-align: center;
  background: var(--surface);
}
.option-card:hover { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.option-card.selected { border-color: var(--brand); background: var(--brand-light); }
.option-card .flag { font-size: 28px; margin-bottom: 8px; }
.option-card .opt-title { font-size: 14px; font-weight: 600; }
.option-card .opt-sub { font-size: 12px; color: var(--text-2); margin-top: 3px; }

/* Schedule type cards */
.stype-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
  position: relative;
}
.stype-card:hover { border-color: var(--brand); }
.stype-card.selected { border-color: var(--brand); background: var(--brand-light); }
.stype-card .stype-tag { position: absolute; top: -1px; right: 12px; }
.stype-main { font-size: 22px; font-weight: 800; color: var(--text); }
.stype-name { font-size: 14px; font-weight: 600; margin: 4px 0 2px; }
.stype-desc { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.stype-dots { display: flex; gap: 3px; margin: 10px 0 4px; }
.stype-dot {
  width: 16px;
  height: 8px;
  border-radius: 4px;
}
.stype-dot.work { background: var(--brand); }
.stype-dot.rest { background: var(--surface-3); }

/* === ALERTS / EDUCATION === */
.alert {
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  border-left: 4px solid;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-content { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 4px; }
.alert-success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger);  color: var(--danger); }
.alert-info    { background: var(--info-bg);    border-color: var(--info);    color: var(--info); }
.alert-neutral { background: var(--surface-2);  border-color: var(--border-strong); color: var(--text-2); }
.alert .alert-body { color: var(--text-2); font-size: 13px; }

/* === AI PANEL === */
#ai-panel {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 360px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 200ms ease;
  box-shadow: var(--shadow-lg);
}
#ai-panel.open { transform: translateX(0); }

.ai-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--brand), #818cf8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
}
.ai-title { font-weight: 600; font-size: 14px; }
.ai-status { font-size: 11px; color: var(--success); display: flex; align-items: center; gap: 4px; }
.ai-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--success); display: inline-block; }

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-msg,
.ai-message {
  max-width: 90%;
  font-size: 13px;
  line-height: 1.5;
}
.ai-msg.user { align-self: flex-end; background: var(--brand); color: white; border-radius: var(--radius) var(--radius-sm) var(--radius-sm) var(--radius); padding: 10px 14px; }
.ai-msg.assistant { align-self: flex-start; background: var(--surface-2); border-radius: var(--radius-sm) var(--radius) var(--radius) var(--radius-sm); padding: 10px 14px; max-width: 100%; }
.ai-message-user { align-self: flex-end; }
.ai-message-assistant { align-self: flex-start; max-width: 100%; }
.ai-bubble {
  background: var(--surface-2);
  border-radius: var(--radius-sm) var(--radius) var(--radius) var(--radius-sm);
  padding: 10px 14px;
}
.ai-message-user .ai-bubble {
  background: var(--brand);
  color: white;
  border-radius: var(--radius) var(--radius-sm) var(--radius-sm) var(--radius);
}

.ai-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.ai-message .ai-quick-btns {
  padding: 8px 0 0;
  border-top: 0;
}
.ai-quick-btn {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-2);
  transition: all var(--transition);
}
.ai-quick-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

.ai-input-row {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.ai-input { flex: 1; border: 1px solid var(--border-strong); border-radius: 20px; padding: 8px 14px; font-size: 13px; outline: none; background: var(--surface); color: var(--text); }
.ai-input:focus { border-color: var(--brand); }

#ai-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(99,102,241,.4);
  transition: transform var(--transition), box-shadow var(--transition);
}
#ai-fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(99,102,241,.5); }

/* === EMPLOYEE MANAGEMENT === */
.emp-list { display: flex; flex-direction: column; gap: 8px; }

.emp-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color var(--transition);
}
.emp-item:hover { border-color: var(--brand); }

.emp-color-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
}

.emp-info { flex: 1; min-width: 0; }
.emp-name { font-weight: 600; font-size: 14px; }
.emp-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* === MODALS === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.96);
  transition: transform 150ms ease;
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-body { padding: 16px 24px; }
.modal-footer { padding: 0 24px 20px; display: flex; gap: 8px; justify-content: flex-end; }

/* === DIVIDER === */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* === EMPTY STATES === */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-2);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.empty-state-desc { font-size: 14px; line-height: 1.5; max-width: 320px; margin: 0 auto 20px; }

/* === TABS === */
.tabs { display: flex; border-bottom: 1px solid var(--border); gap: 0; margin-bottom: 20px; }
.tab {
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  transition: color var(--transition), border-color var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }

/* === COVERAGE BAR === */
.coverage-bar {
  height: 8px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
  margin: 4px 0;
}
.coverage-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }

/* === MONTH NAV === */
.month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 16px;
}
.month-label { font-size: 15px; font-weight: 700; flex: 1; text-align: center; }

/* === VIOLATION LIST === */
.violations { display: flex; flex-direction: column; gap: 8px; }
.violation-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.violation-item.error { background: var(--danger-bg); color: var(--danger); }
.violation-item.warning { background: var(--warning-bg); color: var(--warning); }
.violation-item.info { background: var(--info-bg); color: var(--info); }
.violation-item .vi-icon { font-size: 16px; flex-shrink: 0; }
.violation-ref { font-size: 11px; font-weight: 600; opacity: .8; margin-top: 2px; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .entry-card { grid-template-columns: 1fr; }
  .entry-demo { min-height: 360px; }
  .entry-demo-grid { grid-template-columns: 82px repeat(7, minmax(38px, 1fr)); }
  .entry-copy { padding: 18px; }
  .tour-panel { left: 16px; right: 16px; bottom: 16px; width: auto; }
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #main {
    margin-left: 0;
  }
  .wizard-box {
    padding: 24px;
    border-radius: var(--radius-lg);
  }
  .wizard-box .grid-2 {
    grid-template-columns: 1fr;
  }
  #ai-panel {
    width: 100%;
  }
  .content {
    padding: 16px;
  }
  .stat-cards {
    grid-template-columns: 1fr 1fr;
  }
  #ai-fab {
    bottom: 16px;
    right: 16px;
  }
}

/* === UTILITIES === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-direction-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-2); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.relative { position: relative; }
.rounded { border-radius: var(--radius); }

/* Animation */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 200ms ease forwards; }

/* === 6×1 SHAME SYSTEM === */
@keyframes shameSlide {
  from { opacity:0; transform:translateY(-20px) scale(.95); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
@keyframes shameShake {
  0%,100% { transform:translateX(0); }
  20%,60% { transform:translateX(-6px); }
  40%,80% { transform:translateX(6px); }
}

.shame-modal-body { text-align:center; padding:8px 0 16px; }
.shame-icon { font-size:48px; margin-bottom:12px; }
.shame-text { font-size:15px; font-weight:600; color:var(--text-1); line-height:1.5; margin-bottom:8px; }
.shame-legal-note { font-size:12px; color:var(--text-2); margin-bottom:20px; font-style:italic; }
.shame-stats { display:flex; gap:24px; justify-content:center; margin-bottom:20px; }
.shame-num { font-size:28px; font-weight:800; color:var(--danger); display:block; }
.shame-label { font-size:11px; color:var(--text-2); text-transform:uppercase; letter-spacing:.04em; }
.shame-confirm-btn { width:100%; }

.shame-popup {
  position:fixed; bottom:24px; right:24px; z-index:9998;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:0 8px 32px rgba(0,0,0,.2);
  width:320px; animation:shameSlide .3s ease;
}
.shame-popup-header {
  display:flex; align-items:center; gap:8px;
  padding:12px 16px 8px; border-bottom:1px solid var(--border);
  font-weight:700; color:var(--danger); font-size:13px;
}
.shame-popup-body { padding:12px 16px; font-size:13px; color:var(--text-1); line-height:1.5; }
.shame-popup-actions { display:flex; gap:8px; padding:8px 16px 12px; justify-content:flex-end; }

/* === LEGAL FOOTER === */
.legal-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 40px 32px 24px;
  margin-top: 32px;
}
.legal-footer-inner {
  max-width: none;
  margin: 0 auto;
}
.legal-footer-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-2);
  text-align: center;
  margin-bottom: 28px;
}
.legal-footer-seals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.legal-seal-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg);
  transition: border-color .2s, box-shadow .2s, transform .2s;
  position: relative;
  overflow: hidden;
}
.legal-seal-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.legal-seal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
  transition: background .2s;
}
.legal-seal-card.active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 20%, transparent);
  transform: translateY(-2px);
}
.legal-seal-card.active::before {
  background: var(--color-accent);
}
.legal-seal-card-flag {
  font-size: 28px;
  line-height: 1;
}

/* Law logo badge — styled like official gov branding */
.law-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 2px solid currentColor;
}
.law-logo-abbr {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.01em;
  line-height: 1;
}
.law-logo-line {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 1px;
}
.law-logo-gov {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .8;
}
.law-logo-br { color: #1a8a2e; }
.law-logo-pt { color: #003399; }
.law-logo-us { color: #b22222; }

[data-theme="dark"] .law-logo-br { color: #4caf72; }
[data-theme="dark"] .law-logo-pt { color: #6699ee; }
[data-theme="dark"] .law-logo-us { color: #e06060; }

.legal-seal-card-info { display:flex; flex-direction:column; gap:4px; }
.legal-seal-card-name { font-size:13px; font-weight:700; color:var(--text-1); }
.legal-seal-card-ref { font-size:11px; color:var(--text-2); line-height:1.4; }
.legal-seal-card-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  margin-top: 4px;
  width: fit-content;
}
.legal-seal-card-status.legal   { background:color-mix(in srgb,#22c55e 15%,transparent); color:#15803d; }
.legal-seal-card-status.caution { background:color-mix(in srgb,#f59e0b 15%,transparent); color:#b45309; }
.legal-seal-card-status.illegal { background:color-mix(in srgb,#ef4444 15%,transparent); color:#b91c1c; }
[data-theme="dark"] .legal-seal-card-status.legal   { background:color-mix(in srgb,#22c55e 20%,transparent); color:#4ade80; }
[data-theme="dark"] .legal-seal-card-status.caution { background:color-mix(in srgb,#f59e0b 20%,transparent); color:#fbbf24; }
[data-theme="dark"] .legal-seal-card-status.illegal { background:color-mix(in srgb,#ef4444 20%,transparent); color:#f87171; }

.legal-footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
}
.legal-footer-disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.6;
  opacity: .7;
}

@media (max-width: 768px) {
  .legal-footer-seals {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .legal-footer { padding: 28px 16px 20px; }
}

/* law logo SVGs */
.law-logo-svg {
  display: block;
  flex-shrink: 0;
  border-radius: 4px;
}

/* === DASHBOARD RICH CARDS === */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.dash-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.dash-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.1;
}
.dash-kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 2px;
}
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dash-comp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dash-comp-count {
  font-size: 13px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* === SVG NAV ICONS === */
.nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.nav-item .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  flex-shrink: 0;
}

/* === FOOTER CARD WIDTH FIX === */
.legal-footer-seals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.legal-seal-card {
  min-width: 0;
}
.legal-seal-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.3;
}

@media (max-width: 900px) {
  .dash-kpi-row { grid-template-columns: 1fr 1fr; }
  .dash-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .dash-kpi-row { grid-template-columns: 1fr 1fr; }
}

/* ── ABSENCES ──────────────────────────────────────────────────────────── */
.abs-pill {
  display:inline-flex; align-items:center; justify-content:center;
  font-size:9px; font-weight:800; letter-spacing:.04em; text-transform:uppercase;
  padding:3px 7px; border-radius:6px; line-height:1.3;
  width:100%; box-sizing:border-box;
}
.abs-pill.vacation  { background:#dbeafe; color:#1d4ed8; }
.abs-pill.sick      { background:#fef3c7; color:#b45309; }
.abs-pill.maternity { background:#fce7f3; color:#be185d; }
.abs-pill.paternity { background:#ede9fe; color:#7c3aed; }
.abs-pill.grief     { background:#f1f5f9; color:#475569; }
.abs-pill.other     { background:#f0fdf4; color:#15803d; }
[data-theme="dark"] .abs-pill.vacation  { background:rgba(59,130,246,.25); color:#93c5fd; }
[data-theme="dark"] .abs-pill.sick      { background:rgba(245,158,11,.2); color:#fbbf24; }
[data-theme="dark"] .abs-pill.maternity { background:rgba(236,72,153,.2); color:#f9a8d4; }
[data-theme="dark"] .abs-pill.paternity { background:rgba(139,92,246,.2); color:#c4b5fd; }
[data-theme="dark"] .abs-pill.grief     { background:rgba(100,116,139,.2); color:#94a3b8; }
[data-theme="dark"] .abs-pill.other     { background:rgba(34,197,94,.15); color:#4ade80; }
.abs-cell { background: color-mix(in srgb,#3b82f6 6%,transparent) !important; }
.abs-cell.sick      { background: color-mix(in srgb,#f59e0b 8%,transparent) !important; }
.abs-cell.maternity { background: color-mix(in srgb,#ec4899 8%,transparent) !important; }
.abs-cell.paternity { background: color-mix(in srgb,#8b5cf6 8%,transparent) !important; }
.abs-cell.grief     { background: color-mix(in srgb,#6b7280 8%,transparent) !important; }
.abs-cell.other     { background: color-mix(in srgb,#22c55e 8%,transparent) !important; }

/* Absence modal */
.abs-modal-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.abs-type-pills { display:flex; flex-wrap:wrap; gap:8px; }
.abs-type-btn {
  padding:6px 14px; border-radius:20px; border:2px solid var(--border);
  background:var(--bg); color:var(--text-2); font-size:12px; font-weight:600;
  cursor:pointer; transition:.15s;
}
.abs-type-btn.active { border-color:var(--color-accent); color:var(--color-accent);
  background:color-mix(in srgb,var(--color-accent) 10%,transparent); }

/* Absence summary table */
.abs-summary { margin-top:24px; }
.abs-summary-title { font-size:12px; font-weight:700; text-transform:uppercase;
  letter-spacing:.08em; color:var(--text-2); margin-bottom:12px; }
.abs-tag-row { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.abs-tag-emp { font-size:13px; font-weight:600; color:var(--text-1); min-width:100px; }
.abs-tag-list { display:flex; flex-wrap:wrap; gap:4px; flex:1; }
.abs-tag { font-size:11px; padding:2px 8px; border-radius:20px;
  background:var(--surface); border:1px solid var(--border); color:var(--text-2); }
.abs-delete-btn { font-size:11px; padding:2px 6px; border-radius:4px; border:none;
  background:color-mix(in srgb,#ef4444 15%,transparent); color:#dc2626;
  cursor:pointer; font-weight:600; }
