/* ============================================================
   AVIRONA MASTERS - Dark Futuristic Theme
   BEM class names matching app.html
   ============================================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0e0e18;
  --bg-card: rgba(20, 20, 35, 0.8);
  --bg-card-solid: #141423;
  --bg-input: rgba(10, 10, 20, 0.9);
  --bg-sidebar: #0c0c16;
  --bg-topbar: rgba(10, 10, 20, 0.85);
  --bg-hover: rgba(0, 212, 255, 0.06);
  --bg-modal-overlay: rgba(0, 0, 0, 0.7);
  --color-primary: #00d4ff;
  --color-primary-rgb: 0, 212, 255;
  --color-secondary: #bd00ff;
  --color-success: #00ff88;
  --color-warning: #ffaa00;
  --color-error: #ff4466;
  --text-primary: #e0e0e0;
  --text-secondary: #aaa;
  --text-muted: #666;
  --text-heading: #f0f0f0;
  --text-on-accent: #000;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-light: rgba(255, 255, 255, 0.1);
  --gradient-primary: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  --gradient-primary-hover: linear-gradient(135deg, #00e5ff, #d000ff);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.1);
  --font-heading: 'Orbitron', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --sidebar-width: 220px;
  --topbar-height: 56px;
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.2s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); color: var(--text-heading); line-height: 1.3; letter-spacing: 0.5px; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: #fff; }
::selection { background: rgba(0,212,255,0.3); color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }


/* ============================================================
   AUTH LOADING
   ============================================================ */
.auth-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; color: var(--text-muted); font-size: 0.9rem;
}
.auth-loading__spinner {
  width: 32px; height: 32px; border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--color-primary); border-radius: 50%;
  animation: spin 0.7s linear infinite; margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-container {
  display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(0,212,255,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(189,0,255,0.05) 0%, transparent 50%);
}
.login-card {
  width: 100%; max-width: 400px; padding: 44px 36px;
  background: var(--bg-card); backdrop-filter: blur(20px);
  border: 1px solid var(--border-color-light); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); position: relative;
  animation: fadeUp 0.5s ease-out;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.login-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--gradient-primary); border-radius: var(--radius) var(--radius) 0 0; }
.login-title {
  text-align: center; font-size: 1.6rem; font-weight: 700; letter-spacing: 3px; margin-bottom: 6px;
  background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.login-subtitle { text-align: center; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 32px; }
.login-card .form-group { margin-bottom: 18px; }
.login-card .form-group label { display: block; font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.5px; text-transform: uppercase; font-family: var(--font-heading); }
.login-card .form-group input {
  width: 100%; padding: 11px 14px; background: var(--bg-input);
  border: 1px solid var(--border-color-light); border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: var(--font-body); font-size: 0.9rem; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.login-card .form-group input::placeholder { color: var(--text-muted); opacity: 0.5; }
.login-card .form-group input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(0,212,255,0.1); }
.login-card .btn-primary, .login-card .btn.btn-primary {
  width: 100%; margin-top: 6px; padding: 13px; font-size: 0.9rem; letter-spacing: 2px;
  text-transform: uppercase; font-family: var(--font-heading); background: var(--gradient-primary);
  color: var(--text-on-accent); border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 600; transition: all var(--transition); box-shadow: 0 2px 12px rgba(0,212,255,0.2);
}
.login-card .btn-primary:hover { box-shadow: 0 4px 20px rgba(0,212,255,0.35); transform: translateY(-1px); }
.login-error { background: rgba(255,68,102,0.1); border: 1px solid rgba(255,68,102,0.3); color: var(--color-error); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.82rem; margin-bottom: 18px; display: none; }
.login-error.visible { display: block; }
.login-footer { text-align: center; margin-top: 28px; font-size: 0.72rem; color: var(--text-muted); letter-spacing: 1px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.2); border-top-color: #000; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle; margin-right: 6px; }


/* ============================================================
   APP LAYOUT
   ============================================================ */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.content { flex: 1; padding: 20px 24px 32px; }


/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed; top: 0; left: 0; width: var(--sidebar-width); height: 100vh;
  background: var(--bg-sidebar); border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column; z-index: 100; overflow-y: auto; overflow-x: hidden;
  transition: transform var(--transition);
}
.sidebar__header { padding: 18px 16px 14px; text-align: center; border-bottom: 1px solid var(--border-color); }
.sidebar__logo {
  font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; letter-spacing: 2px;
  background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar__subtitle { display: block; font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; letter-spacing: 0.5px; }
.sidebar__nav { flex: 1; padding: 8px 0; }
.sidebar__section { margin-bottom: 4px; }
.sidebar__section-title { display: block; padding: 12px 16px 4px; font-size: 0.6rem; font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); }
.sidebar__link {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px; margin: 1px 8px;
  color: var(--text-secondary); font-size: 0.85rem; border-radius: var(--radius-sm);
  transition: all var(--transition); position: relative;
}
.sidebar__link:hover { color: var(--text-primary); background: var(--bg-hover); }
.sidebar__link--active { color: var(--color-primary) !important; background: rgba(0,212,255,0.08); }
.sidebar__link--active::before {
  content: ''; position: absolute; left: 0; top: 20%; height: 60%; width: 2px;
  background: var(--color-primary); border-radius: 0 2px 2px 0;
}
.sidebar__icon { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar__footer { padding: 12px 8px; border-top: 1px solid var(--border-color); }
.sidebar__logout-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 16px;
  background: none; border: none; color: var(--text-muted); font-size: 0.82rem;
  font-family: var(--font-body); cursor: pointer; border-radius: var(--radius-sm); transition: all var(--transition);
}
.sidebar__logout-btn:hover { color: var(--color-error); background: rgba(255,68,102,0.06); }
.sidebar--collapsed { transform: translateX(-100%); }


