/* Customer application shell. Kept separate from the public-site stylesheet. */
body.portal-standalone {
    --panel-ink: #172033;
    --panel-muted: #667085;
    --panel-line: #e5eaf1;
    --panel-surface: #ffffff;
    --panel-canvas: #f3f6fa;
    --panel-navy: #0e1729;
    --panel-blue: #2864dc;
    --panel-blue-soft: #edf4ff;
    background: var(--panel-canvas);
    color: var(--panel-ink);
}

body.portal-standalone .portal-page-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(218, 225, 235, 0.9);
    backdrop-filter: blur(18px);
}

body.portal-standalone .portal-page-header .header-content {
    width: min(100%, 1480px);
    min-height: 72px;
    padding: 0.75rem clamp(1rem, 3vw, 2.25rem);
}

body.portal-standalone .portal-page-header .brand,
body.portal-standalone .portal-page-header .brand:visited,
body.portal-standalone .portal-page-header .brand__name {
    color: var(--panel-ink);
}

body.portal-standalone .brand__logo {
    width: 42px;
    height: 42px;
    border-radius: 13px;
}

.portal-brand-copy {
    display: grid;
    line-height: 1.15;
}

.portal-brand-copy__context {
    margin-top: 0.2rem;
    color: var(--panel-muted);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-header-help {
    border: 1px solid var(--panel-line);
    border-radius: 12px;
    background: #fff;
    color: var(--panel-ink);
    padding: 0.7rem 1rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 650;
    cursor: pointer;
}

body.portal-standalone main {
    padding: 0;
}

body.portal-standalone .portal-shell {
    margin: 0;
    padding: clamp(1rem, 2vw, 1.75rem);
}

body.portal-standalone .portal-shell__window {
    width: min(100%, 1480px);
    min-height: calc(100vh - 108px);
    border: 1px solid #dfe5ee;
    border-radius: 24px;
    background: var(--panel-surface);
    box-shadow: 0 24px 70px -42px rgba(21, 37, 64, 0.42);
}

body.portal-standalone .portal-shell__header {
    align-items: center;
    padding: 1.35rem clamp(1.25rem, 3vw, 2.25rem);
    background: #fff;
    border-bottom: 1px solid var(--panel-line);
}

.portal-shell__heading {
    display: grid;
    gap: 0.2rem;
}

body.portal-standalone .portal-shell__eyebrow {
    color: var(--panel-blue);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
}

body.portal-standalone .portal-shell__title {
    color: var(--panel-ink);
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    letter-spacing: -0.03em;
}

body.portal-standalone .portal-shell__subtitle {
    color: var(--panel-muted);
    font-size: 0.9rem;
}

body.portal-standalone .portal-shell__body {
    align-items: stretch;
    background: var(--panel-canvas);
}

body.portal-standalone .portal-shell__nav {
    position: relative;
    width: 252px;
    flex: 0 0 252px;
    gap: 0.35rem;
    padding: 1.25rem 1rem;
    background: var(--panel-navy);
}

.portal-nav__group-label {
    margin: 0.3rem 0.75rem 0.5rem;
    color: #8290a7;
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.portal-standalone .portal-nav__item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 46px;
    padding: 0.45rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #aeb9ca;
    font-size: 0.88rem;
    font-weight: 620;
}

.portal-nav__icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    color: #90a6c7;
    font-size: 1rem;
    line-height: 1;
}

body.portal-standalone .portal-nav__item:hover,
body.portal-standalone .portal-nav__item:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    transform: none;
}

body.portal-standalone .portal-nav__item.is-active {
    border-color: rgba(103, 150, 255, 0.22);
    background: rgba(54, 103, 213, 0.2);
    color: #fff;
    transform: none;
}

body.portal-standalone .portal-nav__item.is-active .portal-nav__icon {
    border-color: rgba(117, 162, 255, 0.35);
    background: #2d64d6;
    color: #fff;
}

.portal-nav__account {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: auto;
    padding: 1rem 0.65rem 0.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    color: #fff;
}

.portal-nav__avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 12px;
    background: #2d64d6;
    font-weight: 750;
}

.portal-nav__account-copy {
    display: grid;
    min-width: 0;
}

.portal-nav__account-copy strong,
.portal-nav__account-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-nav__account-copy strong {
    font-size: 0.85rem;
}

.portal-nav__account-copy small {
    color: #8997ac;
    font-size: 0.71rem;
}

