/* ============================================================
   MarktManager Pro — Main Stylesheet v2
   Design: Premium Dark UI · Modern SaaS aesthetic
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Backgrounds — warm neutral dark instead of cold navy */
  --bg-body: #111318;
  --bg-sidebar: #16181f;
  --bg-topbar: rgba(17, 19, 24, 0.94);
  --bg-card: #1c1f27;
  --bg-card-hover: #22252e;
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-hover: rgba(255, 255, 255, 0.05);

  /* Accent palette — brighter, more vibrant */
  --accent: #6c8eff;
  --accent-hover: #8aa3ff;
  --accent-soft: rgba(108, 142, 255, 0.14);
  --accent-glow: rgba(108, 142, 255, 0.32);

  --green: #34d470;
  --green-soft: rgba(52, 212, 112, 0.13);
  --orange: #ffab40;
  --orange-soft: rgba(255, 171, 64, 0.14);
  --red: #ff5c72;
  --red-soft: rgba(255, 92, 114, 0.13);
  --purple: #bf80ff;
  --purple-soft: rgba(191, 128, 255, 0.14);

  /* Text — warmer, higher contrast */
  --text-primary: #eef0f8;
  --text-muted: rgba(190, 200, 232, 0.72);
  --text-faint: rgba(190, 200, 232, 0.38);

  /* Borders — slightly more visible */
  --border: rgba(255, 255, 255, 0.095);
  --border-hover: rgba(255, 255, 255, 0.18);

  /* Layout */
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  /* Shadows — softer */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.22);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 52px rgba(0, 0, 0, 0.48);

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t: 0.18s;
}

/* ── Light Mode Overrides ───────────────────────────────── */
[data-theme="light"] {
  --bg-body: #f4f6fb;
  --bg-sidebar: #ffffff;
  --bg-topbar: rgba(255, 255, 255, 0.96);
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4ff;
  --bg-input: rgba(0, 0, 0, 0.05);
  --bg-hover: rgba(0, 0, 0, 0.04);

  --accent: #4a6cf7;
  --accent-hover: #3b5de7;
  --accent-soft: rgba(74, 108, 247, 0.12);
  --accent-glow: rgba(74, 108, 247, 0.24);

  --green: #1a9e5a;
  --green-soft: rgba(26, 158, 90, 0.12);
  --orange: #d97706;
  --orange-soft: rgba(217, 119, 6, 0.12);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.11);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.12);

  --text-primary: #1a1d2e;
  --text-muted: rgba(40, 44, 70, 0.6);
  --text-faint: rgba(40, 44, 70, 0.35);

  --border: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 0, 0.2);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
  --shadow-lg: 0 16px 52px rgba(0, 0, 0, 0.18);
}