/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: var(--topbar-height); background: var(--bg-topbar);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-color);
}
.topbar__left { display: flex; align-items: center; gap: 12px; }
.topbar__burger { display: none; background: none; border: none; color: var(--text-primary); cursor: pointer; padding: 4px; }
.topbar__burger svg { width: 22px; height: 22px; }
.topbar__title { font-size: 1rem; letter-spacing: 1px; font-weight: 600; }
.topbar__right { display: flex; align-items: center; gap: 12px; }
.topbar__user { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.topbar__user-name { color: var(--text-primary); font-weight: 500; }
.topbar__role-badge {
  font-size: 0.65rem; padding: 2px 8px; border-radius: 10px; text-transform: uppercase;
  font-weight: 600; letter-spacing: 0.5px; background: rgba(0,212,255,0.1); color: var(--color-primary);
}
.topbar__role-badge[data-role="owner"] { background: rgba(189,0,255,0.12); color: var(--color-secondary); }
.topbar__logout-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.topbar__logout-btn:hover { color: var(--color-error); }
.topbar__logout-btn svg { width: 18px; height: 18px; }


/* ============================================================
   PAGE SECTIONS
   ============================================================ */
.page { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }


/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stats-grid--3 { grid-template-columns: repeat(3, 1fr); }
.stat-card {
  display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius);
  transition: all var(--transition); position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--gradient-primary); opacity: 0; transition: opacity var(--transition); }
.stat-card:hover { border-color: rgba(0,212,255,0.12); box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.stat-card:hover::before { opacity: 1; }
.stat-card__icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card__icon svg { width: 18px; height: 18px; }
.stat-card__icon--blue { background: rgba(0,212,255,0.1); color: var(--color-primary); }
.stat-card__icon--green { background: rgba(0,255,136,0.1); color: var(--color-success); }
.stat-card__icon--orange { background: rgba(255,170,0,0.1); color: var(--color-warning); }
.stat-card__icon--purple { background: rgba(189,0,255,0.1); color: var(--color-secondary); }
.stat-card__icon--cyan { background: rgba(0,212,255,0.1); color: var(--color-primary); }
.stat-card__icon--yellow { background: rgba(255,200,0,0.1); color: #ffc800; }
.stat-card__body { min-width: 0; }
.stat-card__label { display: block; font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px; }
.stat-card__value { display: block; font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; color: var(--text-heading); line-height: 1.2; }


/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius);
  margin-bottom: 18px; transition: border-color var(--transition); position: relative; overflow: hidden;
}
.card:hover { border-color: rgba(0,212,255,0.08); }
.card__header {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}
.card__title { font-size: 0.85rem; letter-spacing: 0.8px; font-weight: 600; }
.card__link { font-size: 0.78rem; color: var(--color-primary); }
.card__body { padding: 18px; }
.card__body--no-padding { padding: 0; }
.card--flex-1 { flex: 1; min-width: 0; }
.card--flex-2 { flex: 2; min-width: 0; }
.dashboard-row, .analytics-row { display: flex; gap: 18px; margin-bottom: 18px; }


