/* ==========================================================================
   DOGAME STATION — APPLE EDITION DESIGN SYSTEM
   macOS & iPadOS inspired UI: SF Pro typography, refined glassmorphism,
   Apple system palettes, smooth tactile curves, and native dark mode.
   ========================================================================== */

:root {
  /* Apple Color Palette */
  --apple-white: #FFFFFF;
  --apple-soft: #FBFBFD;
  --apple-gray-050: #F5F5F7;
  --apple-gray-100: #E8E8ED;
  --apple-ink: #1D1D1F;
  --apple-muted: #86868B;
  --apple-border: #D2D2D7;
  --apple-border-light: rgba(0, 0, 0, 0.08);

  /* Accents & States */
  --apple-blue: #0071E3;
  --apple-blue-deep: #0066CC;
  --apple-blue-subtle: #EBF4FE;
  --apple-success: #34C759;
  --apple-success-subtle: #EAF8EE;
  --apple-warning: #FF9500;
  --apple-warning-subtle: #FFF8EB;
  --apple-danger: #FF3B30;
  --apple-danger-subtle: #FDF2F2;

  /* Apple Dark Surfaces */
  --apple-black: #000000;
  --apple-graphite: #161617;
  --apple-silver-text: #F5F5F7;

  /* Typography */
  --font-sans: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", Menlo, Monaco, Consolas, monospace;

  /* Apple Radii & Elevations */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-card: 24px;
  --radius-pill: 999px;

  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.08);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.16);
  --shadow-focus: 0 0 0 4px rgba(0, 113, 227, 0.18);

  color-scheme: light dark;
}

/* Apple Dark Mode Surface & Palette */
[data-theme="dark"] {
  --apple-white: #1C1C1E;
  --apple-soft: #000000;
  --apple-gray-050: #161617;
  --apple-gray-100: #2C2C2E;
  --apple-ink: #F5F5F7;
  --apple-muted: #8E8E93;
  --apple-border: #38383A;
  --apple-border-light: rgba(255, 255, 255, 0.1);

  --apple-blue: #0A84FF;
  --apple-blue-deep: #0071E3;
  --apple-blue-subtle: rgba(10, 132, 255, 0.16);
  --apple-success: #32D74B;
  --apple-success-subtle: rgba(50, 215, 75, 0.16);
  --apple-warning: #FF9F0A;
  --apple-warning-subtle: rgba(255, 159, 10, 0.16);
  --apple-danger: #FF453A;
  --apple-danger-subtle: rgba(255, 69, 58, 0.18);

  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.85);
  --shadow-focus: 0 0 0 4px rgba(10, 132, 255, 0.28);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  height: 100%;
  overflow: hidden;
  background-color: var(--apple-soft);
  color: var(--apple-ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   APP SHELL & SIDEBAR LAYOUT
   ========================================================================== */
.apple-app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--apple-soft);
}

.apple-sidebar {
  width: 260px;
  min-width: 260px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-right: 1px solid var(--apple-border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  position: relative;
  z-index: 1050;
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .apple-sidebar {
  background: rgba(22, 22, 23, 0.88);
  border-right-color: rgba(255, 255, 255, 0.1);
}

/* Collapsed Sidebar State (iPadOS / macOS style) */
.apple-sidebar.collapsed {
  width: 78px;
  min-width: 78px;
}

.apple-sidebar.collapsed .nav-brand-title,
.apple-sidebar.collapsed .sidebar-item-label,
.apple-sidebar.collapsed .sidebar-item-badge,
.apple-sidebar.collapsed .sidebar-profile-info,
.apple-sidebar.collapsed .sidebar-section-header {
  display: none !important;
}

.apple-sidebar.collapsed .sidebar-nav-item {
  justify-content: center;
  padding: 10px 0;
}

.apple-sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 16px 8px;
}

.apple-sidebar.collapsed .theme-toggle-btn {
  padding: 8px;
  justify-content: center;
}
.apple-sidebar.collapsed .theme-toggle-btn span:last-child {
  display: none;
}

.sidebar-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--apple-border-light);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--apple-ink);
  overflow: hidden;
}

