/* ══════════════════════════════════════════════════════════════
   MEDOFY PLAYSTATION SYSTEM — Design System
   Theme: Dark (Black + Gold Yellow)
   Direction: RTL (Arabic)
   ══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  /* Depth layers */
  --bg-deepest: #050505;
  --bg-base: #0a0a0a;
  --bg-surface: #111111;
  --bg-card: #161616;
  --bg-elevated: #1c1c1c;
  --bg-input: #1e1e1e;
  --bg-hover: #252525;

  /* Brand / Accent */
  --primary: #FFD700;
  --primary-dim: #c9a800;
  --primary-glow: rgba(255, 215, 0, 0.15);
  --primary-glow-strong: rgba(255, 215, 0, 0.3);
  --gradient-primary: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);

  /* Semantic */
  --success: #00E676;
  --success-dim: #00c864;
  --success-bg: rgba(0, 230, 118, 0.1);
  --danger: #FF1744;
  --danger-dim: #d50032;
  --danger-bg: rgba(255, 23, 68, 0.1);
  --warning: #FF9100;
  --info: #40C4FF;

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: #b0b0b0;
  --text-muted: #666666;
  --text-on-primary: #0a0a0a;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-primary: rgba(255, 215, 0, 0.2);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(255, 215, 0, 0.15);

  /* Sizing */
  --sidebar-width: 240px;
  --titlebar-height: 38px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition: 0.25s ease;
  --transition-slow: 0.4s ease;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-base);
  direction: rtl;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ══════════════════════════════════════════════
   TITLE BAR
   ══════════════════════════════════════════════ */
#title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--titlebar-height);
  background: var(--bg-deepest);
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
  -webkit-app-region: drag;
  position: relative;
  z-index: 1000;
}

.title-bar-drag {
  display: flex;
  align-items: center;
  gap: 8px;
  -webkit-app-region: drag;
}

.title-bar-icon {
  font-size: 16px;
}

.title-bar-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.title-bar-controls {
  display: flex;
  align-items: center;
  -webkit-app-region: no-drag;
  direction: ltr;
}

.title-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: var(--titlebar-height);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.title-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.title-btn.close-btn:hover {
  background: var(--danger);
  color: white;
}

/* ══════════════════════════════════════════════
   APP LAYOUT
   ══════════════════════════════════════════════ */
#app-container {
  display: flex;
  height: calc(100vh - var(--titlebar-height));
}

/* ══════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════ */
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--transition-slow);
}

.sidebar-brand {
  padding: 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 3px;
}

.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Nav Menu */
.nav-menu {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
  border-right: 3px solid transparent;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-glow);
  border-right-color: var(--primary);
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.nav-text {
  font-size: 14px;
  font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.day-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.day-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  transition: background var(--transition);
}

.day-status.open .day-dot {
  background: var(--success);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ══════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════ */
#main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  background: var(--bg-base);
}

/* Page Sections */
.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

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

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════
   STATS BAR
   ══════════════════════════════════════════════ */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: center;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-card.stat-available .stat-value { color: var(--success); }
.stat-card.stat-busy .stat-value { color: var(--danger); }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════
   DEVICE CARDS GRID
   ══════════════════════════════════════════════ */
.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.device-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  transition: background var(--transition);
}

.device-card.available::before { background: var(--success); }
.device-card.busy::before { background: var(--danger); }

