:root {
    --blue-dark: #0F2A43;
    --blue-main: #1D4ED8;
    --blue-light: #38BDF8;
    --bg: #F4F7FA;
    --card: #FFFFFF;
    --text: #172033;
    --muted: #6B7280;
    --border: #E5E7EB;
    --success: #16A34A;
    --danger: #DC2626;
    --warning: #F59E0B;

    --sidebar-width: 260px;
    --topbar-height: 78px;
    --footer-height: 44px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--topbar-height) 1fr var(--footer-height);
    min-height: 100vh;
}

.app-topbar {
    grid-column: 1 / 3;
    grid-row: 1;

    height: var(--topbar-height);

    background: linear-gradient(135deg, var(--blue-dark), var(--blue-main));

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 22px;

    color: #fff;

    z-index: 1000;

    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 48px;
    height: 48px;

    border-radius: 14px;

    background: linear-gradient(135deg, #ffffff, var(--blue-light));

    color: var(--blue-dark);

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 800;
    font-size: 22px;
}

.topbar-brand strong {
    display: block;
    font-size: 18px;
}

.topbar-brand span {
    display: block;
    font-size: 13px;
    opacity: .85;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-toggle,
.menu-close {
    display: none;

    border: 0;

    background: transparent;

    color: #fff;

    font-size: 28px;

    cursor: pointer;
}

.app-sidebar {
    grid-column: 1;
    grid-row: 2 / 4;

    background: linear-gradient(180deg, #031425, #081B2E);

    overflow-y: auto;

    padding: 18px 14px;
}

.sidebar-mobile-head {
    display: none;
}

.sidebar-link {
    display: block;

    padding: 14px 16px;

    border-radius: 14px;

    margin-bottom: 8px;

    color: #DCEBFF;

    transition: .2s;
}

.sidebar-link:hover {
    background: rgba(56, 189, 248, .14);
    color: #fff;
}

.app-main {
    grid-column: 2;
    grid-row: 2;

    overflow-y: auto;

    padding: 26px;

    max-height: calc(100vh - var(--topbar-height) - var(--footer-height));
}

.app-footer {
    grid-column: 2;
    grid-row: 3;

    height: var(--footer-height);

    background: #fff;

    border-top: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 22px;

    color: var(--muted);

    font-size: 13px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
    font-size: 42px;
    color: var(--blue-dark);
}

.page-header p {
    margin: 8px 0 0;
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-card,
.card {
    background: #fff;

    border: 1px solid var(--border);

    border-radius: 22px;

    padding: 24px;

    box-shadow: 0 10px 30px rgba(15, 42, 67, .05);
}

.kpi-card span {
    color: var(--muted);
    font-size: 14px;
}

.kpi-card strong {
    display: block;
    margin-top: 10px;
    font-size: 42px;
    color: var(--blue-dark);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.table th {
    background: #F8FAFC;
}

.btn {
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    cursor: pointer;
    transition: .2s;
}

.btn-primary {
    background: var(--blue-main);
    color: #fff;
}

.btn-primary:hover {
    background: #163fb4;
}

.btn-outline {
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.30);
    color: #fff;
}

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.alert-success {
    background: #DCFCE7;
    color: #166534;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: linear-gradient(
        135deg,
        var(--blue-dark),
        var(--blue-main),
        var(--blue-light)
    );
}

.login-card {
    width: 100%;
    max-width: 460px;

    background: #fff;

    border-radius: 28px;

    padding: 36px;

    box-shadow: 0 30px 70px rgba(0,0,0,.20);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo .brand-icon {
    margin: 0 auto 14px;
}

.login-logo h1 {
    margin: 0;
    font-size: 52px;
    color: var(--blue-dark);
}

.login-logo p {
    color: var(--muted);
    margin-top: 8px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.form-control {
    width: 100%;
    height: 52px;

    border: 1px solid var(--border);

    border-radius: 14px;

    padding: 0 16px;

    outline: none;

    font-size: 15px;
}

.form-control:focus {
    border-color: var(--blue-main);
    box-shadow: 0 0 0 4px rgba(29,78,216,.12);
}

.w-100 {
    width: 100%;
}

.mt-3 {
    margin-top: 18px;
}

.mobile-overlay {
    position: fixed;
    inset: 0;

    background: rgba(0,0,0,.5);

    z-index: 999;

    opacity: 0;
    visibility: hidden;

    transition: .2s;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1024px) {

    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 768px) {

    html,
    body {
        overflow: auto;
    }

    .app-shell {
        display: block;
    }

    .app-topbar {
        position: fixed;

        top: 0;
        left: 0;
        right: 0;

        z-index: 1000;
    }

    .menu-toggle {
        display: block;
    }

    .topbar-user span {
        display: none;
    }

    .app-sidebar {
        position: fixed;

        top: 0;
        left: -100%;

        width: 280px;
        height: 100vh;

        z-index: 1100;

        transition: .25s ease;
    }

    .app-sidebar.active {
        left: 0;
    }

    .sidebar-mobile-head {
        display: flex;

        align-items: center;
        justify-content: space-between;

        margin-bottom: 24px;
    }

    .menu-close {
        display: block;
    }

    .app-main {
        margin-top: var(--topbar-height);

        max-height: none;

        padding: 18px;
    }

    .app-footer {
        display: none;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: 34px;
    }

    .grid-4 {
        grid-template-columns: 1fr;
    }

    .kpi-card strong {
        font-size: 34px;
    }

    .login-card {
        padding: 28px;
    }

    .login-logo h1 {
        font-size: 42px;
    }

}

@media (max-width: 480px) {

    .app-main {
        padding: 14px;
    }

    .page-header h1 {
        font-size: 30px;
    }

    .card,
    .kpi-card {
        padding: 18px;
    }

    .topbar-brand strong {
        font-size: 16px;
    }

    .topbar-brand span {
        font-size: 12px;
    }

    .brand-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

}