:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface2: #fbfbfd;
  --border: #d2d2d7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #424245;
  --accent-hover: #1d1d1f;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

a { color: var(--accent-hover); text-decoration: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

h1, h2, h3 { font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.75rem; margin-bottom: 8px; }
h2 { font-size: 1.25rem; margin-bottom: 16px; }

.muted { color: var(--muted); font-size: 0.9rem; }

.hidden { display: none !important; }

nav.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: #000;
  border-bottom: 1px solid #1a1a1a;
  position: sticky;
  top: 0;
  z-index: 40;
}

nav.top .nav-side {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

nav.top .nav-start { justify-content: flex-start; }
nav.top .nav-end { justify-content: flex-end; flex-wrap: wrap; }

nav.top .nav-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

nav.top .nav-logo img {
  display: block;
  height: 11.55px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

nav.top .links { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }

nav.top .links a {
  color: rgba(255,255,255,0.72);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
}

nav.top a, nav.top button.link {
  color: rgba(255, 255, 255, 0.65);
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

nav.top .links a.active,
nav.top .nav-settings.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.24);
}

nav.top .links a:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

nav.top a.active, nav.top a:hover, nav.top button.link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

nav.top .nav-settings {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

nav.top .nav-user {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
  white-space: nowrap;
}

nav.top button.link {
  font-size: 0.75rem;
}

.nav-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px 8px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 10px;
}
.nav-menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: #fff;
  border-radius: 1px;
}
.nav-menu-btn:hover,
.nav-menu-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.12);
}

