/* ===================================================
   Bokadirekt Insight — Design System
   Premium dark theme with glassmorphism
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Tokens ───────────────────────────────────────── */
:root {
  /* Base palette */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.65);
  --bg-card-solid: #151d2e;
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-overlay: rgba(0, 0, 0, 0.6);

  /* Accents */
  --accent: #06d6a0;
  --accent-dim: rgba(6, 214, 160, 0.15);
  --accent-hover: #05c492;
  --accent-2: #118ab2;
  --accent-2-dim: rgba(17, 138, 178, 0.15);
  --amber: #f4a261;
  --amber-dim: rgba(244, 162, 97, 0.15);
  --rose: #ef476f;
  --rose-dim: rgba(239, 71, 111, 0.15);
  --purple: #8338ec;
  --purple-dim: rgba(131, 56, 236, 0.15);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: var(--accent);

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(6, 214, 160, 0.25);

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px rgba(6, 214, 160, 0.08);
  --shadow-modal: 0 25px 60px rgba(0, 0, 0, 0.5);

  /* Blur */
  --glass-blur: 16px;

  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 32px;
  --gap-2xl: 48px;

  /* Transitions */
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Light Theme Overrides ───────────────────────── */
html.theme-light {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-solid: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.03);
  --bg-input: rgba(0, 0, 0, 0.04);
  --bg-overlay: rgba(0, 0, 0, 0.3);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.1);
  --border-accent: rgba(6, 214, 160, 0.3);

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(6, 214, 160, 0.06);
  --shadow-modal: 0 25px 60px rgba(0, 0, 0, 0.15);
}

html.theme-light .glass-card:hover {
  border-color: rgba(0, 0, 0, 0.12);
}

html.theme-light .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
}

html.theme-light .sidebar {
  background: rgba(255, 255, 255, 0.92);
}

html.theme-light .hamburger-btn span {
  background: var(--text-muted);
}

html.theme-light .sidebar-backdrop.visible {
  background: rgba(0, 0, 0, 0.3);
}

html.theme-light .nav-link.active {
  background: rgba(6, 214, 160, 0.08);
}

html.theme-light .salon-selector {
  background: rgba(0, 0, 0, 0.03);
}

html.theme-light .salon-selector:hover,
html.theme-light .salon-selector:focus {
  background: rgba(0, 0, 0, 0.06);
}

html.theme-light .date-preset {
  background: rgba(0, 0, 0, 0.03);
}

html.theme-light .date-preset:hover {
  background: rgba(0, 0, 0, 0.06);
}

html.theme-light .date-input {
  background: rgba(0, 0, 0, 0.03);
}

html.theme-light .date-mobile-select {
  background: rgba(0, 0, 0, 0.03);
}

html.theme-light .staff-card:hover {
  background: rgba(0, 0, 0, 0.04);
}

html.theme-light .occupancy-bar-track {
  background: rgba(0, 0, 0, 0.06);
}

html.theme-light .skeleton {
  background: linear-gradient(90deg,
      rgba(0, 0, 0, 0.04) 25%,
      rgba(0, 0, 0, 0.08) 50%,
      rgba(0, 0, 0, 0.04) 75%);
  background-size: 200% 100%;
}

html.theme-light ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

html.theme-light ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

html.theme-light body::before {
  background: radial-gradient(circle, rgba(6, 214, 160, 0.03) 0%, transparent 70%);
}

html.theme-light body::after {
  background: radial-gradient(circle, rgba(17, 138, 178, 0.03) 0%, transparent 70%);
}

/* ── Theme Transition ────────────────────────────── */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* ── Theme Toggle ────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: var(--gap-md);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.theme-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.3s ease, background 0.3s ease;
}

html.theme-light .theme-toggle-thumb {
  transform: translateX(18px);
  background: var(--accent);
}

html.theme-light .theme-toggle-track {
  background: var(--accent-dim);
  border-color: var(--border-accent);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background ambient glow */
body::before {
  content: '';
  position: fixed;
  top: -30%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(6, 214, 160, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(17, 138, 178, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

/* ── Typography ───────────────────────────────────── */
h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1rem;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ── Glass Card ───────────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  transform: translateY(-1px);
}

/* ── Auth Screen ──────────────────────────────────── */
#auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 1000;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

#auth-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: var(--gap-2xl);
  text-align: center;
  animation: fadeSlideUp 0.5s ease-out;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-xl);
}

.auth-logo-img {
  height: 32px;
  width: auto;
}

.auth-logo h1 {
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--gap-xl);
}

