* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--sms-bg, #f5f6f8);
    color: var(--sms-text, #111827);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

a {
    color: var(--sms-primary, #172446);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

.portal-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.portal-guest .portal-shell {
    width: 100%;
    padding: 0;
}

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

.portal-login-panel {
    width: min(430px, 100%);
    padding: 30px;
    border: 1px solid var(--sms-border, #e5e7eb);
    border-radius: var(--sms-radius, 8px);
    background: var(--sms-surface, #ffffff);
    box-shadow: var(--sms-shadow, 0 12px 30px rgba(15, 23, 42, 0.08));
}

.portal-brand,
.portal-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-brand {
    margin-bottom: 24px;
}

.portal-brand-mark,
.portal-heading-icon,
.portal-summary-icon {
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: var(--sms-primary, #172446);
    box-shadow: 0 10px 20px rgba(23, 36, 70, 0.18);
}

.portal-brand-mark {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    font-size: 24px;
    font-weight: 850;
}

.portal-brand-title {
    display: block;
    color: var(--sms-primary, #172446);
    font-size: 18px;
    font-weight: 850;
}

.portal-brand-subtitle {
    display: block;
    margin-top: 2px;
    color: var(--sms-muted, #667085);
    font-size: 12px;
    font-weight: 700;
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: 0;
}

.portal-login-panel h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--sms-primary, #172446);
    font-size: 28px;
    font-weight: 850;
}

.portal-login-panel h1 i {
    font-size: 22px;
}

.portal-login-panel form {
    display: grid;
    gap: 10px;
}

.portal-login-panel label {
    color: #344054;
    font-size: 13px;
    font-weight: 800;
}

.portal-login-panel input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--sms-border-strong, #d0d5dd);
    border-radius: var(--sms-radius, 8px);
    padding: 0 12px;
    color: var(--sms-text, #111827);
    background: #fff;
    font-size: 15px;
    outline: none;
}

.portal-login-panel input:focus {
    border-color: #b9c7e7;
    box-shadow: 0 0 0 3px rgba(23, 36, 70, 0.08);
}

.portal-login-panel button,
.portal-action-primary,
.portal-logout,
.portal-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    border: 1px solid var(--sms-border-strong, #d0d5dd);
    border-radius: var(--sms-radius, 8px);
    padding: 0 13px;
    background: var(--sms-surface, #ffffff);
    color: var(--sms-primary, #172446);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.portal-login-panel button,
.portal-action-primary {
    border-color: var(--sms-primary, #172446);
    background: var(--sms-primary, #172446);
    color: #ffffff;
}

.portal-login-panel button {
    min-height: 44px;
    margin-top: 4px;
}

.portal-login-panel button:hover,
.portal-action-primary:hover {
    background: var(--sms-primary-hover, #24396f);
}

.portal-logout:hover,
.portal-actions a:hover {
    border-color: #b9c7e7;
    background: #eef4ff;
}

.portal-message {
    margin: 0 0 16px;
    border-radius: var(--sms-radius, 8px);
    padding: 11px 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.portal-message-success {
    border: 1px solid #86efac;
    background: #ecfdf3;
    color: #027a48;
}

.portal-message-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b42318;
}

.portal-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.portal-heading-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    font-size: 19px;
}

.portal-heading-initial {
    font-size: 22px;
    font-weight: 850;
}

.portal-kicker {
    margin-bottom: 4px;
    color: var(--sms-muted, #667085);
    font-size: 13px;
    font-weight: 700;
}

.portal-topbar h1 {
    color: var(--sms-primary, #172446);
    font-size: 30px;
    font-weight: 850;
}

.portal-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.portal-summary article,
.portal-card,
.portal-table-wrap {
    border: 1px solid var(--sms-border, #e5e7eb);
    border-radius: var(--sms-radius, 8px);
    background: var(--sms-surface, #ffffff);
    box-shadow: var(--sms-shadow, 0 12px 30px rgba(15, 23, 42, 0.08));
}

.portal-summary article {
    position: relative;
    min-height: 132px;
    overflow: hidden;
    padding: 18px;
}

.portal-summary article::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.07;
    pointer-events: none;
}

.portal-summary-primary::after {
    background: linear-gradient(135deg, #172446, transparent 70%);
}

.portal-summary-success::after {
    background: linear-gradient(135deg, #04a777, transparent 70%);
}

.portal-summary-info::after {
    background: linear-gradient(135deg, #2176ff, transparent 70%);
}

.portal-summary-icon {
    position: relative;
    z-index: 1;
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    font-size: 16px;
}

.portal-summary-success .portal-summary-icon {
    background: #04a777;
}

.portal-summary-info .portal-summary-icon {
    background: #2176ff;
}

.portal-summary span,
.portal-summary strong {
    position: relative;
    z-index: 1;
    display: block;
}

.portal-summary span {
    margin-bottom: 8px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.portal-summary strong {
    color: var(--sms-primary, #172446);
    font-size: 24px;
    font-weight: 850;
    line-height: 1.1;
}

.portal-section {
    margin-top: 22px;
}

.portal-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.portal-section h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--sms-primary, #172446);
    font-size: 18px;
    font-weight: 850;
}

.portal-section h2::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 22px;
    border-radius: 999px;
    background: var(--sms-primary, #172446);
}

.portal-customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.portal-card {
    padding: 18px;
}

.portal-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--sms-primary, #172446);
    font-size: 17px;
    font-weight: 850;
}

.portal-card h3 i,
.portal-section h2 i {
    color: var(--sms-primary, #172446);
}

.portal-card dl {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px 14px;
    margin: 0;
}

.portal-card dt {
    color: var(--sms-muted, #667085);
    font-size: 13px;
    font-weight: 800;
}

.portal-card dd {
    margin: 0;
    color: #344054;
}

.portal-table-wrap {
    overflow-x: auto;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
}

.portal-table th,
.portal-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf1f6;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.portal-table th {
    color: var(--sms-muted, #667085);
    background: var(--sms-surface-soft, #f9fafb);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.portal-table td {
    color: #344054;
    font-size: 14px;
}

.portal-table tr:last-child td {
    border-bottom: 0;
}

.portal-table tbody tr:hover td {
    background: #f8fafc;
}

.portal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 720px) {
    .portal-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 16px;
    }

    .portal-login-panel {
        padding: 22px;
    }

    .portal-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-summary {
        grid-template-columns: 1fr;
    }

    .portal-card dl {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .portal-table-wrap {
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .portal-table,
    .portal-table thead,
    .portal-table tbody,
    .portal-table th,
    .portal-table td,
    .portal-table tr {
        display: block;
    }

    .portal-table thead {
        display: none;
    }

    .portal-table tr {
        margin-bottom: 12px;
        border: 1px solid var(--sms-border, #e5e7eb);
        border-radius: var(--sms-radius, 8px);
        background: #ffffff;
        box-shadow: var(--sms-shadow, 0 12px 30px rgba(15, 23, 42, 0.08));
    }

    .portal-table td {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        white-space: normal;
    }

    .portal-table td::before {
        content: attr(data-label);
        color: var(--sms-muted, #667085);
        font-weight: 800;
    }

    .portal-actions {
        justify-content: flex-end;
    }
}