.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.45);
}
.nav-drawer[hidden] { display: none !important; }
.nav-drawer-panel {
  background: #fff;
  min-height: 100%;
  width: 100%;
  padding: 20px 28px calc(28px + env(safe-area-inset-bottom));
  padding-top: calc(16px + env(safe-area-inset-top));
}
.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.nav-drawer-head strong { font-size: 1.15rem; }
.nav-drawer-close {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--surface2);
  border-radius: 12px;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
}
.nav-drawer-links {
  display: flex;
  flex-direction: column;
  margin: 8px 0 28px;
}
.nav-drawer-link {
  display: block;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  padding: 18px 4px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.nav-drawer-link.active {
  color: var(--text);
}
.nav-drawer-who {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.nav-drawer-logout { width: 100%; }
body.nav-open { overflow: hidden; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  background: #000;
  border-bottom: 1px solid #1a1a1a;
}

.site-header .site-logo {
  display: block;
  height: 11.55px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

@media (max-width: 700px), (max-width: 1100px) and (orientation: portrait) {
  .nav-menu-btn { display: flex; }
  nav.top {
    grid-template-columns: 44px 1fr auto;
    gap: 8px;
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top));
  }
  nav.top .nav-start,
  nav.top .nav-settings,
  nav.top .nav-end .link {
    display: none;
  }
  nav.top .nav-user { font-size: 0.8rem; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary { background: var(--text); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 6px 10px; font-size: 0.8rem; }
.btn-lg { padding: 16px 24px; font-size: 1.05rem; min-height: 52px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-with-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

input, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(82, 82, 91, 0.1);
}

label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.85rem; }
.field { margin-bottom: 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat .value { font-size: 1.75rem; font-weight: 700; }
.stat .label { color: var(--text); font-size: 0.9rem; font-weight: 500; margin-top: 4px; }
.stat .hint { color: var(--muted); font-size: 0.8rem; margin-top: 6px; line-height: 1.4; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th { color: var(--muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr:hover { background: var(--surface2); }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-ok { background: #dcfce7; color: #166534; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  z-index: 100;
  animation: fadeIn 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.toast-error { background: var(--danger); color: white; }
.toast-success { background: var(--success); color: white; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card { width: 100%; max-width: 420px; }
.login-card h1 { font-size: 1.55rem; letter-spacing: -0.03em; margin-bottom: 10px; }
.hello-blurb {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 16px;
}
.hello-weather {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: -4px 0 20px;
}
.weather-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  min-width: 0;
}
.weather-city {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.weather-emoji {
  font-size: 1.15rem;
  line-height: 1;
  margin-left: auto;
}
.weather-temp {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* POS layout */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  padding: 20px;
  min-height: calc(100vh - 64px);
}
@media (max-width: 900px) {
  .pos-layout { grid-template-columns: 1fr; }
}

.scan-panel, .cart-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.camera-box {
  position: relative;
  margin-bottom: 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface2);
  text-align: center;
}
.camera-box video {
  display: none;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  background: #111;
  margin-bottom: 8px;
}
.camera-box.live video { display: block; }
.camera-box.live #camera-btn { margin-top: 4px; }
.last-scan-photo,
.cart-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
  flex-shrink: 0;
}
.last-scan-photo {
  width: 100%;
  height: auto;
  max-height: 180px;
  margin-bottom: 8px;
}
.cart-item-main { flex: 1; min-width: 0; }
.tag-mismatch {
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.4;
}
.scan-input-wrap { margin-bottom: 16px; }
.scan-input-wrap input {
  font-size: 1.25rem;
  text-align: center;
  letter-spacing: 1px;
}
.scan-hint {
  text-align: center;
  color: var(--muted);
  margin-top: 8px;
  font-size: 0.85rem;
}

.cart-panel { display: flex; flex-direction: column; }
.cart-items {
  flex: 1;
  overflow-y: auto;
  margin: 16px 0;
  max-height: 50vh;
}
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item .name { font-weight: 500; }
.cart-item .meta { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.cart-item .price { font-weight: 600; white-space: nowrap; }
.cart-item button {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
}

.cart-total {
  border-top: 2px solid var(--border);
  padding-top: 16px;
}
.cart-total .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cart-total .grand {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 12px 0 16px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 48px 24px;
}

/* Inline edit cells */
.edit-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.edit-cell input {
  width: 72px;
  padding: 6px 8px;
  font-size: 0.9rem;
}
.edit-cell input.price-input { width: 96px; }

.editable-value {
  display: flex;
  align-items: center;
  gap: 6px;
}
.editable-value .value-text { min-width: 48px; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}
.btn-icon:hover {
  color: var(--text);
  background: var(--surface2);
  border-color: #d4d4d8;
}
.btn-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.edit-form {
  display: flex;
  align-items: center;
  gap: 4px;
}
.edit-form.hidden { display: none; }
.editable-value.hidden { display: none; }

.filters {
  display: grid;
  grid-template-columns: 1fr 200px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
}
@media (max-width: 768px) {
  .filters { grid-template-columns: 1fr; }
}
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}
.checkbox-field input { width: auto; }

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 340px);
}
.stock-table .col-modell {
  min-width: 11rem;
  white-space: nowrap;
}
.stock-table .col-color {
  min-width: 8rem;
  max-width: 14rem;
}
.stock-table .col-price {
  min-width: 5.5rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stock-grid .col-size {
  text-align: center;
  min-width: 2.75rem;
  width: 2.75rem;
  padding-left: 6px;
  padding-right: 6px;
  font-size: 0.78rem;
}
.stock-qty-cell {
  text-align: center;
  padding: 5px 4px;
  font-variant-numeric: tabular-nums;
}
.stock-qty-cell.empty {
  color: var(--muted);
  opacity: 0.35;
}
.stock-qty-cell.qty-zero {
  color: var(--muted);
  opacity: 0.55;
}
.stock-qty-pill {
  display: inline-block;
  min-width: 1.6rem;
  padding: 4px 7px;
  background: #eef0f2;
  border-radius: 6px;
  line-height: 1.2;
}
.stock-qty-cell.has-stock {
  cursor: pointer;
}
.stock-qty-cell.has-stock .stock-qty-pill {
  font-weight: 600;
}
.stock-qty-cell.has-stock:hover .stock-qty-pill,
.stock-qty-cell.has-stock:focus-visible .stock-qty-pill {
  background: #e2e6ea;
  outline: 2px solid var(--border);
  outline-offset: 1px;
}
.stock-grid-wrap {
  max-height: calc(100vh - 320px);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0;
  z-index: 1;
  max-height: calc(100vh - 48px);
  overflow: auto;
}
.modal-card.modal-lg {
  max-width: 720px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.form-grid .form-span-2 { grid-column: span 2; }
.form-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  resize: vertical;
}
.form-grid select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: var(--surface);
}
.modal-card h2 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.gtin-detail {
  margin: 16px 0 0;
}
.gtin-detail dt {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.shipment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-header h1 { margin-bottom: 4px; }
.clickable-row { cursor: pointer; }
.shipment-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.shipment-detail-header h2 { margin: 0; font-size: 1.35rem; }
.shipment-editor-filters {
  grid-template-columns: 1fr 1fr;
}
.search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  max-height: 240px;
  overflow: auto;
}
.search-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.search-result:hover { background: var(--surface2); }
.remove-item {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--danger);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.table-wrap thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.qty-zero { color: var(--muted); }
.result-count { margin-bottom: 12px; color: var(--muted); font-size: 0.9rem; }

.report-tabs {
  margin-bottom: 0;
}
.report-tabs button {
  font-size: 0.85rem;
  padding: 10px 18px;
}

.period-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.period-tabs button,
.period-tabs a {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.period-tabs button.active,
.period-tabs button:hover,
.period-tabs a.active,
.period-tabs a:hover {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

.period-tabs.sub-tabs button[data-gender="egyeb"] {
  display: none;
}
.period-tabs.sub-tabs.has-egyeb button[data-gender="egyeb"] {
  display: inline-block;
}
.period-tabs.sub-tabs {
  margin-top: -8px;
  margin-bottom: 20px;
}
.period-tabs.sub-tabs button {
  padding: 8px 14px;
  font-size: 0.9rem;
}

.sales-list-wrap {
  overflow: auto;
  max-height: min(70vh, 640px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sales-list-wrap thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
  box-shadow: 0 1px 0 var(--border);
}
.sales-list-wrap tbody tr:first-child td {
  border-top: none;
}

/* Schedule */
.container.sched-page {
  max-width: none;
  padding-left: 12px;
  padding-right: 12px;
}
.sched-page {
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}
.sched-mine {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sched-mine strong { font-size: 1.05rem; }
.sched-mine span { color: var(--muted); font-size: 0.9rem; }
.sched-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.sched-week-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sched-week-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sched-week-label strong {
  font-size: 1.05rem;
  white-space: nowrap;
}
.sched-day-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-bottom: 16px;
}
.sched-day-chip {
  flex: 1 0 52px;
  min-width: 52px;
  max-width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.sched-day-chip .dow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.sched-day-chip .dom { font-size: 1.15rem; font-weight: 700; }
.sched-day-chip .count { font-size: 0.72rem; color: var(--muted); }
.sched-day-chip.today { outline: 2px solid var(--text); outline-offset: -1px; }
.sched-day-chip.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}
.sched-day-chip.active .dow,
.sched-day-chip.active .count { color: rgba(255,255,255,0.7); }
.sched-day-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.sched-day-heading h2 { margin: 0; font-size: 1.1rem; }
.sched-person-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.sched-person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
}
.sched-person .name { font-weight: 600; }
.sched-person .when {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sched-person.mine { border-color: #a1a1aa; background: #f4f4f5; }
.sched-person.work .when { color: var(--text); }
.sched-person.off .when { color: var(--muted); font-weight: 500; }
.sched-person.vacation .when { color: #92400e; }
.sched-person.sick .when { color: #991b1b; }
.sched-person.empty .when { color: var(--muted); font-weight: 400; }
.sched-person.editable { cursor: pointer; }
.sched-person.editable:hover { background: var(--surface2); }
.sched-person:disabled { cursor: default; opacity: 1; }

.sched-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  max-height: min(70vh, 720px);
}
.sched-table {
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}
.sched-table th,
.sched-table td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.sched-table th:last-child,
.sched-table td:last-child { border-right: none; }
.sched-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface);
  text-align: center;
  padding: 10px 6px;
}
.sched-table thead .dow {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.sched-table thead .dom { font-size: 1rem; color: var(--text); font-weight: 700; }
.sched-table .sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  min-width: 108px;
  max-width: 148px;
  text-align: left;
  font-weight: 600;
}
.sched-table thead th.sticky { z-index: 4; }
.sched-cell {
  min-width: 78px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 14px 6px;
}
.sched-cell.editable { cursor: pointer; }
.sched-cell.editable:hover { background: var(--surface2); }
.sched-cell.empty { color: var(--muted); font-weight: 400; }
.sched-cell.off { color: var(--muted); font-weight: 500; background: #fafafa; }
.sched-cell.vacation { background: #fef3c7; color: #92400e; }
.sched-cell.sick { background: #fee2e2; color: #991b1b; }
.sched-cell.work { background: #fff; }
.sched-table .is-today { background: #f4f4f5; }
.sched-table tbody tr.mine .sticky { background: #f4f4f5; }
.sched-hours {
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 52px;
}
.sched-table tfoot td,
.sched-table tfoot th {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  background: var(--surface2);
}
.sched-table tfoot .sticky { background: var(--surface2); text-align: left; }

.sched-status-picks,
.sched-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.sched-chip {
  padding: 10px 14px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.sched-chip.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.staff-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px 16px;
  align-items: end;
}
.staff-form .btn { margin-bottom: 16px; }
.inactive-row { opacity: 0.55; }
.users-location {
  font-size: 1.05rem;
  margin: 4px 0 10px;
}
.location-select {
  width: auto;
  min-width: 140px;
  padding: 6px 8px;
  font-size: 0.9rem;
}
.hours-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sched-hours-wrap { max-height: min(70vh, 720px); }
.sched-hours-card { padding: 0; overflow: hidden; }
.sched-hours-card .table-wrap { margin: 0; }

.sched-month-wrap {
  max-height: calc(100vh - 210px);
}
.month-table.hour-grid {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 13px;
  line-height: 1.2;
}
.hour-grid th,
.hour-grid td {
  padding: 1px 4px;
  height: 22px;
  border-right: 1px solid #e5e5e7;
}
.hour-grid thead th {
  padding: 4px 2px;
  height: 24px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hour-grid .hour-col {
  min-width: 0;
}
.hour-grid .sticky.date-cell,
.hour-grid thead th.sticky {
  width: 108px;
  min-width: 108px;
  max-width: 120px;
  z-index: 5;
  padding: 0 8px;
}
.hour-grid .date-cell {
  white-space: nowrap;
  text-align: left;
}
.hour-grid .date-cell .dom {
  display: inline-block;
  min-width: 1.25em;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 5px;
}
.hour-grid .date-cell .dow {
  display: inline;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.hour-grid tbody tr.weekend td,
.hour-grid tbody tr.weekend .sticky {
  background: #f7f7f8;
}
.hour-grid tbody tr.is-today td,
.hour-grid tbody tr.is-today .sticky {
  background: #fff;
}
.hour-grid tbody tr.is-today.weekend td,
.hour-grid tbody tr.is-today.weekend .sticky {
  background: #f7f7f8;
}
.hour-grid tbody tr.week-start td,
.hour-grid tbody tr.week-start .sticky {
  border-top: none;
}
.hour-grid tbody tr.week-gap td {
  height: auto;
  padding: 0;
  border: none;
  background: var(--bg);
  line-height: 0;
}
.hour-grid tbody tr.week-gap td span {
  display: block;
  height: 16px;
}
.hour-grid .hour-cell {
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
}
.hour-grid .hour-cell.empty {
  background: transparent;
}
.hour-grid .hour-cell.tone-0 { background: #dbe7f2; }
.hour-grid .hour-cell.tone-1 { background: #e6dcf2; }
.hour-grid .hour-cell.tone-2 { background: #d8f0e4; }
.hour-grid .hour-cell.tone-3 { background: #f2e6d8; }
.hour-grid .hour-cell.tone-4 { background: #d8eef2; }
.hour-grid .hour-cell.tone-5 { background: #f2dcdc; }
.hour-grid .hour-cell.tone-6 { background: #e4f0d8; }
.hour-grid .hour-cell.tone-7 { background: #f2dce6; }
.hour-grid .hour-cell.overlap { background: #ece8f2; }
.hour-grid .hour-cell:has(.editable):hover { filter: brightness(0.97); }
.name-chip {
  display: inline;
  width: auto;
  margin: 0 6px 0 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  cursor: default;
  color: var(--text);
}
.name-chip:last-child { margin-right: 0; }
.name-chip.editable { cursor: pointer; }
.name-chip:disabled { opacity: 1; }
.name-chip.off { color: var(--muted); font-weight: 500; }
.name-chip.vacation { color: #92400e; }
.name-chip.sick { color: #991b1b; }

@media (min-width: 1100px) {
  .sched-page:has(#month-panel:not(.hidden)) {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .sched-page:has(#month-panel:not(.hidden)) .page-header {
    margin-bottom: 6px;
  }
  .sched-page:has(#month-panel:not(.hidden)) .page-header h1 {
    font-size: 1.15rem;
    margin: 0;
  }
  .sched-page:has(#month-panel:not(.hidden)) .page-header .muted {
    display: none;
  }
  .sched-page:has(#month-panel:not(.hidden)) .period-tabs {
    margin-bottom: 6px;
  }
  .sched-page:has(#month-panel:not(.hidden)) .period-tabs button {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  #month-panel .sched-mine {
    display: none;
  }
  #month-panel .sched-toolbar {
    margin-bottom: 6px;
  }
  .sched-month-wrap {
    max-height: calc(100vh - 168px);
    overflow: auto;
  }
}

@media (max-width: 768px) {
  .staff-form { grid-template-columns: 1fr; }
  .sched-week-label strong { font-size: 0.95rem; }
  #shift-modal.modal {
    align-items: flex-end;
    padding: 0;
  }
  #shift-modal .modal-card {
    width: 100%;
    max-width: none;
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 900px) {
  .sched-day-list { display: none; }
  .sched-day-strip { display: none; }
}

.onboard-page { max-width: 760px; }
.onboard-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}
.onboard-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.onboard-dot.current { background: var(--text); color: #fff; border-color: var(--text); }
.onboard-dot.done:not(.current) { background: #e8eee8; border-color: #c5d4c5; }
.onboard-dot:disabled { opacity: 0.4; cursor: not-allowed; }
.onboard-card h2 { margin-bottom: 12px; }
.onboard-kicker {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.onboard-body p,
.onboard-body li { line-height: 1.55; margin-bottom: 12px; }
.onboard-body ul,
.onboard-body ol { padding-left: 1.2em; margin-bottom: 16px; }
.onboard-body h3 { font-size: 1.05rem; margin: 20px 0 8px; }
.onboard-check { list-style: none; padding-left: 0; }
.onboard-check li {
  padding: 8px 0 8px 28px;
  position: relative;
  border-bottom: 1px solid #eee;
}
.onboard-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
}
.onboard-figure { margin: 16px 0 20px; }
.onboard-figure img {
  width: 100%;
  border-radius: 10px;
  display: block;
  object-fit: cover;
  max-height: 360px;
}
.onboard-figure figcaption {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 8px;
}
.onboard-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 16px 0 8px;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
}
.onboard-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.onboard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 40px;
}
.onboard-timer { flex: 1; text-align: center; margin: 0; }
.onboard-ack { margin-top: 24px; align-items: flex-start; }
.onboard-q {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.onboard-q legend { font-weight: 600; padding: 0 4px; }
.onboard-q label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0;
  color: var(--text);
}
.onboard-q input { width: auto; margin-top: 3px; }
@media (max-width: 600px) {
  nav.top .links { flex-wrap: wrap; }
  .onboard-nav { flex-wrap: wrap; }
  .onboard-nav .btn { flex: 1; }
  .onboard-timer { order: -1; flex-basis: 100%; }
}

