/* ============================================
   Glow Up Admin Dashboard — Luxury Design System
   Matching Glow Up Peptides brand aesthetic
   ============================================ */

:root {
  /* Brand — Gold bleibt */
  --gold: #c5a55a;
  --gold-dark: #b08d3e;
  --gold-light: #e8d48a;
  --gold-glow: rgba(197, 165, 90, 0.15);
  --gold-subtle: rgba(197, 165, 90, 0.08);

  /* Dark Surfaces — zinc scale */
  --bg: #09090b;
  --bg-alt: #111113;
  --bg-warm: #18181b;
  --surface: #1c1c1f;
  --border: #27272a;
  --border-light: #3f3f46;

  /* Text */
  --near-black: #fafafa;
  --dark-text: #fafafa;
  --mid-gray: #a1a1aa;
  --light-gray: #71717a;
  --muted: #52525b;

  /* Product Colors (heller fuer Dark BG) */
  --emerald: #34d399;
  --steel-blue: #60a5fa;
  --purple: #a78bfa;

  /* Status */
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;
  --purple-status: #a78bfa;

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'Source Code Pro', monospace;

  /* Spacing & Radii — shadcn */
  --radius: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --radius-dialog: 10px;
  --transition: 0.2s ease;
  --sidebar-w: 240px;
}

/* RESET */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { height: 100vh; font-family: var(--font-body); background: var(--bg); color: var(--dark-text); overflow: hidden; position: relative; }
body::after {
  content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; width: 100%; position: fixed; top: 0; left: 0;
  z-index: 10000; background: var(--bg);
}
.login-card {
  width: 100%; max-width: 400px; padding: 48px 40px; margin: 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-dialog);
}
.login-brand {
  text-align: center; margin-bottom: 36px;
}
.login-brand .brand-logo {
  font-family: var(--font-display); font-size: 28px; font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 8px;
}
.login-subtitle {
  display: block; font-size: 13px; color: var(--light-gray);
  font-family: var(--font-body); letter-spacing: 2px; text-transform: uppercase;
}
.login-field { margin-bottom: 20px; }
.login-field label {
  display: block; font-size: 12px; font-weight: 600; color: var(--mid-gray);
  margin-bottom: 6px; letter-spacing: 0.3px;
}
.login-field input {
  width: 100%; padding: 12px 14px; font-size: 14px; font-family: var(--font-body);
  background: var(--bg-warm); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--dark-text);
  transition: border-color var(--transition);
}
.login-field input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}
.login-field input::placeholder { color: var(--muted); }
.login-password-wrap {
  position: relative;
}
.login-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--light-gray); cursor: pointer;
  padding: 4px; display: flex; align-items: center;
}
.login-eye:hover { color: var(--mid-gray); }
.login-error {
  padding: 10px 14px; margin-bottom: 16px; font-size: 13px;
  background: rgba(248, 113, 113, 0.1); color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-sm); line-height: 1.5;
}
.login-btn {
  width: 100%; padding: 13px; font-size: 14px; font-weight: 600;
  font-family: var(--font-body); letter-spacing: 0.3px;
  background: var(--gold); color: #09090b; border: none;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.login-btn:hover { background: var(--gold-dark); }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled {
  opacity: 0.6; cursor: not-allowed; transform: none;
}
.login-footer {
  text-align: center; margin-top: 24px; font-size: 12px;
  color: var(--muted);
}
.login-screen.hidden { display: none; }

/* APP LAYOUT */
.app { display: flex; height: 100vh; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-w); background: var(--bg-warm); color: var(--near-black);
  display: flex; flex-direction: column; flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  padding: 24px 24px 20px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
  position: relative;
}
.brand-logo::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: super;
  box-shadow: 0 0 8px rgba(197,165,90,0.5);
}
.brand-label { font-size: 11px; color: var(--light-gray); letter-spacing: 0.5px; font-weight: 500; }

.sidebar-nav { flex: 1; padding: 20px 14px; overflow-y: auto; }
.nav-group { margin-bottom: 24px; }
.nav-group-label {
  display: block; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--gold); padding: 0 12px; margin-bottom: 8px;
}

.nav-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px;
  background: transparent; border: none; color: var(--mid-gray);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px;
  font-family: var(--font-body); font-weight: 600; transition: all var(--transition);
  text-align: left; position: relative;
}
.nav-btn svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.5; stroke: var(--mid-gray); }
.nav-btn:hover { background: var(--gold-subtle); color: var(--near-black); transform: translateX(2px); }
.nav-btn:hover svg { opacity: 1; stroke: var(--near-black); }
.nav-btn.active {
  background: rgba(197,165,90,0.12); color: var(--gold);
  font-weight: 600;
}
.nav-btn.active svg { opacity: 1; stroke: var(--gold); }
.nav-btn.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--gold); border-radius: 0 3px 3px 0;
}

.nav-badge {
  margin-left: auto; background: var(--gold-glow); color: var(--gold);
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.nav-badge.warn { background: rgba(251,191,36,0.15); color: var(--warning); }

.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-footer::after {
  content: 'v2.0 \00b7  Glow Up Peptides';
  font-size: 9px; color: var(--muted);
  letter-spacing: 0.3px; margin-top: 4px;
  font-family: var(--font-body);
}
.sidebar-logout-btn {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding: 8px 12px;
  font-size: 12px; font-family: var(--font-body); color: var(--light-gray);
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--transition);
}
.sidebar-logout-btn:hover {
  color: var(--danger); border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.06);
}
.sidebar-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--light-gray); }
.status-dot {
  width: 6px; height: 6px; background: var(--success); border-radius: 50%;
  box-shadow: 0 0 6px rgba(52,211,153,0.5);
  animation: pulse-green 2s ease-in-out infinite;
}
.sidebar-time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main { flex: 1; overflow-y: auto; padding: 0 40px 36px; }

/* TOPBAR */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0 16px; position: sticky; top: 0; z-index: 50;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  gap: 12px;
  border-bottom: 1px solid rgba(39, 39, 42, 0.6);
  transition: box-shadow var(--transition);
}
.topbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.4); }
.topbar-left {
  display: flex; align-items: center; gap: 12px;
}
.topbar-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  color: var(--near-black);
}
.topbar-right {
  display: flex; align-items: center; gap: 0;
}
.hamburger-btn {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition);
  flex-shrink: 0;
}
.hamburger-btn svg { stroke: var(--mid-gray); }
.hamburger-btn:hover { border-color: var(--gold); }
.hamburger-btn:hover svg { stroke: var(--gold); }
.btn-refresh {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; background: var(--surface); color: var(--mid-gray);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: var(--font-body); transition: all var(--transition);
}
.btn-refresh svg { width: 16px; height: 16px; }
.btn-refresh:hover { border-color: var(--gold); color: var(--gold); }
.btn-refresh:hover svg { stroke: var(--gold); }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.section-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px; gap: 16px;
}
.section-header h1 {
  font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--near-black);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.section-header h1::after {
  content: ''; display: block; width: 40px; height: 2px; margin-top: 8px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}
.section-subtitle { font-size: 13px; color: var(--light-gray); margin-top: 4px; font-weight: 400; }
.header-actions { display: flex; gap: 10px; align-items: center; }