/* ============================================================
   TABLES
   ============================================================ */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.table thead { background: rgba(20,20,35,0.5); }
.table th {
  padding: 10px 14px; text-align: left; font-family: var(--font-heading); font-size: 0.65rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted);
  border-bottom: 1px solid rgba(0,212,255,0.15); white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border-color); color: var(--text-secondary); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover td { background: var(--bg-hover); color: var(--text-primary); }
.table__empty { text-align: center; color: var(--text-muted); padding: 32px 14px !important; font-size: 0.85rem; }
.table__row--clickable { cursor: pointer; }
.table__th-check, .table__td-check { width: 36px; text-align: center; }
.table--sm th { padding: 8px 12px; }
.table--sm td { padding: 8px 12px; font-size: 0.8rem; }


/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; font-size: 0.68rem;
  font-weight: 600; border-radius: 20px; letter-spacing: 0.3px; text-transform: uppercase; white-space: nowrap;
  background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid var(--border-color);
}
.badge--sm { padding: 2px 7px; font-size: 0.62rem; }
.badge--blue { background: rgba(0,212,255,0.1); color: var(--color-primary); border-color: rgba(0,212,255,0.2); }
.badge--green { background: rgba(0,255,136,0.1); color: var(--color-success); border-color: rgba(0,255,136,0.2); }
.badge--red { background: rgba(255,68,102,0.1); color: var(--color-error); border-color: rgba(255,68,102,0.2); }
.badge--orange { background: rgba(255,170,0,0.1); color: var(--color-warning); border-color: rgba(255,170,0,0.2); }
.badge--purple { background: rgba(189,0,255,0.1); color: var(--color-secondary); border-color: rgba(189,0,255,0.2); }
.badge--cyan { background: rgba(0,212,255,0.1); color: var(--color-primary); border-color: rgba(0,212,255,0.2); }
.badge--yellow { background: rgba(255,200,0,0.1); color: #ffc800; border-color: rgba(255,200,0,0.2); }
.badges-wrap { display: flex; flex-wrap: wrap; gap: 4px; }


/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; font-family: var(--font-body); font-size: 0.82rem; font-weight: 500;
  border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--transition); outline: none; white-space: nowrap; line-height: 1.4;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--gradient-primary); color: var(--text-on-accent); font-weight: 600; border: none; box-shadow: 0 2px 10px rgba(0,212,255,0.15); }
.btn--primary:hover { box-shadow: 0 4px 18px rgba(0,212,255,0.3); transform: translateY(-1px); }
.btn--secondary { background: rgba(189,0,255,0.12); color: var(--color-secondary); border-color: rgba(189,0,255,0.25); }
.btn--secondary:hover { background: rgba(189,0,255,0.2); }
.btn--success { background: rgba(0,255,136,0.12); color: var(--color-success); border-color: rgba(0,255,136,0.25); }
.btn--success:hover { background: rgba(0,255,136,0.2); }
.btn--danger { background: rgba(255,68,102,0.12); color: var(--color-error); border-color: rgba(255,68,102,0.25); }
.btn--danger:hover { background: rgba(255,68,102,0.2); }
.btn--outline { background: transparent; color: var(--text-secondary); border-color: var(--border-color-light); }
.btn--outline:hover { color: var(--color-primary); border-color: rgba(0,212,255,0.25); background: rgba(0,212,255,0.04); }
.btn--outline.btn--active { color: var(--color-primary); border-color: rgba(0,212,255,0.4); background: rgba(0,212,255,0.08); }
.btn--ghost { background: transparent; border: none; color: var(--text-secondary); padding: 6px 10px; }
.btn--ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.btn--sm { padding: 5px 10px; font-size: 0.75rem; }
.btn--block { width: 100%; }
.btn--icon { padding: 6px; border-radius: var(--radius-sm); }
.btn--danger-text { color: var(--text-muted); }
.btn--danger-text:hover { color: var(--color-error) !important; background: rgba(255,68,102,0.06); }
.btn-group { display: flex; gap: 4px; }
.action-btns { display: flex; gap: 2px; }
.quick-actions { display: flex; flex-direction: column; gap: 10px; }
.quick-actions .btn { justify-content: flex-start; text-align: left; }


/* ============================================================
   FORMS
   ============================================================ */
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px; background: var(--bg-input);
  border: 1px solid var(--border-color-light); border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: var(--font-body); font-size: 0.85rem; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(0,212,255,0.08); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); opacity: 0.5; }