.nav-logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--apple-ink);
  color: var(--apple-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

[data-theme="dark"] .nav-logo-mark {
  background: var(--apple-blue);
}

.nav-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid var(--apple-border-light);
  color: var(--apple-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.sidebar-toggle-btn:hover {
  background: var(--apple-gray-050);
  color: var(--apple-ink);
  border-color: var(--apple-border);
}
[data-theme="dark"] .sidebar-toggle-btn:hover {
  background: var(--apple-gray-100);
  color: var(--apple-ink);
}

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

.sidebar-section-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--apple-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 8px 12px 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--apple-muted);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  text-decoration: none;
}

.sidebar-nav-item:hover {
  background: var(--apple-gray-050);
  color: var(--apple-ink);
}

.sidebar-nav-item.active {
  background: var(--apple-blue-subtle);
  color: var(--apple-blue);
  font-weight: 600;
}

[data-theme="dark"] .sidebar-nav-item.active {
  background: rgba(10, 132, 255, 0.18);
  color: var(--apple-blue);
}

.sidebar-item-icon {
  font-size: 17px;
  width: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}
.sidebar-item-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.sidebar-item-label {
  white-space: nowrap;
  flex: 1;
}

.sidebar-item-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--apple-blue);
  color: #FFFFFF;
}

.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid var(--apple-border-light);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-operator-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--apple-gray-050);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--apple-border-light);
}

.operator-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--apple-blue);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}

.sidebar-profile-info {
  overflow: hidden;
  line-height: 1.25;
}

.sidebar-profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile-role {
  font-size: 11px;
  color: var(--apple-muted);
}

/* ==========================================================================
   MAIN VIEWPORT & TOP UTILITY BAR
   ========================================================================== */
.apple-main-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.apple-top-utility-bar {
  height: 52px;
  min-height: 52px;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--apple-border-light);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[data-theme="dark"] .apple-top-utility-bar {
  background: rgba(22, 22, 23, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.nav-status-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--apple-muted);
}

.nav-pill-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.04);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--apple-ink);
}

[data-theme="dark"] .nav-pill-status {
  background: rgba(255, 255, 255, 0.08);
}

.status-dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apple-success);
  box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.2);
}

.status-dot-gray {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apple-muted);
}

.clock-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--apple-ink);
  font-weight: 500;
  background: var(--apple-gray-050);
  border: 1px solid var(--apple-border-light);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--apple-border);
  color: var(--apple-ink);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-toggle-btn:hover {
  background: var(--apple-gray-100);
}

[data-theme="dark"] .theme-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--apple-border);
  color: var(--apple-ink);
}

[data-theme="dark"] .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Audio Unlock Banner */
.apple-audio-banner {
  background: var(--apple-ink);
  color: var(--apple-silver-text);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  gap: 16px;
  animation: fadeIn 0.3s ease;
  border-bottom: 1px solid var(--apple-border-light);
}

[data-theme="dark"] .apple-audio-banner {
  background: #000000;
  border-bottom: 1px solid var(--apple-border);
}

.apple-audio-banner.hidden {
  display: none !important;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

@media (max-width: 900px) {
  .apple-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
  }
  .apple-sidebar.drawer-open {
    transform: translateX(0);
  }
  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Content Area */
.apple-content-area {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px 64px;
  flex: 1;
}

/* Controls Bar */
.view-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* Apple Filter Pills */
.apple-filter-pills {
  display: inline-flex;
  gap: 6px;
  background: var(--apple-gray-050);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--apple-border-light);
}

.apple-filter-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--apple-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.apple-filter-btn:hover {
  color: var(--apple-ink);
}