/* ============================================
   STAT CARDS
   ============================================ */
.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--surface); padding: 20px; border-radius: var(--radius);
  display: flex; align-items: flex-start; gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  border: 1px solid var(--border-light);
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.4); transform: translateY(-4px); }
.stat-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt); flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; stroke: var(--mid-gray); }
.stat-card.gold .stat-icon { background: var(--gold-glow); }
.stat-card.gold .stat-icon svg { stroke: var(--gold); }
.stat-card.success .stat-icon { background: rgba(52,211,153,0.12); }
.stat-card.success .stat-icon svg { stroke: var(--success); }
.stat-card.warning .stat-icon { background: rgba(251,191,36,0.12); }
.stat-card.warning .stat-icon svg { stroke: var(--warning); }
.stat-card.danger .stat-icon { background: rgba(248,113,113,0.12); }
.stat-card.danger .stat-icon svg { stroke: var(--danger); }
.stat-card.info .stat-icon { background: rgba(96,165,250,0.12); }
.stat-card.info .stat-icon svg { stroke: var(--info); }
.stat-content { min-width: 0; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: -0.5px; }
.stat-label {
  font-family: var(--font-body); font-size: 11px; color: var(--light-gray);
  margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--surface); padding: 24px; border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04); border: 1px solid var(--border-light);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--near-black); letter-spacing: -0.2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  padding: 11px 24px; background: var(--gold); color: #09090b; border: none;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition); font-family: var(--font-body);
}
.btn-primary:hover { background: var(--gold-dark); color: #fff; }
.btn-primary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; background: var(--surface); color: var(--dark-text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all var(--transition);
  font-family: var(--font-body);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-secondary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-secondary:active { transform: scale(0.97); }

.btn-ghost {
  padding: 11px 24px; background: transparent; color: var(--mid-gray);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all var(--transition);
  font-family: var(--font-body);
}
.btn-ghost:hover { border-color: var(--mid-gray); color: var(--dark-text); }
.btn-ghost:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-ghost:active { transform: scale(0.97); }

.btn-text {
  background: none; border: none; color: var(--gold); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: var(--font-body); transition: color var(--transition);
}
.btn-text:hover { color: var(--gold-dark); }

.btn-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
}
.btn-icon svg { width: 18px; height: 18px; stroke: var(--mid-gray); }
.btn-icon:hover { border-color: var(--gold); }
.btn-icon:hover svg { stroke: var(--gold); }
.btn-icon:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-icon:active { transform: scale(0.95); }

/* ============================================
   SEARCH & FILTERS
   ============================================ */
.filters { display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.search-wrap { position: relative; flex: 1; min-width: 240px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--muted); pointer-events: none; }
.search-input {
  width: 100%; padding: 10px 16px 10px 40px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13.5px; font-family: var(--font-body);
  background: var(--surface); color: var(--dark-text); transition: border var(--transition);
}
.search-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  padding: 7px 14px; border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all var(--transition); font-family: var(--font-body); color: var(--mid-gray);
}
.pill:hover { border-color: var(--gold); color: var(--gold); }
.pill:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.pill:active { transform: scale(0.96); }
.pill.active { background: var(--gold); color: #09090b; border-color: var(--gold); }

.select-sm {
  padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: var(--font-body); background: var(--surface); color: var(--dark-text);
  cursor: pointer; transition: border var(--transition);
}
.select-sm:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }

/* ============================================
   TABLES
   ============================================ */
.table-wrap {
  background: var(--surface); border-radius: var(--radius); overflow: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3); border: 1px solid var(--border-light);
}
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th {
  text-align: left; padding: 12px 20px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--light-gray); font-weight: 600;
  border-bottom: 1px solid var(--border); background: var(--bg-warm);
  position: sticky; top: 0; z-index: 2;
  font-family: var(--font-body);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
td {
  padding: 12px 20px; font-size: 13.5px; border-bottom: 1px solid var(--border-light);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
tr { transition: background var(--transition); }
tbody tr:nth-child(even) td { background: rgba(255,255,255,0.025); }
tbody tr:hover td { background: rgba(197,165,90,0.08); }
tr:last-child td { border-bottom: none; }

.btn-view {
  padding: 4px 12px; background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-xs); font-size: 11px; cursor: pointer;
  transition: all var(--transition); font-family: var(--font-body); color: var(--mid-gray);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-weight: 500; white-space: nowrap; height: 28px;
}
.btn-view svg { width: 14px; height: 14px; stroke: var(--mid-gray); flex-shrink: 0; }
.btn-view:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-glow); }
.btn-view:hover svg { stroke: var(--gold); }

/* ============================================
   STATUS BADGES
   ============================================ */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 12px; border-radius: 999px; min-width: 80px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
  white-space: nowrap; text-align: center; height: 24px;
}
.badge-pending { background: rgba(251,191,36,0.15); color: var(--warning); }
.badge-paid { background: rgba(96,165,250,0.15); color: var(--info); }
.badge-processing { background: rgba(167,139,250,0.15); color: var(--purple-status); }
.badge-shipped { background: rgba(34,211,238,0.15); color: #22d3ee; }
.badge-completed { background: rgba(52,211,153,0.15); color: var(--success); }
.badge-cancelled { background: rgba(248,113,113,0.12); color: var(--danger); }

/* ============================================
   LISTS & EMPTY STATES
   ============================================ */
.list-container { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 14px; border-radius: var(--radius-sm); background: var(--bg-warm);
  font-size: 13px; transition: background var(--transition);
}
.list-item:hover { background: var(--bg-alt); }
.list-item .label { color: var(--mid-gray); font-weight: 500; }
.list-item .value { font-weight: 600; }

.empty-hint { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 0; }
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 60px 20px; text-align: center; color: var(--light-gray);
}
.empty-state svg { stroke: var(--muted); opacity: 0.5; }
.empty-state p { font-size: 14px; font-weight: 500; color: var(--mid-gray); font-family: var(--font-display); }
.empty-state .empty-subtitle {
  font-size: 12px; color: var(--light-gray); font-weight: 400; font-family: var(--font-body);
}

/* ============================================
   INVENTORY — one column per product
   ============================================ */
.inventory-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.inventory-column {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border-light);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3); overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.inventory-column:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.inventory-column-head {
  padding: 20px 24px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border-light);
}
.inventory-column-head .col-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.inventory-column-head .col-dot.emerald { background: var(--emerald); }
.inventory-column-head .col-dot.blue { background: var(--steel-blue); }
.inventory-column-head .col-dot.purple { background: var(--purple); }
.inventory-column-head h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
.inventory-column-body { padding: 8px 0; }
.inventory-row {
  padding: 16px 24px; display: flex; flex-direction: column; gap: 10px;
  border-bottom: 1px solid var(--border-light); transition: background var(--transition);
}
.inventory-row:last-child { border-bottom: none; }
.inventory-row:hover { background: var(--bg-warm); }
.inventory-row .dose-label { font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.product-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.product-dot.emerald { background: var(--emerald); }
.product-dot.blue { background: var(--steel-blue); }
.product-dot.purple { background: var(--purple); }

.stock-bar { height: 5px; border-radius: 3px; background: var(--bg-alt); overflow: hidden; }
.stock-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.stock-fill.ok { background: var(--success); }
.stock-fill.low { background: var(--warning); }
.stock-fill.critical { background: var(--danger); }

.stock-info { display: flex; justify-content: space-between; font-size: 13px; align-items: center; }
.stock-count { font-weight: 600; font-family: var(--font-display); font-size: 15px; }
.stock-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stock-label.ok { color: var(--success); }
.stock-label.low { color: var(--warning); }
.stock-label.critical { color: var(--danger); }

/* Inventory Row Layout */
.inv-row-top {
  display: flex; justify-content: space-between; align-items: center;
}
.inv-stock-control {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.inv-stock-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--light-gray);
}