/* Light mode specific overrides for components that use hardcoded colors */
[data-theme="light"] .sidebar {
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .topbar {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .card {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

[data-theme="light"] .table {
  --bs-table-color: var(--text-primary);
  --bs-table-striped-bg: rgba(0, 0, 0, 0.025);
  --bs-table-hover-bg: rgba(0, 0, 0, 0.04);
  --bs-table-border-color: var(--border);
}

[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
  background-color: #fff;
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
  background-color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

[data-theme="light"] .modal-content {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .btn-outline-light {
  --bs-btn-color: var(--text-primary);
  --bs-btn-border-color: rgba(0, 0, 0, 0.15);
  --bs-btn-hover-bg: rgba(0, 0, 0, 0.06);
  --bs-btn-hover-border-color: rgba(0, 0, 0, 0.25);
  --bs-btn-active-bg: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .badge.text-bg-secondary {
  background: rgba(0, 0, 0, 0.12) !important;
  color: var(--text-primary) !important;
}

[data-theme="light"] .empty-state {
  color: var(--text-muted);
}

[data-theme="light"] .topbar-icon-btn {
  color: var(--text-primary);
}

[data-theme="light"] .topbar-icon-btn:hover {
  background: rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .user-avatar {
  background: linear-gradient(135deg, #4a6cf7, #7c3aed);
}

[data-theme="light"] .nav-label {
  color: rgba(40, 44, 70, 0.4);
}


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

html {
  scroll-behavior: smooth;
}

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

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

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

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

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

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  overflow: hidden;
  transition: transform 0.28s var(--ease);
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(91, 124, 250, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

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

.nav-section {
  margin-bottom: 8px;
}

.nav-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-faint);
  padding: 10px 12px 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t), color var(--t), padding-left var(--t);
  position: relative;
}

.nav-link i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-link span {
  flex: 1;
}

.nav-link .nav-ext-icon {
  font-size: 0.7rem;
  opacity: 0.5;
  width: auto;
}

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

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

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

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-xs);
  margin-bottom: 10px;
  background: var(--bg-hover);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

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

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

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

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  background: rgba(239, 68, 68, 0.08);
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(239, 68, 68, 0.15);
  transition: background var(--t), border-color var(--t);
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red);
}

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1040;
  backdrop-filter: blur(3px);
}

.sidebar-overlay.show {
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--bg-topbar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1030;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
}

.topbar-app {
  color: var(--text-faint);
  font-weight: 500;
}

.topbar-sep {
  color: var(--text-faint);
  font-size: 0.7rem;
}

.topbar-current {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-xs);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background var(--t);
}

.topbar-toggle:hover {
  background: var(--bg-hover);
}

.topbar-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  transition: background var(--t), color var(--t);
}

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

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w);
  padding-top: calc(var(--topbar-h) + 28px);
  padding-bottom: 0;
  padding-left: 28px;
  padding-right: 28px;
  min-height: 100vh;
  transition: margin var(--t);
  display: flex;
  flex-direction: column;
}

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

.page-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE – MOBILE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .topbar {
    left: 0;
  }

  .main-content {
    margin-left: 0;
    padding: calc(var(--topbar-h) + 20px) 16px 80px;
    /* More bottom padding for FABs if added */
  }

  /* Typography formatting */
  html {
    font-size: 14px;
  }

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

  .stat-value {
    font-size: 1.6rem;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  /* Modals full width on phones */
  .modal-dialog {
    margin: 10px;
  }

  .modal-content {
    border-radius: var(--radius-sm);
  }

  /* Navbar adjustments */
  .topbar {
    padding: 0 16px;
  }

  .topbar-actions .btn-primary span {
    display: none;
    /* Hide text, show icon only */
  }

  .topbar-actions .btn-primary {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .topbar-actions .btn-primary i {
    margin: 0 !important;
    font-size: 1.1rem;
  }

  /* Event List Mobile Stack */
  .ev-row {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 12px 12px 0;
  }

  .ev-bar {
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    border-radius: 3px;
  }

  .ev-date {
    width: 50px;
    /* Slightly wider */
    text-align: left;
    padding-left: 12px;
  }

  .ev-body {
    width: calc(100% - 60px);
    /* Fill remaining space next to date */
  }

  .ev-finance {
    display: flex !important;
    /* Force show */
    width: 100%;
    text-align: left;
    padding-left: 60px;
    /* Align with body */
    margin-top: -4px;
    gap: 12px;
    align-items: center;
    min-width: 0;
  }

  .ev-revenue {
    font-size: 0.95rem;
  }

  .ev-profit {
    margin-top: 0;
    font-size: 0.85rem;
  }

  .ev-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    margin-top: 6px;
  }

  /* Forms */
  .form-control,
  .form-select,
  .btn {
    font-size: 16px !important;
    /* Prevent zoom on iOS */
  }
}

