.portal-auth,
.portal-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 36px auto 72px;
    color: #102a43;
}

.portal-auth,
.portal-auth > *,
.portal-auth__intro,
.portal-auth__card,
.portal-auth form,
.portal-shell,
.portal-panels,
.portal-card {
    min-width: 0;
}

.portal-auth {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(380px, .8fr);
    overflow: hidden;
    min-height: 590px;
    border: 1px solid #dce6ee;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(16, 42, 67, .12);
}

.portal-auth__intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(36px, 7vw, 84px);
    color: #fff;
    background: linear-gradient(145deg, #0c2941 0%, #123f5f 100%);
}

.portal-auth--professional .portal-auth__intro {
    background: linear-gradient(145deg, #073b3a 0%, #0e665e 100%);
}

.portal-auth__intro h1 {
    max-width: 650px;
    margin: 12px 0 18px;
    color: #fff;
    font-size: clamp(2.25rem, 5vw, 4.6rem);
    line-height: .98;
}

.portal-auth__intro > p {
    max-width: 590px;
    margin: 0;
    color: #dcebf5;
    font-size: 1.05rem;
    line-height: 1.75;
}

.portal-benefits {
    display: grid;
    gap: 13px;
    padding: 0;
    margin: 34px 0 0;
    list-style: none;
}

.portal-benefits li {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 700;
}

.portal-benefits span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    color: #0b634f;
    background: #fff;
}

.portal-auth__card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(30px, 5vw, 62px);
}