/* Stepper Component */
.stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface);
}
.stepper-btn {
  width: 36px; height: 36px; border: none; background: var(--bg-alt);
  font-size: 18px; font-weight: 300; cursor: pointer; color: var(--dark-text);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
  font-family: var(--font-display); line-height: 1;
}
.stepper-btn:hover { background: var(--gold); color: white; }
.stepper-btn:active { transform: scale(0.95); }
.stepper-value {
  width: 56px; height: 36px; border: none; border-left: 1px solid var(--border);
  border-right: 1px solid var(--border); text-align: center; font-size: 14px;
  font-weight: 600; font-family: var(--font-mono); background: var(--surface);
  color: var(--dark-text); outline: none;
  -moz-appearance: textfield;
}
.stepper-value::-webkit-outer-spin-button,
.stepper-value::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-value:focus { background: var(--gold-glow); }

/* Sale Controls */
.inv-sale-control {
  padding-top: 8px; margin-top: 4px;
  border-top: 1px dashed var(--border-light);
}
.inv-sale-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.sale-switch-label {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--mid-gray);
}
.sale-switch-label input {
  accent-color: var(--danger); width: 16px; height: 16px; cursor: pointer;
}
.sale-switch-text { user-select: none; }
.sale-pct-display {
  font-size: 13px; font-weight: 700; font-family: var(--font-mono);
  color: var(--danger); min-width: 50px; text-align: right;
}
.inv-sale-slider-wrap {
  transition: opacity var(--transition);
}
.inv-sale-slider-wrap.disabled {
  opacity: 0.3; pointer-events: none;
}

/* Range Slider — background is dynamically set via JS (updateSliderBackground) to reflect fill position */
.sale-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--border);
  outline: none; cursor: pointer;
}
.sale-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: white; border: 2px solid var(--danger);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  cursor: pointer; transition: box-shadow 0.2s;
}
.sale-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(248,113,113,0.12);
}
.sale-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: white; border: 2px solid var(--danger);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15); cursor: pointer;
}
.sale-slider-labels {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--muted); margin-top: 2px;
  padding: 0 2px;
}
.btn-stock {
  padding: 7px 14px; background: var(--gold-dark); color: #09090b;
  border: none; border-radius: var(--radius-xs); font-size: 12px;
  font-weight: 600; cursor: pointer; transition: background var(--transition);
  font-family: var(--font-body);
}
.btn-stock:hover { background: var(--gold-dark); }
.btn-stock:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-stock:active { transform: scale(0.96); }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal {
  background: var(--surface); border-radius: var(--radius-dialog); width: 100%; max-width: 700px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  animation: slideUp 0.25s ease;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 28px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-head h2 { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt); border: none; border-radius: 50%;
  cursor: pointer; transition: all var(--transition);
}
.modal-close svg { width: 14px; height: 14px; stroke: var(--mid-gray); }
.modal-close:hover { background: rgba(248,113,113,0.1); }
.modal-close:hover svg { stroke: var(--danger); }
.modal-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.modal-body { padding: 24px 28px; }
.modal-block { margin-bottom: 24px; }
.modal-block h4 {
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--light-gray); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border-light);
}
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.modal-total {
  display: flex; justify-content: space-between; padding-top: 14px;
  border-top: 1px solid var(--border); font-weight: 700; font-size: 16px; margin-top: 14px;
  font-family: var(--font-display);
}
.modal-actions { display: flex; gap: 12px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.info-text { font-size: 14px; line-height: 1.7; color: var(--mid-gray); }

.input-full, .textarea-full {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: var(--font-body); transition: border var(--transition);
  background: var(--bg-alt); color: var(--dark-text);
}
.input-full:focus, .textarea-full:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.textarea-full { resize: vertical; min-height: 80px; }

/* TIMELINE */
.timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 5px; top: 12px; bottom: 12px;
  width: 2px; background: var(--border-light);
}
.timeline-entry { display: flex; gap: 16px; padding: 8px 0; position: relative; }
.timeline-dot {
  width: 12px; height: 12px; background: var(--surface); border: 2px solid var(--gold);
  border-radius: 50%; margin-top: 4px; flex-shrink: 0; z-index: 1;
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.timeline-entry:first-child .timeline-dot { background: var(--gold); }
.timeline-content { flex: 1; }
.timeline-date { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.3px; font-family: var(--font-mono); }
.timeline-text { font-size: 13px; margin-top: 4px; color: var(--mid-gray); line-height: 1.5; }

/* VIP */
.vip-star { color: var(--gold); cursor: pointer; font-size: 16px; transition: transform var(--transition); }
.vip-star:hover { transform: scale(1.2); }

/* ============================================
   SIDEBAR OVERLAY (Mobile)
   ============================================ */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  z-index: 90; opacity: 0; transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
  display: block; opacity: 1;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--bg-warm) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; width: 80%; margin-bottom: 8px; }
.skeleton-text.short { width: 40%; }
.skeleton-stat { height: 32px; width: 60px; margin-bottom: 4px; }

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet-Large: 1200px */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .main { padding: 0 28px 28px; }
}

/* Tablet: 900px — Collapsed Sidebar with Icons */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: -280px; top: 0; bottom: 0;
    width: 260px; z-index: 100;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 8px 0 32px rgba(0,0,0,0.5);
  }
  .hamburger-btn { display: flex; }
  .main { padding: 0 20px 24px; margin-left: 0; }
  .grid-2, .modal-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .inventory-columns { grid-template-columns: 1fr; }
  .topbar-title { font-size: 16px; }
  .keyboard-hint { display: none; }
  .section-header h1 { font-size: 20px; }
  .section-header { flex-direction: column; gap: 12px; }
  .header-actions { align-self: flex-start; }
  .filters { flex-direction: column; }
  .search-wrap { min-width: unset; width: 100%; }
  .filter-pills { width: 100%; }
  .bulk-bar { flex-wrap: wrap; }
  .today-comparison { flex-direction: column; }
  .comparison-item { min-width: unset; }
  .btn-refresh span { display: none; }
  .btn-refresh { padding: 9px 12px; }
  .settings-grid { grid-template-columns: 1fr; }
  .price-management-grid { grid-template-columns: 1fr; }
}