/* ══════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  transition: border-color var(--t), box-shadow var(--t);
}

.card:hover {
  border-color: var(--border-hover);
}

.card-header {
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0 !important;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

.card-footer {
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius) !important;
  padding: 14px 20px;
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  overflow: hidden;
  position: relative;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-color, var(--accent)), transparent);
  opacity: 0;
  transition: opacity var(--t);
}

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

.stat-card:hover::after {
  opacity: 0.6;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  background: var(--icon-bg, var(--accent-soft));
}

.stat-body {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-change {
  font-size: 0.8rem;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 500;
}

.stat-change.up {
  background: var(--green-soft);
  color: var(--green);
}

.stat-change.down {
  background: var(--red-soft);
  color: var(--red);
}

.stat-change.neu {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ── Market Cards ───────────────────────────────────────────── */
.market-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.market-card-header {
  padding: 20px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.market-card-body {
  padding: 14px 20px;
  flex: 1;
}

.market-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  text-align: center;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  gap: 8px;
}

.market-card-meta-item .meta-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.market-card-meta-item .meta-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.market-card-actions {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.market-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════ */
.table {
  color: var(--text-primary);
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
  --bs-table-border-color: var(--border);
}

.table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.015);
}

.table tbody td {
  padding: 13px 16px;
  vertical-align: middle;
  border-color: var(--border);
  font-size: 0.875rem;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all var(--t) var(--ease);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #7b6cf6 100%);
  color: white;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #9b8cff 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: white;
}

.btn-success:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--red), #b91c1c);
  color: white;
}

.btn-danger:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, var(--orange), #d97706);
  color: white;
}

.btn-warning:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  color: white;
}

.btn-outline-light,
.btn-outline-secondary {
  background: transparent;
  border: 1px solid var(--border) !important;
  color: var(--text-muted);
}

.btn-outline-light:hover,
.btn-outline-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover) !important;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 6px 12px;
}

.btn-xs {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  line-height: 1.5;
  border-radius: 6px;
}

.btn-lg {
  font-size: 0.95rem;
  padding: 13px 28px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-control,
.form-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-xs);
  font-size: 0.875rem;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  padding: 9px 14px;
}

.form-control:focus,
.form-select:focus {
  background: rgba(91, 124, 250, 0.06);
  border-color: rgba(91, 124, 250, 0.5);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(91, 124, 250, 0.15);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-faint);
}

