:root {
    --primary: #0f2f4a;
    --primary-dark: #0a2238;
    --accent: #f58220;
    --accent-soft: #fff3e8;
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --success: #16a34a;
    --shadow: 0 12px 30px rgba(15, 47, 74, 0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 280px;
    height: 100vh;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark), var(--primary));
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    box-shadow: 8px 0 24px rgba(0,0,0,.08);
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-nav {
    padding: 14px 12px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 28px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.25);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.brand-block {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,.10);
}

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    object-fit: contain;
    background: white;
    padding: 5px;
}

.brand-logo-placeholder {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
}

.brand-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.15;
    max-width: 180px;
}

.brand-subtitle {
    color: rgba(255,255,255,.65);
    font-size: 12px;
    margin-top: 3px;
}

.sidebar-nav { padding: 14px 12px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.78);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 4px;
    font-weight: 600;
    transition: all .18s ease;
}
.nav-link i { font-size: 16px; width: 20px; text-align: center; }
.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(245,130,32,.95);
    transform: translateX(2px);
}

.main-area {
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
}

.topbar {
    height: 82px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.page-kicker {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.topbar h1 {
    margin: 3px 0 0;
    font-size: 22px;
    font-weight: 800;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 14px 7px 7px;
    box-shadow: 0 4px 12px rgba(0,0,0,.04);
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}
.user-name { font-weight: 800; font-size: 13px; }
.user-pill a { font-size: 12px; color: var(--muted); text-decoration: none; }

.content-area { padding: 28px; }
.app-alert { border-radius: 14px; border: 0; box-shadow: var(--shadow); }

.app-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.app-card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.app-card-title {
    font-size: 16px;
    font-weight: 900;
    margin: 0;
}
.app-card-body { padding: 20px; }

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: "";
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--accent-soft);
    right: -28px;
    top: -28px;
}
.stat-label { color: var(--muted); font-weight: 700; }
.stat-value { font-size: 30px; font-weight: 900; margin-top: 6px; }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-accent:hover { background: #df7018; border-color: #df7018; color: #fff; }

.form-control, .form-select {
    border-radius: 12px;
    border-color: var(--border);
    padding: 10px 12px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem rgba(245,130,32,.15);
}

.table { vertical-align: middle; }
.table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
      radial-gradient(circle at top left, rgba(245,130,32,.16), transparent 30%),
      linear-gradient(135deg, #0a2238, #0f2f4a);
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0,0,0,.25);
    padding: 28px;
}
.auth-title { font-size: 26px; font-weight: 900; margin-bottom: 4px; }
.auth-subtitle { color: var(--muted); margin-bottom: 22px; }

@media (max-width: 992px) {
    .sidebar { width: 84px; }
    .brand-title, .brand-subtitle, .nav-link span { display: none; }
    .main-area { margin-left: 84px; width: calc(100% - 84px); }
    .brand-block { justify-content: center; padding: 18px 10px; }
    .nav-link { justify-content: center; }
}
.nav-section {
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 18px 18px 8px;
}

.sidebar-nav .nav-link {
    margin-bottom: 4px;
}