/* Mobile: 600px */
@media (max-width: 600px) {
  .main { padding: 0 14px 20px; }
  .topbar { padding: 14px 0 12px; }
  .topbar-title { font-size: 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-value { font-size: 20px; }
  .stat-icon { width: 34px; height: 34px; }
  .stat-icon svg { width: 16px; height: 16px; }
  .stat-label { font-size: 10px; }
  .section-header h1 { font-size: 18px; }
  .lifecycle-pipeline {
    flex-wrap: nowrap; gap: 0; padding: 20px 8px;
    overflow-x: auto; justify-content: flex-start;
  }
  .lifecycle-line { min-width: 16px; }
  .lifecycle-step { min-width: 80px; }
  .lifecycle-dot { width: 36px; height: 36px; }
  .lifecycle-dot svg { width: 16px; height: 16px; }
  .lifecycle-label { font-size: 11px; }
  .lifecycle-email { font-size: 9px; max-width: 80px; }
  .email-template-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .email-status-indicator { margin-right: 0; }
  .last-updated { display: none; }
  .auto-refresh-indicator { display: none; }

  /* Modal fullscreen on mobile */
  .modal-overlay { padding: 0; align-items: stretch; }
  .modal {
    max-width: none; max-height: none; border-radius: 0;
    height: 100vh; width: 100vw;
  }
  .modal-head { padding: 16px 18px; }
  .modal-head h2 { font-size: 17px; }
  .modal-body { padding: 16px 18px; }
  .modal-actions { flex-direction: column; }
  .modal-actions button { width: 100%; }

  /* Forms full width */
  .input-full, .textarea-full, .select-sm { font-size: 16px; } /* prevent iOS zoom */
  .settings-grid { grid-template-columns: 1fr; }
  .price-management-grid { grid-template-columns: 1fr; }
  .email-template-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .pill { padding: 6px 10px; font-size: 11px; }
  .card { padding: 18px; }
  .card-header h3 { font-size: 14px; }

  /* Table scroll indicator */
  .table-wrap { position: relative; }
  .table-wrap::after {
    content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 24px;
    background: linear-gradient(to left, var(--surface), transparent);
    pointer-events: none; z-index: 1; border-radius: 0 var(--radius) var(--radius) 0;
  }

  /* Tabellen auf Handy besser lesbar */
  table { min-width: 500px; }
  th { padding: 10px 12px; font-size: 10px; }
  td { padding: 10px 12px; font-size: 12px; }
}

/* ============================================
   SUPPORT TICKETS
   ============================================ */
.ticket-new { background: rgba(197, 165, 90, 0.06); }
.ticket-new td:first-child strong { color: var(--gold) !important; }

.ticket-message-box {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
}

.support-stats { margin-right: 8px; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--mid-gray);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
}

/* ============================================
   TOOLTIP SYSTEM
   ============================================ */
[data-tooltip] {
  position: relative;
  cursor: help;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #27272a;
  color: rgba(255,255,255,0.9);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  white-space: normal;
  width: max-content;
  max-width: 260px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.stat-label[data-tooltip] { border-bottom: 1px dashed var(--muted); }

/* ============================================
   ENHANCED STAT CARDS
   ============================================ */
.stat-trend {
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.stat-trend.neutral { color: var(--muted); }

/* ============================================
   SMART INSIGHTS
   ============================================ */
.insights-card {
  margin-top: 24px;
}
.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  line-height: 1.6;
}
.insight-item:last-child { border-bottom: none; }
.insight-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.insight-icon.positive { background: rgba(52,211,153,0.1); }
.insight-icon.negative { background: rgba(248,113,113,0.1); }
.insight-icon.info { background: rgba(96,165,250,0.1); }
.insight-icon.gold { background: var(--gold-glow); }
.insight-text strong { color: var(--dark-text); }

/* ============================================
   KI SUPPORT-ASSISTENT
   ============================================ */
/* Auto-Translate Button */
.btn-auto-translate {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 10px; background: var(--bg-alt); color: var(--gold-dark);
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  font-size: 10px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); transition: all var(--transition);
}
.btn-auto-translate:hover { background: var(--gold-glow); border-color: var(--gold); }
.btn-auto-translate:disabled { opacity: 0.5; cursor: wait; }

.btn-ai-suggest {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: linear-gradient(135deg, var(--near-black), #3a3a38);
  color: var(--gold-light); border: 1px solid var(--gold); border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); transition: all var(--transition);
}
.btn-ai-suggest:hover { background: linear-gradient(135deg, #3a3a38, var(--near-black)); box-shadow: 0 0 12px rgba(197,165,90,0.2); }
.btn-ai-suggest:active { transform: scale(0.97); }
.btn-ai-suggest:disabled { opacity: 0.5; cursor: wait; }

.ai-status {
  font-size: 12px; padding: 8px 12px; border-radius: 6px; margin-bottom: 8px;
}
.ai-status.loading { background: rgba(197,165,90,0.08); color: var(--gold-dark); }
.ai-status.success { background: rgba(52,211,153,0.08); color: var(--success); }
.ai-status.error { background: rgba(248,113,113,0.08); color: var(--danger); }

.ai-spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid var(--gold-light); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.6s linear infinite;
  margin-right: 6px; vertical-align: middle;
}
/* ============================================
   FUNNEL VISUALIZATION
   ============================================ */
.funnel-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.funnel-label {
  width: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--mid-gray);
  text-align: right;
}
.funnel-track {
  flex: 1;
  height: 28px;
  background: var(--bg-alt);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.funnel-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  min-width: 40px;
}
.funnel-fill.visitors { background: var(--gold-dark); }
.funnel-fill.cart { background: var(--gold); }
.funnel-fill.purchase { background: var(--success); }
.funnel-value {
  width: 60px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark-text);
}
.funnel-pct {
  font-size: 11px;
  color: var(--light-gray);
  font-weight: 400;
}

/* Discount Analytics */
.clickable-row:hover { background: var(--bg-alt); cursor: pointer; }
.btn-dc-detail {
  background: var(--gold-glow); color: var(--gold-dark); border: 1px solid var(--gold);
  font-weight: 600;
}
.btn-dc-detail:hover { background: var(--gold); color: #fff; }

/* (Legacy sale-row replaced by inv-sale-control) */
.sub-badge {
  font-size: 10px; background: rgba(197,165,90,0.15); color: var(--gold-dark);
  padding: 2px 6px; border-radius: 999px; margin-left: 6px; font-weight: 600;
}

/* Restock Alert Banner */
.restock-banner {
  background: linear-gradient(135deg, rgba(197,165,90,0.08), rgba(197,165,90,0.04));
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.restock-banner-title {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--gold-dark); margin-bottom: 12px;
}
.restock-alert-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.restock-alert-item:last-child { border-bottom: none; }

/* Product Checkboxes in Discount Modal */
.product-checkboxes {
  display: flex; flex-direction: column; gap: 8px;
}
.product-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--dark-text); cursor: pointer;
}
.product-check input { accent-color: var(--gold); width: 16px; height: 16px; }

/* ============================================
   EMAIL TEMPLATE EDITOR
   ============================================ */
.email-template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition), opacity var(--transition);
}
.email-template-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  border-color: var(--gold);
}

.email-template-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  gap: 16px;
}
.email-template-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}
.email-icon { font-size: 22px; flex-shrink: 0; }
.email-template-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.email-trigger { font-size: 12px; color: var(--gold); font-weight: 500; margin-top: 2px; }
.email-desc { font-size: 11px; color: var(--light-gray); margin-top: 1px; }

