/* ================================================================
   REMINDO – Design System
   Dark mode default · Mobile-first · Native App Feel
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:wght@300;400;500;600&family=Barlow+Condensed:wght@600;700;800&display=swap');

/* ── Tokens ────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-base:    #080810;
  --bg-surface: #0f0f1a;
  --bg-card:    #141422;
  --bg-hover:   #1a1a2e;
  --bg-input:   #1e1e30;
  --bg-overlay: rgba(8, 8, 16, 0.85);

  /* Borders */
  --border:      rgba(255,255,255,0.07);
  --border-focus: rgba(255,255,255,0.2);

  /* Text */
  --text-primary:   #f0f0f8;
  --text-secondary: #8888a8;
  --text-muted:     #55556a;
  --text-invert:    #080810;

  /* Brand accent */
  --accent:       #7c6fff;
  --accent-glow:  rgba(124, 111, 255, 0.25);
  --accent-dim:   rgba(124, 111, 255, 0.12);

  /* Areas */
  --service: #06b6d4;
  --service-dim: rgba(6, 182, 212, 0.12);
  --bar:     #f59e0b;
  --bar-dim: rgba(245, 158, 11, 0.12);
  --kitchen: #ef4444;
  --kitchen-dim: rgba(239, 68, 68, 0.12);
  --runner: #8b5cf6;
  --runner-dim: rgba(139, 92, 246, 0.12);

  /* Experience levels */
  --trial:      #6b7280;
  --trial-dim:  rgba(107, 114, 128, 0.12);
  --training:   #f97316;
  --training-dim: rgba(249, 115, 22, 0.12);
  --trained:    #3b82f6;
  --trained-dim: rgba(59, 130, 246, 0.12);
  --skilled:    #22c55e;
  --skilled-dim: rgba(34, 197, 94, 0.12);
  --experienced: #a855f7;
  --experienced-dim: rgba(168, 85, 247, 0.12);

  /* Status */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;

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

  /* Radius */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px var(--border);
  --shadow-elevated: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
  --shadow-accent: 0 0 24px var(--accent-glow);

  /* Nav */
  --nav-height: 68px;

  /* Transitions */
  --t: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light Mode */
[data-theme="light"] {
  --bg-base:    #f4f4f8;
  --bg-surface: #ffffff;
  --bg-card:    #ffffff;
  --bg-hover:   #f0f0f8;
  --bg-input:   #f4f4f8;
  --bg-overlay: rgba(244, 244, 248, 0.9);
  --border:      rgba(0,0,0,0.08);
  --border-focus: rgba(0,0,0,0.2);
  --text-primary:   #0f0f1a;
  --text-secondary: #5555699;
  --text-muted:     #9999aa;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 0 0 1px var(--border);
  --shadow-elevated: 0 8px 24px rgba(0,0,0,0.12), 0 0 0 1px var(--border);
}

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

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ─────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(1.5rem, 5vw, 2rem); }
h2 { font-size: clamp(1.1rem, 4vw, 1.4rem); }
h3 { font-size: 1rem; }

.label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Layout ─────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.page-content {
  flex: 1;
  padding: var(--sp-md);
  padding-bottom: calc(var(--nav-height) + var(--sp-lg));
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-md) 0;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: var(--sp-md);
  transition: box-shadow var(--t);
}

.card-sm { padding: var(--sp-sm) var(--sp-md); }
.card-lg { padding: var(--sp-lg); }

