:root {
    --navy-950: #07101f;
    --navy-900: #0b1220;
    --navy-800: #111c2f;
    --navy-700: #17243a;
    --orange-600: #ea580c;
    --orange-500: #f97316;
    --amber-500: #d6a84f;
    --khaki-100: #f4ead8;
    --khaki-200: #e8d5ad;
    --white: #ffffff;
    --soft-bg: #f5f7fb;
    --card-border: #e7ebf3;
    --text-main: #111827;
    --text-muted: #667085;
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, .08);
    --shadow-md: 0 18px 45px rgba(15, 23, 42, .14);
    --radius-lg: 22px;
    --sidebar-width: 292px;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
    min-height: 100%;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(214,168,79,.18), transparent 32rem),
        linear-gradient(180deg, #fbfcff 0%, var(--soft-bg) 100%);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
}

body.login-page {
    background:
        radial-gradient(circle at 12% 18%, rgba(249,115,22,.35), transparent 24rem),
        radial-gradient(circle at 82% 78%, rgba(214,168,79,.25), transparent 24rem),
        linear-gradient(135deg, #07101f 0%, #0b1220 52%, #17243a 100%);
}

a { transition: all .18s ease; }

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

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    padding: 18px 16px;
    background:
        linear-gradient(180deg, rgba(23,36,58,.95), rgba(7,16,31,.98)),
        radial-gradient(circle at top right, rgba(249,115,22,.25), transparent 18rem);
    color: var(--white);
    box-shadow: 16px 0 40px rgba(7,16,31,.12);
    z-index: 1040;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 6px 14px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-wrap {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    text-decoration: none;
}

.brand-wrap:hover { color: var(--white); transform: translateY(-1px); }

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0,0,0,.22);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-text strong { font-size: 1.12rem; letter-spacing: -.03em; }
.brand-text small { color: #d9c99d; font-size: .72rem; margin-top: 5px; white-space: nowrap; }

.sidebar-close {
    display: none;
    border: 0;
    color: var(--white);
    background: rgba(255,255,255,.1);
    border-radius: 12px;
    width: 38px;
    height: 38px;
}

.sidebar-nav {
    min-height: 0;
    padding: 12px 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    flex: 1;
}

.sidebar-group {
    margin: 4px 0;
}

.sidebar-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    color: #dce3ef;
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.sidebar-group-title::-webkit-details-marker { display: none; }
.sidebar-group-title i { color: var(--amber-500); }

.sidebar-group-title::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: auto;
    margin-right: 2px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
}

.sidebar-group[open] > .sidebar-group-title,
.sidebar-group-title:hover {
    background: rgba(255,255,255,.08);
    color: var(--white);
}

.sidebar-group[open] > .sidebar-group-title::after { transform: rotate(45deg); }

.sidebar-group-title:focus-visible {
    outline: 2px solid var(--amber-500);
    outline-offset: -2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 7px 10px;
    margin: 2px 0;
    border-radius: 10px;
    color: #dce3ef;
    text-decoration: none;
    font-weight: 600;
}

.sidebar-group .nav-item {
    margin-left: 12px;
    font-size: .86rem;
}

.nav-item i {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: var(--amber-500);
    background: rgba(255,255,255,.07);
}

.nav-item:hover,
.nav-item:focus {
    color: var(--white);
    background: rgba(255,255,255,.09);
    transform: translateX(2px);
}

.nav-item.disabled {
    color: rgba(220,227,239,.55);
    cursor: not-allowed;
}

.nav-item.disabled:hover { transform: none; background: transparent; }

.sidebar-foot {
    flex-shrink: 0;
    padding: 12px 10px 4px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.plan-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    color: #fff4df;
    background: linear-gradient(135deg, rgba(249,115,22,.95), rgba(214,168,79,.9));
    font-weight: 800;
    font-size: .8rem;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 76px;
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 28px;
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid rgba(231,235,243,.95);
    backdrop-filter: blur(14px);
}

.topbar-menu {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    background: var(--white);
    color: var(--navy-900);
    font-size: 1.4rem;
}

.topbar-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.topbar-title span {
    color: var(--navy-900);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -.02em;
}

.topbar-title small { color: var(--text-muted); font-size: .8rem; margin-top: 2px; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    color: var(--navy-900);
    background: var(--white);
}

.notification-dot {
    position: absolute;
    top: 10px;
    right: 11px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange-500);
    box-shadow: 0 0 0 3px rgba(249,115,22,.18);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px 7px 7px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: var(--white);
}

.avatar {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--white);
    background: linear-gradient(135deg, var(--navy-800), var(--orange-500));
}

.user-info { display: flex; flex-direction: column; line-height: 1.08; }
.user-info strong { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .83rem; }
.user-info small { color: var(--text-muted); font-size: .72rem; margin-top: 3px; }

.btn-soft-danger {
    border-color: #fee2e2;
    color: #b42318;
    background: #fff7f7;
    border-radius: 999px;
    font-weight: 700;
}

.btn-soft-danger:hover { background: #fee2e2; color: #912018; }

.content-wrap { padding: 28px; }

.page-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--orange-600);
    background: #fff3e8;
    padding: 7px 11px;
    border-radius: 999px;
    font-weight: 800;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.page-title {
    margin: 12px 0 6px;
    color: var(--navy-900);
    font-weight: 850;
    letter-spacing: -.045em;
}