.email-template-editor {
  border-top: 1px solid var(--border-light);
  padding: 20px;
  background: var(--bg-warm);
}
.email-field { margin-bottom: 14px; }
.email-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--mid-gray);
  margin-bottom: 6px;
}
.email-field .textarea-full {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}
.email-field-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--muted);
  border-radius: 28px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 22px; width: 22px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--success);
  box-shadow: 0 0 8px rgba(52,211,153,0.3);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}
.toggle-switch:hover .toggle-slider {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}
.toggle-switch input:checked:hover + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(52,211,153,0.15);
}

/* ============================================
   ORDER LIFECYCLE PIPELINE
   ============================================ */
.lifecycle-pipeline {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 20px 24px;
  gap: 0;
}
.lifecycle-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 120px;
  position: relative;
}
.lifecycle-dot {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lifecycle-dot:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.lifecycle-dot svg {
  width: 20px; height: 20px; stroke: white; stroke-width: 2.5;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.lifecycle-dot.active { background: var(--gold); }
.lifecycle-dot.warning { background: var(--warning); }
.lifecycle-dot.processing { background: var(--purple-status); }
.lifecycle-dot.shipped { background: var(--info); }
.lifecycle-dot.success { background: var(--success); }
.lifecycle-label {
  font-size: 13px; font-weight: 700; color: var(--dark-text);
  font-family: var(--font-display); letter-spacing: -0.2px;
}
.lifecycle-email {
  font-size: 11px; color: var(--mid-gray); text-align: center;
  max-width: 120px; line-height: 1.3;
}
.lifecycle-line {
  flex: 1; height: 3px; margin-top: 20px;
  background: linear-gradient(90deg, var(--border) 0%, var(--gold) 50%, var(--border) 100%);
  background-size: 200% 100%;
  position: relative;
  min-width: 24px;
  border-radius: 2px;
}
.lifecycle-line::after {
  content: '';
  position: absolute; right: -3px; top: -4px;
  width: 0; height: 0;
  border-left: 6px solid var(--gold);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

/* ============================================
   EMAIL GROUPS
   ============================================ */
.email-vars-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--bg-alt); border-radius: var(--radius-sm);
  margin-bottom: 24px; font-size: 11px;
}
.vars-label { color: var(--mid-gray); font-weight: 600; margin-right: 4px; }
.email-vars-bar code {
  background: var(--surface); padding: 3px 8px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 10px; color: var(--gold-dark);
  border: 1px solid var(--border);
}

.email-group { margin-bottom: 28px; }
.email-group-header {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: var(--dark-text); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border-light);
}
.email-group-count {
  font-size: 11px; font-weight: 500; color: var(--light-gray);
  font-family: var(--font-body);
}

.email-stats-badge {
  font-size: 12px; color: var(--light-gray);
  display: flex; align-items: center; gap: 6px;
}

/* Email Type Badges */
.email-type-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
  text-transform: uppercase; vertical-align: middle; margin-left: 6px;
}
.email-type-critical {
  background: rgba(251,191,36,0.12); color: var(--warning);
}
.email-type-optional {
  background: rgba(96,165,250,0.1); color: var(--info);
}

/* Email Status Indicator */
.email-status-indicator {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; margin-right: 14px;
  white-space: nowrap; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 10px; border-radius: 999px;
}
.email-status-on {
  color: var(--success);
  background: rgba(52,211,153,0.08);
}
.email-status-off {
  color: var(--danger);
  background: rgba(248,113,113,0.06);
}
.email-status-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.email-status-dot.on {
  background: var(--success);
  box-shadow: 0 0 6px rgba(52,211,153,0.5);
  animation: pulse-green 2s ease-in-out infinite;
}
.email-status-dot.off { background: var(--danger); }

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 4px rgba(52,211,153,0.3); }
  50% { box-shadow: 0 0 10px rgba(52,211,153,0.6); }
}

/* Critical email deactivated state — handled by enhanced rules below */

/* Enhanced Email Cards */
.email-template-card.inactive {
  opacity: 0.65;
  border-style: dashed;
  border-left: 3px solid var(--border);
}
.email-template-card.inactive:hover { opacity: 0.85; }
.email-template-card.inactive .email-icon { filter: grayscale(1); }

/* Active card left border accent */
.email-template-card:not(.inactive) {
  border-left: 3px solid var(--success);
}
.email-template-card.inactive.is-critical {
  border-left: 3px solid var(--danger);
}

/* Email Critical Warning */
.email-critical-warning {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--warning); font-weight: 500;
  padding: 8px 12px; background: rgba(251,191,36,0.08);
  border-radius: var(--radius-xs); margin-top: 6px;
}
.email-critical-warning svg { flex-shrink: 0; }
.email-critical-off {
  background: rgba(248,113,113,0.08) !important;
  color: var(--danger) !important;
}

/* Critical toggle gets gold ring */
.email-template-card.is-critical .toggle-slider {
  box-shadow: 0 0 0 2px rgba(251,191,36,0.25);
}
.email-template-card.is-critical .toggle-switch input:checked + .toggle-slider {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(197,165,90,0.4);
}

/* ============================================
   SETTINGS
   ============================================ */
#sec-settings { padding-bottom: 80px; }
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 4px 0;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-field.full-width { grid-column: 1 / -1; }
.settings-field label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--mid-gray);
}
.settings-hint {
  font-size: 11px; color: var(--light-gray); line-height: 1.4;
}
.settings-save-bar {
  display: flex; justify-content: flex-end; align-items: center; gap: 16px;
  padding: 16px 40px;
  position: fixed; bottom: 0; right: 0;
  left: var(--sidebar-w);
  background: var(--bg);
  z-index: 40;
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
}
@media (max-width: 900px) {
  .settings-save-bar { left: 0; padding: 14px 20px; }
}
.settings-save-status {
  font-size: 13px; color: var(--success); font-weight: 500;
}
.toggle-inline {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--dark-text); cursor: pointer;
  font-weight: 500; text-transform: none; letter-spacing: 0;
}
.toggle-inline input { accent-color: var(--gold); width: 18px; height: 18px; }

/* Price Management Grid */
.price-management-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.price-product-column {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.price-product-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border-light);
  background: var(--bg-warm);
}
.price-product-head .col-dot { width: 8px; height: 8px; border-radius: 50%; }
.price-product-head h4 {
  font-family: var(--font-display); font-size: 14px; font-weight: 600; margin: 0;
}
.price-dose-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.price-dose-row:last-child { border-bottom: none; }
.price-dose-label { font-weight: 600; min-width: 60px; font-family: var(--font-display); }
.price-dose-input {
  width: 90px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-xs); font-size: 13px; text-align: right;
  font-family: var(--font-mono); transition: border var(--transition);
  background: var(--bg-alt); color: var(--dark-text);
}
.price-dose-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.price-dose-display { font-size: 11px; color: var(--light-gray); min-width: 60px; }

/* Settings responsive handled in main responsive block */

/* ============================================
   AUTO-REFRESH INDICATOR
   ============================================ */
.auto-refresh-indicator {
  width: 80px; height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden; margin-right: 12px;
}
.auto-refresh-bar {
  height: 100%; width: 0%; background: var(--gold);
  border-radius: 2px; transition: width 1s linear;
}

/* ============================================
   SESSION TIMER
   ============================================ */
.session-timer {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--muted); letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ============================================
   KEYBOARD SHORTCUT HINT
   ============================================ */
