:root {
  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --sidebar-bg: #0c1e2e;
  --sidebar-hover: #163047;
  --sidebar-active: #0e9f9a;
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --teal: #0e9f9a;
  --teal-dark: #0a7e7a;
  --emerald: #10b981;
  --emerald-bg: #d1fae5;
  --emerald-text: #065f46;
  --amber: #f59e0b;
  --amber-bg: #fef3c7;
  --amber-text: #92400e;
  --rose: #ef4444;
  --rose-bg: #fee2e2;
  --rose-text: #991b1b;
  --indigo: #6366f1;
  --indigo-bg: #e0e7ff;
  --indigo-text: #3730a3;
  --sky-bg: #e0f2fe;
  --sky-text: #075985;
  --slate-bg: #f1f5f9;
  --slate-text: #475569;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.18);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.num, td.num, th.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 248px;
  background: var(--sidebar-bg);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo-img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.receipt-logo {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  margin: 0 auto 8px;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.nav-menu {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}

.nav-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shift-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  cursor: pointer;
}
.shift-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}
.shift-pill.open .dot {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}

.lang-switch {
  display: flex;
  gap: 6px;
}
.lang-btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.16);
  background: transparent;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.lang-btn.active {
  background: #fff;
  color: var(--sidebar-bg);
  border-color: #fff;
}

/* Main */
.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
}

.page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.content-area {
  padding: 20px 24px 36px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 8px; font-size: 11.5px; border-radius: 5px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); }