body.portal-standalone .portal-shell__content {
    gap: 1rem;
    min-width: 0;
    padding: clamp(1rem, 2.5vw, 2rem);
    background: var(--panel-canvas);
}

body.portal-standalone .console__status {
    min-height: 52px;
    padding: 0.55rem 0.65rem 0.55rem 0.9rem;
    border: 1px solid var(--panel-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: none;
}

body.portal-standalone .console__status-text {
    color: var(--panel-ink);
    font-size: 0.85rem;
}

body.portal-standalone .console__status-sub {
    color: var(--panel-muted);
    font-size: 0.72rem;
}

body.portal-standalone .chip-button,
body.portal-standalone .button {
    min-height: 42px;
    padding: 0.7rem 1rem;
    border-radius: 12px;
}

body.portal-standalone .button--primary {
    border: 1px solid #2459c4;
    background: var(--panel-blue);
    box-shadow: 0 10px 24px -16px rgba(40, 100, 220, 0.8);
}

body.portal-standalone .portal-view {
    gap: 1.35rem;
}

body.portal-standalone .portal-view__header h3 {
    color: var(--panel-ink);
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    letter-spacing: -0.035em;
}

body.portal-standalone .app-view__lead {
    color: var(--panel-muted);
}

.portal-dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: clamp(1.35rem, 3vw, 2.1rem);
    border: 1px solid #dce6f7;
    border-radius: 20px;
    background: linear-gradient(118deg, #fff 15%, #edf4ff 100%);
}

.portal-dashboard-hero__eyebrow,
.customer-card-heading__eyebrow {
    margin: 0 0 0.25rem;
    color: var(--panel-blue);
    font-size: 0.67rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portal-dashboard-hero h3 {
    margin: 0;
    color: var(--panel-ink);
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    letter-spacing: -0.045em;
}

.portal-dashboard-hero p:last-child {
    margin: 0.4rem 0 0;
    color: var(--panel-muted);
    font-size: 0.92rem;
}

.portal-dashboard-hero__action {
    flex: 0 0 auto;
    gap: 0.45rem;
}

.customer-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.customer-metric-card {
    position: relative;
    display: grid;
    gap: 0.2rem;
    min-height: 138px;
    overflow: hidden;
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--panel-line);
    border-radius: 17px;
    background: #fff;
}

.customer-metric-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #4778e6;
    content: '';
}

.customer-metric-card--waiting::before {
    background: #e7a533;
}

.customer-metric-card--completed::before {
    background: #1f9d76;
}

