:root {
    --sb-w: 260px;
    --sb-bg: #0f172a;
    --sb-text: #94a3b8;
    --sb-active: #3b82f6;
    --sb-hover: #1e293b;
    --body-bg: #f1f5f9;
    --primary: #3b82f6;
    --primary-h: #2563eb;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
}

/* ─── Sidebar ─────────────────────────────────────── */
.bo-sidebar {
    width: var(--sb-w);
    background: var(--sb-bg);
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
}

.bo-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.bo-brand-name    { color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: .02em; }
.bo-brand-sub     { color: var(--sb-text); font-size: .7rem; margin-top: .15rem; }

.bo-nav           { flex: 1; padding: .75rem 0; }

.bo-nav-section {
    padding: .5rem 1.25rem .2rem;
    color: rgba(255,255,255,.25);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.bo-nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    margin: .1rem .75rem;
    color: var(--sb-text);
    text-decoration: none;
    font-size: .875rem;
    border-radius: 8px;
    transition: background .15s, color .15s;
}

.bo-nav-link:hover           { background: var(--sb-hover); color: #fff; }
.bo-nav-link.active          { background: rgba(59,130,246,.15); color: var(--sb-active); }
.bo-nav-link i               { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

.bo-user-area {
    padding: .875rem 1rem;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    gap: .75rem;
}

.bo-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: .8rem; font-weight: 700;
    flex-shrink: 0;
}

.bo-user-name { color: #fff; font-size: .8rem; font-weight: 500; }
.bo-user-role { color: var(--sb-text); font-size: .7rem; }

/* ─── Main layout ─────────────────────────────────── */
.bo-main    { margin-left: var(--sb-w); min-height: 100vh; background: var(--body-bg); }

.bo-topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: .875rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
}

.bo-page-title { font-size: 1.15rem; font-weight: 600; color: var(--text); }

.bo-content { padding: 1.5rem; }

/* ─── Cards ───────────────────────────────────────── */
.bo-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.bo-card-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}

.bo-card-title { font-size: 1rem; font-weight: 600; color: var(--text); }

/* ─── Stat cards ──────────────────────────────────── */
.bo-stat {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.bo-stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}

.bo-stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.bo-stat-label { font-size: .78rem; color: var(--muted); margin-top: .2rem; }

/* ─── Table ───────────────────────────────────────── */
.bo-table { width: 100%; border-collapse: separate; border-spacing: 0; }

.bo-table th {
    font-size: .72rem; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: .05em;
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    white-space: nowrap;
}

.bo-table td {
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: .875rem;
    color: var(--text);
    vertical-align: middle;
}

.bo-table tr:last-child td { border-bottom: none; }
.bo-table tbody tr:hover   { background: #f8fafc; }

/* ─── Badges ──────────────────────────────────────── */
.badge-role {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .72rem; font-weight: 500;
}

.badge-admin   { background: #fef3c7; color: #92400e; }
.badge-manager { background: #dbeafe; color: #1e40af; }
.badge-user    { background: #dcfce7; color: #166534; }
.badge-ok      { background: #dcfce7; color: #166534; }
.badge-off     { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef9c3; color: #854d0e; }

/* ─── Buttons ─────────────────────────────────────── */
.btn-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--muted);
    font-size: .875rem;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}
.btn-icon:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-icon.danger:hover { background: #ef4444; border-color: #ef4444; }

/* ─── Auth pages ──────────────────────────────────── */
.auth-bg {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #0f172a 100%);
    padding: 2rem;
}

.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 2.25rem 2.5rem;
    width: 100%; max-width: 440px;
    box-shadow: 0 24px 48px rgba(0,0,0,.28);
}

.auth-logo {
    width: 54px; height: 54px;
    background: var(--primary);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.4rem;
    margin: 0 auto 1.25rem;
}

.auth-title    { font-size: 1.4rem; font-weight: 700; color: var(--text); text-align: center; margin-bottom: .35rem; }
.auth-subtitle { color: var(--muted); text-align: center; font-size: .875rem; margin-bottom: 1.75rem; }

.auth-form .form-label { font-size: .85rem; font-weight: 500; color: var(--text); margin-bottom: .3rem; }

.auth-form .form-control {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: .6rem .875rem;
    font-size: .9rem;
    transition: border-color .15s, box-shadow .15s;
}
.auth-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

.btn-auth {
    background: var(--primary); color: #fff;
    border: none; border-radius: 10px;
    padding: .7rem 1.5rem; font-size: .9rem; font-weight: 600;
    width: 100%; cursor: pointer;
    transition: background .15s, transform .1s, box-shadow .15s;
}
.btn-auth:hover {
    background: var(--primary-h);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,130,246,.35);
}

.auth-link { font-size: .85rem; color: var(--primary); text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

/* ─── OTP input ───────────────────────────────────── */
.otp-input {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .5rem;
    text-align: center;
    border-radius: 12px;
    padding: .75rem 1rem;
}

/* ─── Recovery codes ──────────────────────────────── */
.recovery-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
    background: #f8fafc; border-radius: 10px; padding: 1rem;
    border: 1px solid var(--border);
}
.recovery-code {
    font-family: 'Courier New', monospace; font-size: .85rem;
    background: #fff; border: 1px solid var(--border);
    border-radius: 6px; padding: .3rem .6rem; text-align: center;
}

/* ─── QR code ─────────────────────────────────────── */
.qr-wrap {
    display: flex; justify-content: center;
    background: #fff; border-radius: 10px;
    border: 1px solid var(--border); padding: 1rem;
    margin: 1rem 0;
}

/* ─── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
    .bo-sidebar { transform: translateX(-100%); transition: transform .25s; }
    .bo-sidebar.open { transform: translateX(0); }
    .bo-main { margin-left: 0; }
    .bo-topbar { padding: .75rem 1rem; }
    .bo-content { padding: 1rem; }
}
