* {
    box-sizing: border-box;
}

:root {
    --body-bg: #0f192b;
    --sidebar-bg: #202c3f;
    --topbar-bg: #202c3f;
    --panel-bg: #202d41;
    --active-bg: #394b63;
    --border: #8491a4;
    --table-head: #758398;
    --text: #f5f7fa;
    --muted: #c7d0dc;
    --title: #c6d8ff;
    --danger: #ff2f43;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--body-bg);
    color: var(--text);
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

/* ---------- LOGIN ---------- */

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 85% 10%, rgba(255,255,255,.035), transparent 22%),
        var(--body-bg);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(430px, 100%);
    background: var(--panel-bg);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 9px;
    box-shadow: 0 22px 55px rgba(0,0,0,.32);
    padding: 30px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 28px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #34465f;
    border: 2px solid #8897aa;
    color: #fff;
    font-weight: 800;
    font-size: 20px;
}

.login-brand h1 {
    margin: 0 0 5px;
    font-size: 22px;
    font-weight: 700;
}

.login-brand p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

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

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #dce4ed;
    font-size: 13px;
    font-weight: 600;
}

.form-group input {
    display: block;
    width: 100%;
    height: 44px;
    border: 1px solid #627188;
    border-radius: 4px;
    outline: 0;
    padding: 0 12px;
    background: #162338;
    color: #fff;
}

.form-group input::placeholder {
    color: #8491a3;
}

.form-group input:focus {
    border-color: #a2b5cd;
}

.login-button {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 4px;
    background: var(--active-bg);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.login-button:hover {
    filter: brightness(1.09);
}

.alert {
    padding: 11px 12px;
    margin-bottom: 18px;
    border-radius: 4px;
    background: rgba(180, 48, 68, .28);
    border: 1px solid rgba(255, 108, 129, .55);
    color: #ffdce2;
    font-size: 13px;
}

.login-note {
    margin-top: 18px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

/* ---------- DASHBOARD ---------- */

.dashboard-page {
    min-height: 100vh;
    background: var(--body-bg);
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 245px;
    z-index: 20;
    overflow-y: auto;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255,255,255,.025);
}

.sidebar-brand {
    height: 81px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-bottom: 1px solid rgba(0,0,0,.22);
}

.brand-mark-small {
    width: 36px;
    height: 36px;
    font-size: 15px;
}

.sidebar-brand-text {
    min-width: 0;
}

.sidebar-brand-text strong {
    display: block;
    max-width: 165px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.sidebar-brand-text small {
    display: block;
    margin-top: 2px;
    color: #bac5d3;
    font-size: 9px;
    letter-spacing: .5px;
}

.menu-heading {
    padding: 26px 12px 10px;
    color: #c1cad6;
    font-size: 12px;
    font-weight: 700;
}

.menu-link {
    min-height: 44px;
    margin: 0 12px 8px;
    border-radius: 4px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #d2dbe6;
    font-size: 14px;
    font-weight: 600;
}

.menu-link:hover,
.menu-link.active {
    background: var(--active-bg);
}

.menu-icon {
    width: 16px;
    flex: 0 0 16px;
    text-align: center;
    color: #d7e1ed;
}

.page-wrap {
    min-height: 100vh;
    margin-left: 245px;
}

.topbar {
    height: 81px;
    background: var(--topbar-bg);
    border-bottom: 1px solid rgba(0,0,0,.28);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

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

.chevron {
    margin-left: 8px;
}

.content {
    padding: 28px 23px 45px;
}

.page-title {
    margin: 0 0 24px;
    color: var(--title);
    font-size: 24px;
    font-weight: 600;
}

.panel {
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 24px;
}

.user-panel {
    margin-bottom: 14px;
}

.user-info-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.info-table td {
    height: 37px;
    border: 1px solid var(--border);
    padding: 9px 16px;
}

.info-table td:first-child {
    width: 49%;
}

.stc-badge {
    display: inline-block;
    margin-right: 4px;
    padding: 2px 4px;
    background: var(--danger);
    color: #fff;
    font-style: italic;
    font-weight: 800;
    line-height: 1;
}

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

.stat-card {
    min-height: 112px;
    padding: 20px;
    border-radius: 8px;
    background: var(--panel-bg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card span {
    color: #c2cbd8;
    font-size: 13px;
    font-weight: 600;
}

.stat-card strong {
    font-size: 24px;
    font-weight: 700;
}

.placeholder-panel h3 {
    margin: 0 0 10px;
    color: #cbd4df;
    font-size: 20px;
}

.placeholder-panel p {
    margin: 0;
    color: #bdc7d4;
    line-height: 1.7;
    font-size: 14px;
}

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

@media (max-width: 850px) {
    .sidebar {
        width: 205px;
    }

    .page-wrap {
        margin-left: 205px;
    }

    .user-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }

    .page-wrap {
        margin-left: 0;
    }

    .sidebar-brand {
        height: 65px;
    }

    .menu-heading {
        padding-top: 15px;
    }

    .topbar {
        height: 58px;
    }

    .content {
        padding: 18px 12px 30px;
    }

    .panel {
        padding: 14px;
    }

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

    .info-table td {
        padding: 8px 10px;
    }
}