.apple-filter-btn.active {
  background: var(--apple-white);
  color: var(--apple-ink);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .apple-filter-btn.active {
  background: #2C2C2E;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Apple Search Box */
.apple-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.apple-search-input {
  background: var(--apple-white);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-pill);
  padding: 8px 36px 8px 16px;
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--apple-ink);
  width: 240px;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-search-input:focus {
  border-color: var(--apple-blue);
  box-shadow: var(--shadow-focus);
  width: 290px;
}

.apple-search-icon {
  position: absolute;
  right: 12px;
  color: var(--apple-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.button-primary {
  background: var(--apple-blue);
  color: #FFFFFF !important;
  border: none;
  border-radius: var(--radius-pill);
  min-height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, transform 0.05s ease;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.button-primary:hover {
  background: var(--apple-blue-deep);
}
.button-primary:active {
  transform: scale(0.98);
}
.button-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-secondary {
  background: var(--apple-white);
  color: var(--apple-ink);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-pill);
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  text-decoration: none;
}
.button-secondary:hover {
  background: var(--apple-gray-050);
  border-color: #B0B0B5;
}
.button-secondary:active {
  transform: scale(0.98);
}
.button-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-subtle-danger {
  background: var(--apple-white);
  color: var(--apple-danger);
  border: 1px solid rgba(255, 59, 48, 0.3);
  border-radius: var(--radius-pill);
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  text-decoration: none;
}
.button-subtle-danger:hover {
  background: var(--apple-danger-subtle);
  border-color: var(--apple-danger);
}
.button-subtle-danger:active {
  transform: scale(0.98);
}
.button-subtle-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Badges */
.apple-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.badge-stopped {
  background: var(--apple-gray-050);
  color: var(--apple-muted);
}
.badge-running {
  background: var(--apple-blue-subtle);
  color: var(--apple-blue);
}
.badge-warning {
  background: var(--apple-warning-subtle);
  color: var(--apple-warning);
}
.badge-finished {
  background: var(--apple-danger-subtle);
  color: var(--apple-danger);
}
.badge-lost {
  background: var(--apple-success-subtle);
  color: var(--apple-success);
}

/* ==========================================================================
   ROOM CARDS (APPLE PRODUCT CARD)
   ========================================================================== */
.apple-rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--apple-white);
  border-radius: var(--radius-card);
  border: 1px solid var(--apple-border-light);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* State Accent Bar */
.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--apple-gray-100);
}
.product-card[data-state="running"]::before { background: var(--apple-blue); }
.product-card[data-state="warning"]::before { background: var(--apple-warning); }
.product-card[data-state="finished"]::before { background: var(--apple-danger); }
.product-card[data-state="lost_time"]::before { background: var(--apple-success); }

.product-card[data-state="finished"] {
  border-color: rgba(255, 59, 48, 0.4);
  animation: finishPulse 1.8s infinite alternate ease-in-out;
}
@keyframes finishPulse {
  0% { box-shadow: 0 8px 24px rgba(255, 59, 48, 0.08); }
  100% { box-shadow: 0 16px 36px rgba(255, 59, 48, 0.25); }
}

.card-top-bar {
  padding: 20px 22px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-station-id {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--apple-muted);
}

.card-station-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--apple-ink);
  margin-top: 2px;
}

/* Apple Minimalist Digital Stage */
.apple-timer-stage {
  background: var(--apple-gray-050);
  margin: 8px 18px 16px;
  border-radius: 18px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--apple-border-light);
}

.timer-digits {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--apple-ink);
}
.product-card[data-state="warning"] .timer-digits { color: var(--apple-warning); }
.product-card[data-state="finished"] .timer-digits { color: var(--apple-danger); }
.product-card[data-state="lost_time"] .timer-digits { color: var(--apple-blue); }

.timer-meta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--apple-border-light);
  font-size: 12px;
  color: var(--apple-muted);
}

.tv-hardware-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.hardware-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--apple-muted);
}
.hardware-dot.on {
  background: var(--apple-success);
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.4);
}

.card-actions-area {
  padding: 0 18px 20px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-button-group {
  display: flex;
  gap: 8px;
  align-items: center;
}
.flex-1 {
  flex: 1;
}

/* ==========================================================================
   TABLES & RESERVATIONS MATRIX
   ========================================================================== */
.apple-table-stage {
  background: var(--apple-white);
  border-radius: var(--radius-card);
  border: 1px solid var(--apple-border-light);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

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

.table-stage-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--apple-ink);
}

.table-scroll-wrap {
  overflow-x: auto;
  max-height: 640px;
}

.apple-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.apple-table th {
  background: var(--apple-gray-050);
  color: var(--apple-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--apple-border-light);
  border-right: 1px solid var(--apple-border-light);
  position: sticky;
  top: 0;
  z-index: 5;
}
.apple-table th:first-child {
  text-align: left;
  min-width: 120px;
}

.apple-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--apple-border-light);
  border-right: 1px solid var(--apple-border-light);
  text-align: center;
  background: var(--apple-white);
  color: var(--apple-ink);
}