.customer-metric-card__label {
    color: var(--panel-muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.customer-metric-card strong {
    color: var(--panel-ink);
    font-size: 2rem;
    line-height: 1.2;
}

.customer-metric-card > span:last-child {
    align-self: end;
    color: var(--panel-muted);
    font-size: 0.78rem;
}

.customer-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
    gap: 0.9rem;
}

body.portal-standalone .app-card {
    padding: clamp(1rem, 2vw, 1.35rem);
    border: 1px solid var(--panel-line);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 14px 34px -30px rgba(28, 49, 83, 0.65);
}

.customer-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.customer-card-heading h4 {
    margin: 0;
    color: var(--panel-ink);
    font-size: 1rem;
}

.customer-recent-jobs {
    display: grid;
}

.customer-recent-job {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 70px;
    padding: 0.75rem 0.25rem;
    border: 0;
    border-top: 1px solid var(--panel-line);
    background: transparent;
    color: inherit;
    text-align: start;
    cursor: pointer;
}

.customer-recent-job:hover {
    background: #f8faff;
}

.customer-recent-job__marker {
    width: 10px;
    height: 10px;
    border: 3px solid #dbe7ff;
    border-radius: 50%;
    background: var(--panel-blue);
    box-sizing: content-box;
}

.customer-recent-job__copy {
    display: grid;
    min-width: 0;
}

.customer-recent-job__copy strong,
.customer-recent-job__copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-recent-job__copy strong {
    color: var(--panel-ink);
    font-size: 0.88rem;
}

.customer-recent-job__copy small {
    color: var(--panel-muted);
    font-size: 0.75rem;
}

.customer-recent-jobs__empty {
    display: grid;
    gap: 0.3rem;
    min-height: 170px;
    place-content: center;
    padding: 1.25rem;
    color: var(--panel-muted);
    text-align: center;
}

.customer-recent-jobs__empty strong {
    color: var(--panel-ink);
}

.customer-quick-actions {
    display: grid;
    gap: 0.55rem;
}

.customer-quick-actions button {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    min-height: 58px;
    padding: 0.7rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #f7f9fc;
    color: inherit;
    text-align: start;
    cursor: pointer;
}

.customer-quick-actions button:hover,
.customer-quick-actions button:focus-visible {
    border-color: #d8e3f8;
    background: var(--panel-blue-soft);
}

.customer-quick-actions button > span:first-child {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 10px;
    background: #e7efff;
    color: var(--panel-blue);
    font-size: 1rem;
}

.customer-quick-actions button > span:last-child {
    display: grid;
}

.customer-quick-actions strong {
    color: var(--panel-ink);
    font-size: 0.83rem;
}

.customer-quick-actions small {
    color: var(--panel-muted);
    font-size: 0.71rem;
}

body.portal-standalone .field input,
body.portal-standalone .field select,
body.portal-standalone .field textarea {
    border-color: #dce2eb;
    border-radius: 12px;
    background: #fbfcfe;
}

body.portal-standalone .field input:focus,
body.portal-standalone .field select:focus,
body.portal-standalone .field textarea:focus {
    border-color: #7da4f2;
    outline: 3px solid rgba(40, 100, 220, 0.12);
}

body.portal-standalone .job-card {
    border: 1px solid var(--panel-line);
    border-radius: 15px;
    background: #fff;
    box-shadow: none;
}

body.portal-standalone .status-badge[data-status='assigned'] {
    border-color: #bfd3ff;
    background: #edf3ff;
    color: #2458bd;
}

body.portal-standalone .status-badge[data-status='in_progress'] {
    border-color: #bde8de;
    background: #eaf8f4;
    color: #14795f;
}

body.portal-standalone .status-badge[data-status='completed'],
body.portal-standalone .status-badge[data-status='paid'] {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #475569;
}

@media (max-width: 980px) {
    body.portal-standalone .portal-shell__body {
        flex-direction: column;
    }

    body.portal-standalone .portal-shell__nav {
        position: sticky;
        top: 0;
        z-index: 4;
        width: 100%;
        flex: 0 0 auto;
        flex-direction: row;
        overflow-x: auto;
        padding: 0.65rem;
        scrollbar-width: none;
    }

    body.portal-standalone .portal-shell__nav::-webkit-scrollbar,
    .portal-nav__group-label,
    .portal-nav__account {
        display: none;
    }

    body.portal-standalone .portal-nav__item {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 0.35rem 0.65rem 0.35rem 0.4rem;
    }

    .portal-nav__icon {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .customer-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    body.portal-standalone .portal-page-header .header-content {
        min-height: 64px;
        gap: 0.5rem;
        padding-inline: 0.75rem;
    }

    body.portal-standalone .portal-page-header .brand {
        min-width: 0;
        gap: 0.5rem;
        font-size: 0.95rem;
    }

    body.portal-standalone .brand__logo {
        width: 36px;
        height: 36px;
        border-radius: 11px;
    }

    body.portal-standalone .header-actions,
    body.portal-standalone .header-locale,
    body.portal-standalone .locale-switcher {
        min-width: 0;
        flex-wrap: nowrap;
    }

    body.portal-standalone .locale-switcher__icon {
        display: none;
    }

    body.portal-standalone .locale-switcher__select {
        width: 7.75rem;
        min-width: 0;
        padding-inline-start: 0.65rem;
        padding-inline-end: 1.55rem;
    }

    .portal-brand-copy__context,
    .portal-header-help,
    body.portal-standalone .portal-shell__subtitle,
    body.portal-standalone .portal-shell__eyebrow {
        display: none;
    }

    body.portal-standalone .portal-shell {
        padding: 0;
    }

    body.portal-standalone .portal-shell__window {
        min-height: calc(100vh - 64px);
        border: 0;
        border-radius: 0;
    }

    body.portal-standalone .portal-shell__header {
        padding: 0.9rem 1rem;
    }

    body.portal-standalone .portal-shell__content {
        padding: 0.85rem;
    }

    body.portal-standalone .console__status-sub {
        display: none;
    }

    .portal-dashboard-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .portal-dashboard-hero__action {
        width: 100%;
    }

    .customer-metric-grid {
        grid-template-columns: 1fr;
    }

    .customer-metric-card {
        min-height: 108px;
    }

    .customer-recent-job {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .customer-recent-job .status-badge {
        grid-column: 2;
        justify-self: start;
    }
}
