* {
    box-sizing: border-box;
}

:root {
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;

    color: #172033;
    background: #f4f6fa;
}

body {
    margin: 0;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

.center-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top right, #dfe9ff, transparent 36%),
        #f4f6fa;
}

.login-card {
    width: min(430px, calc(100% - 40px));
    background: white;
    border: 1px solid #e2e7f0;
    border-radius: 18px;
    padding: 38px;
    box-shadow: 0 24px 60px rgba(23, 32, 51, .10);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 34px;
}

.brand h1 {
    margin: 0;
    font-size: 27px;
}

.brand p {
    margin: 4px 0 0;
    color: #788399;
}

.brand-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #2563eb;
    color: white;
    font-weight: 800;
    font-size: 23px;
}

.brand-mark.small {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 18px;
}

label {
    display: block;
    margin: 18px 0 7px;
    font-size: 14px;
    font-weight: 650;
}

input {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #ccd3df;
    border-radius: 9px;
    font-size: 15px;
    outline: none;
}

input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

button {
    border: 0;
    border-radius: 9px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    background: #2563eb;
    color: white;
}

form button {
    width: 100%;
    margin-top: 24px;
}

button.secondary {
    background: #eef2f7;
    color: #263044;
}

.error {
    padding: 10px 12px;
    margin-top: 16px;
    border-radius: 8px;
    background: #fff0f0;
    color: #b42318;
    font-size: 14px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 245px 1fr;
}

.sidebar {
    background: #111827;
    color: white;
    padding: 22px 15px;
}

.sidebar-brand {
    display: flex;
    gap: 11px;
    align-items: center;
    padding: 0 8px 24px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}

.sidebar-brand strong,
.sidebar-brand span {
    display: block;
}

.sidebar-brand span {
    color: #8d99ad;
    font-size: 12px;
    margin-top: 2px;
}

nav {
    margin-top: 23px;
}

nav a {
    display: block;
    color: #aeb8c8;
    text-decoration: none;
    padding: 11px 13px;
    margin: 3px 0;
    border-radius: 8px;
    font-size: 14px;
}

nav a:hover,
nav a.active {
    background: #1f2937;
    color: white;
}

main {
    min-width: 0;
}

.topbar {
    height: 82px;
    padding: 0 30px;
    background: white;
    border-bottom: 1px solid #e5e9f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar h2 {
    margin: 0;
    font-size: 21px;
}

.topbar p {
    margin: 4px 0 0;
    color: #8791a3;
    font-size: 13px;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-area strong,
.user-area span {
    display: block;
    text-align: right;
}

.user-area span {
    margin-top: 3px;
    color: #8993a5;
    font-size: 12px;
}

.content {
    padding: 28px;
}

.welcome {
    background: white;
    border: 1px solid #e2e7f0;
    border-radius: 14px;
    padding: 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome h3 {
    margin: 4px 0 8px;
    font-size: 23px;
}

.welcome p {
    margin: 0;
    color: #6f7a8d;
}

.eyebrow {
    color: #2563eb;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: .08em;
}

.status-badge {
    background: #edfbf2;
    color: #187a3d;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-badge span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: #20a95b;
}

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

.stats article,
.panel {
    background: white;
    border: 1px solid #e2e7f0;
    border-radius: 13px;
}

.stats article {
    padding: 20px;
}

.stats span,
.stats small {
    display: block;
    color: #8490a3;
}

.stats span {
    font-size: 13px;
}

.stats strong {
    display: block;
    font-size: 22px;
    margin: 9px 0 5px;
}

.stats small {
    font-size: 12px;
}

.panel {
    margin-top: 18px;
    padding: 22px;
}

.panel-heading h3 {
    margin: 5px 0 0;
}

.plans {
    margin-top: 18px;
}

.plan-row {
    padding: 15px 0;
    border-top: 1px solid #edf0f4;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-row strong,
.plan-row span {
    display: block;
}

.plan-row span {
    margin-top: 4px;
    color: #8490a3;
    font-size: 13px;
}

.plan-status {
    background: #fff7e5;
    color: #9a6500;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

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

    .sidebar {
        display: none;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .topbar,
    .content {
        padding-left: 18px;
        padding-right: 18px;
    }
}

.mfa-area {
    margin-top: 18px;
}

.mfa-setup-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    border-top: 1px solid #edf0f4;
    padding-top: 22px;
}

.mfa-setup-grid h4 {
    margin: 0 0 8px;
}

.mfa-setup-grid p {
    color: #6f7a8d;
    line-height: 1.5;
}

.qr-box {
    margin-top: 18px;
    width: 260px;
    max-width: 100%;
    padding: 18px;
    background: white;
    border: 1px solid #dfe4ec;
    border-radius: 12px;
}

.qr-box img {
    display: block;
    width: 100%;
    height: auto;
}

#mfaConfirmButton {
    margin-top: 18px;
}

.recovery-warning {
    margin-top: 20px;
    padding: 16px;
    border-radius: 10px;
    background: #fff7e5;
    color: #795300;
}

.recovery-warning p {
    margin: 6px 0 0;
}

.recovery-codes {
    margin: 18px 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.recovery-code {
    padding: 10px 12px;
    border-radius: 8px;
    background: #f3f5f8;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 14px;
    letter-spacing: .04em;
}

.security-ok {
    color: #187a3d;
    font-weight: 700;
}

@media (max-width: 700px) {
    .mfa-setup-grid {
        grid-template-columns: 1fr;
    }

    .recovery-codes {
        grid-template-columns: 1fr;
    }
}

.login-step-heading {
    margin-top: 8px;
    margin-bottom: 20px;
}

.login-step-heading h2 {
    margin: 0 0 7px;
    font-size: 21px;
}

.login-step-heading p {
    margin: 0;
    color: #788399;
    line-height: 1.5;
}

select {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #ccd3df;
    border-radius: 9px;
    background: white;
    color: #172033;
    font-size: 15px;
}

select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.login-secondary-button {
    width: 100%;
    margin-top: 10px;
}