.form-select {
  appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23888' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.form-select option { background: var(--bg-card-solid); color: var(--text-primary); }
.form-textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.form-label { display: block; font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 5px; font-weight: 500; }
.form-label--inline { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.form-checkbox { accent-color: var(--color-primary); }
.form-hint { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; display: block; }
.form-group { margin-bottom: 14px; }
.form-group--half { flex: 1; min-width: 0; }
.form-row { display: flex; gap: 14px; }
.form-grid { }
.form-grid--narrow { max-width: 420px; }
.form-fieldset { border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 18px; }
.form-legend { font-family: var(--font-heading); font-size: 0.75rem; color: var(--color-primary); letter-spacing: 0.5px; padding: 0 8px; }
.form-actions { margin-top: 8px; }
.required { color: var(--color-error); }
.checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checkbox-item { font-size: 0.82rem; }
.inline-form { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.inline-form .form-input { max-width: 240px; }


/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar--wrap { flex-wrap: wrap; }
.filter-bar__group { flex-shrink: 0; }
.filter-bar__group--grow { flex: 1; min-width: 140px; }
.filter-bar__group .form-select, .filter-bar__group .form-input { min-width: 120px; }


/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 16px 0; flex-wrap: wrap; }
.pagination__btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px;
  padding: 0 8px; background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.78rem; cursor: pointer;
  transition: all var(--transition); font-family: var(--font-body);
}
.pagination__btn:hover { border-color: rgba(0,212,255,0.2); color: var(--color-primary); }
.pagination__btn--active { background: var(--gradient-primary); color: var(--text-on-accent); border: none; font-weight: 600; }
.pagination__btn:disabled { opacity: 0.3; cursor: not-allowed; }
.pagination__dots { color: var(--text-muted); font-size: 0.8rem; padding: 0 4px; }
.pagination__info { font-size: 0.75rem; color: var(--text-muted); margin-left: 10px; }


/* ============================================================
   CHARTS
   ============================================================ */
.chart-container { position: relative; width: 100%; min-height: 220px; }
.chart-container--square { min-height: 260px; }


/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar { width: 100%; height: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.progress-bar--sm { height: 4px; }
.progress-bar__fill { height: 100%; background: var(--gradient-primary); border-radius: 3px; transition: width 0.4s ease; }
.rating-cell { display: flex; align-items: center; gap: 8px; }
.rating-cell__value { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; color: var(--text-heading); min-width: 24px; }
.master-name strong { display: block; }
.master-name small { color: var(--text-muted); font-size: 0.72rem; }


/* ============================================================
   FUNNEL
   ============================================================ */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel__step { display: flex; align-items: center; gap: 14px; }
.funnel__bar { flex: 1; height: 28px; background: rgba(255,255,255,0.03); border-radius: var(--radius-sm); overflow: hidden; }
.funnel__fill { height: 100%; background: var(--gradient-primary); border-radius: var(--radius-sm); transition: width 0.6s ease; min-width: 4px; }
.funnel__fill--danger { background: linear-gradient(135deg, var(--color-error), #ff6688); }
.funnel__info { min-width: 140px; display: flex; align-items: center; gap: 8px; }
.funnel__label { font-size: 0.78rem; color: var(--text-secondary); }
.funnel__count { font-family: var(--font-heading); font-size: 0.85rem; color: var(--text-heading); font-weight: 600; }


/* ============================================================
   DETAIL GRID (Order Detail Modal)
   ============================================================ */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 20px; }
.detail-grid__item { }
.detail-grid__item--full { grid-column: 1 / -1; }
.detail-grid__label { display: block; font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.detail-grid__value { font-size: 0.88rem; color: var(--text-primary); }
.detail-section { margin-top: 20px; }
.detail-section__title { font-size: 0.78rem; letter-spacing: 0.5px; margin-bottom: 10px; color: var(--color-primary); }


/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { display: flex; flex-direction: column; gap: 12px; padding-left: 8px; }
.timeline__item { display: flex; align-items: flex-start; gap: 10px; }
.timeline__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); margin-top: 6px; flex-shrink: 0; }
.timeline__dot--blue { background: var(--color-primary); }
.timeline__dot--green { background: var(--color-success); }
.timeline__dot--orange { background: var(--color-warning); }
.timeline__dot--red { background: var(--color-error); }
.timeline__dot--purple { background: var(--color-secondary); }
.timeline__dot--cyan { background: var(--color-primary); }
.timeline__content { min-width: 0; }
.timeline__text { font-size: 0.82rem; color: var(--text-primary); }
.timeline__date { font-size: 0.72rem; color: var(--text-muted); margin-left: 8px; }
.timeline__comment { display: block; font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }


/* ============================================================
   MODALS
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--bg-modal-overlay); backdrop-filter: blur(4px);
  z-index: 999; opacity: 0; transition: opacity var(--transition);
}
.modal-backdrop.active { opacity: 1; }
.modal {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition); pointer-events: none;
}
.modal.active { opacity: 1; pointer-events: auto; }
.modal__dialog {
  width: 90%; max-width: 480px; max-height: 85vh; background: var(--bg-card-solid);
  border: 1px solid var(--border-color-light); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
  transform: scale(0.96) translateY(8px); transition: transform var(--transition);
}
.modal.active .modal__dialog { transform: scale(1) translateY(0); }
.modal__dialog--sm { max-width: 380px; }
.modal__dialog--lg { max-width: 560px; }
.modal__dialog--xl { max-width: 720px; }
.modal__header {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}
.modal__title { font-size: 0.9rem; letter-spacing: 0.8px; }
.modal__close { background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; padding: 2px 6px; line-height: 1; transition: color var(--transition); }
.modal__close:hover { color: var(--color-error); }
.modal__body { padding: 20px; overflow-y: auto; flex: 1; }
.modal__footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border-color); }
.modal__footer-actions { display: flex; gap: 6px; }
.modal-confirm__message { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; }
.rating-info { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 0.85rem; }
.rating-info__label { color: var(--text-muted); }
.rating-info__value { color: var(--text-heading); font-weight: 600; }


/* ============================================================
   TOASTS
   ============================================================ */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 400px;
  padding: 12px 16px; background: var(--bg-card-solid); border: 1px solid var(--border-color-light);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  transform: translateX(100%); opacity: 0; transition: all 0.3s ease;
}
.toast--visible { transform: translateX(0); opacity: 1; }
.toast--hiding { transform: translateX(40px); opacity: 0; }
.toast--success { border-left: 3px solid var(--color-success); }
.toast--error { border-left: 3px solid var(--color-error); }
.toast--warning { border-left: 3px solid var(--color-warning); }
.toast--info { border-left: 3px solid var(--color-primary); }
.toast__icon { flex-shrink: 0; }
.toast__icon svg { width: 18px; height: 18px; }
.toast--success .toast__icon { color: var(--color-success); }
.toast--error .toast__icon { color: var(--color-error); }
.toast--warning .toast__icon { color: var(--color-warning); }
.toast--info .toast__icon { color: var(--color-primary); }
.toast__message { flex: 1; font-size: 0.82rem; color: var(--text-primary); }
.toast__close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: 0; line-height: 1; }
.toast__close:hover { color: var(--text-primary); }