.reservation-slot-box {
  min-height: 44px;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.slot-empty {
  background: var(--apple-soft);
  color: var(--apple-muted);
  border: 1px dashed var(--apple-border);
}
.slot-empty:hover {
  background: var(--apple-blue-subtle);
  color: var(--apple-blue);
  border-color: var(--apple-blue);
}
.slot-booked {
  background: var(--apple-warning-subtle);
  color: var(--apple-ink);
  border: 1px solid rgba(255, 149, 0, 0.4);
}
.slot-active-live {
  background: var(--apple-success-subtle);
  color: var(--apple-ink);
  border: 1px solid rgba(52, 199, 89, 0.4);
}

/* ==========================================================================
   HISTORY LIST & CARDS
   ========================================================================== */
.apple-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 960px;
}

.history-card-item {
  background: var(--apple-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--apple-border-light);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  gap: 16px;
}
.history-card-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

/* ==========================================================================
   MODALS & DIALOGS (APPLE STAGE)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active, .modal-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.65);
}

.apple-modal-host {
  position: fixed;
  inset: 0;
  z-index: 2050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}
.apple-modal-host.active, .apple-modal-host:not(.hidden) {
  pointer-events: auto;
}

.apple-modal {
  background: var(--apple-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  transform: scale(0.97) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--apple-border-light);
  pointer-events: auto;
}
.apple-modal-host.active .apple-modal,
.apple-modal-host:not(.hidden) .apple-modal {
  transform: scale(1) translateY(0);
}

.apple-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--apple-border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--apple-ink);
}
.modal-subtitle {
  font-size: 13px;
  color: var(--apple-muted);
  margin-top: 3px;
}

.apple-modal-body {
  padding: 20px 24px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.apple-modal-footer {
  background: var(--apple-gray-050);
  padding: 16px 24px;
  border-top: 1px solid var(--apple-border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Forms & Fields */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--apple-muted);
}

.input-field, .select-field, .textarea-field {
  background: var(--apple-white);
  color: var(--apple-ink);
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  min-height: 42px;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-field:focus, .select-field:focus, .textarea-field:focus {
  border-color: var(--apple-blue);
  box-shadow: var(--shadow-focus);
}

/* Preset Duration Chips */
.preset-chip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.duration-chip {
  background: var(--apple-gray-050);
  border: 1px solid var(--apple-border-light);
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  color: var(--apple-ink);
  transition: all 0.15s ease;
  user-select: none;
}
.duration-chip:hover {
  background: var(--apple-blue-subtle);
  border-color: var(--apple-blue);
  color: var(--apple-blue);
}
.duration-chip.selected {
  background: var(--apple-blue);
  color: #FFFFFF;
  border-color: var(--apple-blue);
  font-weight: 600;
}

/* Open Session Choice Card */
.open-session-box {
  background: var(--apple-gray-050);
  border: 1px solid var(--apple-border-light);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.open-session-box:hover {
  border-color: var(--apple-blue);
  background: var(--apple-blue-subtle);
}

/* ==========================================================================
   TOAST SHELF
   ========================================================================== */
.toast-shelf {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3000;
  pointer-events: none;
}

.apple-toast {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--apple-ink);
  border: 1px solid var(--apple-border-light);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow-modal);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto;
  cursor: pointer;
  animation: toastSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .apple-toast {
  background: rgba(28, 28, 30, 0.94);
  border-color: var(--apple-border);
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   LOGIN SCREEN (APPLE STYLE)
   ========================================================================== */
.login-body {
  background: var(--apple-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  overflow-y: auto;
}

.login-wrapper {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-card {
  background: var(--apple-white);
  border: 1px solid var(--apple-border-light);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.login-brand__logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--apple-ink);
  color: var(--apple-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-subtle);
}

[data-theme="dark"] .login-brand__logo {
  background: var(--apple-blue);
}

.login-brand__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--apple-ink);
}

.login-brand__title span {
  color: var(--apple-blue);
}

.login-brand__tagline {
  font-size: 13px;
  color: var(--apple-muted);
  margin-top: -4px;
}

.login-alert {
  background: var(--apple-danger-subtle);
  color: var(--apple-danger);
  border: 1px solid rgba(255, 59, 48, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-hint {
  background: var(--apple-gray-050);
  border: 1px solid var(--apple-border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--apple-muted);
  line-height: 1.4;
}

.login-hint code {
  font-family: var(--font-mono);
  color: var(--apple-ink);
  background: var(--apple-white);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--apple-border-light);
}

.login-footer {
  text-align: center;
  font-size: 12px;
  color: var(--apple-muted);
}