.auth-input-group {
  position: relative;
  margin-bottom: var(--gap-md);
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-input::placeholder {
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.auth-error {
  color: var(--rose);
  font-size: 0.8rem;
  margin-bottom: var(--gap-md);
  min-height: 1.2em;
  transition: opacity var(--transition);
}

/* ── Buttons ──────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 214, 160, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 8px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.12);
}

/* =========================================================================
   2. APP LAYOUT (SPA)
   ========================================================================= */

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  border-radius: 0;
  border-left: none;
  border-top: none;
  border-bottom: none;
  display: flex;
  flex-direction: column;
  padding: var(--gap-md) var(--gap-md) var(--gap-md);
  background: rgba(14, 21, 37, 0.7);
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-lg);
}

.sidebar-logo {
  height: 20px;
  width: auto;
}

.sidebar-product-name {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition);
}

.nav-icon {
  font-size: 1rem;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateX(2px);
}

.nav-link.active {
  background: rgba(6, 214, 160, 0.1);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-footer {
  margin-top: auto;
}

.full-width {
  width: 100%;
}

/* ── Sidebar Backdrop ────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.visible {
  opacity: 1;
}

/* ── Hamburger Button ────────────────────────────── */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}

.hamburger-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Main Content Area ────────────────────────────── */
.app-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: var(--gap-lg) var(--gap-xl);
}

/* ── Top Bar ──────────────────────────────────────── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--gap-xl);
  padding-bottom: var(--gap-sm);
  border-bottom: 1px solid var(--border-light);
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--gap-lg);
}

.salon-selector {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.salon-selector:hover,
.salon-selector:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

/* ── Date Range Picker ────────────────────────────── */
.date-range-picker {
  display: flex;
  align-items: center;
  gap: 4px;
}

.date-preset {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.date-preset:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.date-preset.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.date-custom-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.date-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  width: 120px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  color-scheme: dark;
}

html.theme-light .date-input {
  color-scheme: light;
}

.date-input:focus {
  border-color: var(--accent);
}

.date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

html.theme-light .date-input::-webkit-calendar-picker-indicator {
  filter: none;
}

.date-separator {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Mobile date picker dropdown (hidden on desktop) */
.date-mobile-select {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(6, 214, 160, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(6, 214, 160, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(6, 214, 160, 0);
  }
}

.refresh-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── SPA Views ────────────────────────────────────── */
.view {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.view.active {
  display: block;
}

/* ── Dashboard Layout ─────────────────────────────── */
#dashboard {
  display: none;
}

#dashboard.visible {
  display: flex;
  animation: fadeIn 0.4s ease-out;
}

/* ── KPI Row ──────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-lg);
  margin-bottom: var(--gap-xl);
}

.kpi-card {
  padding: var(--gap-lg);
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kpi-card.teal::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.kpi-card.amber::before {
  background: linear-gradient(90deg, var(--amber), #e76f51);
}

.kpi-card.purple::before {
  background: linear-gradient(90deg, var(--purple), #b5179e);
}

.kpi-card.blue::before {
  background: linear-gradient(90deg, var(--accent-2), #073b4c);
}

.kpi-card.rose::before {
  background: linear-gradient(90deg, var(--rose), #c1121f);
}

.kpi-card.rose .kpi-value {
  color: var(--rose);
}

.kpi-card.rose .kpi-icon {
  background: var(--rose-dim);
  color: var(--rose);
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-right: 44px;
}

.kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.kpi-card.teal .kpi-value {
  color: var(--accent);
}

.kpi-card.amber .kpi-value {
  color: var(--amber);
}

.kpi-card.purple .kpi-value {
  color: var(--purple);
}

.kpi-card.blue .kpi-value {
  color: var(--accent-2);
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
}

.kpi-sub .trend-up {
  color: var(--accent);
}

.kpi-sub .trend-down {
  color: var(--rose);
}

/* Icon wrapper inside KPI */
.kpi-icon {
  position: absolute;
  top: var(--gap-lg);
  right: var(--gap-lg);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-card.teal .kpi-icon {
  background: var(--accent-dim);
  color: var(--accent);
}

.kpi-card.amber .kpi-icon {
  background: var(--amber-dim);
  color: var(--amber);
}

.kpi-card.purple .kpi-icon {
  background: var(--purple-dim);
  color: var(--purple);
}

.kpi-card.blue .kpi-icon {
  background: var(--accent-2-dim);
  color: var(--accent-2);
}

/* ── KPI Sparklines ──────────────────────────────── */
.kpi-sparkline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  opacity: 0.3;
  pointer-events: none;
}

/* ── Grids ────────────────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-lg);
  margin-bottom: var(--gap-xl);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-lg);
}

/* ── Pagination ───────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pagination button {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}
.pagination button:hover { background: var(--glass-border); }
.pagination button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ── Section Card ─────────────────────────────────── */
.section-card {
  padding: var(--gap-lg);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap-lg);
}

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.section-badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── Charts ───────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
  height: 260px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.donut-container {
  position: relative;
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-container canvas {
  max-width: 200px;
  max-height: 200px;
}

.donut-center {
  position: absolute;
  text-align: center;
}

.donut-center .donut-total {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.donut-center .donut-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-legend {
  display: flex;
  gap: var(--gap-lg);
  margin-top: var(--gap-md);
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ── Table ────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: var(--gap-sm) var(--gap-md);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 10px var(--gap-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

.data-table tr {
  transition: background var(--transition);
}

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

.customer-name {
  color: var(--text-primary);
  font-weight: 500;
}

.service-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
}

.time-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.price-tag {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--amber);
}

/* Status badges */
.status-online {
  color: var(--accent);
}

.status-walkin {
  color: var(--amber);
}

.status-cancel {
  color: var(--rose);
  text-decoration: line-through;
  opacity: 0.6;
}

/* ── Staff Cards ──────────────────────────────────── */
.staff-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  max-height: 480px;
  overflow-y: auto;
  padding-right: var(--gap-sm);
  /* space for scrollbar */
}

.staff-card {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  padding: var(--gap-md);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  transition: background var(--transition);
}

.staff-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.staff-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-dim), var(--accent-2-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  flex-shrink: 0;
}

