:root {
    --navy: #0A1F40;
    --cyan: #00FFFF;
    --blue: #3399FF;
    --violet: #4C33CC;
    --deep-violet: #1A1040;

    --bg: #f5f8fc;
    --surface: #ffffff;
    --text: #0A1F40;
    --muted: #6d7a91;
    --border: #e2e9f2;

    --success: #159a6a;
    --warning: #df9b19;
    --danger: #cc3d5b;

    --shadow: 0 18px 50px rgba(10, 31, 64, .10);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--text);
    background: var(--bg);
}

button,
input {
    font: inherit;
}

/* LOGIN */

.login-page {
    min-height: 100vh;
    background: #fff;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 1.05fr) minmax(420px, .95fr);
}

.login-brand-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 64px 7vw;
    color: #fff;
    background:
        radial-gradient(circle at 15% 20%, rgba(0,255,255,.18), transparent 24%),
        radial-gradient(circle at 85% 80%, rgba(76,51,204,.55), transparent 35%),
        linear-gradient(140deg, #0A1F40 0%, #081a39 48%, #1A1040 100%);
}

.login-brand-panel::after {
    content: "";
    position: absolute;
    width: 460px;
    height: 460px;
    right: -180px;
    bottom: -180px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
}

.brand-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.login-logo {
    display: block;
    width: min(410px, 85%);
    height: 125px;
    object-fit: contain;
    object-position: left center;
    margin-bottom: 46px;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.brand-content h1 {
    margin: 0;
    max-width: 580px;
    font-size: clamp(36px, 4vw, 60px);
    line-height: 1.03;
    letter-spacing: -2px;
}

.brand-content > p {
    margin: 24px 0 34px;
    max-width: 560px;
    color: rgba(255,255,255,.72);
    font-size: 18px;
    line-height: 1.7;
}

.brand-points {
    display: grid;
    gap: 14px;
    color: rgba(255,255,255,.88);
}

.brand-points div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-points span {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 18px rgba(0,255,255,.6);
}

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 54px;
    background:
        linear-gradient(180deg, rgba(51,153,255,.035), transparent 35%),
        #fff;
}

.login-card {
    width: 100%;
    max-width: 465px;
}

.mobile-brand {
    display: none;
}

.login-heading {
    margin-bottom: 34px;
}

.eyebrow {
    display: inline-block;
    color: #287fda;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.7px;
}

.login-heading h2 {
    margin: 8px 0 10px;
    font-size: 39px;
    letter-spacing: -1.2px;
}

.login-heading p {
    margin: 0;
    color: var(--muted);
}

.alert {
    margin-bottom: 22px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
}

.alert-error {
    color: #9d2944;
    background: #fff0f4;
    border: 1px solid #ffd5df;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 9px;
    font-size: 14px;
    font-weight: 700;
}

.form-group input {
    width: 100%;
    height: 52px;
    padding: 0 15px;
    outline: none;
    color: var(--text);
    background: #fff;
    border: 1px solid #d7e0eb;
    border-radius: 11px;
    transition: .18s ease;
}

.form-group input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(51,153,255,.12);
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 78px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 8px;
    height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    color: #286eb4;
    background: #eff7ff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.btn {
    height: 52px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 800;
    transition: .18s ease;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #0A1F40, #102c5d);
    box-shadow: 0 12px 30px rgba(10,31,64,.18);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 34px rgba(10,31,64,.24);
}

.btn-full {
    width: 100%;
}

.login-footer {
    margin-top: 28px;
    color: #9aa6b8;
    text-align: center;
    font-size: 12px;
}

/* APPLICATION */

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

.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, #091d3b 0%, #0A1F40 65%, #141037 100%);
    color: #fff;
}

