:root {
  --bg:         #0b0d14;
  --surface:    #111520;
  --card-bg:    rgba(22, 27, 45, 0.85);
  --border:     rgba(255, 255, 255, 0.07);
  --input-bg:   rgba(255, 255, 255, 0.05);
  --text:       #e8eaf6;
  --text-muted: #6b7280;
  --text-dim:   #9ca3af;
  --accent:     #8b5cf6;
  --accent-2:   #06b6d4;
  --success:    #10b981;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --gradient:   linear-gradient(135deg, #8b5cf6, #06b6d4);
  --sidebar-w:  240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform 0.3s;
}
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo {
  width: 38px; height: 38px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(139,92,246,0.35);
}
.sidebar-title { font-size: 1rem; font-weight: 700; }
.sidebar-subtitle { font-size: 0.7rem; color: var(--text-muted); }

.nav-section { padding: 20px 12px 8px; }
.nav-label { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; padding: 0 8px; margin-bottom: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  cursor: pointer; font-size: 0.875rem; font-weight: 500;
  color: var(--text-dim); transition: background 0.15s, color 0.15s;
  text-decoration: none; user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-item.active { background: rgba(139,92,246,0.15); color: var(--accent); }
.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  margin-top: auto; padding: 16px 12px;
  border-top: 1px solid var(--border);
}

/* ── Main Layout ─────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,13,20,0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar h2 { font-size: 1.1rem; font-weight: 600; }
.page-content { padding: 28px; flex: 1; }

/* ── Cards ───────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s;
}
.card:hover { border-color: rgba(139,92,246,0.2); }
.card-title { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px; }

/* ── Stat Cards ──────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; }
.stat-icon { font-size: 1.6rem; margin-bottom: 10px; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* ── Grid ────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ── Progress Bar ────────────────────────────── */
.progress-wrap { margin: 10px 0 4px; }
.progress-header { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 6px; }
.progress-track { height: 6px; background: rgba(255,255,255,0.07); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width 0.6s ease; background: var(--gradient); }
.progress-fill.danger { background: linear-gradient(90deg, #ef4444, #f87171); }
.progress-fill.warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* ── Store Cards ─────────────────────────────── */
.stores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.store-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; cursor: pointer; transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
.store-card:hover { border-color: rgba(139,92,246,0.35); transform: translateY(-2px); background: rgba(139,92,246,0.07); }
.store-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.store-avatar {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--gradient); display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.store-name { font-size: 0.95rem; font-weight: 600; }
.store-domain { font-size: 0.75rem; color: var(--text-muted); }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; font-weight: 600; padding: 2px 8px;
  border-radius: 99px; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-green  { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-red    { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-yellow { background: rgba(245,158,11,0.15); color: #fbbf24; }

/* ── Tables ──────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; }
td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--text-dim); }
tr:hover td { background: rgba(255,255,255,0.02); }
tr:last-child td { border-bottom: none; }

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 9px;
  font-size: 0.85rem; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; transition: opacity 0.2s, transform 0.15s;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 4px 12px rgba(139,92,246,0.3); }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

/* ── Forms ───────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); font-size: 0.9rem; font-family: inherit;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,92,246,0.12); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ── Toggle ──────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle { position: relative; width: 44px; height: 24px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0; background: rgba(255,255,255,0.1);
  border-radius: 99px; transition: background 0.25s;
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: #fff;
  border-radius: 50%; transition: transform 0.25s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }

/* ── Alerts ──────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 9px; font-size: 0.85rem; margin-bottom: 16px; }
.alert-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.alert-error   { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }

/* ── Misc ────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.justify-between { justify-content: space-between; }
.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 18px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.loading { text-align:center; padding:60px; color: var(--text-muted); font-size:1.5rem; }
.empty-state { text-align:center; padding:60px 20px; color: var(--text-muted); }
.empty-icon { font-size:3rem; margin-bottom:12px; }