.page-subtitle { max-width: 720px; color: var(--text-muted); margin: 0; }

.card-kpi,
.app-card {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow-sm);
}

.kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 154px;
    padding: 22px;
}

.kpi-card::after {
    content: '';
    position: absolute;
    right: -34px;
    top: -34px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(214,168,79,.16);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 16px;
    color: var(--white);
    background: linear-gradient(135deg, var(--navy-800), var(--orange-500));
    box-shadow: 0 12px 24px rgba(249,115,22,.16);
}

.kpi-label { color: var(--text-muted); font-weight: 700; font-size: .82rem; }
.kpi-value { color: var(--navy-900); font-weight: 850; font-size: 2.1rem; letter-spacing: -.06em; margin: 4px 0 0; }
.kpi-note { color: var(--text-muted); font-size: .8rem; margin-top: 8px; }

.btn-primary {
    background: linear-gradient(135deg, var(--orange-500), var(--amber-500));
    border-color: var(--orange-500);
    border-radius: 14px;
    font-weight: 800;
    box-shadow: 0 10px 18px rgba(249,115,22,.16);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--orange-600), #c89136);
    border-color: var(--orange-600);
}

.btn-light {
    border-color: var(--card-border);
    border-radius: 14px;
    font-weight: 700;
    background: #f8fafc;
}

.form-label { color: var(--navy-900); font-weight: 750; font-size: .85rem; }
.form-control, .form-select {
    min-height: 44px;
    border-radius: 14px;
    border-color: #dbe2ec;
    font-weight: 500;
}
.form-control:focus, .form-select:focus {
    border-color: var(--orange-500);
    box-shadow: 0 0 0 .22rem rgba(249,115,22,.12);
}

.table { --bs-table-color: var(--text-main); }
.table thead th {
    color: #5b6475;
    background: #f8fafc;
    border-bottom: 1px solid var(--card-border);
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.table td { vertical-align: middle; color: #27364a; }
.badge { border-radius: 999px; padding: .48rem .7rem; font-weight: 800; }

.login-shell {
    width: min(1080px, calc(100% - 32px));
    min-height: 650px;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    margin: 32px auto;
    border-radius: 34px;
    overflow: hidden;
    box-shadow: 0 28px 90px rgba(0,0,0,.34);
    background: var(--white);
}

.login-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px;
    color: var(--white);
    background:
        radial-gradient(circle at 18% 22%, rgba(249,115,22,.45), transparent 17rem),
        linear-gradient(150deg, var(--navy-900), var(--navy-700));
}

.login-panel::after {
    content: '';
    position: absolute;
    right: -80px;
    bottom: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(214,168,79,.2);
}

.login-panel-content { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand img { width: 58px; height: 58px; border-radius: 18px; }
.login-brand strong { display: block; font-size: 1.35rem; letter-spacing: -.04em; }
.login-brand small { color: var(--khaki-200); }
.login-panel h1 { margin-top: 72px; font-weight: 850; line-height: .98; letter-spacing: -.06em; }
.login-panel p { color: rgba(255,255,255,.74); max-width: 440px; }

.login-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff4df;
    margin-top: 13px;
    font-weight: 650;
}
.login-feature i { color: var(--amber-500); }

.login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 46px;
    background: var(--white);
}

.login-card h2 { color: var(--navy-900); font-weight: 850; letter-spacing: -.04em; }

.sidebar-overlay { display: none; }

@media (max-width: 1180px) {
    .user-info { display: none; }
    .user-chip { padding-right: 7px; }
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        transform: translateX(-105%);
        transition: transform .24s ease;
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(7,16,31,.52);
        opacity: 0;
        pointer-events: none;
        transition: opacity .24s ease;
        z-index: 1030;
    }
    body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .topbar-menu { display: inline-flex; align-items: center; justify-content: center; }
    .topbar { padding: 0 18px; }
    .content-wrap { padding: 20px; }
    .login-shell { grid-template-columns: 1fr; }
    .login-panel { min-height: 360px; }
    .login-panel h1 { margin-top: 42px; }
}

@media (max-width: 768px) {
    .topbar { height: 68px; }
    .topbar-title small { display: none; }
    .topbar-actions .icon-btn, .topbar-actions .user-chip { display: none; }
    .page-hero { flex-direction: column; }
    .content-wrap { padding: 16px; }
    .kpi-card { min-height: 136px; }
    .login-card, .login-panel { padding: 28px; }
    .login-shell { width: min(100% - 20px, 540px); margin: 10px auto; border-radius: 26px; }
}

@media (max-width: 576px) {
    .sidebar { width: min(88vw, var(--sidebar-width)); }
    .topbar-actions .btn { padding-inline: 10px; }
    .page-title { font-size: 1.55rem; }
    .table-responsive { border-radius: 16px; }
}
/* Page header / breadcrumb tuning */
.page-title {
    font-size: 1.35rem !important;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    font-size: 0.875rem;
    color: #8a94a6;
}

.breadcrumb,
.breadcrumb-item,
.breadcrumb-item a {
    font-size: 0.78rem !important;
    font-weight: 500;
}

.breadcrumb {
    margin-bottom: 0.35rem;
}

.content-header,
.page-header {
    margin-bottom: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.nav-icon {
    width: 1.35rem;
    min-width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    font-size: 0.95rem;
}

.nav-text {
    flex: 1;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    color: #fbbf24;
}