.keyboard-hint {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted); margin-right: 12px;
  cursor: default;
}
.keyboard-hint svg { opacity: 0.5; }

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions {
  display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
  align-items: center;
}
.quick-action-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; background: var(--surface);
  border: 1px solid var(--gold); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); color: var(--gold-dark);
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(197,165,90,0.08);
}
.quick-action-btn:hover {
  background: var(--gold); color: var(--near-black);
  box-shadow: 0 4px 12px rgba(197,165,90,0.2);
}
.quick-action-btn:hover svg { stroke: var(--near-black); }
.quick-action-hints {
  flex: 1; display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center;
}
.qa-hint {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: rgba(251,191,36,0.08);
  border-radius: 20px; font-size: 11px; font-weight: 600;
  color: var(--warning);
}
.qa-hint.info { background: rgba(96,165,250,0.08); color: var(--info); }
.qa-hint.success { background: rgba(52,211,153,0.08); color: var(--success); }

/* ============================================
   TODAY VS YESTERDAY COMPARISON
   ============================================ */
.today-comparison {
  display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.comparison-item {
  flex: 1; min-width: 200px;
  background: var(--surface); padding: 16px 20px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-light);
  display: flex; flex-direction: column; gap: 4px;
  transition: box-shadow var(--transition);
}
.comparison-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.comparison-label {
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--light-gray);
}
.comparison-values {
  font-size: 14px; font-weight: 500; color: var(--dark-text);
  font-family: var(--font-display);
}
.comp-today { font-weight: 700; color: var(--dark-text); font-family: var(--font-mono); }
.comp-yesterday { color: var(--light-gray); font-family: var(--font-mono); font-size: 12px; }
.comp-up { color: var(--success); font-weight: 700; font-size: 11px; margin-left: 4px; }
.comp-up::before { content: '\2191 '; }
.comp-down { color: var(--danger); font-weight: 700; font-size: 11px; margin-left: 4px; }
.comp-down::before { content: '\2193 '; }

/* ============================================
   REVENUE GOAL TRACKER
   ============================================ */
.revenue-goal-card { margin-bottom: 20px; }
.revenue-goal-bar {
  height: 8px; background: var(--bg-alt);
  border-radius: 4px; overflow: hidden; margin: 8px 0;
  position: relative;
}
.revenue-goal-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.revenue-goal-fill::after {
  content: ''; position: absolute; right: 0; top: -2px; bottom: -2px;
  width: 3px; background: var(--gold); border-radius: 2px;
  box-shadow: 0 0 8px rgba(197,165,90,0.5);
}
.revenue-goal-info {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--mid-gray);
  font-family: var(--font-mono);
}
.revenue-goal-pct {
  font-family: var(--font-display); font-weight: 700;
  font-size: 16px; color: var(--gold); letter-spacing: -0.5px;
}

/* ============================================
   BULK ORDER PROCESSING
   ============================================ */
.bulk-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; margin-bottom: 12px;
  background: var(--gold-glow); border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
}
.bulk-count {
  font-size: 13px; font-weight: 600; color: var(--gold-dark);
  min-width: 100px;
}
#ordersBody .bulk-checkbox {
  accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer;
}
#bulkSelectAll { accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer; }

/* ============================================
   NEW ORDER / NOTIFICATION FLASH
   ============================================ */
@keyframes newItemFlash {
  0%   { background: rgba(197,165,90,0.3); }
  100% { background: transparent; }
}
.flash-new {
  animation: newItemFlash 2s ease-out;
}
.notification-toast {
  position: fixed; top: 20px; right: 20px;
  background: #27272a; color: #fafafa;
  padding: 12px 20px 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; z-index: 2000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  border-left: 3px solid var(--gold);
  transform: translateX(120%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-body);
  display: flex; align-items: center; gap: 8px;
  max-width: 360px;
}
.notification-toast.show { transform: translateX(0); }
.notification-toast.toast-error { border-left-color: var(--danger); }

/* ============================================
   SORTABLE TABLE HEADERS
   ============================================ */
.sortable-header {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color var(--transition);
}
.sortable-header:hover { color: var(--gold); }

/* ============================================
   PAGINATION
   ============================================ */
.pagination-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; padding: 14px 20px;
  border-top: 1px solid var(--border-light);
}
.pagination-btn {
  padding: 6px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xs); font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: var(--font-body); color: var(--mid-gray);
  transition: all var(--transition);
}
.pagination-btn:hover { border-color: var(--gold); color: var(--gold); }
.pagination-btn.active {
  background: var(--gold); color: #09090b; border-color: var(--gold);
}
.pagination-dots {
  padding: 6px 4px; font-size: 12px; color: var(--muted);
}

/* ============================================
   RESULT COUNT
   ============================================ */
.result-count {
  font-size: 12px; font-weight: 500; color: var(--light-gray);
  padding: 7px 14px; background: var(--bg-alt); border-radius: 20px;
  white-space: nowrap;
}

/* ============================================
   LAST UPDATED TIMESTAMP
   ============================================ */
.last-updated {
  font-size: 11px; color: var(--muted); margin-right: 12px;
  font-family: var(--font-mono); letter-spacing: 0.3px;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading-state {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 40px 20px; color: var(--light-gray);
  font-size: 13px;
}
.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
.loading-spinner-sm {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
button:disabled,
button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(30%);
}

/* ============================================
   MARKETING DASHBOARD
   ============================================ */
.marketing-kpi-grid {
  grid-template-columns: repeat(4, 1fr);
}

/* Marketing Alerts */
.marketing-alerts {
  display: flex; flex-direction: column; gap: 8px;
}
.marketing-alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.6;
  border-left: 4px solid;
}
.marketing-alert-danger {
  background: rgba(248,113,113,0.06); border-color: var(--danger);
}
.marketing-alert-warning {
  background: rgba(251,191,36,0.06); border-color: var(--warning);
}
.marketing-alert-info {
  background: rgba(96,165,250,0.06); border-color: var(--info);
}
.marketing-alert-icon {
  font-size: 16px; flex-shrink: 0; margin-top: 1px;
}
.marketing-alert-text { flex: 1; }
.marketing-alert-text strong { color: var(--dark-text); }

/* Action Plan */
.action-plan-item {
  padding: 14px 0; border-bottom: 1px solid var(--border-light);
}
.action-plan-item:last-of-type { border-bottom: none; }
.action-plan-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px; flex-wrap: wrap; gap: 8px;
}
.action-plan-header strong {
  font-family: var(--font-display); font-size: 14px; color: var(--dark-text);
}
.action-plan-status {
  font-size: 12px; color: var(--mid-gray); font-weight: 500;
}
.action-plan-rec {
  font-size: 13px; color: var(--mid-gray); line-height: 1.6;
  padding-left: 2px;
}
.action-plan-next {
  padding: 16px 0 4px; margin-top: 8px; border-top: 2px solid var(--border);
}
.action-plan-step {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 13px; color: var(--dark-text);
}
.step-number {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold-glow); color: var(--gold-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}

/* Customer Mix Bar */
.customer-mix-bar {
  display: flex; height: 32px; border-radius: var(--radius-sm);
  overflow: hidden; margin-bottom: 14px;
}
.mix-segment {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  min-width: 60px; transition: width 0.6s ease;
}
.mix-segment span { white-space: nowrap; padding: 0 8px; }
.mix-new { background: var(--info); }
.mix-return { background: var(--success); }

