/* webapp-nihonbashi - Reservation Management System */
/* Design System: Clean white & sky-blue theme for Japanese nightlife entertainment */

/* ============================================ */
/* CSS Variables */
/* ============================================ */
:root {
  /* Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f9ff;
  --bg-tertiary: #e8f1fb;
  --bg-sidebar: #f0f6ff;
  --text-primary: #1a1a2e;
  --text-secondary: #495057;
  --text-tertiary: #868e96;
  --border-color: #d1e3f0;
  --border-light: #e2ecf5;

  /* Accent Colors */
  --accent: #0ea5e9;
  --accent-light: rgba(14, 165, 233, 0.12);
  --accent-hover: #0284c7;

  /* Status Colors */
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);
  --danger: #f43f5e;
  --danger-light: rgba(244, 63, 94, 0.12);

  /* Store Colors */
  --store-puru: #ec4899;
  --store-puru-bg: rgba(236, 72, 153, 0.10);
  --store-ooku: #a855f7;
  --store-ooku-bg: rgba(168, 85, 247, 0.10);

  /* Layout */
  --sidebar-width: 220px;
  --topbar-height: 56px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* ============================================ */
/* Reset & Base Styles */
/* ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  min-height: 100vh;
}

/* ============================================ */
/* Loading Overlay */
/* ============================================ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================ */
/* Menu Bar */
/* ============================================ */
.menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 100;
  gap: 4px;
}

.menubar-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 16px;
  border-right: 1px solid var(--border-color);
  margin-right: 8px;
  flex-shrink: 0;
}

.menubar-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.menubar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}

.menubar-nav::-webkit-scrollbar {
  display: none;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  text-decoration: none;
}

.menu-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.menu-item.active {
  background: var(--accent);
  color: #fff;
}

.menu-item.active:hover {
  background: var(--accent-hover);
}

.menu-item i {
  font-size: 12px;
}

.menu-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 4px;
  flex-shrink: 0;
}

.menubar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
  padding-left: 8px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}

/* ============================================ */
/* Main Content Layout */
/* ============================================ */
.main-content {
  margin-left: 0;
  margin-top: 48px;
  min-height: 100vh;
  background: var(--bg-secondary);
}

/* ============================================ */
/* Topbar */
/* ============================================ */
.topbar {
  position: sticky;
  top: 48px; /* menubar height */
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left,
.topbar-center,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.store-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============================================ */
/* Section */
/* ============================================ */
.section {
  padding: 20px 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================ */
/* Buttons */
/* ============================================ */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #dce8f5;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #e11d48;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

/* ============================================ */
/* Form Elements */
/* ============================================ */
.input-text,
.input-date,
.input-select,
textarea {
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: all 0.15s ease;
  font-family: inherit;
}

.input-text:focus,
.input-date:focus,
.input-select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light);
}

.input-text {
  min-width: 200px;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-row > * {
  flex: 1;
  min-width: 150px;
}

/* ============================================ */
/* Data Table */
/* ============================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table thead {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
}

.data-table th {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(14, 165, 233, 0.05);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================ */
/* Inline Edit */
/* ============================================ */
.inline-edit {
  background: transparent;
  border: 1px solid transparent;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-primary);
  width: 100%;
  transition: all 0.15s ease;
}

.inline-edit:hover {
  border-color: var(--border-color);
}

.inline-edit:focus {
  border-color: var(--accent);
  background: var(--bg-tertiary);
  box-shadow: 0 0 0 3px var(--accent-light);
  outline: none;
}

/* ============================================ */
/* Badges */
/* ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-neutral {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.badge-puru {
  background: var(--store-puru-bg);
  color: var(--store-puru);
}

.badge-ooku {
  background: var(--store-ooku-bg);
  color: var(--store-ooku);
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

/* ============================================ */
/* Tab Group */
/* ============================================ */
.tab-group {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.tab-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-primary);
  border: none;
  cursor: pointer;
  border-right: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.tab-btn:last-child {
  border-right: none;
}

.tab-btn.active {
  background: var(--accent);
  color: white;
}

.tab-btn:hover:not(.active) {
  background: var(--bg-tertiary);
}

/* ============================================ */
/* Modals */
/* ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(14, 165, 233, 0.1);
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
}

.modal-lg {
  max-width: 700px;
}

.modal-xl {
  max-width: 1000px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.modal-close:hover {
  background: var(--bg-tertiary);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================ */
/* Toast Notifications */
/* ============================================ */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.3s ease;
  border-left: 3px solid transparent;
}

.toast-success {
  background: #f0fdf9;
  color: #059669;
  border-left-color: #10b981;
}

.toast-error {
  background: #fff1f2;
  color: #e11d48;
  border-left-color: #f43f5e;
}

.toast-info {
  background: #f0f4ff;
  color: #0ea5e9;
  border-left-color: #0ea5e9;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================ */
/* Column Toggle Panel */
/* ============================================ */
.column-toggle-panel {
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.column-order-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.column-order-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  cursor: grab;
  user-select: none;
  transition: background 0.15s, box-shadow 0.15s;
  border: 1px solid transparent;
}

.column-order-item:hover {
  background: #dce8f5;
}

.column-order-item.column-dragging {
  opacity: 0.4;
  background: var(--bg-primary);
}

.column-order-item.column-drag-over {
  border-top: 2px solid var(--accent);
  padding-top: 4px;
}

.column-drag-handle {
  color: var(--text-tertiary);
  font-size: 12px;
  cursor: grab;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.column-drag-handle:active {
  cursor: grabbing;
}

.column-order-item label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-primary);
  flex: 1;
  margin: 0;
}

