:root {
    --ym:#e60012;
    --blue:#173f8a;
    --ink:#182230;
    --muted:#667085;
    --bg:#f5f7fb;
    --surface:#fff;
    --line:#e7ebf3;
    --success:#198754;
    --danger:#dc3545;
    --warning:#ffc107;
    --radius:16px;
    --shadow:0 8px 24px rgba(20,38,63,.07);
    --font-head:'Poppins',sans-serif;
    --font-body:'Inter',sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: linear-gradient(140deg,#f7f9ff 0%,#fff8f8 48%,#f6f8ff 100%);
    color: var(--ink);
    font: 14px var(--font-body);
}

a {
    text-decoration: none;
}

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    background: linear-gradient(180deg,#101f55,#082860 55%,#16113d);
    color: #dce5ff;
    padding: 25px 14px;
    z-index: 1040;
    transition: .3s;
    border-right: 3px solid var(--ym);
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 6px 28px;
    color: #fff;
    font: 600 14px var(--font-head);
}

.brand-logo {
    width: 132px;
    height: 38px;
    object-fit: cover;
    object-position: center;
    mix-blend-mode: screen;
}

.brand-name {
    max-width: 70px;
    font-size: 10px;
    line-height: 1.2;
    color: #dce5ff;
}

.sidebar-search {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.12);
    color: #fff;
    border-radius: 10px;
    padding: 10px;
    width: 100%;
    outline: 0;
}

.nav-title {
    font-size: 10px;
    letter-spacing: 1px;
    margin: 22px 11px 8px;
    color: #9caee3;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 12px;
    color: #dce5ff;
    border-radius: 10px;
    margin: 2px 0;
    transition: .2s;
}

    .side-link:hover, .side-link.active {
        background: linear-gradient(90deg,#e60012,#bd0010);
        color: #fff;
        box-shadow: 0 6px 14px rgba(230,0,18,.2);
    }

    .side-link .badge {
        margin-left: auto;
    }

.main {
    margin-left: 264px;
    min-height: 100vh;
}

.topbar {
    height: 76px;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(12px);
    border-bottom: 3px solid var(--ym);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.page-content {
    padding: 30px 32px;
}

.crumb {
    color: var(--ym);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.page-title {
    font: 600 25px var(--font-head);
    margin: 4px 0;
    color: #172b4d;
}

.user-avatar {
    width: 39px;
    height: 39px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff0f1;
    color: var(--ym);
    font-weight: 700;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    color: var(--muted);
    position: relative;
}

.notify-dot {
    position: absolute;
    right: 9px;
    top: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
}

.card {
    border: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--surface);
}

.kpi-card {
    padding: 20px;
    overflow: hidden;
    position: relative;
    min-height: 154px;
    transition: .25s;
}

    .kpi-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 14px 28px rgba(20,38,63,.12);
    }

.kpi-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #eaf0ff;
    color: var(--ym);
    font-size: 20px;
}

.kpi-value {
    font: 600 27px var(--font-head);
    margin: 17px 0 2px;
}

.trend {
    font-size: 12px;
    color: var(--success);
}

.spark {
    position: absolute;
    right: 13px;
    bottom: 17px;
    color: #7ca6f8;
    font-size: 26px;
}

.panel-title {
    font: 600 16px var(--font-head);
    margin: 0;
}

.panel-sub {
    font-size: 12px;
    color: var(--muted);
}

.chart-box {
    min-height: 290px;
}

.table-wrap {
    overflow: auto;
}

.table {
    margin: 0;
    --bs-table-bg:transparent;
}

    .table thead th {
        background: linear-gradient(90deg,#142e75,#073d91);
        color: #fff;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .35px;
        white-space: nowrap;
        border: 0;
        padding: 14px;
    }

    .table tbody td {
        vertical-align: middle;
        padding: 14px;
        border-color: var(--line);
        white-space: nowrap;
    }

    .table tbody tr:nth-child(6n+1) {
        background: #fff7f7;
    }

    .table tbody tr:nth-child(6n+2) {
        background: #f3f7ff;
    }

    .table tbody tr:nth-child(6n+3) {
        background: #f2fcf7;
    }

    .table tbody tr:nth-child(6n+4) {
        background: #fffaf0;
    }

    .table tbody tr:nth-child(6n+5) {
        background: #faf5ff;
    }

    .table tbody tr:nth-child(6n) {
        background: #f1fbfc;
    }

    .table tbody tr:hover {
        background: #ffe8ea!important;
    }

.avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    object-fit: cover;
    background: #edf2ff;
}

.badge-soft-success {
    color: #08783f;
    background: #e5f7ed;
}

.badge-soft-warning {
    color: #9b6900;
    background: #fff6d9;
}

.badge-soft-danger {
    color: #b42318;
    background: #feeceb;
}

.badge-soft-primary {
    color: var(--ym);
    background: #fff0f1;
}

.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: .6rem 1rem;
}

.btn-primary {
    background: var(--ym);
    border-color: var(--ym);
}

    .btn-primary:hover {
        background: #b9000f;
        border-color: #b9000f;
    }

.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    transition: .2s;
}

    .quick-action:hover {
        border-color: #f2a2aa;
        background: #fff7f7;
        transform: translateY(-2px);
    }

    .quick-action i {
        color: var(--ym);
        font-size: 18px;
    }

.form-control, .form-select {
    border-color: #dce3ee;
    border-radius: 10px;
    min-height: 45px;
}

    .form-control:focus, .form-select:focus {
        border-color: #ed6f7b;
        box-shadow: 0 0 0 .2rem rgba(230,0,18,.12);
    }

.form-floating > label {
    color: #778399;
}

.filters {
    padding: 18px;
}

.alert-overdue {
    background: linear-gradient(110deg,#fff4f4,#fff);
    border-left: 4px solid var(--danger);
}

.timeline {
    border-left: 2px solid #dce5f7;
    margin-left: 9px;
    padding-left: 25px;
}

.timeline-item {
    position: relative;
    padding: 0 0 22px;
}

    .timeline-item:before {
        content: '';
        position: absolute;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--ym);
        left: -31px;
        top: 5px;
    }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    background: var(--success);
    margin-right: 5px;
}

.login-body {
    min-height: 100vh;
    background: #eef4ff;
}

.login-hero {
    min-height: 100vh;
    position: relative;
    color: #fff;
    background: linear-gradient(115deg,rgba(0,31,101,.9),rgba(0,51,153,.6)),url('https://images.unsplash.com/photo-1558981806-ec527fa84c39?auto=format&fit=crop&w=1400&q=80') center/cover;
}

.login-card {
    width: min(430px,100%);
    padding: 38px;
    border: 1px solid rgba(255,255,255,.75);
    background: rgba(255,255,255,.78);
    box-shadow: 0 20px 60px rgba(0,35,110,.14);
    backdrop-filter: blur(18px);
    border-radius: 24px;
}

.auth-logo {
    color: var(--ym);
    font: 700 22px var(--font-head);
}

.mobile-dashboard {
    display: none;
}

.desktop-only {
    display: block;
}

.product-thumb {
    width: 56px;
    height: 41px;
    object-fit: cover;
    border-radius: 8px;
}

.footer {
    color: #8a94a6;
    font-size: 12px;
    padding: 20px 32px;
}

.a4-paper {
    max-width: 850px;
    margin: auto;
    padding: 56px;
    background: #fff;
    box-shadow: var(--shadow);
    min-height: 900px;
}

.scan-fab {
    display: none;
}
