/* Client portal only. Staff pages do not use .portal-shell. */

.portal-shell {
    background: #f4f1ea;
}

.portal-shell .main-content {
    background: #f4f1ea;
    min-width: 0;
}

.portal-shell .sidebar .nav-links {
    scrollbar-width: thin;
    scrollbar-color: rgba(197, 160, 33, 0.45) transparent;
}

.portal-shell .nav-links a.portal-sub {
    padding: 8px 18px 8px 62px;
    font-size: 13px;
    font-weight: 400;
    gap: 0;
}

.portal-shell .user-profile #portalAvatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #c5a021;
    color: #002147;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.portal-shell .portal-topbar {
    background: #002147;
    color: #ffffff;
    border-bottom: none;
    padding: 22px 32px;
    gap: 16px;
    align-items: center;
}

.portal-shell .portal-topbar h1 {
    color: #ffffff;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.portal-shell .portal-heading p {
    color: #c9d4e3;
    font-size: 14px;
    margin-top: 4px;
    line-height: 1.4;
}

.portal-shell .portal-menu {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: transparent;
    color: #ffffff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.portal-shell .portal-banner {
    margin: 20px 32px 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
}

.portal-shell .portal-page {
    padding: 32px;
    max-width: 1500px;
    width: 100%;
}

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

.portal-shell .portal-stat {
    background: #ffffff;
    border: 1px solid #e7e2d6;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0, 33, 71, 0.05);
    padding: 18px 18px 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    min-height: 118px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portal-shell .portal-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 33, 71, 0.08);
}

.portal-shell .portal-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 33, 71, 0.06);
    color: #002147;
    flex-shrink: 0;
}

.portal-shell .portal-stat-icon.is-gold { background: rgba(197, 160, 33, 0.16); color: #8a7012; }
.portal-shell .portal-stat-icon.is-alert { background: rgba(185, 28, 28, 0.08); color: #b91c1c; }

.portal-shell .portal-stat-label {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.portal-shell .portal-stat-value {
    margin: 6px 0 0;
    font-size: 28px;
    line-height: 1.1;
    color: #002147;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.portal-shell .portal-stat-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #94a3b8;
}

.portal-shell .portal-dash {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
    gap: 18px;
    margin-top: 18px;
    align-items: start;
}

.portal-shell .portal-dash-side {
    display: grid;
    gap: 18px;
}

.portal-shell .portal-panel,
.portal-shell .card {
    background: #ffffff;
    border: 1px solid #e7e2d6;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0, 33, 71, 0.05);
    padding: 22px 24px;
}

.portal-shell .card:hover {
    transform: none;
}

.portal-shell .portal-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.portal-shell .portal-panel-head h2 {
    margin: 0;
    font-size: 18px;
    color: #002147;
    letter-spacing: -0.02em;
}

.portal-shell .portal-panel-head p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.portal-shell .portal-stack {
    display: grid;
    gap: 12px;
}

.portal-shell .matter-card,
.portal-shell .doc-card,
.portal-shell .pay-card {
    border: 1px solid #eeeae2;
    border-radius: 16px;
    padding: 16px 16px 14px;
    background: #fffcf7;
}

.portal-shell .matter-card h3,
.portal-shell .pay-card h3 {
    margin: 0;
    font-size: 16px;
    color: #002147;
}

.portal-shell .matter-top,
.portal-shell .doc-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.portal-shell .doc-top strong,
.portal-shell .matter-top h3 {
    min-width: 0;
}

.portal-shell .portal-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    line-height: 1.3;
    max-width: 100%;
}

.portal-shell .portal-pill.is-done { background: #e8f6ef; color: #106b4d; }
.portal-shell .portal-pill.is-current { background: rgba(197, 160, 33, 0.16); color: #7a6410; }
.portal-shell .portal-pill.is-alert { background: #fee2e2; color: #b91c1c; }

.portal-shell .progress-track {
    height: 8px;
    background: #e7e2d6;
    border-radius: 99px;
    overflow: hidden;
    margin: 12px 0 6px;
}

.portal-shell .progress-track span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #002147, #c5a021);
}

.portal-shell .meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: #64748b;
    font-size: 13px;
    margin-top: 8px;
}

.portal-shell .row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.portal-shell .portal-empty {
    text-align: center;
    padding: 36px 18px 28px;
}

.portal-shell .portal-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 33, 71, 0.06);
    color: #002147;
    font-size: 24px;
}

.portal-shell .portal-empty h3 {
    margin: 0;
    color: #002147;
    font-size: 18px;
}

.portal-shell .portal-empty p {
    margin: 8px auto 0;
    max-width: 460px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.55;
}

.portal-shell .portal-empty .btn {
    margin-top: 16px;
}

.portal-shell .portal-select {
    margin-bottom: 16px;
}

.portal-shell .portal-select label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #002147;
    margin-bottom: 6px;
}