.column-order-item input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
}

/* ============================================ */
/* Info Box */
/* ============================================ */
.info-box {
  padding: 12px 16px;
  background: var(--accent-light);
  border: 1px solid rgba(14, 165, 233, 0.15);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* ============================================ */
/* Cards */
/* ============================================ */
.card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

/* ============================================ */
/* Timer Styles */
/* ============================================ */
.timer-badge {
  font-family: 'Courier New', Consolas, monospace;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.timer-running {
  background: var(--warning-light);
  color: #fbbf24;
}

.timer-active {
  background: rgba(16, 185, 129, 0.15); color: #34d399;
}
.timer-over {
  background: rgba(244, 63, 94, 0.15); color: #fb7185;
}
.timer-waiting {
  background: var(--bg-tertiary); color: var(--text-tertiary);
}
.timer-done {
  background: rgba(14, 165, 233, 0.12); color: #38bdf8;
}
.timer-paused {
  background: rgba(245, 158, 11, 0.15); color: #fbbf24;
  border: 1px dashed #d97706;
}
.timer-paused i { margin-right: 2px; }
.timer-serving {
  background: rgba(59, 130, 246, 0.15); color: #60a5fa;
  font-weight: 700;
}
.cast-shift-time {
  display: block; font-size: 10px; color: var(--text-tertiary);
  line-height: 1.2; margin-top: 1px;
}

.timer-overtime {
  background: var(--danger-light);
  color: var(--danger);
}

/* ============================================ */
/* Evolution Display */
/* ============================================ */
.evolution-display {
  display: flex;
  align-items: center;
  gap: 6px;
}

.evolution-display img {
  height: 36px;
  width: auto;
  image-rendering: pixelated;
}

.evolution-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.evolution-next {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.evolution-next.evolution-max {
  color: #fb923c;
  font-weight: 700;
}

.evolution-path {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  white-space: nowrap;
}

.evolution-path.path-pururun {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
}

.evolution-path.path-oku {
  background: rgba(129, 140, 248, 0.15);
  color: #818cf8;
}

.evolution-path.path-balanced {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

/* Timeline Ticker - Card Grid */
.timeline-ticker {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  min-height: 0;
}

.timeline-ticker:empty { display: none; }

.ticker-item {
  display: flex;
  flex-direction: column;
  padding: 10px 38px 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  position: relative;
  animation: tickerFadeIn 0.3s ease;
  border-left: 4px solid transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.15s;
}

.ticker-item:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

@keyframes tickerFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ticker-item .ticker-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ticker-item .ticker-time {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
}

.ticker-item .ticker-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ticker-item .ticker-detail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1.3;
}

.ticker-item .ticker-detail i {
  font-size: 12px;
  opacity: 0.7;
}

.ticker-item .ticker-cast {
  font-weight: 600;
}

.ticker-item .ticker-course {
  opacity: 0.7;
  font-size: 12px;
}

.ticker-item .ticker-customer {
  opacity: 0.65;
  font-size: 11px;
  margin-top: 3px;
}

/* Type-specific styles */
.ticker-item.ticker-arrival {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border-left-color: #10b981;
}
.ticker-item.ticker-arrival .ticker-badge {
  background: #10b981;
  color: #fff;
}

.ticker-item.ticker-confirm {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
  border-left-color: #f59e0b;
}
.ticker-item.ticker-confirm .ticker-badge {
  background: #f59e0b;
  color: #fff;
}

.ticker-item.ticker-shift {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border-left-color: #3b82f6;
}
.ticker-item.ticker-shift .ticker-badge {
  background: #3b82f6;
  color: #fff;
}

.ticker-item.ticker-ending {
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  border-left-color: #f43f5e;
}
.ticker-item.ticker-ending .ticker-badge {
  background: #f43f5e;
  color: #fff;
}

.ticker-item.ticker-next {
  background: rgba(168, 85, 247, 0.12);
  color: #c4b5fd;
  border-left-color: #a855f7;
  opacity: 0.8;
}
.ticker-item.ticker-next .ticker-badge {
  background: #a855f7;
  color: #fff;
}

.ticker-item i.ticker-icon {
  font-size: 12px;
  opacity: 0.7;
}

.ticker-check-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  min-width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
  opacity: 0.3;
  font-size: 10px;
  padding: 0;
  transition: opacity 0.2s, background 0.2s, transform 0.15s;
}

.ticker-check-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.1);
  transform: scale(1.1);
}

/* ============================================ */
/* Empty State */
/* ============================================ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ============================================ */
/* Utility Classes */
/* ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-tertiary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ============================================ */
/* Responsive Design */
/* ============================================ */
@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
  }

  .topbar {
    padding: 0 12px;
  }

  .section {
    padding: 12px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .data-table {
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 6px 8px;
  }

  .modal-dialog {
    margin: 0;
    max-height: 100vh;
    border-radius: 0;
  }

  .toast-container {
    top: 8px;
    right: 8px;
    left: 8px;
  }

  .toast {
    min-width: auto;
    width: 100%;
  }

  .menubar-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .menubar-nav::-webkit-scrollbar {
    display: none;
  }
}

/* ============================================ */
/* Timeline View - CityHeaven Style */
/* ============================================ */

/* 1. View Toggle (Table / Timeline switch) */
.view-toggle {
  display: inline-flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
}

.view-btn + .view-btn {
  border-left: none;
}