/* ============================================================
   TAGS (Settings page)
   ============================================================ */
.tags-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  background: rgba(0,212,255,0.06); border: 1px solid rgba(0,212,255,0.15); border-radius: 20px;
  font-size: 0.78rem; color: var(--text-primary);
}
.tag--loading { background: none; border: none; color: var(--text-muted); }
.tag--muted { background: none; border: 1px solid var(--border-color); color: var(--text-muted); }
.tag__remove {
  background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.9rem;
  padding: 0 2px; line-height: 1; transition: color var(--transition);
}
.tag__remove:hover { color: var(--color-error); }


/* ============================================================
   MISC
   ============================================================ */
.text-muted { color: var(--text-muted) !important; }
input[type="checkbox"] { accent-color: var(--color-primary); cursor: pointer; }


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .dashboard-row, .analytics-row { flex-direction: column; }
  .stats-grid--3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.sidebar--open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .topbar__burger { display: inline-flex; }
  .content { padding: 14px 14px 24px; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar__group { width: 100%; }
  .filter-bar__group .form-select, .filter-bar__group .form-input { width: 100%; }
  .form-row { flex-direction: column; gap: 0; }
  .modal__dialog { width: 95%; max-height: 90vh; }
  .detail-grid { grid-template-columns: 1fr; }
  .toast-container { left: 12px; right: 12px; }
  .toast { min-width: auto; }
}
@media (max-width: 480px) {
  .login-card { padding: 32px 22px; }
  .login-title { font-size: 1.3rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card__value { font-size: 1.1rem; }
}