.sidebar-brand {
    height: 92px;
    display: flex;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-brand img {
    display: block;
    width: 190px;
    height: 58px;
    object-fit: contain;
    object-position: left center;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.nav {
    flex: 1;
    padding: 18px 13px;
    overflow-y: auto;
}

.nav-section {
    margin: 21px 12px 8px;
    color: rgba(255,255,255,.37);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    margin: 3px 0;
    padding: 0 13px;
    border-radius: 10px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 14px;
    transition: .18s;
}

.nav-item:hover,
.nav-item.active {
    color: #fff;
    background: rgba(51,153,255,.16);
}

.nav-item.active {
    box-shadow: inset 3px 0 0 var(--cyan);
}

.nav-item.disabled {
    opacity: .62;
    cursor: default;
}

.nav-icon {
    width: 22px;
    text-align: center;
    color: #7fc1ff;
    font-size: 17px;
}

.sidebar-footer {
    padding: 18px 22px 24px;
    border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-footer a {
    color: rgba(255,255,255,.68);
    text-decoration: none;
    font-size: 13px;
}

.main-content {
    grid-column: 2;
    min-width: 0;
}

.topbar {
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--border);
}

.topbar-title {
    font-size: 20px;
    font-weight: 800;
}

.topbar-subtitle {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 11px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue), var(--violet));
    font-weight: 900;
}

.user-menu strong,
.user-menu span {
    display: block;
}

.user-menu strong {
    font-size: 13px;
}

.user-menu span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.page-content {
    padding: 30px 34px 46px;
}

.welcome {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding: 30px 34px;
    border-radius: var(--radius);
    color: #fff;
    background:
        radial-gradient(circle at 85% 15%, rgba(0,255,255,.18), transparent 26%),
        linear-gradient(125deg, #0A1F40, #142c5d 58%, #27165d);
    box-shadow: var(--shadow);
}

.welcome h1 {
    margin: 6px 0 9px;
    font-size: 31px;
}

.welcome p {
    max-width: 710px;
    margin: 0;
    color: rgba(255,255,255,.73);
    line-height: 1.65;
}

.welcome .eyebrow {
    color: #75d8ff;
}

.welcome-mark {
    align-self: center;
    width: 78px;
    height: 78px;
    flex: 0 0 78px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(135deg, #3399FF, #4C33CC);
    font-size: 35px;
    font-weight: 900;
    box-shadow: 0 15px 35px rgba(0,0,0,.16);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.stat-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 7px 26px rgba(10,31,64,.045);
}

.stat-card {
    padding: 22px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stat-value {
    margin: 12px 0 6px;
    color: var(--navy);
    font-size: 32px;
    font-weight: 900;
}

.stat-foot {
    color: #a0aabb;
    font-size: 11px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr);
    gap: 18px;
    margin-top: 18px;
}

.panel {
    padding: 23px;
}

.panel-heading h3 {
    margin: 0;
    font-size: 17px;
}

.panel-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.empty-state {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
}

.empty-state strong {
    margin: 11px 0 6px;
    color: var(--navy);
}

.empty-state span {
    max-width: 420px;
    font-size: 13px;
    line-height: 1.5;
}

.empty-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 17px;
    background: linear-gradient(135deg, #3399FF, #4C33CC);
    font-weight: 900;
}

.system-list {
    margin-top: 19px;
}

.system-list > div {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 47px;
    border-bottom: 1px solid #edf1f6;
    font-size: 13px;
}

.system-list > div:last-child {
    border-bottom: 0;
}

.system-list strong {
    font-size: 11px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.ok {
    background: var(--success);
}

.status-dot.pending {
    background: var(--warning);
}

@media (max-width: 1050px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        min-height: 100vh;
        padding: 30px 20px;
    }

    .mobile-brand {
        display: block;
        margin-bottom: 25px;
    }

    .mobile-brand img {
        width: 245px;
        height: 85px;
        object-fit: contain;
    }

    .app-layout {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .topbar {
        height: auto;
        min-height: 78px;
        padding: 15px 18px;
    }

    .user-menu > div:last-child {
        display: none;
    }

    .page-content {
        padding: 20px 16px 32px;
    }

    .welcome {
        padding: 24px;
    }

    .welcome-mark {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