.device-card:hover {
  border-color: var(--border-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.device-card.busy {
  border-color: rgba(255, 23, 68, 0.15);
}

.device-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.device-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.device-type-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.device-type-badge.PS5 {
  background: linear-gradient(135deg, #1a1aff, #0070d1);
  color: white;
}
.device-type-badge.PS4 {
  background: linear-gradient(135deg, #003087, #00439c);
  color: white;
}
.device-type-badge.PS3 {
  background: linear-gradient(135deg, #333, #555);
  color: white;
}

.device-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.available {
  background: var(--success);
  box-shadow: 0 0 6px rgba(0, 230, 118, 0.5);
}
.status-dot.busy {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(255, 23, 68, 0.5);
  animation: pulse-dot 1.5s infinite;
}

.device-status .status-text {
  color: var(--text-secondary);
}

.device-prices {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.device-prices span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.device-timer {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  padding: 8px;
  background: var(--primary-glow);
  border-radius: var(--radius-sm);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.device-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.device-card-actions .btn {
  flex: 1;
  font-size: 12px;
  padding: 6px 8px;
}

/* ══════════════════════════════════════════════
   PRODUCTS GRID
   ══════════════════════════════════════════════ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  border-color: var(--border-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.product-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.product-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
}

.product-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-icon {
  font-size: 14px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-on-primary);
}
.btn-primary:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-success {
  background: var(--success);
  color: var(--bg-base);
}
.btn-success:hover {
  background: var(--success-dim);
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.3);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: var(--danger-dim);
  box-shadow: 0 0 15px rgba(255, 23, 68, 0.3);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-warning {
  background: var(--primary);
  color: var(--bg-base);
}
.btn-warning:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-large {
  padding: 14px 32px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-ghost-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ══════════════════════════════════════════════
   FORM ELEMENTS
   ══════════════════════════════════════════════ */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  direction: rtl;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  padding-left: 32px;
}

.form-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  margin-top: 20px;
}

/* Search */
.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}

.search-input {
  padding: 8px 36px 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  width: 220px;
  transition: all var(--transition);
  direction: rtl;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  width: 280px;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.filter-select {
  padding: 8px 14px 8px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  direction: rtl;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ══════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
  animation: modalFadeIn 0.25s ease;
}

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

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease;
}

.modal-content.modal-large {
  max-width: 640px;
}

.modal-content.modal-small {
  max-width: 380px;
}

@keyframes modalSlideIn {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.modal-body {
  padding: 24px;
}

/* ══════════════════════════════════════════════
   SESSION MODAL
   ══════════════════════════════════════════════ */
.session-device-info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
}

.session-device-info .device-info-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.session-device-info .device-info-type {
  font-size: 13px;
  color: var(--text-muted);
}

/* Play Mode Selector */
.play-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.mode-btn:hover {
  border-color: var(--border-light);
  background: var(--bg-elevated);
}

.mode-btn.active {
  border-color: var(--primary);
  background: var(--primary-glow);
  color: var(--primary);
}

.mode-icon {
  font-size: 28px;
}

.mode-label {
  font-size: 14px;
  font-weight: 600;
}

.mode-price {
  font-size: 12px;
  color: var(--text-muted);
}

.mode-btn.active .mode-price {
  color: var(--primary-dim);
}

/* Session Timer Bar */
.session-timer-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.timer-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.timer-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timer-display {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

.timer-cost {
  font-size: 20px;
  font-weight: 700;
  color: var(--success);
}

.timer-mode {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Session Products */
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header-row h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.session-products-section {
  margin-bottom: 20px;
}

.session-mode-section {
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.session-mode-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.session-mode-history {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.session-mode-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.session-mode-history-item:last-child {
  border-bottom: none;
}

.session-mode-history-item.current .session-mode-history-title {
  color: var(--primary);
}

.session-mode-history-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.session-mode-history-title {
  font-weight: 700;
  color: var(--text-primary);
}

.session-mode-history-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.session-mode-history-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: left;
}

.session-discount-section {
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.session-products-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.session-product-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.session-product-item:last-child {
  border-bottom: none;
}

.sp-name {
  font-weight: 600;
  color: var(--text-primary);
}

.sp-details {
  font-size: 12px;
  color: var(--text-muted);
}

.sp-total {
  font-weight: 700;
  color: var(--primary);
  margin-left: 12px;
  margin-right: auto;
}

.sp-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color var(--transition-fast);
}

.sp-remove:hover {
  color: var(--danger);
}

.empty-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px;
}

/* Session Totals */
.session-totals-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.total-item.total-item-discount {
  border-top: 1px dashed rgba(255, 193, 7, 0.25);
  margin-top: 6px;
  padding-top: 12px;
}

.total-item.total-item-discount .total-label,
.total-item.total-item-discount .total-value {
  color: #ffd54f;
}

.total-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.total-label {
  color: var(--text-secondary);
}

.total-value {
  font-weight: 600;
  color: var(--text-primary);
}

.total-item.grand-total {
  border-top: 2px solid var(--primary);
  margin-top: 8px;
  padding-top: 12px;
}

.total-item.grand-total .total-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.total-item.grand-total .total-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

/* ══════════════════════════════════════════════
   INVOICE
   ══════════════════════════════════════════════ */
.invoice {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 24px;
}

.invoice-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px dashed var(--border);
}

.invoice-header h4 {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 4px;
}

.invoice-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.invoice-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.invoice-row span:last-child {
  font-weight: 600;
  color: var(--text-primary);
}

.invoice-divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 12px 0;
}

.invoice-products {
  margin: 12px 0;
}

.invoice-products h5 {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.invoice-total {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 2px solid var(--primary);
  margin-top: 12px;
}

.invoice-total span:first-child {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.invoice-total span:last-child {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

/* ══════════════════════════════════════════════
   DAILY PAGE
   ══════════════════════════════════════════════ */
.daily-status-banner {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.daily-active-info {
  background: var(--bg-card);
  border: 1px solid var(--success);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.daily-active-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.daily-active-header h3 {
  color: var(--success);
  font-size: 18px;
}

.daily-live-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.daily-stat {
  text-align: center;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.daily-stat-value {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.daily-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Day sessions list */
.daily-sessions-list {
  margin-top: 16px;
}

.daily-expenses-list {
  margin-top: 16px;
}

.daily-expenses-list h4 {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.expense-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.expense-row-main {
  min-width: 0;
}

.expense-row-title {
  font-weight: 600;
  color: var(--text-primary);
}

.expense-row-note {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}

.expense-row-amount {
  font-weight: 700;
  color: #ffd54f;
}

.expense-row-actions {
  display: flex;
  gap: 8px;
}

.daily-sessions-list h4 {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
}

.session-row-device {
  font-weight: 600;
  color: var(--text-primary);
}

.session-row-time {
  color: var(--text-muted);
}

.session-row-price {
  font-weight: 700;
  color: var(--primary);
}

.session-row-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.session-row-status.active {
  background: var(--success-bg);
  color: var(--success);
}

.session-row-status.ended {
  background: var(--bg-hover);
  color: var(--text-muted);
}

/* Section Divider */
.section-divider {
  margin-top: 32px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.section-divider h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Days History */
.days-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.day-history-card:hover {
  border-color: var(--border-primary);
  background: var(--bg-elevated);
}

.day-history-date {
  font-weight: 600;
  color: var(--text-primary);
}

.day-history-stats {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.day-history-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.day-history-income {
  font-weight: 700;
  color: var(--primary) !important;
}

/* ══════════════════════════════════════════════
   REPORTS PAGE
   ══════════════════════════════════════════════ */
.report-controls {
  margin-bottom: 24px;
  max-width: 400px;
}

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

.report-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.report-stat-value {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.report-stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.report-highlight-net {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(255, 193, 7, 0.08), rgba(255, 193, 7, 0.02));
}

.report-highlight-expense .report-stat-value,
.report-highlight-discount .report-stat-value {
  color: #ffd54f;
}

.report-section {
  margin-bottom: 24px;
}

.report-section h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.report-table th {
  background: var(--bg-elevated);
  padding: 12px 16px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.report-table td {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.report-table tr:last-child td {
  border-bottom: none;
}

.report-table tr:hover td {
  background: var(--bg-elevated);
}

.report-mode-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-mode-summary {
  font-weight: 600;
  color: var(--text-primary);
}

.report-mode-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════
   SETTINGS
   ══════════════════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.setting-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.setting-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.setting-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.setting-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ══════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: calc(var(--titlebar-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  pointer-events: auto;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  box-shadow: var(--shadow-md);
  max-width: 400px;
  text-align: center;
}

.toast.success {
  background: var(--success);
  color: var(--bg-base);
}

.toast.error {
  background: var(--danger);
  color: white;
}

.toast.warning {
  background: var(--warning);
  color: var(--bg-base);
}

.toast.info {
  background: var(--info);
  color: var(--bg-base);
}

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

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* ══════════════════════════════════════════════
   EMPTY STATES
   ══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 4px;
}

.empty-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════
   CONFIRM DIALOG
   ══════════════════════════════════════════════ */
.confirm-text {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 8px;
}

/* ══════════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════════ */
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ══════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ══════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .report-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .session-timer-bar {
    grid-template-columns: 1fr;
  }
  .session-mode-actions {
    grid-template-columns: 1fr;
  }
}
