:root {
  --bg: #0f1117;
  --sidebar-bg: #161b27;
  --card-bg: #1c2333;
  --border: #2a3347;
  --accent: #FF6B35;
  --accent-hover: #e85a24;
  --text-1: #e8eaf0;
  --text-2: #7a8499;
  --text-3: #4a5568;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --radius: 10px;
  --sidebar-w: 220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text-1); min-height: 100vh; font-size: 14px; }

/* ── Login ─────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 2.5rem 2rem; width: 100%; max-width: 380px; }
.login-logo { display: flex; align-items: center; gap: .6rem; margin-bottom: 2rem; }
.login-logo svg { width: 32px; height: 32px; }
.login-logo span { font-size: 1.1rem; font-weight: 700; color: var(--text-1); }
.login-card h1 { font-size: 1.1rem; font-weight: 600; margin-bottom: .3rem; }
.login-card p { color: var(--text-2); font-size: .85rem; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .8rem; color: var(--text-2); margin-bottom: .4rem; font-weight: 500; }
.form-group input { width: 100%; height: 40px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0 .9rem; color: var(--text-1); font-size: .9rem; outline: none; }
.form-group input:focus { border-color: var(--accent); }
.btn-primary { width: 100%; height: 42px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: .92rem; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--accent-hover); }
.login-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; border-radius: 8px; padding: .6rem .9rem; font-size: .83rem; margin-bottom: 1rem; }

/* ── Layout ────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; }
.sidebar-logo { display: flex; align-items: center; gap: .6rem; padding: 1.25rem 1.1rem; border-bottom: 1px solid var(--border); }
.sidebar-logo svg { width: 28px; height: 28px; }
.sidebar-logo span { font-size: .95rem; font-weight: 700; color: var(--text-1); }
.sidebar-logo small { font-size: .68rem; color: var(--text-2); margin-left: .2rem; }
.sidebar-nav { flex: 1; padding: .75rem 0; }
.nav-item { display: flex; align-items: center; gap: .65rem; padding: .6rem 1.1rem; color: var(--text-2); text-decoration: none; font-size: .85rem; font-weight: 500; border-radius: 0; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(255,255,255,.04); color: var(--text-1); }
.nav-item.active { background: rgba(255,107,53,.12); color: var(--accent); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-footer { padding: .75rem 1.1rem; border-top: 1px solid var(--border); }
.sidebar-footer a { color: var(--text-3); font-size: .8rem; text-decoration: none; }
.sidebar-footer a:hover { color: var(--text-2); }

.main { margin-left: var(--sidebar-w); flex: 1; padding: 2rem; }
.page-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-1); }

/* ── Stats grid ────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.stat-label { font-size: .75rem; color: var(--text-2); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .4rem; }
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--text-1); line-height: 1; }
.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.green .stat-value { color: var(--green); }

/* ── Live bar ──────────────────────────────────────────────── */
.live-bar { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.75rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); flex-shrink: 0; }
.live-dot.busy { background: var(--red); box-shadow: 0 0 6px var(--red); }
.live-label { font-size: .85rem; color: var(--text-2); }
.live-label strong { color: var(--text-1); }
.live-slots { display: flex; gap: .35rem; margin-left: auto; }
.slot { width: 22px; height: 22px; border-radius: 5px; background: var(--border); }
.slot.active { background: var(--green); }

/* ── Chart ─────────────────────────────────────────────────── */
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.75rem; }
@media (max-width: 900px) { .chart-row { grid-template-columns: 1fr; } }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.card-title { font-size: .8rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 1rem; }
.bar-chart { display: flex; align-items: flex-end; gap: .4rem; height: 80px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .35rem; height: 100%; justify-content: flex-end; }
.bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 3px; transition: height .3s; }
.bar-lbl { font-size: .65rem; color: var(--text-2); white-space: nowrap; }

/* ── Table ─────────────────────────────────────────────────── */
.table-wrap { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-header { padding: .85rem 1.2rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.table-header .card-title { margin: 0; }
table { width: 100%; border-collapse: collapse; }
th { padding: .65rem 1rem; text-align: left; font-size: .75rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02); }
td { padding: .7rem 1rem; font-size: .83rem; border-bottom: 1px solid var(--border); color: var(--text-1); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 5px; font-size: .72rem; font-weight: 600; }
.badge.used { background: rgba(239,68,68,.15); color: #fca5a5; }
.badge.unused { background: rgba(34,197,94,.12); color: #86efac; }
.badge.demo { background: rgba(245,158,11,.12); color: #fcd34d; }
.badge.paid { background: rgba(34,197,94,.12); color: #86efac; }
.mono { font-family: 'Courier New', monospace; font-size: .8rem; }
.text-2 { color: var(--text-2); }
.text-xs { font-size: .75rem; }

/* ── Actions ───────────────────────────────────────────────── */
.btn-sm { display: inline-flex; align-items: center; gap: .3rem; height: 28px; padding: 0 .7rem; border-radius: 6px; font-size: .76rem; font-weight: 600; border: none; cursor: pointer; }
.btn-sm.danger { background: rgba(239,68,68,.15); color: #fca5a5; }
.btn-sm.danger:hover { background: rgba(239,68,68,.25); }
.btn-sm.warn { background: rgba(245,158,11,.12); color: #fcd34d; }
.btn-sm.warn:hover { background: rgba(245,158,11,.22); }
.btn-sm.ok { background: rgba(34,197,94,.12); color: #86efac; }
.btn-sm.ok:hover { background: rgba(34,197,94,.22); }
.btn-accent { background: var(--accent); color: #fff; height: 36px; padding: 0 1rem; border-radius: 8px; font-size: .85rem; font-weight: 600; border: none; cursor: pointer; }
.btn-accent:hover { background: var(--accent-hover); }

/* ── Generate form ─────────────────────────────────────────── */
.gen-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.gen-form .fg { display: flex; flex-direction: column; gap: .3rem; }
.gen-form label { font-size: .75rem; color: var(--text-2); font-weight: 500; }
.gen-form input { height: 36px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0 .8rem; color: var(--text-1); font-size: .85rem; outline: none; min-width: 200px; }
.gen-form input:focus { border-color: var(--accent); }

/* ── Filter tabs ───────────────────────────────────────────── */
.filter-tabs { display: flex; gap: .4rem; }
.filter-tab { padding: .3rem .75rem; border-radius: 6px; font-size: .78rem; font-weight: 500; text-decoration: none; color: var(--text-2); background: transparent; border: 1px solid transparent; }
.filter-tab:hover { color: var(--text-1); background: rgba(255,255,255,.04); }
.filter-tab.active { background: rgba(255,107,53,.12); color: var(--accent); border-color: rgba(255,107,53,.2); }

/* ── Flash ─────────────────────────────────────────────────── */
.flash { padding: .7rem 1.2rem; border-radius: 8px; margin-bottom: 1.25rem; font-size: .85rem; }
.flash.ok { background: rgba(34,197,94,.12); color: #86efac; border: 1px solid rgba(34,197,94,.2); }
.flash.err { background: rgba(239,68,68,.12); color: #fca5a5; border: 1px solid rgba(239,68,68,.2); }

/* ── Empty state ───────────────────────────────────────────── */
.empty { text-align: center; padding: 3rem 1rem; color: var(--text-2); font-size: .88rem; }