.view-btn:hover:not(.active) {
  background: var(--bg-tertiary);
}

.view-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* 2. Timeline Container */
.timeline-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  overflow: hidden;
}

/* 3. Date Navigation Tabs */
.timeline-date-nav {
  display: flex;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.timeline-date-nav::-webkit-scrollbar {
  display: none;
}

.timeline-date-tab {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.timeline-date-tab:hover {
  color: var(--text-primary);
  background: rgba(14, 165, 233, 0.08);
}

.timeline-date-tab.active {
  background: var(--bg-primary);
  border-bottom: 2px solid var(--accent);
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-date-tab.today {
  color: var(--danger);
}

.timeline-date-tab.today.active {
  color: var(--danger);
  border-bottom-color: var(--danger);
}

/* 4. Header Row (fixed above scroll area) */
.timeline-header-row {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.timeline-cast-header-fixed {
  width: 180px;
  min-width: 180px;
  height: 32px;
  background: var(--bg-tertiary);
  border-right: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.timeline-time-header-scroll {
  flex: 1;
  overflow: hidden;
  background: var(--bg-tertiary);
}

/* 5. Timeline Body (main scrollable area) */
.timeline-body {
  display: flex;
  height: calc(100vh - 240px);
  overflow: hidden;
}

/* 6. Cast Panel (left fixed panel) */
.timeline-cast-panel {
  width: 180px;
  min-width: 180px;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  background: var(--bg-primary);
  flex-shrink: 0;
  scrollbar-width: none;
}

.timeline-cast-panel::-webkit-scrollbar {
  display: none;
}

.timeline-cast-row {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  gap: 8px;
}

.timeline-cast-info {
  overflow: hidden;
  flex: 1;
}

.timeline-cast-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-cast-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* 7. Grid Scroll Area (right scrollable area) */
.timeline-grid-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
  cursor: grab;
  background: var(--bg-primary);
}

.timeline-grid-scroll.dragging {
  cursor: grabbing;
  user-select: none;
}

/* 8. Time Header (inside header-scroll) */
.timeline-time-header {
  display: flex;
  height: 32px;
}

.timeline-hour-cell {
  width: 120px;
  min-width: 120px;
  border-right: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  padding-left: 4px;
}

/* 8. Grid Body */
.timeline-grid {
  position: relative;
}

.timeline-row {
  height: 56px;
  position: relative;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
  cursor: pointer;
}

.timeline-row:nth-child(even) {
  background: #f5f9ff;
}

.timeline-hour-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-color);
  z-index: 0;
}

/* 9. Shift Bar (working hours background) */
.timeline-shift-bar {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 0;
  background: rgba(14, 165, 233, 0.06);
  opacity: 1;
  z-index: 1;
  pointer-events: none;
}

.timeline-shift-bar.store-puru {
  background: rgba(236, 72, 153, 0.08);
}

.timeline-shift-bar.store-ooku {
  background: rgba(168, 85, 247, 0.08);
}

/* 10. Reservation Block */
.timeline-reservation-block {
  position: absolute;
  top: 8px;
  height: 40px;
  background: var(--store-puru);
  color: white;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.timeline-reservation-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  background: #db2777;
  cursor: grab;
}

.timeline-reservation-block:active {
  cursor: grabbing;
}

.timeline-reservation-block.store-puru {
  background: #ec4899;
}

.timeline-reservation-block.store-ooku {
  background: #a855f7;
}

/* 11. Now Line (current time indicator) */
.timeline-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--danger);
  z-index: 10;
  pointer-events: none;
}

.timeline-now-line::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
}

/* 12. Tooltip */
.timeline-tooltip {
  position: fixed;
  z-index: 1000;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  font-size: 13px;
  max-width: 280px;
  pointer-events: none;
  color: var(--text-primary);
}