/* ============================================
   SECTION DIVIDERS
   ============================================ */
.section + .section { border-top: 1px solid var(--border-light); }

/* ============================================
   MONO FONT FOR AMOUNTS & IDS
   ============================================ */
td .mono, .amount-mono, .id-mono {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.3px;
}

/* ============================================
   CARD HOVER UNIFICATION
   ============================================ */
.card {
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.5); transform: translateY(-2px);
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.main::-webkit-scrollbar { width: 6px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.main::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ============================================
   FOCUS VISIBLE GLOBAL
   ============================================ */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (max-width: 1200px) {
  .marketing-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .marketing-kpi-grid { grid-template-columns: 1fr; }
}

/* ============================================
   DISCOUNT RECOMMENDATION BOX
   ============================================ */
.discount-recommendation {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 12px;
  overflow: hidden;
}
.rec-header {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border-light);
  color: var(--mid-gray);
}
.rec-body { padding: 8px 14px; }
.rec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 12px;
  color: var(--dark-text);
  border-bottom: 1px solid var(--border-light);
}
.rec-row:last-child { border-bottom: none; }
.rec-value {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--gold-dark);
  font-size: 12px;
}
.rec-row.rec-warning {
  color: var(--danger);
  font-weight: 600;
  border-bottom: none;
  padding-top: 8px;
}
.discount-margin-warning {
  background: rgba(229, 160, 0, 0.1);
  border: 1px solid rgba(229, 160, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--warning);
  margin-top: 8px;
  display: none;
}

/* Discount Usage Mini-Bar */
.usage-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.usage-bar {
  width: 60px;
  height: 5px;
  border-radius: 3px;
  background: var(--bg-alt);
  overflow: hidden;
  flex-shrink: 0;
}
.usage-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  background: var(--success);
}
.usage-fill.mid { background: var(--warning); }
.usage-fill.high { background: var(--danger); }

/* Badge expired */
.badge-expired {
  background: rgba(217, 64, 64, 0.1);
  color: var(--danger);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Inline KPI for discount table */
.dc-inline-kpi {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--mid-gray);
}
.dc-inline-kpi span {
  white-space: nowrap;
}
.dc-inline-kpi .kpi-value {
  font-weight: 600;
  color: var(--dark-text);
  font-family: var(--font-mono);
}

/* Discount action buttons */
.dc-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}
.btn-icon-sm {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon-sm svg {
  width: 14px;
  height: 14px;
  stroke: var(--mid-gray);
  fill: none;
  stroke-width: 2;
}
.btn-icon-sm:hover {
  border-color: var(--gold);
  background: var(--gold-glow);
}
.btn-icon-sm:hover svg { stroke: var(--gold); }
.btn-icon-sm.btn-delete:hover {
  border-color: var(--danger);
  background: rgba(217, 64, 64, 0.08);
}
.btn-icon-sm.btn-delete:hover svg { stroke: var(--danger); }

/* Discount Toggle (styled like email toggles) */
/* Discount Toggle — nutzt globale .toggle-switch Klasse + Status-Indikator */
.dc-toggle-wrap {
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
}

/* Inventory Summary Bar */
.inventory-summary {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.inv-summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inv-summary-label {
  font-size: 12px;
  color: var(--light-gray);
  font-weight: 500;
}
.inv-summary-value {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--dark-text);
}
.inv-summary-value.warn { color: var(--warning); }
.inv-summary-value.danger { color: var(--danger); }
.inv-summary-value.success { color: var(--success); }

/* Low-stock threshold inline edit */
.threshold-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--light-gray);
}
.threshold-input {
  width: 40px;
  padding: 2px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-family: var(--font-mono);
  text-align: center;
  background: var(--bg-warm);
  color: var(--dark-text);
}
.threshold-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

/* Support priority badges */
.badge-priority-high {
  background: rgba(217, 64, 64, 0.1);
  color: var(--danger);
}
.badge-priority-medium {
  background: rgba(229, 160, 0, 0.1);
  color: var(--warning);
}
.badge-priority-low {
  background: rgba(45, 139, 111, 0.1);
  color: var(--success);
}

/* Order quick-status buttons */
.quick-status-btns {
  display: flex;
  gap: 3px;
}
.btn-quick-status {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.btn-quick-status:hover {
  border-color: var(--gold);
  background: var(--gold-glow);
  color: var(--gold-dark);
}

/* Copy button */
.btn-copy {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity var(--transition);
  vertical-align: middle;
  margin-left: 4px;
}
.btn-copy:hover { opacity: 1; }
.btn-copy svg {
  width: 12px;
  height: 12px;
  stroke: var(--mid-gray);
  fill: none;
  stroke-width: 2;
}

/* ============================================
   SUB-TABS (Reviews etc.)
   ============================================ */
.sub-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-alt);
  padding: 4px;
  border-radius: var(--radius-sm);
  width: fit-content;
}
.sub-tab {
  background: transparent;
  border: none;
  padding: 8px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--mid-gray);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.sub-tab:hover {
  color: var(--dark-text);
  background: rgba(255,255,255,0.06);
}
.sub-tab.active {
  background: var(--surface);
  color: var(--dark-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ============================================
   BROADCAST COMPOSE
   ============================================ */
#broadcastCompose .modal-block h4 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--mid-gray);
  margin-bottom: 8px;
}

/* ============================================
   NEWSLETTER ENHANCED
   ============================================ */
.pill-sm {
  padding: 4px 10px !important;
  font-size: 11px !important;
  min-height: unset;
}

.nl-sort {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}
.nl-sort:hover { color: var(--gold); }
.nl-sort .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.4;
}
.nl-sort.active .sort-arrow { opacity: 1; color: var(--gold); }

.nl-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.nl-source-badge.source-modal {
  background: rgba(197,165,90,0.12);
  color: var(--gold-dark);
}
.nl-source-badge.source-footer {
  background: rgba(52,211,153,0.10);
  color: var(--emerald);
}
.nl-source-badge.source-other {
  background: rgba(96,165,250,0.10);
  color: var(--steel-blue);
}

.nl-email-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nl-email-cell .btn-copy-email {
  opacity: 0;
  transition: opacity var(--transition);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--light-gray);
}
.nl-email-cell .btn-copy-email:hover { color: var(--gold); }
tr:hover .nl-email-cell .btn-copy-email { opacity: 1; }

.nl-actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nl-growth-positive { color: var(--success); font-weight: 600; }
.nl-growth-negative { color: var(--danger); font-weight: 600; }
.nl-growth-neutral { color: var(--light-gray); font-weight: 500; }

#nlSourceLegend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.nl-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--mid-gray);
}
.nl-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nl-legend-value {
  font-weight: 600;
  color: var(--dark-text);
  margin-left: 2px;
}

/* Pagination for Newsletter */
#nlPagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
}

/* ============================================
   SECTION TABS (for consolidated navigation)
   ============================================ */