.portal-auth__card h2 {
    margin: 8px 0;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.portal-auth__card p {
    color: #60758a;
    line-height: 1.55;
}

.portal-auth form,
.portal-form {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.portal-auth label,
.portal-form label {
    display: grid;
    gap: 8px;
    color: #223d55;
    font-size: .88rem;
    font-weight: 800;
}

.portal-auth input,
.portal-form input,
.portal-form select,
.portal-form textarea,
.portal-upload input,
.portal-upload select,
.job-dialog input,
.job-dialog select,
.job-dialog textarea {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    border: 1px solid #cbd9e5;
    border-radius: 11px;
    padding: 11px 13px;
    color: #102a43;
    background: #fff;
    font: inherit;
}

.portal-auth input:focus,
.portal-form input:focus,
.portal-form select:focus,
.portal-form textarea:focus,
.portal-upload input:focus,
.portal-upload select:focus,
.job-dialog input:focus,
.job-dialog select:focus,
.job-dialog textarea:focus {
    outline: 3px solid rgba(22, 151, 115, .15);
    border-color: #169773;
}

.portal-auth form .button {
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
}

.portal-auth__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: #8192a2;
    font-size: .8rem;
}

.portal-auth__divider::before,
.portal-auth__divider::after {
    height: 1px;
    flex: 1;
    content: "";
    background: #e1e8ee;
}

.portal-social {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.portal-social .button { text-align: center; }
.portal-auth__foot { margin: 24px 0 0; text-align: center; }
.portal-auth__foot a { color: #086f58; font-weight: 800; }

.portal-kicker {
    color: #b16b00;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.portal-auth__intro .portal-kicker,
.portal-hero .portal-kicker { color: #ffbd24; }

.portal-alert {
    margin: 18px 0;
    border: 1px solid #efb4b4;
    border-radius: 12px;
    padding: 13px 15px;
    color: #9c2429;
    background: #fff0f0;
    font-size: .9rem;
    line-height: 1.5;
}

.portal-alert.is-success {
    border-color: #a7d9c9;
    color: #0a654f;
    background: #edf9f5;
}

.portal-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 34px clamp(24px, 5vw, 54px);
    border-radius: 24px 24px 0 0;
    color: #fff;
    background: linear-gradient(135deg, #0d2d46, #174a6c);
}

.portal-hero--professional { background: linear-gradient(135deg, #083936, #0c695e); }
.portal-hero h1 { margin: 8px 0; color: #fff; font-size: clamp(1.9rem, 4vw, 3.2rem); }
.portal-hero p { max-width: 660px; margin: 0; color: #d8e7f1; }
.portal-hero__actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }

.portal-tabs {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    gap: 4px;
    padding: 0 20px;
    border: 1px solid #dce6ee;
    border-top: 0;
    background: #fff;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.portal-tabs button {
    flex: 0 0 auto;
    min-height: 48px;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 18px 16px 15px;
    color: #60758a;
    background: transparent;
    font: inherit;
    font-size: .86rem;
    font-weight: 800;
    cursor: pointer;
}

.portal-tabs button:hover,
.portal-tabs button.is-active { border-bottom-color: #169773; color: #0b604d; }

.portal-panels {
    min-height: 550px;
    padding: clamp(18px, 3vw, 30px);
    border: 1px solid #dce6ee;
    border-top: 0;
    border-radius: 0 0 24px 24px;
    background: #f4f7fa;
}

.portal-panel { display: none; }
.portal-panel.is-active { display: block; }

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

.portal-metric,
.portal-card {
    border: 1px solid #dce6ee;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(16, 42, 67, .05);
}

.portal-metric { padding: 20px; }
.portal-metric small { display: block; color: #6d8194; font-weight: 700; }
.portal-metric strong { display: block; margin-top: 8px; color: #102a43; font-size: 1.65rem; }
.portal-metric span { display: block; margin-top: 5px; color: #169773; font-size: .76rem; font-weight: 800; }

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

.portal-grid--wide { grid-template-columns: .9fr 1.5fr; }
.portal-card { padding: clamp(18px, 3vw, 26px); }

.portal-card__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.portal-card__heading > * { min-width: 0; }

.portal-card__heading h2 { margin: 5px 0 0; font-size: 1.25rem; }
.portal-link-button { border: 0; color: #076d55; background: transparent; font-weight: 800; cursor: pointer; }

.portal-empty {
    border: 1px dashed #c8d7e2;
    border-radius: 13px;
    padding: 26px;
    color: #60758a;
    text-align: center;
    background: #f9fbfc;
}

.portal-empty b { display: block; margin-bottom: 6px; color: #29475f; }

.portal-list { display: grid; gap: 11px; }
.portal-list__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid #e0e8ef;
    border-radius: 13px;
    padding: 15px;
    color: inherit;
    background: #fff;
    text-decoration: none;
}

.portal-list__item:hover { border-color: #aabfce; }
.portal-list__item > div { min-width: 0; }
.portal-list__item h3 { margin: 0 0 5px; font-size: .98rem; }
.portal-list__item h3,
.portal-list__item p,
.document-row { overflow-wrap: anywhere; }
.portal-list__item p { margin: 0; color: #667d91; font-size: .81rem; line-height: 1.5; }
.portal-list__item > div:last-child { flex: 0 0 auto; text-align: right; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 9px;
    color: #4c6174;
    background: #edf2f6;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.status-pill--active,
.status-pill--approved,
.status-pill--online,
.status-pill--completed { color: #087259; background: #dff5ed; }
.status-pill--attention,
.status-pill--pending { color: #925800; background: #fff0c7; }
.status-pill--danger,
.status-pill--rejected,
.status-pill--cancelled { color: #a12c32; background: #fde7e7; }

.next-action {
    border-left: 4px solid #ffb91e;
    border-radius: 10px;
    padding: 16px;
    background: #fff8e5;
}

.next-action h3 { margin: 0 0 6px; }
.next-action p { margin: 0 0 15px; color: #667686; line-height: 1.55; }
.next-action__buttons { display: flex; flex-wrap: wrap; gap: 9px; }

.portal-filter-row { display: flex; overflow-x: auto; overscroll-behavior-inline: contain; gap: 8px; margin-bottom: 18px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.portal-filter-row button {
    flex: 0 0 auto;
    min-height: 42px;
    border: 1px solid #cad8e3;
    border-radius: 999px;
    padding: 8px 14px;
    color: #51697d;
    background: #fff;
    font: inherit;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
}
.portal-filter-row button.is-active { border-color: #169773; color: #fff; background: #169773; }

.portal-form { grid-template-columns: 1fr 1fr; }
.portal-form__wide { grid-column: 1 / -1; }
.portal-form textarea { resize: vertical; }

.portal-upload { display: grid; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #e0e8ef; }

.availability-switch { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.availability-switch input { position: absolute; width: 1px; min-height: 0; height: 1px; margin: 0; padding: 0; overflow: hidden; opacity: 0; pointer-events: none; }
.availability-switch span { position: relative; width: 48px; height: 27px; border-radius: 999px; background: #7d909f; transition: .2s; }
.availability-switch span::after { position: absolute; top: 4px; left: 4px; width: 19px; height: 19px; border-radius: 50%; content: ""; background: #fff; transition: .2s; }
.availability-switch input:checked + span { background: #23b98b; }
.availability-switch input:checked + span::after { transform: translateX(21px); }
.availability-switch input:focus-visible + span { outline: 3px solid rgba(255, 189, 36, .45); outline-offset: 3px; }
.availability-switch b { min-width: 49px; color: #fff; font-size: .85rem; }

.job-card { position: relative; }
.job-card__amount { color: #102a43; font-weight: 900; }
.job-card__booking-state { margin-top: 5px !important; color: #0b755b !important; font-weight: 800; }
.provider-booking-status { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 16px 20px; border: 1px solid #b9ddcf; border-radius: 14px; color: #075f4c; background: #ecfaf5; }
.provider-booking-status strong { font-size: 1rem; }
.provider-booking-status span { color: #3c6b60; font-size: .78rem; text-align: right; }
.provider-booking-status.has-offer { color: #73510f; border-color: #f0d38e; background: #fff8e6; }
.provider-booking-status.has-offer span { color: #82682f; }
.provider-booking-status.is-empty { color: #425b70; border-color: #d6e0e7; background: #f3f7f9; }
.provider-booking-status.is-empty span { color: #6c8194; }
.job-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.job-actions > * { max-width: 100%; overflow-wrap: anywhere; }
.job-actions button,
.job-actions a {
    border: 1px solid #b9cbd8;
    border-radius: 9px;
    padding: 8px 11px;
    color: #24455d;
    background: #fff;
    font: inherit;
    font-size: .76rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}
.job-actions .is-primary { border-color: #0b755b; color: #fff; background: #0b755b; }
.job-actions .is-danger { border-color: #efb4b4; color: #9c2429; background: #fff4f4; }

.job-dialog {
    width: min(760px, calc(100% - 24px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    box-sizing: border-box;
    overflow: auto;
    border: 0;
    border-radius: 20px;
    padding: clamp(20px, 4vw, 34px);
    color: #102a43;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
}
.job-dialog:not([open]) { display: none; }
.job-dialog::backdrop { background: rgba(5, 26, 42, .7); }
.job-dialog.is-fallback-modal {
    position: fixed;
    z-index: 100;
    inset: 16px auto auto 50%;
    margin: 0;
    transform: translateX(-50%);
    box-shadow: 0 0 0 100vmax rgba(5, 26, 42, .7), 0 30px 90px rgba(0, 0, 0, .28);
}
.job-dialog__close { position: sticky; top: 0; float: right; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%; color: #102a43; background: #edf2f6; font-size: 1.5rem; cursor: pointer; }
.job-detail__header { padding-right: 45px; }
.job-detail__header h2 { margin: 6px 0; }
.job-detail__section { margin-top: 22px; border-top: 1px solid #e1e8ee; padding-top: 18px; }
.job-detail__section h3 { margin: 0 0 12px; }
.job-detail__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.job-detail__fact { border-radius: 10px; padding: 12px; background: #f3f7f9; }
.job-detail__fact small { display: block; color: #6c8194; }
.job-detail__fact b { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.job-location { width: 100%; box-sizing: border-box; }
.job-location__notice { margin: 0 0 10px; color: #526b7d; font-size: .76rem; }
.job-location__notice.is-error { color: #9c2429; }
.job-location__map { position: relative; width: 100%; height: 300px; overflow: hidden; border: 1px solid #d6e0e7; border-radius: 13px; background: #dce9e4; }
.job-location__map .leaflet-tile { max-width: none !important; }
.job-map-marker-host { border: 0; background: transparent; }
.job-map-marker { display: grid; place-items: center; width: 42px; height: 42px; border: 3px solid #fff; border-radius: 50%; font-size: .65rem; font-weight: 900; box-shadow: 0 0 0 6px rgba(16,42,67,.14), 0 5px 14px rgba(16,42,67,.24); }
.job-map-marker--destination { color: #fff; background: #102a43; }
.job-map-marker--professional { color: #102a43; background: #ffbd24; }
.job-workflow { display: grid; gap: 10px; }
.job-workflow label { display: grid; gap: 6px; color: #425b70; font-size: .8rem; font-weight: 800; }
.quote-lines { display: grid; gap: 8px; }
.quote-line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; border: 1px solid #e0e8ef; border-radius: 12px; background: #f8fafb; }
.quote-line > * { min-width: 0; }
.quote-line [name="description"] { grid-column: 1 / -1; }
.quote-line button { justify-self: end; width: 42px; min-height: 42px; border: 0; border-radius: 8px; color: #9c2429; background: #fdeaea; cursor: pointer; }
.schedule-days { display: grid; gap: 9px; }
.schedule-day { display: grid; grid-template-columns: 22px minmax(90px,1fr) 120px 120px; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid #e1e8ee; border-radius: 10px; }
.schedule-day input[type="time"] { width: 100%; }
.document-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid #e8edf2; }
.document-row:last-child { border-bottom: 0; }
.document-row p { margin: 4px 0 0; color: #6c8092; font-size: .78rem; }

.portal-loading {
    position: fixed;
    z-index: 20;
    right: 22px;
    bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 999px;
    padding: 11px 16px;
    color: #fff;
    background: #102a43;
    box-shadow: 0 12px 40px rgba(16, 42, 67, .25);
    font-size: .82rem;
    font-weight: 800;
}
.portal-loading[hidden] { display: none; }
.portal-loading span { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #ffbd24; border-radius: 50%; animation: portal-spin .8s linear infinite; }
@keyframes portal-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .portal-auth { grid-template-columns: 1fr; }
    .portal-auth__intro { min-height: 320px; }
    .portal-metrics { grid-template-columns: repeat(2, 1fr); }
    .portal-grid,
    .portal-grid--wide { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    html, body { overflow-x: hidden; }
    .portal-auth,
    .portal-shell { width: min(100% - 20px, 1180px); margin-top: 14px; }
    .portal-auth { border-radius: 19px; }
    .portal-auth__intro { min-height: 0; padding: 34px 25px; }
    .portal-auth__intro > *, .portal-auth__card > * { max-width: 100%; overflow-wrap: anywhere; }
    .portal-auth__intro h1 { font-size: 2.3rem; }
    .portal-auth__card { padding: 28px 22px; }
    .portal-social { grid-template-columns: 1fr; }
    .portal-hero { align-items: flex-start; flex-direction: column; padding: 26px 20px; border-radius: 19px 19px 0 0; }
    .portal-hero__actions { width: 100%; flex-wrap: wrap; justify-content: space-between; }
    .portal-tabs { padding: 0 8px; }
    .portal-tabs button { padding-inline: 12px; }
    .portal-panels { padding: 12px; }
    .portal-metrics { gap: 9px; }
    .portal-metric { padding: 15px; }
    .portal-metric strong { font-size: 1.25rem; }
    .portal-form { grid-template-columns: 1fr; }
    .portal-form__wide { grid-column: auto; }
    .portal-card__heading { align-items: stretch; flex-direction: column; }
    .portal-card__heading > .button,
    .portal-card__heading > .portal-link-button { width: 100%; min-height: 42px; text-align: center; }
    .portal-list__item { flex-direction: column; }
    .portal-list__item > div:last-child { width: 100%; text-align: left; }
    .job-detail__facts { grid-template-columns: 1fr; }
    .provider-booking-status { align-items: flex-start; flex-direction: column; gap: 4px; }
    .provider-booking-status span { text-align: left; }
    .job-location__map { height: 260px; }
    .quote-line { grid-template-columns: 1fr; }
    .quote-line [name="description"] { grid-column: auto; }
    .schedule-day { grid-template-columns: 22px 1fr; }
    .schedule-day input[type="time"] { grid-column: span 1; }
}