.timeline-tooltip-row {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-tooltip-row:last-child {
  margin-bottom: 0;
}

.timeline-tooltip-label {
  color: var(--text-tertiary);
  min-width: 60px;
  flex-shrink: 0;
}

.timeline-tooltip-value {
  font-weight: 500;
}

/* ============================================ */
/* Reservation Detail Modal (CityHeaven-style) */
/* ============================================ */

.modal-detail {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.modal-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 5;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-detail-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-detail-status {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.modal-detail-status.status-confirmed {
  background: var(--success-light);
  color: #34d399;
}

.modal-detail-status.status-tentative {
  background: var(--warning-light);
  color: #fbbf24;
}

.modal-detail-status.status-cancelled {
  background: var(--danger-light);
  color: #fb7185;
}

.modal-detail-status.status-completed {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.modal-close-btn {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 0 4px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-detail-body {
  display: flex;
  gap: 24px;
  padding: 20px 24px;
}

.modal-detail-left {
  flex: 1;
  min-width: 0;
}

.modal-detail-right {
  width: 280px;
  min-width: 280px;
}

.detail-section {
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.detail-section-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-section-content {
  padding: 16px;
}

.detail-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 13px;
}

.detail-row:last-child {
  margin-bottom: 0;
}

.detail-label {
  width: 80px;
  min-width: 80px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.detail-value {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

/* Price rows */
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}

.price-row:last-child {
  border-bottom: none;
}

.price-row .price-item {
  color: var(--text-secondary);
}

.price-row .price-amount {
  font-weight: 500;
  text-align: right;
  min-width: 80px;
}

/* Total price box */
.price-total-box {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-total-label {
  font-size: 14px;
  font-weight: 600;
  color: #34d399;
}

.price-total-amount {
  font-size: 20px;
  font-weight: 700;
  color: #34d399;
}

/* Inline edit form */
.detail-edit-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}

.detail-edit-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.detail-edit-select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Footer */
.modal-detail-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-detail-footer-right {
  display: flex;
  gap: 8px;
}

/* Mobile */
@media (max-width: 768px) {
  .modal-detail {
    width: 95%;
    max-width: none;
  }
  .modal-detail-body {
    flex-direction: column;
    gap: 16px;
  }
  .modal-detail-right {
    width: 100%;
    min-width: 0;
  }
}

/* ============================================ */
/* Section Improvements */
/* ============================================ */

/* Generic .table to match data-table style */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table thead {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
}

.table th {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: rgba(14, 165, 233, 0.05);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Section toolbar */
.section-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* Cast attendance summary */
.cast-attendance-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.15);
  border-radius: var(--radius-md);
}
.att-summary-label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.att-summary-label i { margin-right: 4px; }
.att-summary-total {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.att-summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
}
.att-summary-badge strong {
  font-size: 15px;
}

/* Cast management list layout */
.cast-card {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.12s ease;
}

.cast-card:last-child {
  border-bottom: none;
}

.cast-card:hover {
  background: var(--bg-secondary);
}

.cast-card-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.cast-card-info {
  flex: 1;
  min-width: 0;
}

.cast-card-name {
  font-weight: 600;
  font-size: 13px;
}

.cast-card-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cast-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s;
}

.cast-card:hover .cast-card-actions {
  opacity: 1;
}

/* Cast list row elements */
.cast-list-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  min-width: 70px;
}

.cast-list-stores {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.cast-list-store-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 2px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--bg-secondary);
  border-left: 3px solid var(--border-color);
}

.cast-list-store-tag.store-puru {
  border-left-color: var(--store-puru);
  background: var(--store-puru-bg);
}

.cast-list-store-tag.store-ooku {
  border-left-color: var(--store-ooku);
  background: var(--store-ooku-bg);
}

.cast-list-store-tag .badge {
  flex-shrink: 0;
  font-size: 10px;
  padding: 1px 6px;
}

.cast-list-stage {
  font-weight: 600;
  color: var(--text-primary);
}

.cast-list-rank {
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.cast-store-fee {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  font-size: 11px;
  color: var(--warning);
  white-space: nowrap;
}

.cast-list-detail {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.cast-list-detail i {
  margin-right: 3px;
  font-size: 10px;
}
.cast-search-input {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-width: 200px;
}
.cast-search-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Cast list layout */
.cast-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Attendance card layout */
.attendance-store-group {
  margin-bottom: 20px;
}

.attendance-store-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
}

.attendance-store-header .badge {
  font-size: 13px;
  padding: 4px 12px;
}

.attendance-store-count {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.attendance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.attendance-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: border-color 0.15s;
  position: relative;
}

.attendance-item:hover {
  border-color: var(--accent);
}

.attendance-item-number {
  font-size: 11px;
  color: var(--text-tertiary);
  min-width: 20px;
}

.attendance-item-name {
  font-weight: 500;
  flex: 1;
}

.attendance-item-time {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

/* Attendance CRUD */
.attendance-item-actions {
  display: flex;
  gap: 2px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s;
}
.attendance-item:hover .attendance-item-actions {
  opacity: 1;
}
.att-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-tertiary);
  font-size: 11px;
  transition: background 0.15s, color 0.15s;
}
.att-action-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.att-action-btn.att-del:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}
.att-action-btn.att-save {
  color: #34d399;
}
.att-action-btn.att-save:hover {
  background: rgba(16, 185, 129, 0.15);
}
.att-add-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  background: none;
  border: 1.5px dashed var(--border-light);
  border-radius: 8px;
  color: var(--text-tertiary);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.att-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.att-edit-row {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 4px 0;
}
.att-edit-input {
  padding: 4px 6px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 12px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.att-edit-input[type="text"] {
  flex: 1;
  min-width: 60px;
}
.att-edit-input[type="time"] {
  width: 80px;
}
.att-add-form {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  margin: 16px;
}
.att-add-form-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.att-add-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.att-add-form-row label {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 40px;
}
.att-add-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Salary section improvements */
.salary-info {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.salary-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-size: 15px;
}

/* Edit overlay card (used in cast edit, salary detail, etc.) */
.edit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.edit-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
  padding: 24px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.edit-card h4 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* Form grid inside edit modals */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid .form-group-full {
  grid-column: 1 / -1;
}

/* Form control (for select/input inside modals) */
.form-control {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: all 0.15s ease;
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Required field asterisk */
.required {
  color: var(--danger);
  font-weight: 700;
}

/* Form actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* Inline add form */
.add-form-inline {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.add-form-inline h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* Checkbox inline */
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 12px;
  font-size: 13px;
  cursor: pointer;
}

/* Price formatting */
.price-text {
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

/* Badge additional colors */
.badge-pink {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
}

.badge-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.badge-info {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
}

/* Button link style */
.btn-link {
  background: transparent;
  color: var(--accent);
  padding: 4px 8px;
  font-size: 12px;
}

.btn-link:hover {
  background: var(--accent-light);
}

.btn-info {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
}

.btn-info:hover {
  background: rgba(6, 182, 212, 0.25);
}

.btn-warning {
  background: var(--warning-light);
  color: #fbbf24;
}

.btn-warning:hover {
  background: rgba(245, 158, 11, 0.25);
}

/* Rank display inline */
.rank-display {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.rank-store {
  color: var(--text-tertiary);
}

.rank-value {
  font-weight: 600;
  color: var(--text-primary);
}

.rank-special {
  color: #f472b6;
  font-weight: 600;
}

/* Responsive adjustments for cast/salary */
@media (max-width: 768px) {
  .cast-card {
    flex-wrap: wrap;
  }
  .cast-list-stores {
    flex-basis: 100%;
    padding-left: 44px;
  }
  .attendance-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .edit-card {
    max-width: none;
    margin: 10px;
  }
}

/* Past reservation row - dark overlay */
tr.past-reservation {
  position: relative;
}
tr.past-reservation td {
  color: #aaa !important;
  background: rgba(200, 215, 230, 0.6) !important;
}
tr.past-reservation td strong,
tr.past-reservation td .badge,
tr.past-reservation td .timer-badge,
tr.past-reservation td .reservation-no {
  opacity: 0.5;
}
tr.past-reservation td input,
tr.past-reservation td select {
  color: #aaa;
  background: rgba(200, 215, 230, 0.4);
}

/* Attendance date tabs */
.att-date-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}
.att-date-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-primary);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 56px;
  position: relative;
}
.att-date-tab:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
}
.att-date-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.att-date-tab.sun .att-date-dow { color: #fb7185; }
.att-date-tab.sat .att-date-dow { color: #60a5fa; }
.att-date-tab.active .att-date-dow { color: #fff; }
.att-date-day {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.att-date-dow {
  font-size: 11px;
  color: var(--text-secondary);
}
.att-date-count {
  font-size: 10px;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border-radius: 8px;
  padding: 1px 6px;
  font-weight: 600;
}
.att-date-tab.active .att-date-count {
  background: rgba(255,255,255,0.3);
  color: #fff;
}
.att-today-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: 3px;
  vertical-align: middle;
}
.att-date-tab.active .att-today-dot {
  background: #fff;
}

/* ============================================ */
/* Wait Time Dashboard                          */
/* ============================================ */

.wd-store-section {
  margin-bottom: 24px;
}

.wd-store-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
}

.wd-update-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: auto;
}

.wd-cast-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wd-cast-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #ffffff;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-left: 3px solid transparent;
  transition: background 0.15s;
  position: relative;
}

.wd-cast-card:hover {
  background: var(--bg-tertiary);
}

/* Status circle - smaller for list layout */
.wd-status-circle {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.wd-status-circle.wd-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.wd-status-circle.wd-orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.wd-status-circle.wd-red { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.wd-status-circle.wd-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.wd-status-circle.wd-gray { background: rgba(113, 113, 122, 0.15); color: #71717a; }

/* Card left border accent */
.wd-cast-card.wd-green { border-left: 3px solid #10b981; }
.wd-cast-card.wd-orange { border-left: 3px solid #f59e0b; }
.wd-cast-card.wd-red { border-left: 3px solid #f43f5e; }
.wd-cast-card.wd-blue { border-left: 3px solid #3b82f6; }
.wd-cast-card.wd-gray { border-left: 3px solid #52525b; opacity: 0.7; }

/* Cast body */
.wd-cast-body {
  flex: 1 1 auto;
  min-width: 0;
}

.wd-cast-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.2;
}

.wd-cast-status {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 12px;
}

.wd-label-current {
  font-weight: 700;
  font-size: 13px;
}

.wd-cast-card.wd-green .wd-label-current { color: #34d399; }
.wd-cast-card.wd-orange .wd-label-current { color: #fbbf24; }
.wd-cast-card.wd-red .wd-label-current { color: #fb7185; }
.wd-cast-card.wd-blue .wd-label-current { color: #60a5fa; }
.wd-cast-card.wd-gray .wd-label-current { color: #71717a; }

.wd-label-arrow {
  color: var(--text-tertiary);
  font-size: 9px;
}

.wd-label-suggest {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
}

.wd-label-suggest.wd-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.wd-label-suggest.wd-orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* Time slots chips */
.wd-time-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

.wd-time-chip {
  font-size: 10px;
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}

/* Action area */
.wd-cast-action {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wd-wait-select {
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  min-width: 70px;
}

.wd-wait-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.wd-time-input {
  font-size: 12px;
  padding: 4px 4px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  width: 72px;
}

.wd-time-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.wd-sync-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.15s;
  padding: 0;
}

.wd-sync-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.wd-sync-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Keep existing wait-time-* classes for backward compat */
.wait-time-updated { font-size: 11px; color: var(--text-tertiary); margin-bottom: 12px; }
.wait-time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 20px; }
.wait-time-card { background: #ffffff; border: 1px solid var(--border-color); border-radius: 8px; padding: 14px; text-align: center; }
.wait-time-card.wait-available { border-left: 3px solid #10b981; background: rgba(16, 185, 129, 0.08); }
.wait-time-card.wait-busy { border-left: 3px solid #f59e0b; background: rgba(245, 158, 11, 0.08); }
.wait-time-card.wait-finished { border-left: 3px solid #52525b; background: var(--bg-tertiary); opacity: 0.7; }
.wait-time-store { margin-bottom: 6px; }
.wait-time-cast { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.wait-time-value { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.wait-time-next { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.wait-time-label { font-size: 11px; color: var(--text-secondary); }

/* Wait Dashboard - Reservation Timeline */
.wd-res-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
}
.wd-res-block {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  border-left: 3px solid var(--border-light);
}
.wd-res-block.wd-res-active {
  background: rgba(245, 158, 11, 0.12);
  border-left-color: #f59e0b;
}
.wd-res-time {
  font-weight: 700;
  color: var(--text-primary);
}
.wd-res-course {
  color: var(--text-tertiary);
}
.wd-res-customer {
  color: #60a5fa;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wd-res-end {
  color: var(--text-tertiary);
  font-size: 10px;
}

/* ============================================ */
/* CityHeaven Course Selector                   */
/* ============================================ */
.ch-course-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}
.ch-course-box {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  max-width: 400px;
  width: 90%;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.ch-course-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.ch-course-title i {
  color: #fb923c;
  margin-right: 6px;
}
.ch-course-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.ch-course-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ch-course-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-tertiary);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.15s;
}
.ch-course-item:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: #f59e0b;
}
.ch-course-item.ch-course-match {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  font-weight: 600;
}
.ch-course-item.ch-course-match::after {
  content: ' \u2605\u63a8\u5968';
  color: #fb923c;
  font-size: 11px;
}

/* ============================================ */
/* A-rank fixes                                 */
/* ============================================ */

/* Row borders for reservation list */
#reservationBody tr {
  border-bottom: 1px solid var(--border-color);
}
#reservationBody tr:last-child {
  border-bottom: none;
}

/* Store select color coding */
select.store-select.badge-puru {
  background: var(--store-puru-bg);
  color: var(--store-puru);
  font-weight: 600;
  border-color: var(--store-puru);
}
select.store-select.badge-ooku {
  background: var(--store-ooku-bg);
  color: var(--store-ooku);
  font-weight: 600;
  border-color: var(--store-ooku);
}

/* Ticker nomination badge */
.ticker-nom {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  margin: 0 4px;
}
.ticker-nom-free {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font-weight: 700;
}

/* Wait time: collapsible reservation summary */
.wd-res-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
  user-select: none;
}
.wd-res-summary:hover { color: var(--text-primary); }
.wd-res-arrow {
  font-size: 9px;
  transition: transform 0.2s;
  display: inline-block;
}
.wd-res-arrow.wd-res-open {
  transform: rotate(90deg);
}
.wd-res-count {
  font-weight: 600;
  color: #fb923c;
}
.wd-res-next-time {
  color: var(--text-tertiary);
  font-size: 10px;
}

/* Wait Dashboard Priority */
.wd-priority-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  z-index: 2;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  border: 2px solid var(--bg-primary);
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.wd-priority-badge:hover {
  background: #fbbf24;
  color: #78350f;
  transform: scale(1.15);
}
.wd-priority-badge.wd-prio-active {
  background: #fbbf24;
  color: #78350f;
  font-weight: 800;
  font-size: 12px;
}
.wd-priority-badge.wd-prio-active:hover {
  background: #f59e0b;
}
.wd-cast-card.wd-prioritized {
  border: 2px solid #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.2);
}

/* Idle cast pickup alert */
.wd-idle-alert {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.wd-idle-title {
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 6px;
}
.wd-idle-title i { color: #f59e0b; margin-right: 4px; }
.wd-idle-list { display: flex; flex-wrap: wrap; gap: 6px; }
.wd-idle-chip {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 16px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fcd34d;
}
.wd-idle-chip small {
  font-weight: 400;
  color: #fbbf24;
  margin-left: 2px;
}

/* ============================================================
   DISPATCH ROUTING
   ============================================================ */
.dp-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}
.dp-tabs {
  display: flex;
  gap: 4px;
}
.dp-tab {
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.dp-tab:hover { background: var(--bg-tertiary); }
.dp-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.dp-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.dp-route-summary {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #34d399;
}
.dp-route-summary i { margin-right: 6px; }
.dp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dp-select-all {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-tertiary);
}
.dp-select-all label { cursor: pointer; }
.dp-select-all input[type="checkbox"] { margin-right: 6px; }
.dp-stop {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.dp-stop:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.dp-stop.selected {
  border-color: var(--accent);
  background: rgba(14, 165, 233, 0.08);
}
.dp-stop input[type="checkbox"] {
  margin-top: 4px;
  flex-shrink: 0;
}
.dp-order {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.dp-stop-body { flex: 1; min-width: 0; }
.dp-stop-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.dp-stop-detail {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}
.dp-stop-detail i { margin-right: 3px; color: var(--text-tertiary); }
.dp-stop-addr {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.dp-stop-addr i { margin-right: 3px; }
.dp-stop-warn {
  font-size: 11px;
  color: #f59e0b;
  margin-top: 4px;
}
.dp-stop-warn i { margin-right: 3px; }
.dp-status-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.dp-status-badge.dp-pending { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.dp-status-badge.dp-active { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.dp-status-badge.dp-completed { background: var(--bg-tertiary); color: var(--text-tertiary); }

/* Btn xs variant */
.btn-xs { padding: 2px 8px; font-size: 11px; }

/* Dispatch add form */
.dp-add-form {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.dp-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.dp-add-row .form-control {
  min-width: 0;
}

/* Responsive */
@media (max-width: 640px) {
  .dp-controls { flex-direction: column; align-items: stretch; }
  .dp-actions { justify-content: flex-end; }
  .dp-stop-detail { flex-direction: column; gap: 2px; }
  .dp-add-row { flex-direction: column; }
  .dp-add-row .form-control { width: 100% !important; flex: none !important; }
}

/* ============================================================
   TIMER SECTION
   ============================================================ */
.timer-content { padding: 0; }

/* ============================================================
   WHITEBOARD-STYLE TIMER
   ============================================================ */

/* Store section */
.wb-store-section { margin-bottom: 16px; }
.wb-store-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--accent);
  padding: 8px 4px; margin-bottom: 8px;
  border-bottom: 3px solid var(--accent);
}

/* Whiteboard grid */
.wb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

/* Cast card */
.wb-card {
  border-radius: 10px; padding: 10px;
  border: 2px solid var(--border-color);
  background: var(--bg-tertiary);
  display: flex; flex-direction: column;
  min-height: 140px; transition: all 0.2s;
  position: relative;
}

/* Idle */
.wb-card-idle {
  border-color: var(--border-color);
  background: var(--bg-tertiary);
}

/* Active */
.wb-card-active { color: #fff; border-color: transparent; }
.wb-card-green { background: linear-gradient(135deg, #065f46, #059669); }
.wb-card-yellow { background: linear-gradient(135deg, #854d0e, #b45309); }
.wb-card-red { background: linear-gradient(135deg, #991b1b, #dc2626); animation: wb-pulse 1s ease-in-out infinite; }

@keyframes wb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); }
  50% { box-shadow: 0 0 12px 4px rgba(220,38,38,0.3); }
}

/* Out */
.wb-card-out {
  border-color: var(--border-color);
  background: var(--bg-tertiary);
  opacity: 0.6;
}

/* Card header */
.wb-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
  padding-bottom: 4px; border-bottom: 1px solid rgba(128,128,128,0.2);
}
.wb-cast-name {
  font-size: 13px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100px;
}
.wb-work-time { font-size: 10px; opacity: 0.6; }

/* Timer display */
.wb-timer-area { text-align: center; margin: 4px 0; }
.wb-timer-time {
  font-family: 'Courier New', 'SF Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 26px; font-weight: 800; line-height: 1.1;
}
.wb-timer-up {
  font-size: 12px; font-weight: 700; opacity: 0.85;
  margin-top: 2px;
}
.wb-timer-green { color: #fff; }
.wb-timer-yellow { color: #fff; }
.wb-timer-red { color: #fff; }

/* Progress bar */
.wb-progress {
  height: 3px; border-radius: 2px;
  background: rgba(0,0,0,0.08); overflow: hidden;
  margin: 4px 0;
}
.wb-progress-fill {
  height: 100%; border-radius: 2px;
  transition: width 1s linear;
}
.wb-progress-green { background: #4ade80; }
.wb-progress-yellow { background: #facc15; }
.wb-progress-red { background: #f87171; }

/* Timer info row */
.wb-timer-info {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; opacity: 0.75; margin-bottom: 4px;
}
.wb-room {
  background: rgba(14, 165, 233, 0.15); padding: 1px 6px;
  border-radius: 8px; font-weight: 600;
}
.wb-course { font-weight: 600; }

/* Reservation info (inside active card) */
.wb-reservation {
  font-size: 10px; opacity: 0.8;
  padding: 3px 6px; margin: 2px 0 4px;
  background: rgba(14, 165, 233, 0.10); border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-hotel { opacity: 0.7; }

/* Idle: next reservation */
.wb-next-res {
  flex: 1; padding: 4px 0;
}
.wb-next-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-tertiary); font-weight: 600; margin-bottom: 2px;
}
.wb-next-detail {
  font-size: 11px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-next-time {
  font-weight: 700; color: var(--accent);
}
.wb-next-course {
  font-size: 10px; color: var(--text-tertiary); margin-top: 1px;
}

/* Idle label */
.wb-idle-label {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-tertiary); font-weight: 500;
}

/* Out status */
.wb-status-area {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; border-radius: 6px; margin: 4px 0;
}
.wb-status-end { color: #fb923c; }
.wb-status-sold { color: #fb7185; }

/* Button common */
.wb-btn {
  border: none; border-radius: 6px; cursor: pointer;
  font-weight: 700; font-size: 11px; padding: 5px 0;
  width: 100%; text-align: center; transition: opacity 0.15s;
}
.wb-btn:hover { opacity: 0.85; }
.wb-btn:active { transform: scale(0.97); }

.wb-btn-start { background: var(--accent); color: #fff; }
.wb-btn-stop { background: #f43f5e; color: #fff; }
.wb-btn-pause { background: #d97706; color: #fff; }
.wb-btn-resume { background: #059669; color: #fff; flex: 1; }
.wb-btn-sm { min-width: 36px; padding: 4px 8px; font-size: 13px; font-weight: 700; }
.wb-timer-btns { display: flex; gap: 4px; margin-top: auto; }
.wb-timer-btns .wb-btn { flex: 1; }
.wb-btn-clear {
  background: transparent; color: var(--text-tertiary);
  border: 1px solid var(--border-color); margin-top: auto;
}

/* Action area (idle card bottom) */
.wb-actions { margin-top: auto; }
.wb-status-btns {
  display: flex; gap: 4px; margin-top: 4px;
}
.wb-btn-end, .wb-btn-sold {
  flex: 1; padding: 3px 0; font-size: 10px; font-weight: 600;
  border-radius: 4px; background: var(--bg-primary);
  color: var(--text-secondary); border: 1px solid var(--border-color);
  cursor: pointer; transition: all 0.15s;
}
.wb-btn-end:hover { border-color: #fb923c; color: #fb923c; }
.wb-btn-sold:hover { border-color: #fb7185; color: #fb7185; }
.wb-btn-end.active { background: #fb923c; color: #fff; border-color: #fb923c; }
.wb-btn-sold.active { background: #f43f5e; color: #fff; border-color: #f43f5e; }

/* Reservation list (always shown at card bottom) */
.wb-res-list {
  margin-top: 6px; padding-top: 4px;
  border-top: 1px dashed rgba(128,128,128,0.3);
}
.wb-res-item {
  display: flex; gap: 4px; align-items: center;
  font-size: 10px; padding: 1px 0;
  line-height: 1.3;
}
.wb-res-time { font-weight: 700; white-space: nowrap; }
.wb-res-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-res-past { opacity: 0.4; text-decoration: line-through; }

/* Serving card (reservation-time based auto-detect) */
.wb-card-serving {
  border-color: #3b82f6;
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(59,130,246,0.04));
}
.wb-serving-label {
  text-align: center; font-size: 14px; font-weight: 700;
  color: #60a5fa; margin-bottom: 2px;
}
.wb-serving-label i { margin-right: 4px; }
.wb-serving-info {
  display: flex; flex-direction: column; align-items: center;
  font-size: 11px; color: var(--text-secondary); gap: 2px; margin-bottom: 4px;
}
.wb-serving-remaining { font-weight: 700; color: #34d399; }
.wb-serving-warn { font-weight: 700; color: #fbbf24; }
.wb-serving-over { font-weight: 700; color: #fb7185; }

/* Paused card */
.wb-card-paused {
  border-color: #d97706;
  background: linear-gradient(135deg, rgba(217,119,6,0.12), rgba(217,119,6,0.04));
}
.wb-paused-label {
  text-align: center; font-size: 13px; font-weight: 700;
  color: #fbbf24; margin-bottom: 4px;
}
.wb-timer-edit {
  display: flex; align-items: center; justify-content: center; gap: 4px; margin: 4px 0;
}
.wb-time-input {
  width: 56px; text-align: center; font-size: 20px; font-weight: 700;
  padding: 4px 2px; border: 2px solid #d97706; border-radius: 6px;
  background: var(--bg-primary); color: var(--text-primary);
  -moz-appearance: textfield;
}
.wb-time-input::-webkit-outer-spin-button,
.wb-time-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wb-time-unit { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.wb-course-presets {
  display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; margin: 4px 0;
}
.wb-btn-preset {
  padding: 2px 6px; font-size: 10px; border-radius: 4px;
  background: var(--bg-primary); color: var(--text-secondary);
  border: 1px solid var(--border-color); cursor: pointer;
}
.wb-btn-preset:hover { border-color: #d97706; color: #fbbf24; }
.wb-btn-preset.active { background: #d97706; color: #fff; border-color: #d97706; }

/* Active card reservation list */
.wb-card-active .wb-res-list { border-top-color: rgba(255,255,255,0.2); }
.wb-card-active .wb-res-item { color: rgba(255,255,255,0.8); }
.wb-card-active .wb-res-past { opacity: 0.3; }

/* Timer course button (modal) */
.timer-course-btn {
  padding: 8px 16px; border-radius: 8px;
  border: 2px solid var(--border-color); background: var(--bg-tertiary);
  color: var(--text-primary); cursor: pointer; font-weight: 600;
  font-size: 14px; transition: all 0.2s;
}
.timer-course-btn:hover { border-color: var(--accent); }
.timer-course-btn.active { border-color: var(--accent); background: var(--accent); color: #fff; }

/* Store tabs */
.wb-store-tab {
  padding: 4px 12px; border-radius: 6px;
  border: 1px solid var(--border-color); background: var(--bg-tertiary);
  color: var(--text-secondary); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.wb-store-tab:hover { border-color: var(--accent); color: var(--accent); }
.wb-store-tab.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* Timer empty state */
.timer-empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-secondary); font-size: 14px;
}

/* Responsive */
@media (max-width: 640px) {
  .wb-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 6px;
  }
  .wb-card { padding: 8px; min-height: 120px; }
  .wb-timer-time { font-size: 22px; }
  .wb-cast-name { font-size: 12px; }
}

/* Wait time controls embedded in timer cards */
.wb-wait-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  padding: 5px 0 2px;
  margin-top: 4px;
  border-top: 1px dashed var(--border-color);
  font-size: 11px;
}
.wb-wait-row .wd-status-circle {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  font-size: 9px;
}
.wb-wait-row .wd-wait-select {
  font-size: 10px;
  padding: 2px 2px;
  min-width: 0;
  flex: 1 1 50px;
  max-width: 72px;
}
.wb-wait-row .wd-time-input {
  font-size: 10px;
  padding: 2px 1px;
  width: 52px;
  flex: 0 0 52px;
  height: 22px;
}
.wb-wait-row .wd-sync-btn {
  width: 22px;
  height: 22px;
  font-size: 9px;
  flex: 0 0 22px;
}
.wb-wait-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
}
.wb-wait-slots .wd-time-chip {
  font-size: 9px;
  padding: 0 4px;
}
.wb-prio-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  cursor: pointer;
  z-index: 2;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  border: 2px solid var(--bg-primary);
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.wb-prio-badge:hover {
  background: #fbbf24;
  color: #78350f;
  transform: scale(1.15);
}
.wb-prio-badge.wb-prio-active {
  background: #fbbf24;
  color: #78350f;
  font-weight: 800;
}

/* ============================================ */
/* Scrollbar Styling                            */
/* ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f5f9ff;
}
::-webkit-scrollbar-thumb {
  background: #c1d5e8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a0b8d0;
}