.section-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  margin: -4px 0 24px; overflow-x: auto;
}
.sec-tab {
  padding: 10px 20px; border: none; background: none; cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--light-gray); border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap; flex-shrink: 0;
}
.sec-tab:hover { color: var(--near-black); }
.sec-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.sec-tab .tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px; background: var(--gold-glow); color: var(--gold);
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px;
  min-width: 18px;
}
.sec-tab .tab-badge.warn { background: rgba(251,191,36,0.15); color: var(--warning); }
.sec-tab-panel { display: none; }
.sec-tab-panel.active { display: block; }

/* Dynamic section header actions — hidden/shown by tab switch */
.section-header-actions { display: flex; gap: 10px; align-items: center; }
.section-header-actions:empty { display: none; }

/* Customer Tags */
.customer-tag {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.3px; text-transform: uppercase;
}
.customer-tag.tag-new { background: rgba(96,165,250,0.1); color: var(--info); }
.customer-tag.tag-repeat { background: rgba(52,211,153,0.1); color: var(--success); }
.customer-tag.tag-inactive { background: rgba(248,113,113,0.08); color: var(--danger); }
.customer-tag.tag-vip { background: var(--gold-glow); color: var(--gold-dark); }

/* Activity Log */
.activity-log { max-height: 400px; overflow-y: auto; }
.activity-entry {
  display: flex; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border-light); font-size: 13px;
}
.activity-entry:last-child { border-bottom: none; }
.activity-icon {
  flex-shrink: 0; display: flex; align-items: center;
  color: var(--gold); opacity: 0.7;
}
.activity-time {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  min-width: 62px; flex-shrink: 0;
}
.activity-detail { color: var(--mid-gray); line-height: 1.5; }
.activity-text { color: var(--mid-gray); line-height: 1.5; }
.activity-text strong { color: var(--dark-text); }

/* Mobile bottom nav — hidden by default */
.mobile-bottom-nav { display: none; }

/* Tablet: responsive tabs */
@media (max-width: 900px) {
  .section-tabs { margin: -4px 0 16px; }
  .sec-tab { padding: 8px 14px; font-size: 12px; }
}

/* Mobile: bottom nav visible, sidebar als Overlay (NICHT display:none) */
@media (max-width: 600px) {
  .main { margin-left: 0; padding-bottom: 72px !important; }
  .topbar { left: 0; }
  .mobile-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-warm); border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; align-items: center;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    z-index: 80; box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
  }
  .mobile-bottom-nav .mob-nav-btn {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: none; border: none; cursor: pointer; padding: 6px 8px;
    color: var(--light-gray); transition: color var(--transition);
    font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
    font-family: var(--font-body);
  }
  .mobile-bottom-nav .mob-nav-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }
  .mobile-bottom-nav .mob-nav-btn.active { color: var(--gold); }
  .mobile-bottom-nav .mob-nav-btn:hover { color: var(--gold); }
  .settings-save-bar { bottom: 56px; left: 0; }
  .section-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .topbar .topbar-right .keyboard-hint { display: none; }

  /* Section tabs: scrollable on mobile */
  .section-tabs {
    margin: 0 -14px 16px; padding: 0 14px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; flex-wrap: nowrap;
  }
  .section-tabs::-webkit-scrollbar { display: none; }
  .sec-tab { padding: 8px 12px; font-size: 11px; white-space: nowrap; flex-shrink: 0; }
  .mobile-bottom-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; gap: 0; padding: 6px 8px env(safe-area-inset-bottom, 6px); }
  .mobile-bottom-nav::-webkit-scrollbar { display: none; }
}

/* ============================================
   ACCOUNTS SECTION
   ============================================ */
.account-status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  text-transform: uppercase;
}
.account-status-active   { background: rgba(52,211,153,0.12); color: var(--success); }
.account-status-inactive { background: rgba(248,113,113,0.12); color: var(--danger); }
.account-status-vip      { background: rgba(197,165,90,0.15); color: var(--gold); }

.dsgvo-compliance-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--success);
  padding: 4px 10px; border-radius: 999px;
  background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.2);
}
.dsgvo-compliance-badge svg { width: 12px; height: 12px; stroke: currentColor; fill: none; }

/* Activity Timeline (Account Modal) */
.account-timeline { display: flex; flex-direction: column; gap: 0; max-height: 400px; overflow-y: auto; }
.account-timeline-entry {
  display: flex; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.account-timeline-entry:last-child { border-bottom: none; }
.account-timeline-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: var(--bg-alt); border: 1px solid var(--border);
}
.account-timeline-icon svg { width: 14px; height: 14px; stroke: var(--mid-gray); fill: none; }
.account-timeline-icon.order    { background: rgba(197,165,90,0.12); border-color: rgba(197,165,90,0.3); }
.account-timeline-icon.order svg { stroke: var(--gold); }
.account-timeline-icon.support  { background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.3); }
.account-timeline-icon.support svg { stroke: var(--info); }
.account-timeline-icon.review   { background: rgba(52,211,153,0.10); border-color: rgba(52,211,153,0.3); }
.account-timeline-icon.review svg { stroke: var(--success); }
.account-timeline-icon.newsletter { background: rgba(167,139,250,0.10); border-color: rgba(167,139,250,0.3); }
.account-timeline-icon.newsletter svg { stroke: var(--purple); }
.account-timeline-body { flex: 1; min-width: 0; }
.account-timeline-title { font-size: 13px; font-weight: 600; color: var(--dark-text); }
.account-timeline-meta  { font-size: 11px; color: var(--mid-gray); margin-top: 2px; }
.account-timeline-date  {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  white-space: nowrap; flex-shrink: 0; padding-top: 2px;
}

/* DSGVO Action Buttons */
.dsgvo-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 16px 20px; background: rgba(248,113,113,0.04);
  border: 1px solid rgba(248,113,113,0.15); border-radius: var(--radius);
  margin-top: 24px;
}
.dsgvo-actions h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--danger); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px; width: 100%;
  border-bottom: none; padding-bottom: 0;
}
.btn-dsgvo-export {
  padding: 9px 16px; background: transparent; color: var(--mid-gray);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-dsgvo-export:hover { border-color: var(--gold); color: var(--gold); }
.btn-dsgvo-delete {
  padding: 9px 16px; background: transparent; color: var(--danger);
  border: 1px solid rgba(248,113,113,0.4); border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-dsgvo-delete:hover { background: rgba(248,113,113,0.1); }
.dsgvo-note {
  font-size: 11px; color: var(--muted); line-height: 1.5;
  padding: 0 4px; width: 100%;
}

/* ============================================
   PULL-TO-REFRESH
   ============================================ */
.ptr-indicator {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center;
  height: 0; overflow: hidden;
  background: var(--bg-warm); border-bottom: 1px solid var(--border);
  z-index: 200; transition: height 0.2s ease;
}
.ptr-indicator.pulling { height: var(--ptr-height, 0px); transition: none; }
.ptr-indicator.refreshing { height: 48px; }
.ptr-icon {
  width: 24px; height: 24px; stroke: var(--gold); fill: none;
  transition: transform 0.2s ease;
}
.ptr-indicator.triggered .ptr-icon { transform: rotate(180deg); }
.ptr-indicator.refreshing .ptr-icon {
  animation: spin 0.8s linear infinite;
}
.ptr-text {
  font-size: 12px; color: var(--light-gray); margin-left: 8px;
  font-family: var(--font-body); font-weight: 500;
}
