:root {
    --sidebar-width: 250px;
    --navy: #0d2b4b;
    --navy-border: #27445f;
    --blue: #2563eb;
    --page-background: #f4f7fb;
    --text: #192b43;
    --muted: #64748b;
    --border: #dce5f0;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: 14px;
}

body {
    margin: 0;
    background: var(--page-background);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.6;
}

a {
    color: #235bc5;
    text-decoration: none;
}

    a:hover {
        color: #174392;
    }

.skip-link {
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 2000;
    padding: 10px 16px;
    background: white;
    color: var(--navy);
    border-radius: 6px;
}

    .skip-link:focus {
        top: 12px;
    }

.portal-shell {
    min-height: 100vh;
}

.portal-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    overflow-y: auto;
    background: var(--navy);
    color: #dce8f5;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 28px 24px 12px;
    color: white;
}

    .portal-brand:hover {
        color: white;
    }

.brand-mark {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--blue);
    font-size: 29px;
    font-weight: 700;
}

.brand-name,
.brand-caption {
    display: block;
}

.brand-name {
    font-size: 29px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.7px;
}

.brand-caption {
    margin-top: 6px;
    color: #a3c9f7;
    font-size: 10px;
    letter-spacing: 1.2px;
}

.sidebar-description {
    padding: 0 24px 24px;
    color: #b1c4d8;
    font-size: 12px;
}

.sidebar-navigation {
    padding: 20px 14px;
    border-top: 1px solid var(--navy-border);
}

.navigation-caption {
    margin: 0 14px 10px;
    color: #8faac4;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    margin-bottom: 6px;
    padding: 11px 15px;
    border-radius: 8px;
    color: #dce8f5;
    font-weight: 500;
    transition: background .15s ease;
}

    .sidebar-link:hover,
    .sidebar-link:focus-visible {
        background: #173e62;
        color: white;
    }

    .sidebar-link.active {
        background: #1a4c79;
        color: white;
    }

.navigation-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

    .navigation-icon svg {
        width: 100%;
        height: 100%;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.6;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: auto;
    padding: 22px 24px;
    border-top: 1px solid var(--navy-border);
    color: #b1c4d8;
    font-size: 11px;
}

    .sidebar-footer a {
        color: #93c5fd;
    }

.portal-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.portal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 94px;
    padding: 18px 32px;
    border-bottom: 1px solid var(--border);
    background: white;
}

.topbar-caption {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.1px;
}

.topbar-title {
    font-size: 21px;
    font-weight: 600;
    line-height: 1.3;
}

.account-actions,
.account-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

    .account-actions form {
        margin: 0;
    }

.account-name {
    color: #40536b;
    font-size: 12px;
    min-width: 0;
}

.account-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: 1px solid #d9e7fe;
    border-radius: 50%;
    background: #eff6ff;
    color: #2458bd;
    font-weight: 700;
}

.account-email {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-content {
    flex: 1;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 30px 32px 40px;
}

    .portal-content h1,
    .portal-content h2 {
        color: #18304c;
        font-size: 25px;
        font-weight: 650;
        letter-spacing: -.5px;
    }

    .portal-content h3 {
        font-size: 20px;
        font-weight: 600;
    }

    .portal-content h5 {
        font-size: 15px;
        font-weight: 600;
    }

.text-muted {
    color: var(--muted) !important;
}

.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
}

.shadow-sm {
    box-shadow: 0 3px 14px rgba(23, 43, 77, .035) !important;
}

.table {
    --bs-table-color: var(--text);
    --bs-table-hover-bg: #f5f9ff;
    font-size: 13px;
}

    .table > :not(caption) > * > * {
        padding: 16px 18px;
        border-bottom-color: #e8eef6;
    }

    .table thead th {
        background: #edf3fc;
        color: #436183;
        font-size: 10px;
        font-weight: 650;
        letter-spacing: .5px;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .table tbody tr:last-child td {
        border-bottom: 0;
    }

    .table code {
        color: #486181;
        font-size: 11px;
        overflow-wrap: anywhere;
    }

    .table td:last-child .btn {
        margin: 3px 3px 3px 0;
    }

.table-responsive {
    border-radius: 12px;
}

.form-label {
    margin-bottom: 6px;
    color: #40536b;
    font-size: 12px;
    font-weight: 600;
}

.form-control,
.form-select {
    min-height: 43px;
    border-color: #cfdbea;
    border-radius: 7px;
    color: var(--text);
    font-size: 14px;
}

    .form-control::placeholder {
        color: #94a3b8;
    }

    .form-control:focus,
    .form-select:focus,
    .form-check-input:focus {
        border-color: #86aff5;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    }

.form-check {
    margin-bottom: 9px;
}

.form-check-input:checked {
    background-color: var(--blue);
    border-color: var(--blue);
}

.btn {
    padding: 9px 16px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
}

.btn-sm {
    padding: 7px 12px;
    font-size: 11px;
}

.btn-primary {
    background: var(--blue);
    border-color: var(--blue);
}

    .btn-primary:hover {
        background: #1d4ed8;
        border-color: #1d4ed8;
    }

.btn-outline-secondary {
    border-color: #cfdbea;
    background: white;
    color: #475b75;
}

    .btn-outline-secondary:hover {
        border-color: #aebfd6;
        background: #edf3fa;
        color: #243c5a;
    }

.badge {
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
}

.alert {
    padding: 14px 18px;
    border-radius: 9px;
    font-size: 13px;
}

.validation-summary-valid {
    display: none;
}

.portal-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 32px;
    border-top: 1px solid var(--border);
    color: #7a8ca3;
    font-size: 11px;
}

/* Identity account navigation */
.nav-pills .nav-link {
    border-radius: 7px;
    color: #405a7b;
}

    .nav-pills .nav-link.active {
        background: var(--blue);
        color: white;
    }

@media (max-width: 1100px) {
    :root {
        --sidebar-width: 220px;
    }

    .portal-content,
    .portal-topbar {
        padding-left: 22px;
        padding-right: 22px;
    }

    .account-email {
        max-width: 150px;
    }
}

@media (max-width: 767px) {
    .portal-sidebar {
        position: static;
        width: 100%;
        overflow: visible;
    }

    .portal-brand {
        padding: 18px 20px 12px;
    }

    .sidebar-description,
    .sidebar-footer,
    .navigation-caption {
        display: none;
    }

    .sidebar-navigation {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 14px;
    }

    .sidebar-link {
        min-height: 40px;
        margin: 0;
        padding: 9px 12px;
        font-size: 12px;
    }

    .navigation-icon {
        width: 17px;
        height: 17px;
    }

    .portal-main {
        margin-left: 0;
        min-height: calc(100vh - 100px);
    }

    .portal-topbar {
        min-height: 80px;
        padding: 16px 18px;
        flex-wrap: wrap;
    }

    .topbar-title {
        font-size: 19px;
    }

    .portal-content {
        padding: 22px 16px;
    }

        .portal-content h1,
        .portal-content h2 {
            font-size: 22px;
        }

    .portal-footer {
        padding: 16px 18px;
    }

    .account-email {
        max-width: 180px;
    }

    .table > :not(caption) > * > * {
        padding: 12px;
    }
}

.metric-card {
    height: 100%;
    padding: 22px 24px;
    box-shadow: 0 3px 14px rgba(23, 43, 77, .035);
}

.metric-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.metric-value {
    margin: 8px 0 4px;
    color: #18304c;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -1px;
}

.metric-description {
    color: #8190a4;
    font-size: 11px;
}

.dashboard-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 22px;
    border-bottom: 1px solid #e8eef6;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
