:root {
    --brand: #4f46e5;
    --brand-2: #6366f1;
    --sidebar-bg: #0f172a;
    --sidebar-bg-2: #131c31;
    --sidebar-text: #94a3b8;
    --sidebar-active: #e2e8f0;
    --bg: #f4f6fb;
    --panel: #ffffff;
    --border: #e6e9f2;
    --ink: #1e293b;
    --muted: #64748b;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

.brand-dot { width: 12px; height: 12px; border-radius: 4px; background: linear-gradient(135deg, var(--brand), #22d3ee); display: inline-block; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 256px; background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
    color: var(--sidebar-text); flex-shrink: 0; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.05rem; padding: 6px 10px 22px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin-bottom: 3px;
    border-radius: 9px; color: var(--sidebar-text); text-decoration: none; font-size: .93rem; transition: all .15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: var(--sidebar-active); }
.sidebar-nav a.active { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(79,70,229,.35); }
.sidebar-nav a i { font-size: 1.05rem; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #475569; margin: 18px 12px 8px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 62px; background: var(--panel); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-weight: 600; font-size: 1.05rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--muted); }
.btn-ghost:hover { background: #f1f5f9; }
.content { padding: 24px; }

.user-chip { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 500; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; }

.locale-switch, .guest-locale { display: flex; gap: 4px; }
.locale-switch a, .guest-locale a {
    padding: 3px 9px; font-size: .78rem; font-weight: 600; border-radius: 6px; color: var(--muted); text-decoration: none;
}
.locale-switch a.active, .guest-locale a.active { background: var(--brand); color: #fff; }

/* ---------- Panels & stats ---------- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.panel-head { padding: 15px 18px; font-weight: 600; border-bottom: 1px solid var(--border); }
.panel-body { padding: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; }
.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.stat-label { color: var(--muted); font-size: .82rem; margin-top: 3px; }
.bg-primary-soft { background: #eef2ff; color: var(--brand); }
.bg-success-soft { background: #ecfdf5; color: #059669; }
.bg-warning-soft { background: #fffbeb; color: #d97706; }
.bg-info-soft { background: #eff6ff; color: #2563eb; }
.bg-dark-soft { background: #e2e8f0; color: #334155; }

.table-clean th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); }
.table-clean td { vertical-align: middle; border-bottom: 1px solid var(--border); }
.table-clean tr:last-child td { border-bottom: none; }

/* ---------- Guest (auth) ---------- */
.guest-body { background: radial-gradient(1200px 600px at 20% -10%, #1e293b, #0f172a); min-height: 100vh; }
.guest-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.guest-card { width: 100%; max-width: 410px; background: #fff; border-radius: 18px; padding: 32px; box-shadow: 0 30px 60px rgba(2,6,23,.45); }
.guest-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.guest-brand h1 { font-size: 1.15rem; margin: 0; font-weight: 700; }
.guest-brand p { margin: 0; font-size: .8rem; color: var(--muted); }
.guest-heading { font-size: 1.35rem; font-weight: 700; margin-bottom: 18px; }
.guest-form .form-label { font-size: .82rem; font-weight: 600; color: #475569; }
.guest-link { font-size: .85rem; color: var(--brand); text-decoration: none; display: block; text-align: center; }
.guest-locale { justify-content: center; margin-top: 20px; }

/* ---------- Buttons ---------- */
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: #4338ca; border-color: #4338ca; }

/* ---------- Error pages ---------- */
.error-page { text-align: center; padding: 40px 10px; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--brand); line-height: 1; }
.error-text { color: var(--muted); margin: 12px 0 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .sidebar { position: fixed; left: -260px; z-index: 40; transition: left .25s; }
    .sidebar.open { left: 0; }
}