.card-pressable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-fast), background var(--t-fast);
}
.card-pressable:active { transform: scale(0.98); background: var(--bg-hover); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-md);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Section ────────────────────────────────────────────────────── */
.section { margin-bottom: var(--sp-lg); }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-sm);
  padding: 0 var(--sp-xs);
}
.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:active { transform: scale(0.96); box-shadow: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:active { background: var(--bg-hover); }

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:active { background: rgba(239, 68, 68, 0.2); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: var(--r-sm); }
.btn-icon {
  padding: 8px;
  border-radius: var(--r-sm);
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.btn-full { width: 100%; justify-content: center; }

/* ── Badges / Pills ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.badge-service    { background: var(--service-dim); color: var(--service); }
.badge-bar        { background: var(--bar-dim); color: var(--bar); }
.badge-kitchen    { background: var(--kitchen-dim); color: var(--kitchen); }
.badge-runner     { background: var(--runner-dim); color: var(--runner); }

.badge-trial      { background: var(--trial-dim); color: var(--trial); }
.badge-training   { background: var(--training-dim); color: var(--training); }
.badge-trained    { background: var(--trained-dim); color: var(--trained); }
.badge-skilled    { background: var(--skilled-dim); color: var(--skilled); }
.badge-experienced { background: var(--experienced-dim); color: var(--experienced); }

/* ── Inputs ─────────────────────────────────────────────────────── */
.input-group { margin-bottom: var(--sp-md); }

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

.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.input::placeholder { color: var(--text-muted); }

select.input { cursor: pointer; }
textarea.input { resize: none; min-height: 80px; }

/* ── Toggle / Switch ────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.toggle-label { font-size: 0.9rem; color: var(--text-primary); }
.toggle-sub   { font-size: 0.75rem; color: var(--text-muted); }

.toggle {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-hover);
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  transition: background var(--t-fast);
  cursor: pointer;
}
.toggle-track::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform var(--t-bounce), background var(--t-fast);
}
.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-track::after {
  transform: translateX(18px);
  background: #fff;
}

/* ── Bottom Navigation ──────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  transition: color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  padding: 8px 0;
  position: relative;
}

.nav-item.active { color: var(--accent); }

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 2px;
  background: var(--accent);
  border-radius: 0 0 var(--r-full) var(--r-full);
}

.nav-label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ── Top Bar ────────────────────────────────────────────────────── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-md) var(--sp-sm);
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.top-bar-logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.top-bar-logo span { color: var(--accent); }

/* ── Avatar / Employee Card ─────────────────────────────────────── */
.avatar {
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.avatar-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.employee-row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: 12px var(--sp-md);
  background: var(--bg-card);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  border: 1px solid var(--border);
}
.employee-row:active { background: var(--bg-hover); }

.employee-info { flex: 1; min-width: 0; }
.employee-name { font-weight: 600; font-size: 0.95rem; line-height: 1.2; }
.employee-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  margin-top: 4px;
}

/* ── Shift Card ─────────────────────────────────────────────────── */
.shift-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.shift-item:last-child { border-bottom: none; }

.shift-time {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  min-width: 76px;
}

.shift-person { font-weight: 500; font-size: 0.9rem; }

/* ── Hint Cards ─────────────────────────────────────────────────── */
.hint-card {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-sm);
  padding: 12px var(--sp-md);
  background: var(--bg-card);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  margin-bottom: var(--sp-sm);
}
.hint-card.info { border-left-color: var(--info); }
.hint-card.warning { border-left-color: var(--warning); }

.hint-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ── Empty State ────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-2xl) var(--sp-lg);
  text-align: center;
  gap: var(--sp-sm);
  color: var(--text-muted);
}
.empty-state svg { opacity: 0.3; margin-bottom: var(--sp-sm); }
.empty-state-title { font-size: 0.95rem; font-weight: 600; }
.empty-state-sub { font-size: 0.8rem; }

/* ── Divider ────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: var(--sp-md) 0; }

/* ── Stack / Row helpers ────────────────────────────────────────── */
.stack  { display: flex; flex-direction: column; gap: var(--sp-sm); }
.stack-lg { gap: var(--sp-md); }
.row    { display: flex; align-items: center; gap: var(--sp-sm); }
.row-between { justify-content: space-between; }
.row-wrap { flex-wrap: wrap; }

/* ── Modal / Sheet ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-sheet {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--sp-lg);
  padding-bottom: calc(var(--sp-lg) + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform var(--t);
  max-height: 90dvh;
  overflow-y: auto;
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-handle {
  width: 36px; height: 4px;
  background: var(--border-focus);
  border-radius: var(--r-full);
  margin: -8px auto var(--sp-lg);
}

/* ── Toast / Snackbar ───────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: var(--sp-md);
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  pointer-events: none;
  width: min(calc(100% - 32px), 400px);
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px var(--sp-md);
  font-size: 0.875rem;
  box-shadow: var(--shadow-elevated);
  animation: toastIn 300ms var(--t) forwards;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  pointer-events: all;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Spinner ────────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Color dot ──────────────────────────────────────────────────── */
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Scrollbars ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 2px; }

/* ── Utilities ──────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.fw-600 { font-weight: 600; }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mb-md { margin-bottom: var(--sp-md); }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