.portal-shell .portal-timeline {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.portal-shell .portal-timeline li {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 14px;
    position: relative;
    padding-bottom: 18px;
}

.portal-shell .portal-timeline li:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 26px;
    bottom: 0;
    width: 2px;
    background: #e7e2d6;
}

.portal-shell .portal-timeline .mark {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 2px solid #cbd5e1;
    color: #94a3b8;
    background: #fff;
    position: relative;
    z-index: 1;
}

.portal-shell .portal-timeline .done .mark {
    background: #106b4d;
    border-color: #106b4d;
    color: #fff;
}

.portal-shell .portal-timeline .current .mark {
    background: #c5a021;
    border-color: #c5a021;
    color: #002147;
    box-shadow: 0 0 0 4px rgba(197, 160, 33, 0.2);
}

.portal-shell .portal-timeline strong { color: #002147; }
.portal-shell .portal-timeline .future strong { color: #94a3b8; }

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

.portal-shell .matter-table th {
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0 12px 10px 0;
}

.portal-shell .matter-table td {
    padding: 14px 12px 14px 0;
    border-top: 1px solid #eeeae2;
    vertical-align: middle;
    font-size: 14px;
}

.portal-shell .tabs button.active {
    background: #002147;
    border-color: #002147;
}

.portal-shell .help-panel { max-width: 760px; }
.portal-shell .contact-line { margin: 10px 0; font-size: 15px; }
.portal-shell .contact-line a { color: #002147; }

.portal-overlay { display: none; }

@media (max-width: 1100px) {
    .portal-shell .portal-stats { grid-template-columns: 1fr 1fr; }
    .portal-shell .portal-dash { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
    .portal-shell .main-content {
        padding: 0;
        width: auto;
        flex: 1;
    }

    .portal-shell .portal-menu { display: inline-flex; }

    .portal-shell .portal-overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 21, 42, 0.45);
        z-index: 1500;
    }

    .portal-shell .portal-page,
    .portal-shell .portal-banner {
        margin-left: 16px;
        margin-right: 16px;
    }

    .portal-shell .portal-page { padding: 20px 0 28px; }
    .portal-shell .portal-topbar { padding: 16px; }
    .portal-shell .portal-topbar h1 { font-size: 22px; }
}

@media (max-width: 700px) {
    .portal-shell .portal-stats { grid-template-columns: 1fr; }
    .portal-shell .matter-table thead { display: none; }
    .portal-shell .matter-table,
    .portal-shell .matter-table tbody,
    .portal-shell .matter-table tr,
    .portal-shell .matter-table td { display: block; width: 100%; }
    .portal-shell .matter-table tr {
        border: 1px solid #eeeae2;
        border-radius: 14px;
        padding: 12px 14px;
        margin-bottom: 12px;
        background: #fffcf7;
    }
    .portal-shell .matter-table td { border: 0; padding: 4px 0; }
}