.staff-info {
  flex: 1;
  min-width: 0;
}

.staff-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.staff-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.staff-occupancy {
  text-align: right;
  flex-shrink: 0;
}

.occupancy-bar-track {
  width: 80px;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.occupancy-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.8s ease-out;
}

.occupancy-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ── Bottom Grid ──────────────────────────────────── */

/* Sales feed */
.sale-item {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.sale-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.sale-icon.service-sale {
  background: var(--accent-dim);
  color: var(--accent);
}

.sale-icon.product-sale {
  background: var(--amber-dim);
  color: var(--amber);
}

.sale-details {
  flex: 1;
  min-width: 0;
}

.sale-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sale-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sale-amount {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* Quick stats */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* ── Loading Skeletons ────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
      var(--bg-input) 25%,
      rgba(255, 255, 255, 0.08) 50%,
      var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-line {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-line:last-child {
  width: 60%;
}

.skeleton-kpi {
  height: 40px;
  width: 120px;
  border-radius: 6px;
}

/* ── Empty State ──────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--gap-2xl) var(--gap-lg);
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: var(--gap-md);
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.85rem;
}

/* ── Staff Tabs ──────────────────────────────────── */
.staff-tabs {
  display: flex;
  gap: 8px;
}

.staff-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.staff-tab:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.staff-tab.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.staff-tab-content {
  display: none;
}

.staff-tab-content.active {
  display: block;
}

/* ── Staff Ranking Table ─────────────────────────── */
.ranking-table th {
  white-space: nowrap;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
}

.rank-1 {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #000;
}

.rank-2 {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #fff;
}

.rank-3 {
  background: linear-gradient(135deg, #b45309, #92400e);
  color: #fff;
}

.rank-other {
  background: var(--bg-input);
  color: var(--text-muted);
}

.ranking-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.ranking-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.ranking-pct {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ranking-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
}

.ranking-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease-out;
}

.accent-fill {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.purple-fill {
  background: linear-gradient(90deg, var(--purple), #b5179e);
}

.amber-fill {
  background: linear-gradient(90deg, var(--amber), #e76f51);
}

/* ── Animations ───────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card entrance stagger */
.animate-in {
  animation: fadeSlideUp 0.5s ease-out both;
}

.animate-in:nth-child(1) {
  animation-delay: 0.05s;
}

.animate-in:nth-child(2) {
  animation-delay: 0.10s;
}

.animate-in:nth-child(3) {
  animation-delay: 0.15s;
}

.animate-in:nth-child(4) {
  animation-delay: 0.20s;
}

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Prognos / Forecast ──────────────────────────── */
.prognos-loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.loading-text {
  font-size: 0.9rem;
  margin-bottom: var(--gap-md);
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}

.loading-bar-fill {
  width: 30%;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  animation: loadSlide 1.5s ease-in-out infinite;
}

@keyframes loadSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.forecast-legend {
  display: flex;
  gap: 20px;
  padding-top: var(--gap-md);
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-line.solid {
  display: inline-block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
}

.legend-line.green { background: #06d6a0; }
.legend-line.blue { background: #118ab2; }

.legend-band {
  display: inline-block;
  width: 20px;
  height: 10px;
  background: rgba(17, 138, 178, 0.2);
  border-radius: 2px;
}

.forecast-summary {
  padding: var(--gap-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.forecast-summary .stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.forecast-summary .stat-row:last-of-type {
  border-bottom: none;
}

/* ── Statistik View ──────────────────────────────── */
.statistik-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: var(--gap-lg);
  align-items: start;
}

.statistik-column {
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg);
}

.stat-box {
  padding: var(--gap-lg);
}

.stat-box-title {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--gap-lg);
  padding-bottom: var(--gap-sm);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-box-grid {
  display: grid;
  gap: var(--gap-md);
}

.stat-box-grid.cols-1 { grid-template-columns: 1fr; }
.stat-box-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.stat-box-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat-box-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.stat-box-grid.cols-6 { grid-template-columns: repeat(3, 1fr); }
.stat-box-grid.cols-7 { grid-template-columns: repeat(4, 1fr); }

.stat-cell {
  text-align: center;
  padding: var(--gap-sm) var(--gap-xs);
}

.stat-cell-icon {
  font-size: 1.1rem;
  margin-bottom: 4px;
  opacity: 0.7;
}

.stat-cell-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.2;
  min-height: 1.8em;
}

.stat-cell-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.stat-cell-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}

.stat-cell-list {
  text-align: left;
  padding: var(--gap-sm) var(--gap-md);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
}

.stat-cell-list .stat-cell-label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--gap-sm);
  font-size: 0.75rem;
}

.stat-cell-listcontent {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.stat-cell-listcontent .top-item {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}

.stat-cell-listcontent .top-item:last-child {
  border-bottom: none;
}

.stat-cell-listcontent .top-item-name {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.stat-cell-listcontent .top-item-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.78rem;
}

/* ── Responsive ───────────────────────────────────── */

/* Tablet: sidebar becomes overlay */
@media (max-width: 1024px) {
  .hamburger-btn {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.visible {
    display: block;
    opacity: 1;
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-grid,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .statistik-grid {
    grid-template-columns: 1fr;
  }

  .stat-box-grid.cols-7 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet: collapse date picker */
@media (max-width: 768px) {
  .date-preset,
  .date-custom-wrapper {
    display: none;
  }

  .date-mobile-select {
    display: block;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .sidebar {
    width: 100%;
  }

  .kpi-row {
    grid-template-columns: 1fr;
  }

  .top-bar {
    flex-wrap: wrap;
    gap: var(--gap-sm);
  }

  .top-bar-right {
    flex-wrap: wrap;
    gap: var(--gap-sm);
  }

  .forecast-legend {
    flex-wrap: wrap;
    gap: var(--gap-sm);
  }

  .salon-selector {
    width: 100%;
  }

  .app-content {
    padding: var(--gap-md);
  }

  .section-card {
    padding: var(--gap-md);
  }

  .data-table {
    font-size: 0.8rem;
  }

  .page-title {
    font-size: 1.25rem;
  }
}

/* ── Staff Detail Slide-in Panel ─────────────────── */
.staff-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.staff-detail-overlay.hidden { display: none; }
.staff-detail-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.staff-detail-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: 520px;
  max-width: 100%;
  height: 100vh;
  background: var(--bg-card-solid);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: var(--gap-lg);
}
.staff-detail-overlay.visible .staff-detail-panel {
  transform: translateX(0);
}
.staff-detail-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  transition: background 0.15s, color 0.15s;
  margin-bottom: var(--space-3);
}
.staff-detail-close:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}
#staff-detail-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--gap-lg) 0;
}
.staff-detail-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-md);
  margin-bottom: var(--gap-lg);
}
.staff-detail-kpis .kpi-card {
  padding: var(--gap-md);
}
.staff-detail-section {
  margin-bottom: var(--gap-lg);
}
.staff-detail-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-3) 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.staff-detail-extras {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--gap-md);
  margin-bottom: var(--gap-lg);
}
.staff-detail-extras .detail-stat {
  text-align: center;
  padding: var(--gap-md);
  background: var(--glass-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.detail-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.detail-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.staff-row-clickable { cursor: pointer; }
.staff-row-clickable:hover { background: var(--glass-bg); }

@media (max-width: 768px) {
  .staff-detail-panel { width: 100%; }
  .staff-detail-extras { grid-template-columns: 1fr; }
}