.form-select option {
  background: #1a2035;
  color: var(--text-primary);
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group-text {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ══════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════ */
.modal-content {
  background: #131929;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.015);
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal-title {
  font-weight: 700;
  font-size: 1rem;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  gap: 10px;
}

.btn-close {
  filter: invert(1) brightness(0.7);
}

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
  font-weight: 600;
  font-size: 0.71rem;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.badge.bg-success {
  background: var(--green-soft) !important;
  color: var(--green) !important;
}

.badge.bg-danger {
  background: var(--red-soft) !important;
  color: var(--red) !important;
}

.badge.bg-warning {
  background: var(--orange-soft) !important;
  color: var(--orange) !important;
}

.badge.bg-info {
  background: var(--accent-soft) !important;
  color: var(--accent-hover) !important;
}

.badge.bg-secondary {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-muted) !important;
}

.badge.bg-primary {
  background: var(--accent-soft) !important;
  color: var(--accent-hover) !important;
}

/* ══════════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════════ */
.alert {
  border-radius: var(--radius-sm);
  border-width: 1px;
  font-size: 0.875rem;
}

.alert-success {
  background: var(--green-soft);
  border-color: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.alert-danger {
  background: var(--red-soft);
  border-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.alert-warning {
  background: var(--orange-soft);
  border-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.alert-info {
  background: var(--accent-soft);
  border-color: rgba(91, 124, 250, 0.2);
  color: #93b4fd;
}

/* ══════════════════════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════════════════════ */
.nav-tabs {
  border-bottom: 1px solid var(--border);
}

.nav-tabs .nav-link {
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 18px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--t);
}

.nav-tabs .nav-link:hover {
  color: var(--text-primary);
}

.nav-tabs .nav-link.active {
  color: var(--accent-hover);
  background: transparent;
  border-bottom-color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════
   FULLCALENDAR
   ══════════════════════════════════════════════════════════════ */
.fc {
  --fc-border-color: var(--border);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: rgba(255, 255, 255, 0.02);
  --fc-list-event-hover-bg-color: rgba(255, 255, 255, 0.04);
  --fc-today-bg-color: rgba(91, 124, 250, 0.06);
  --fc-event-bg-color: var(--accent);
  --fc-event-border-color: transparent;
}

.fc .fc-toolbar-title {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
}

.fc .fc-button {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-xs) !important;
}

.fc .fc-button:hover {
  background: var(--border-hover);
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--accent);
  border-color: var(--accent);
}

.fc .fc-col-header-cell-cushion {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fc .fc-daygrid-day-number {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  color: var(--accent-hover);
  font-weight: 700;
}

.fc .fc-event {
  border-radius: 5px;
  font-size: 0.78rem;
  padding: 2px 6px;
}

.fc .fc-list-event-title a {
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════════
   UTILITIES & MISC
   ══════════════════════════════════════════════════════════════ */

/* Progress */
.progress {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  height: 6px;
}

.progress-bar {
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  border-radius: 20px;
}

/* Divider */
hr,
.divider {
  border-color: var(--border) !important;
  opacity: 1;
}

/* Star rating */
.star-rating {
  color: var(--orange);
  letter-spacing: 2px;
}

/* Status colors */
.profit-positive {
  color: var(--green) !important;
}

.profit-negative {
  color: var(--red) !important;
}

.status-geplant {
  color: var(--orange);
}

.status-bestaetigt {
  color: var(--green);
}

.status-abgesagt {
  color: var(--red);
}

.status-abgeschlossen {
  color: var(--text-faint);
}

/* Text helpers */
.text-primary-custom {
  color: var(--text-primary) !important;
}

.text-muted-custom {
  color: var(--text-muted) !important;
}

.text-accent {
  color: var(--accent) !important;
}

.text-green {
  color: var(--green) !important;
}

.text-red {
  color: var(--red) !important;
}

.text-orange {
  color: var(--orange) !important;
}

/* BG glass util */
.bg-glass {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

/* Section chip header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

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

.empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h5 {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* Inline editing */
.inline-edit-field {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  border-radius: 6px;
  padding: 3px 8px;
  width: 100%;
  transition: all var(--t);
  font-size: inherit;
}

.inline-edit-field:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.inline-edit-field:focus {
  background: rgba(91, 124, 250, 0.06);
  border-color: var(--accent);
  outline: none;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 0.3s ease forwards;
}

/* Stagger children */
.stagger>*:nth-child(1) {
  animation-delay: 0.05s;
}

.stagger>*:nth-child(2) {
  animation-delay: 0.1s;
}

.stagger>*:nth-child(3) {
  animation-delay: 0.15s;
}

.stagger>*:nth-child(4) {
  animation-delay: 0.2s;
}

/* ══════════════════════════════════════════════════════════════
   CARD GRID SYSTEM (Phase 5)
   ══════════════════════════════════════════════════════════════ */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .grid-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Event Card */
.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.event-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--status-color, var(--border));
}

.event-card-header {
  padding: 16px 20px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.event-date-badge {
  text-align: center;
  line-height: 1.1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-width: 54px;
}

.event-date-day {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.event-date-month {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}

.event-card-body {
  padding: 10px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.35;
  display: block;
  margin-bottom: 2px;
}

.event-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.es-item {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 2px;
}

.es-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.event-card-actions {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Legal Footer Bar ───────────────────────────────────────── */
.app-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 28px;
  font-size: 0.75rem;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  background: var(--bg-sidebar);
  /* auto top margin pushes footer to bottom of flex column */
  margin: auto -28px 0 -28px;
}

.app-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t);
}

.app-footer a:hover {
  color: var(--accent);
}

.footer-sep {
  opacity: 0.4;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
}