.btn-emerald { background: var(--emerald); color: #fff; }
.btn-emerald:hover { background: #059669; }
.btn-amber { background: var(--amber); color: #fff; }
.btn-amber:hover { background: #d97706; }
.btn-rose { background: var(--rose); color: #fff; }
.btn-rose:hover { background: #dc2626; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-alt); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--slate-bg); color: var(--text); }

/* Cards & Grids */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 16px 18px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 18px;
  box-shadow: var(--shadow);
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.kpi-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 18px;
  align-items: start;
}

.grid-equal-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

/* Weather & Shift Banner */
.desk-banner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.weather-strip {
  background: linear-gradient(135deg, #0c2d48 0%, #0e7490 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.weather-metrics {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.w-stat {
  display: flex;
  flex-direction: column;
}
.w-stat-label { font-size: 11px; color: #bae6fd; text-transform: uppercase; letter-spacing: 0.04em; }
.w-stat-val { font-size: 15px; font-weight: 700; }

.register-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow);
}

/* Badges / Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-emerald { background: var(--emerald-bg); color: var(--emerald-text); }
.badge-amber { background: var(--amber-bg); color: var(--amber-text); }
.badge-rose { background: var(--rose-bg); color: var(--rose-text); }
.badge-indigo { background: var(--indigo-bg); color: var(--indigo-text); }
.badge-sky { background: var(--sky-bg); color: var(--sky-text); }
.badge-slate { background: var(--slate-bg); color: var(--slate-text); }

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  background: var(--surface-alt);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody tr:hover {
  background: #f8fafc;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.row-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

/* Filter Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Forms */
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-section-title {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal-dark);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100;
}
.modal-backdrop.hidden { display: none; }

.modal-card {
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.modal-close {
  border: 0;
  background: var(--slate-bg);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Progress Bar */
.progress-track {
  width: 100%;
  height: 8px;
  background: var(--slate-bg);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
}

/* Shop Quick Grid */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}
.shop-tile {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.shop-tile:hover {
  border-color: var(--teal);
  background: #f0fdfa;
}

/* Toast */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #0f172a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}
.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }

/* Receipt & Print */
.receipt-box {
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 20px;
  background: #fff;
  color: #0f172a;
}
.receipt-header {
  text-align: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.receipt-line {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13.5px;
}
.receipt-total {
  border-top: 2px solid #0f172a;
  margin-top: 10px;
  padding-top: 10px;
  font-size: 16px;
  font-weight: 800;
}

.print-mount { display: none; }

@media print {
  body { background: #fff; }
  .app-shell, .modal-backdrop, .toast-container { display: none !important; }
  .print-mount {
    display: block !important;
    padding: 12mm;
    max-width: 148mm;
    margin: 0 auto;
  }
}

.hidden { display: none !important; }

.user-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}
.user-pill-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-pill-role {
  font-size: 10.5px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0c1e2e 0%, #0e7490 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 300;
}

.login-card {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border-radius: 16px;
  padding: 28px 26px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.login-card h2 {
  margin: 12px 0 2px;
  font-size: 20px;
}

.login-logo {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(12, 30, 46, 0.25);
}

/* Empty & Utility */
.empty-state {
  padding: 32px 18px;
  text-align: center;
  color: var(--text-muted);
}
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mt-12 { margin-top: 12px; }
.mb-14 { margin-bottom: 14px; }

/* Calendar Views */
.cal-month-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.cal-month-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.cal-month-head div {
  padding: 9px 10px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: center;
}

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-day-cell {
  min-height: 118px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  cursor: pointer;
  transition: background 0.12s;
}
.cal-day-cell:hover { background: #f8fafc; }
.cal-day-cell.other-month { background: #f8fafc; color: var(--text-muted); }
.cal-day-cell.is-today { background: #f0fdfa; }

.cal-day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.cal-day-num {
  font-size: 12.5px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}
.cal-day-cell.is-today .cal-day-num {
  background: var(--teal);
  color: #fff;
}

.cal-wind-mini {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96px;
}

.cal-event-chip {
  font-size: 11.5px;
  padding: 3px 6px;
  border-radius: 6px;
  border-left: 3px solid var(--primary);
  background: #f0f9ff;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  font-weight: 500;
}
.cal-event-chip:hover { filter: brightness(0.96); }
.cal-event-chip.sport-Kitesurf { border-left-color: #0284c7; background: #e0f2fe; }
.cal-event-chip.sport-Surf { border-left-color: #0e9f9a; background: #ccfbf1; }
.cal-event-chip.sport-Wingfoil { border-left-color: #6366f1; background: #e0e7ff; }
.cal-event-chip.sport-Rental { border-left-color: #f59e0b; background: #fef3c7; }
.cal-event-chip.sport-Storage { border-left-color: #64748b; background: #f1f5f9; }
.cal-event-chip.status-Cancelled { opacity: 0.5; text-decoration: line-through; }

/* Week Time Grid */
.cal-week-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.cal-week-inner {
  min-width: 820px;
}

.cal-week-header {
  display: grid;
  grid-template-columns: 64px repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.cal-week-hcell {
  padding: 8px 6px;
  text-align: center;
  border-left: 1px solid var(--border);
  font-size: 12px;
}
.cal-week-hcell.is-today {
  background: #f0fdfa;
  color: var(--teal-dark);
}

.cal-week-body {
  display: grid;
  grid-template-columns: 64px repeat(7, minmax(0, 1fr));
  position: relative;
}

.cal-time-col {
  display: flex;
  flex-direction: column;
}
.cal-time-label {
  height: 54px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  padding: 2px 8px 0 0;
  border-bottom: 1px solid #f1f5f9;
}

.cal-week-day-col {
  position: relative;
  border-left: 1px solid var(--border);
  height: 756px; /* 14 hours * 54px */
}
.cal-week-day-col.is-today { background: rgba(14, 159, 154, 0.03); }

.cal-hour-slot {
  height: 54px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}
.cal-hour-slot:hover { background: rgba(2, 132, 199, 0.05); }

.cal-week-event {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 7px;
  padding: 4px 6px;
  font-size: 11.5px;
  line-height: 1.25;
  overflow: hidden;
  border-left: 3px solid #0284c7;
  background: #e0f2fe;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
  cursor: pointer;
  z-index: 2;
}
.cal-week-event.sport-Surf { border-left-color: #0e9f9a; background: #ccfbf1; }
.cal-week-event.sport-Wingfoil { border-left-color: #6366f1; background: #e0e7ff; }
.cal-week-event.sport-Rental { border-left-color: #f59e0b; background: #fef3c7; }
.cal-week-event.sport-Storage { border-left-color: #64748b; background: #f1f5f9; }
.cal-week-event.status-Cancelled { opacity: 0.48; text-decoration: line-through; }

@media (max-width: 1240px) {
  .grid-2, .desk-banner, .grid-equal-2 { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    left: -260px;
    transition: left 0.2s;
  }
  .sidebar.open { left: 0; }
  .mobile-menu-btn { display: inline-flex; }
  .form-grid, .form-grid-3, .grid-3 { grid-template-columns: 1fr; }
  .topbar { padding: 12px 14px; }
  .content-area { padding: 14px; }
}
