:root {
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --sidebar-bg: #111827;
    --sidebar-fg: #cbd5e1;
    --sidebar-fg-active: #ffffff;
    --sidebar-active-bg: #1f2937;
    --content-bg: #f3f4f6;
    --border: #e5e7eb;
}

* { box-sizing: border-box; }

body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* ------------------------------------------------------------------ Guest */
.guest-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #111827 100%);
    display: flex;
}
.guest-main {
    margin: auto;
    width: 100%;
    padding: 24px;
}
.guest-card-wrap { max-width: 400px; margin: 0 auto; }
.guest-brand { color: #fff; font-size: 1.5rem; font-weight: 700; letter-spacing: .3px; }
.guest-body .text-muted { color: rgba(255, 255, 255, .65) !important; }
.guest-card { border: none; border-radius: 12px; }
.guest-card .text-muted { color: #6b7280 !important; }
.error-code { font-size: 3.5rem; font-weight: 800; color: #1e3a8a; line-height: 1; }

/* ------------------------------------------------------------------ Shell */
.app-body { background: var(--content-bg); }
.app-shell { min-height: 100vh; }

.app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
    transition: transform .2s ease;
}
.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    color: #fff;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sidebar-logo { color: #fbbf24; font-size: 1.25rem; }
.sidebar-title { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { padding: 12px 0 24px; }
.sidebar-group-label {
    padding: 16px 20px 6px;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6b7280;
    font-weight: 600;
}
.sidebar-menu { list-style: none; margin: 0; padding: 0; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--sidebar-fg);
    text-decoration: none;
    font-size: .9rem;
    border-left: 3px solid transparent;
}
.sidebar-link i:first-child { width: 18px; text-align: center; font-size: 1rem; }
.sidebar-link:hover { background: var(--sidebar-active-bg); color: var(--sidebar-fg-active); }
.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-fg-active);
    border-left-color: #3b82f6;
}
.sidebar-link.disabled { color: #4b5563; cursor: not-allowed; }
.sidebar-link.disabled:hover { background: transparent; color: #4b5563; }
.sidebar-lock { margin-left: auto; font-size: .7rem; }

/* ------------------------------------------------------------------ Main */
.app-main { margin-left: var(--sidebar-width); min-height: 100vh; }
.app-topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 1.1rem; font-weight: 600; margin: 0; }
.btn-icon { border: none; background: transparent; font-size: 1.4rem; line-height: 1; padding: 4px 8px; }

.btn-account {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 12px 4px 4px;
}
.account-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: #1e3a8a;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.account-meta { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.account-name { font-size: .85rem; font-weight: 600; color: #111827; }
.account-role { font-size: .72rem; color: #6b7280; }

.app-content { padding: 24px; }
.app-breadcrumb { margin-bottom: 16px; }
.app-breadcrumb .breadcrumb { font-size: .85rem; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-size: 1.4rem; font-weight: 700; margin: 0; }
.page-subtitle { font-size: .9rem; }

/* ------------------------------------------------------------------ Stat cards */
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
}
.stat-icon {
    width: 46px; height: 46px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; }
.stat-value { font-size: 1.35rem; font-weight: 700; color: #111827; }
.stat-value-sm { font-size: 1rem; font-weight: 600; }

.flash-stack { margin-bottom: 8px; }

/* ------------------------------------------------------------------ Responsive */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 1035;
}
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.is-open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .sidebar-backdrop.is-visible { display: block; }
}
