:root {
    --color-teal: #0e2f36;
    --color-teal-light: #18444c;
    --color-teal-dark: #0a2429;
    --color-teal-soft: #2e5e66;
    --color-orange: #f7931e;
    --color-orange-light: #ffa73a;
    --color-orange-dark: #e67e00;
    --color-cyan: #35d6ff;
    --color-cyan-dark: #0fa3c5;
    --color-green: #00e5a8;
    --color-white: #ffffff;
    --font-heading: 'Manrope', sans-serif;
    --font-body: 'Inter', sans-serif;
    --glass-bg: rgba(14, 67, 80, 0.25);
    --glass-border: rgba(53, 214, 255, 0.22);
    --panel-bg: rgba(7, 27, 32, 0.62);
    --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.35);
    --shadow-cyan: 0 0 24px rgba(53, 214, 255, 0.18);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-white);
    background:
        radial-gradient(circle at 72% 12%, rgba(53, 214, 255, 0.22), transparent 30%),
        radial-gradient(circle at 18% 26%, rgba(247, 147, 30, 0.16), transparent 28%),
        radial-gradient(circle at 52% 86%, rgba(0, 229, 168, 0.13), transparent 28%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.045) 0, rgba(255, 255, 255, 0.045) 1px, transparent 1px, transparent 60px),
        linear-gradient(135deg, var(--color-teal-soft) 0%, var(--color-teal) 45%, var(--color-teal-dark) 100%);
    background-attachment: fixed;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card,
.content-card,
.metric-card {
    border: 1px solid var(--glass-border);
    background: var(--panel-bg);
    box-shadow: var(--shadow-soft), var(--shadow-cyan);
    backdrop-filter: blur(18px);
    border-radius: 28px;
}

.auth-card {
    width: min(100%, 460px);
    padding: 32px;
}

.auth-brand,
.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-weight: 800;
}

.auth-brand img,
.portal-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.auth-card h1,
.portal-topbar h1,
.content-card h2,
.allocation-column h3 {
    font-family: var(--font-heading);
    letter-spacing: -0.03em;
}

.auth-card h1 {
    font-size: 2.2rem;
    margin: 28px 0 8px;
}

.muted,
.fine-print {
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.6;
}

.fine-print {
    font-size: 0.84rem;
}

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

label {
    display: grid;
    gap: 8px;
    color: rgba(255, 255, 255, 0.84);
    font-weight: 700;
    font-size: 0.92rem;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(53, 214, 255, 0.22);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-white);
    padding: 13px 14px;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-cyan);
    box-shadow: 0 0 0 4px rgba(53, 214, 255, 0.12);
}

.standard-input-currency {
    display: flex;
    align-items: center;
    width: 100%;
    border: 1px solid rgba(53, 214, 255, 0.22);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.standard-input-currency:focus-within {
    border-color: var(--color-cyan);
    box-shadow: 0 0 0 4px rgba(53, 214, 255, 0.12);
}

.standard-input-currency-prefix {
    flex: 0 0 auto;
    padding-left: 14px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--color-white);
}

.standard-input-currency input {
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none !important;
    padding-left: 8px;
}

.standard-input-currency input:focus {
    border: 0;
    box-shadow: none;
}

.primary-button,
.secondary-button,
.text-button {
    border: 0;
    cursor: pointer;
    font-weight: 800;
    border-radius: 999px;
    min-height: 46px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.primary-button {
    color: #06242a;
    background: linear-gradient(145deg, var(--color-green), var(--color-cyan));
    box-shadow: 0 12px 28px rgba(53, 214, 255, 0.22);
}

.secondary-button {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.text-button {
    color: var(--color-cyan);
    background: transparent;
    padding-inline: 8px;
}

.small {
    min-height: 38px;
    padding-inline: 16px;
    font-size: 0.9rem;
}

.wide {
    width: 100%;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: rgba(255, 255, 255, 0.6);
}

.auth-divider:before,
.auth-divider:after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(255, 255, 255, 0.16);
}

.portal-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.portal-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px;
    border-right: 1px solid rgba(53, 214, 255, 0.16);
    background: rgba(4, 20, 24, 0.66);
    backdrop-filter: blur(18px);
}

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

.portal-nav {
    display: grid;
    gap: 8px;
}

.portal-nav a {
    padding: 13px 14px;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 750;
}

.portal-nav a:hover,
.portal-nav a:focus {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.08);
}

.portal-nav a[aria-disabled="true"] {
    opacity: 0.45;
}

.portal-main {
    min-width: 0;
}

.portal-topbar {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 32px;
    border-bottom: 1px solid rgba(53, 214, 255, 0.14);
    background: rgba(8, 36, 43, 0.46);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 5;
}

.portal-topbar h1 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--color-cyan);
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 900;
}

.account-menu {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.78);
}

.menu-button {
    display: none;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-white);
    border-radius: 12px;
    width: 44px;
    height: 44px;
}

.portal-content {
    padding: 32px;
    display: grid;
    gap: 24px;
}

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

.metric-card {
    padding: 22px;
}

.metric-card span {
    display: block;
    color: rgba(255, 255, 255, 0.68);
    font-weight: 800;
}

.metric-card strong {
    display: block;
    margin-top: 14px;
    font-family: var(--font-heading);
    font-size: 2.4rem;
    color: var(--color-cyan);
}

.metric-card.warning strong {
    color: var(--color-orange-light);
}

.metric-card.accent strong {
    color: var(--color-green);
}

.content-card {
    padding: 24px;
}

.narrow-card {
    max-width: 760px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

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

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

.portal-table th,
.portal-table td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-table th {
    color: var(--color-cyan);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.empty-state {
    text-align: center;
    display: grid;
    place-items: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.74);
}

.empty-state img {
    width: 96px;
    margin-bottom: 14px;
}

.validation-summary,
.field-validation {
    display: none;
    border: 1px solid rgba(247, 147, 30, 0.35);
    background: rgba(247, 147, 30, 0.12);
    color: #ffd4a0;
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.5;
}

.field-validation:not(:empty),
.validation-summary:not(:empty) {
    display: block;
}

.toast.success {
    margin: 20px 32px 0;
    border: 1px solid rgba(0, 229, 168, 0.35);
    background: rgba(0, 229, 168, 0.12);
    color: #b8ffe9;
    padding: 14px 16px;
    border-radius: 16px;
}

.inline-form,
.form-actions,
.column-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-actions {
    justify-content: flex-end;
    margin-top: 12px;
}

.allocation-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    align-items: start;
}

.allocation-column {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.055);
    border-radius: 22px;
    padding: 16px;
    min-height: 280px;
}

.allocation-column h3 {
    margin: 0 0 14px;
}

.column-title-row {
    justify-content: space-between;
    margin-bottom: 14px;
}

.column-title-row h3 {
    margin: 0;
}

.allocation-list {
    min-height: 210px;
    display: grid;
    align-content: start;
    gap: 12px;
}

.job-card {
    cursor: grab;
    border: 1px solid rgba(53, 214, 255, 0.18);
    background: rgba(6, 24, 29, 0.82);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.job-card strong,
.job-card span,
.job-card small {
    display: block;
}

.job-card span {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.8);
}

.job-card small {
    margin-top: 4px;
    color: var(--color-cyan);
    font-weight: 800;
}

.sortable-ghost {
    opacity: 0.45;
}

.hidden-token-form {
    display: none;
}

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

    .portal-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 180ms ease;
        z-index: 20;
    }

    .portal-sidebar.open {
        transform: translateX(0);
    }

    .menu-button {
        display: inline-grid;
        place-items: center;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .portal-topbar,
    .portal-content {
        padding-inline: 18px;
    }

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

    .account-menu,
    .section-header,
    .inline-form,
    .form-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

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

/*PORTAL REVISION - APP STYLE BACKGROUND*/
body {
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.16), transparent 24%),
        radial-gradient(circle at 22% 82%, rgba(247, 147, 30, 0.42), transparent 34%),
        radial-gradient(circle at 74% 26%, rgba(53, 214, 255, 0.20), transparent 30%),
        radial-gradient(circle at 54% 70%, rgba(0, 229, 168, 0.14), transparent 28%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.075) 0, rgba(255, 255, 255, 0.075) 1px, transparent 1px, transparent 58px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.052) 0, rgba(255, 255, 255, 0.052) 1px, transparent 1px, transparent 58px),
        linear-gradient(145deg, #71878d 0%, #0e454d 27%, #062b32 55%, #071c22 100%);
    background-attachment: fixed;
}

body:before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.12), transparent 18%),
        radial-gradient(circle at 50% 115%, rgba(247, 147, 30, 0.30), transparent 32%);
    mix-blend-mode: screen;
    opacity: 0.72;
}

.portal-shell,
.auth-page {
    position: relative;
    z-index: 1;
}

/*PORTAL REVISION - TEAM SELECTION*/
.team-selection-card {
    max-width: 1180px;
}

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

.team-card {
    display: grid;
    gap: 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055));
    border-radius: 28px;
    padding: 18px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.team-logo-wrap {
    min-height: 154px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.92);
    overflow: hidden;
}

.team-logo-wrap img {
    max-width: 78%;
    max-height: 120px;
    object-fit: contain;
}

.team-card-body h3 {
    margin: 0 0 6px;
    font-size: 1.15rem;
}

.team-card-body p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
}

.team-badge,
.selected-team-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 0 12px;
    margin-top: 10px;
    color: #061d22;
    background: linear-gradient(145deg, var(--color-orange-light), var(--color-orange));
    font-weight: 900;
    font-size: 0.82rem;
}

.selected-team-pill {
    margin-top: 0;
    color: #06242a;
    background: linear-gradient(145deg, var(--color-green), var(--color-cyan));
}

.restricted-team-list {
    margin-top: 32px;
}

/*PORTAL REVISION - APP STYLE DASHBOARD RINGS*/
.dashboard-grid {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.metric-card {
    min-height: 170px;
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 22px;
}

.metric-card:before {
    content: "";
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: conic-gradient(var(--color-cyan) 0deg, rgba(53, 214, 255, 0.18) 0deg);
    box-shadow: inset 0 0 0 13px rgba(7, 27, 32, 0.72), 0 0 28px rgba(53, 214, 255, 0.20);
    position: absolute;
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
}

.metric-card.warning:before {
    background: conic-gradient(var(--color-orange) 0deg, rgba(247, 147, 30, 0.20) 0deg);
    box-shadow: inset 0 0 0 13px rgba(7, 27, 32, 0.72), 0 0 28px rgba(247, 147, 30, 0.18);
}

.metric-card.accent:before {
    background: conic-gradient(var(--color-green) 0deg, rgba(0, 229, 168, 0.20) 0deg);
    box-shadow: inset 0 0 0 13px rgba(7, 27, 32, 0.72), 0 0 28px rgba(0, 229, 168, 0.18);
}

.metric-card span,
.metric-card strong {
    position: relative;
    z-index: 1;
}

.metric-card span {
    align-self: start;
    justify-self: start;
    color: rgba(255, 255, 255, 0.88);
}

.metric-card strong {
    margin-top: 30px;
    color: var(--color-white);
    text-shadow: 0 0 18px rgba(53, 214, 255, 0.28);
}

.toast.error {
    margin: 20px 32px 0;
    border: 1px solid rgba(247, 147, 30, 0.38);
    background: rgba(247, 147, 30, 0.13);
    color: #ffd4a0;
    padding: 14px 16px;
    border-radius: 16px;
}

button:disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.auth-two-factor {
    display: none;
    gap: 14px;
    margin-top: 18px;
}

.auth-two-factor.active {
    display: grid;
}

/*PORTAL REVISION - LOCKED MENU*/
.nav-locked-message {
    margin-top: 8px;
    padding: 14px;
    border: 1px solid rgba(53, 214, 255, 0.16);
    background: rgba(255, 255, 255, 0.055);
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.88rem;
    line-height: 1.5;
}

/*PORTAL REVISION - DASHBOARD RINGS*/
.metric-card {
    --metric-color: var(--color-cyan);
    --metric-track: rgba(53, 214, 255, 0.18);
    --progress: 0deg;
    min-height: 190px;
}

.metric-card.warning {
    --metric-color: var(--color-orange);
    --metric-track: rgba(247, 147, 30, 0.22);
}

.metric-card.accent {
    --metric-color: var(--color-green);
    --metric-track: rgba(0, 229, 168, 0.22);
}

.metric-card:before {
    top: 58px;
    width: 112px;
    height: 112px;
    background: conic-gradient(var(--metric-color) var(--progress), var(--metric-track) var(--progress));
}

.metric-ring-value {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    margin-top: 34px;
}

.metric-ring-value strong {
    margin-top: 0;
}

.metric-ring-value small {
    color: var(--metric-color);
    font-weight: 900;
}

.metric-card em {
    position: relative;
    z-index: 1;
    color: var(--metric-color);
    font-style: normal;
    font-weight: 900;
}

/*PORTAL REVISION - ALLOCATION EMPTY STATES*/
.allocation-empty {
    min-height: 92px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.045);
    border-radius: 18px;
    display: grid;
    place-items: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.66);
    font-weight: 800;
    padding: 16px;
}


.table-search-empty {
    margin-top: 14px;
}

/*PORTAL REVISION - CREATE JOB FORM*/
.job-form-card {
    max-width: 980px;
}

.job-create-form {
    gap: 26px;
}

.form-section {
    display: grid;
    gap: 12px;
}

.form-section h3 {
    margin: 0;
    font-size: 1.15rem;
}

.option-scroller {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 0 12px;
    border-bottom: 6px solid var(--color-orange);
}

.option-pill {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 132px;
    min-height: 58px;
    place-items: center;
    justify-content: center;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid rgba(53, 214, 255, 0.35);
    background: rgba(53, 214, 255, 0.13);
    color: var(--color-white);
    box-shadow: inset 0 0 24px rgba(53, 214, 255, 0.08);
    cursor: pointer;
}

.option-pill.selected,
.option-pill:has(input:checked) {
    border-color: var(--color-orange-light);
    background: rgba(247, 147, 30, 0.23);
    box-shadow: 0 0 22px rgba(247, 147, 30, 0.24), inset 0 0 28px rgba(247, 147, 30, 0.12);
}

.option-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-pill span {
    font-weight: 900;
    white-space: nowrap;
}

.selector-card {
    width: 100%;
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 22px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    color: var(--color-white);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055));
    cursor: pointer;
    text-align: left;
}

.selector-card span {
    font-weight: 900;
    color: #ffe6c4;
}

.selector-card strong {
    font-size: 2rem;
    color: #ffe6c4;
}

.form-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.selector-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(10px);
}

.selector-modal.open {
    display: grid;
}

.selector-dialog {
    width: min(100%, 760px);
    max-height: min(760px, 88vh);
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 16px;
    border: 1px solid var(--glass-border);
    background: rgba(7, 27, 32, 0.94);
    border-radius: 28px;
    box-shadow: var(--shadow-soft), var(--shadow-cyan);
    padding: 22px;
}

.selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.selector-header h3 {
    margin: 0;
    font-size: 1.35rem;
}

.selector-search {
    min-height: 50px;
}

.selector-list {
    display: grid;
    gap: 10px;
    overflow-y: auto;
    padding-right: 4px;
}

.selector-option {
    display: grid;
    gap: 4px;
    width: 100%;
    border: 1px solid rgba(53, 214, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    color: var(--color-white);
    padding: 14px;
    text-align: left;
    cursor: pointer;
}

.selector-option:hover,
.selector-option:focus {
    border-color: var(--color-cyan);
    background: rgba(53, 214, 255, 0.10);
}

.selector-option strong,
.selector-option span,
.selector-option small {
    display: block;
}

.selector-option span,
.selector-option small {
    color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 640px) {
    .form-grid-two {
        grid-template-columns: 1fr;
    }
}

.metric-card.warning:before,
.metric-card.accent:before {
    background: conic-gradient(var(--metric-color) var(--progress), var(--metric-track) var(--progress));
}

/*PORTAL REVISION - DASHBOARD CHARTS AND JOB BADGES*/
.dashboard-grid {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.metric-card {
    min-height: 210px;
    --metric-color: var(--color-cyan);
    --metric-track: rgba(53, 214, 255, 0.16);
    --progress: 0deg;
}

.metric-card.warning {
    --metric-color: var(--color-orange);
    --metric-track: rgba(247, 147, 30, 0.20);
}

.metric-card.accent {
    --metric-color: var(--color-green);
    --metric-track: rgba(0, 229, 168, 0.20);
}

.metric-card:before,
.metric-card.warning:before,
.metric-card.accent:before {
    width: 132px;
    height: 132px;
    top: 54px;
    background:
        radial-gradient(circle at center, rgba(7, 27, 32, 0.96) 0 54%, transparent 55%),
        conic-gradient(var(--metric-color) var(--progress), var(--metric-track) var(--progress));
    box-shadow: inset 0 0 0 12px rgba(7, 27, 32, 0.60), 0 0 32px color-mix(in srgb, var(--metric-color) 22%, transparent);
}

.metric-ring-value {
    margin-top: 42px;
}

.metric-ring-value strong,
.metric-card strong {
    color: var(--color-white) !important;
    font-size: 2.35rem;
    line-height: 1;
}

.metric-ring-value small {
    color: var(--metric-color);
    font-size: 1rem;
    font-weight: 900;
}

.metric-card em {
    margin-top: 90px;
    display: block;
    color: var(--metric-color);
}

.cd-badge {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    color: var(--color-white);
    font-weight: 950;
    box-shadow: 0 0 18px rgba(53, 214, 255, 0.22);
}

.cd-badge.collection {
    background: linear-gradient(145deg, var(--color-cyan), var(--color-cyan-dark));
}

.cd-badge.delivery {
    background: linear-gradient(145deg, var(--color-orange-light), var(--color-orange));
    box-shadow: 0 0 18px rgba(247, 147, 30, 0.24);
}

.job-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.job-card-title-row .cd-badge {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    font-size: 0.84rem;
}

/*PORTAL REVISION - ALLOCATION PLANNER LAYOUT*/
.allocation-planner-card {
    padding: 22px;
}

.allocation-planner-header {
    align-items: flex-start;
}

.allocation-date-form input[type="date"] {
    min-width: 190px;
}

.driver-selector-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 2px 18px;
    margin-bottom: 8px;
    scrollbar-width: thin;
}

.planning-member-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 52px;
}

.planning-row-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(53, 214, 255, 0.28);
    border-radius: 50%;
    color: var(--color-cyan);
    background: rgba(53, 214, 255, 0.08);
}
.planning-row-icon svg,.viewing-eye-off{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.planning-member-row .driver-selector-strip,
.planning-viewer-strip {
    margin: 0;
    padding: 4px 2px;
    min-height: 52px;
}

.planning-viewer-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
}

.viewing-member-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: default;
    flex: 0 0 auto;
}

.viewing-member-chip .driver-pill-avatar,
.viewing-member-initials {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.viewing-member-initials {
    display: grid;
    place-items: center;
    color: #fff;
    background: #17363d;
    border: 1px solid rgba(255,255,255,.2);
    font-size: .72rem;
}

.viewing-connection-count { color: var(--color-cyan); }

.driver-pill {
    border: 1px solid rgba(53, 214, 255, 0.22);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.82);
    border-radius: 999px;
    min-height: 44px;
    padding: 0 18px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}

.driver-pill.selected {
    color: #ffffff;
    border-color: rgba(247, 147, 30, 0.95);
    background: rgba(247, 147, 30, 0.12);
    box-shadow: 0 0 0 2px rgba(247, 147, 30, 0.11), 0 10px 24px rgba(247, 147, 30, 0.16);
}

.allocation-board-planner {
    grid-template-columns: minmax(320px, 0.9fr) minmax(340px, 1fr) minmax(360px, 1.08fr);
    align-items: stretch;
}

.allocation-panel {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.055);
    border-radius: 22px;
    padding: 16px;
    min-height: 440px;
    display: flex;
    flex-direction: column;
}

.allocation-map-panel {
    min-width: 0;
}

.allocation-map,
.allocation-map-placeholder {
    flex: 1;
    min-height: 360px;
    border-radius: 18px;
    overflow: hidden;
}

.allocation-map-placeholder {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 22px;
    border: 1px dashed rgba(53, 214, 255, 0.24);
    background: rgba(6, 24, 29, 0.56);
    color: rgba(255, 255, 255, 0.76);
}

.allocation-map-placeholder strong,
.allocation-map-placeholder span {
    display: block;
}

.allocation-list {
    flex: 1;
}

.allocation-driver-empty {
    flex: 1;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.045);
    border-radius: 18px;
    display: grid;
    place-items: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.66);
    font-weight: 900;
    padding: 18px;
}

.allocation-empty.compact {
    min-height: 44px;
    padding: 10px 16px;
    white-space: nowrap;
}

@media (max-width: 1320px) {
    .allocation-board-planner {
        grid-template-columns: 1fr;
    }
}

/*PORTAL REVISION - DASHBOARD RINGS AND PLANNING DETAILS*/
[hidden] {
    display: none !important;
}

.metric-card {
    --metric-size: 126px;
    --metric-thickness: 10px;
    min-height: 230px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    justify-items: center;
    position: relative;
    overflow: hidden;
}

.metric-card > span {
    justify-self: start;
    align-self: start;
    margin: 0;
}

.metric-card:before,
.metric-card.warning:before,
.metric-card.accent:before {
    content: "";
    position: absolute;
    width: var(--metric-size);
    height: var(--metric-size);
    left: 50%;
    top: 74px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: var(--metric-track);
    box-shadow: inset 0 0 0 14px rgba(7, 27, 32, 0.72), 0 0 28px color-mix(in srgb, var(--metric-color) 18%, transparent);
}

.metric-card:after,
.metric-card.warning:after,
.metric-card.accent:after {
    content: "";
    position: absolute;
    width: var(--metric-size);
    height: var(--metric-size);
    left: 50%;
    top: 74px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: conic-gradient(var(--metric-color) var(--progress), transparent var(--progress));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--metric-thickness) - 1px), #000 calc(100% - var(--metric-thickness)));
    mask: radial-gradient(farthest-side, transparent calc(100% - var(--metric-thickness) - 1px), #000 calc(100% - var(--metric-thickness)));
}

.metric-ring-value {
    position: relative;
    z-index: 2;
    margin-top: 36px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.metric-ring-value strong,
.metric-card strong {
    color: var(--color-white) !important;
    font-size: 2.35rem;
    line-height: 1;
}

.metric-ring-value small {
    color: var(--metric-color) !important;
    font-size: 1rem;
    font-weight: 950;
}

.metric-card em {
    position: relative;
    z-index: 2;
    margin-top: 8px;
    color: var(--metric-color);
    font-style: normal;
    font-weight: 950;
}

.cd-badge,
.job-card-title-row .cd-badge {
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    font-size: 0.92rem;
}

.table-action {
    min-height: 34px;
    padding: 0 12px;
}

.freight-coin-summary,
.job-cost-card {
    border: 1px solid rgba(247, 147, 30, 0.28);
    background: rgba(247, 147, 30, 0.12);
    border-radius: 18px;
    padding: 14px 16px;
    display: grid;
    gap: 3px;
    min-width: 170px;
}

.freight-coin-summary span,
.job-cost-card span,
.freight-coin-summary small,
.job-cost-card small {
    color: rgba(255, 255, 255, 0.72);
    font-weight: 800;
}

.freight-coin-summary strong,
.job-cost-card strong {
    color: var(--color-orange-light) !important;
    font-size: 1.5rem;
}

.form-stage-addresses [data-stage-address] {
    min-width: 0;
}


/*PORTAL REVISION V6 - DASHBOARD METRIC VISIBILITY*/
.metric-card {
    --metric-size: 112px;
    --metric-thickness: 10px;
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    overflow: hidden;
    min-height: 185px;
    padding-bottom: 18px;
}

.metric-card:before,
.metric-card.warning:before,
.metric-card.accent:before {
    width: var(--metric-size) !important;
    height: var(--metric-size) !important;
    top: 56px !important;
    background: var(--metric-track) !important;
    box-shadow: inset 0 0 0 12px rgba(7, 27, 32, 0.72), 0 0 28px color-mix(in srgb, var(--metric-color) 18%, transparent) !important;
}

.metric-card:after,
.metric-card.warning:after,
.metric-card.accent:after {
    width: var(--metric-size) !important;
    height: var(--metric-size) !important;
    top: 56px !important;
}

.metric-ring-value {
    margin-top: 20px !important;
    align-self: center;
}

.metric-card em {
    margin-top: 0 !important;
    align-self: end;
    justify-self: center;
    display: block;
}

/*PORTAL REVISION V6 - ALLOCATION AND JOB CARDS*/
.allocation-assigned-user {
    margin-top: 10px;
    color: var(--color-orange-light);
    font-size: 0.78rem;
    font-weight: 900;
}

.cd-badge {
    flex: 0 0 32px;
    min-width: 32px !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50%;
    font-size: 0.82rem !important;
    font-weight: 950;
    overflow: hidden;
}

.form-grid-two,
.stage-address-grid {
    gap: 18px !important;
}

.form-stage-addresses [data-stage-address] {
    min-width: 0;
}

.data-grid-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-search-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.portal-search-row input {
    max-width: 420px;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(53, 214, 255, 0.12);
    border: 1px solid rgba(53, 214, 255, 0.18);
    color: var(--color-cyan);
    font-size: 0.82rem;
    font-weight: 900;
}

@media (max-width: 980px) {
    .portal-search-row {
        align-items: stretch;
        flex-direction: column;
    }

    .portal-search-row input {
        max-width: none;
    }
}



/*PORTAL REVISION V7 - DASHBOARD RING LAYOUT*/
.dashboard-grid {
    align-items: stretch;
}

.metric-card {
    position: relative;
    min-height: 230px !important;
    padding: 22px 22px 28px !important;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    --metric-size: 116px;
    --metric-thickness: 9px;
}

.metric-card:before,
.metric-card.warning:before,
.metric-card.accent:before {
    width: var(--metric-size) !important;
    height: var(--metric-size) !important;
    top: 76px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-radius: 50% !important;
    background: var(--metric-track) !important;
    box-shadow: inset 0 0 0 13px rgba(7, 27, 32, 0.82), 0 0 24px color-mix(in srgb, var(--metric-color) 20%, transparent) !important;
}

.metric-card:after,
.metric-card.warning:after,
.metric-card.accent:after {
    content: "";
    position: absolute;
    width: var(--metric-size) !important;
    height: var(--metric-size) !important;
    top: 76px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-radius: 50% !important;
    background: conic-gradient(var(--metric-color) var(--progress), transparent var(--progress)) !important;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--metric-thickness) - 1px), #000 calc(100% - var(--metric-thickness))) !important;
    mask: radial-gradient(farthest-side, transparent calc(100% - var(--metric-thickness) - 1px), #000 calc(100% - var(--metric-thickness))) !important;
}

.metric-ring-value {
    margin-top: 56px !important;
    align-self: center;
}

.metric-ring-value strong,
.metric-card strong {
    color: var(--color-white) !important;
    font-size: 2.35rem !important;
    line-height: 1 !important;
}

.metric-ring-value small {
    color: var(--metric-color) !important;
    font-size: 1rem !important;
    font-weight: 950 !important;
}

.metric-card em {
    display: block !important;
    position: relative !important;
    z-index: 3 !important;
    margin-top: 24px !important;
    text-align: center !important;
    color: var(--metric-color) !important;
    font-style: normal !important;
    font-weight: 950 !important;
    font-size: 1rem !important;
}

/*PORTAL REVISION V7 - FORM SPACING AND ANIMATION*/
.form-grid-two {
    gap: 16px;
}

.form-stage-addresses .form-grid-two {
    gap: 18px !important;
}

.form-stage-addresses [data-stage-address] {
    min-width: 0;
}

.page-enter,
.portal-main > main,
.content-card,
.metric-card {
    animation: portalFadeUp 240ms ease-out both;
}

@keyframes portalFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*PORTAL REVISION V7 - LOGIN MASCOT*/
.auth-page {
    position: relative;
    overflow: hidden;
}

.auth-card {
    position: relative;
    z-index: 2;
}

.auth-mascot {
    position: absolute;
    right: -42px;
    bottom: -30px;
    width: 150px;
    max-width: 34vw;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.32));
    pointer-events: none;
    z-index: 3;
}

.auth-card.has-mascot {
    padding-bottom: 42px;
}

/*PORTAL REVISION V7 - STAGED PRODUCT LIST*/
.staged-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.staged-item {
    display: grid;
    grid-template-columns: 1fr 120px 120px auto;
    gap: 10px;
    align-items: end;
    padding: 14px;
    border: 1px solid rgba(53, 214, 255, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.055);
}

.staged-item-title {
    font-weight: 900;
    color: var(--color-white);
}

.staged-item-detail {
    color: var(--color-cyan);
    font-size: 0.86rem;
    font-weight: 800;
}

.staged-empty {
    padding: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    color: rgba(255, 255, 255, 0.64);
    font-weight: 800;
    text-align: center;
}

.danger-button {
    border: 1px solid rgba(247, 147, 30, 0.30);
    background: rgba(247, 147, 30, 0.12);
    color: #ffd4a0;
    border-radius: 999px;
    min-height: 40px;
    padding: 0 14px;
    cursor: pointer;
    font-weight: 900;
}

@media (max-width: 980px) {
    .staged-item {
        grid-template-columns: 1fr;
    }

    .auth-mascot {
        position: static;
        width: 116px;
        margin: 18px auto -10px;
    }
}

/*PORTAL REVISION V8 - STRUCTURAL DASHBOARD RINGS AND JOB PRODUCT FLOW*/
.dashboard-grid {
    align-items: stretch;
}

.metric-card {
    --metric-size: 104px;
    --metric-thickness: 8px;
    min-height: 210px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    overflow: visible !important;
}

.metric-card > span {
    width: 100%;
    align-self: stretch !important;
    margin-bottom: 6px !important;
}

.metric-card:before,
.metric-card:after,
.metric-card.warning:before,
.metric-card.warning:after,
.metric-card.accent:before,
.metric-card.accent:after {
    content: none !important;
}

.metric-ring-shell {
    width: var(--metric-size);
    height: var(--metric-size);
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    flex: 0 0 var(--metric-size);
    background:
        radial-gradient(circle, rgba(7, 27, 32, 0.84) 0 58%, transparent 59%),
        conic-gradient(var(--metric-color) var(--progress), var(--metric-track) var(--progress));
    box-shadow: inset 0 0 0 10px rgba(7, 27, 32, 0.72), 0 0 28px color-mix(in srgb, var(--metric-color) 18%, transparent);
}

.metric-ring-shell:after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.07);
    pointer-events: none;
}

.metric-ring-value {
    position: static !important;
    z-index: 2;
    margin-top: 0 !important;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.metric-ring-value strong,
.metric-card strong {
    color: var(--color-white) !important;
    font-size: 2rem !important;
    line-height: 1 !important;
    margin: 0 !important;
}

.metric-ring-value small {
    color: var(--metric-color) !important;
    font-size: 0.9rem !important;
    font-weight: 950 !important;
}

.metric-card em {
    position: static !important;
    z-index: 2 !important;
    margin-top: 0 !important;
    display: block !important;
    color: var(--metric-color) !important;
    font-style: normal !important;
    font-weight: 950 !important;
    font-size: 0.95rem !important;
    line-height: 1.2 !important;
    text-align: center !important;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(53, 214, 255, 0.28);
    background: rgba(53, 214, 255, 0.12);
    color: var(--color-cyan);
    font-size: 0.8rem;
    font-weight: 950;
    white-space: nowrap;
}

.status-pill.completed {
    border-color: rgba(0, 229, 168, 0.32);
    background: rgba(0, 229, 168, 0.12);
    color: var(--color-green);
}

.status-pill.active {
    border-color: rgba(247, 147, 30, 0.34);
    background: rgba(247, 147, 30, 0.13);
    color: var(--color-orange-light);
}

.status-pill.payment {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
}

.form-grid-two,
.form-grid-three {
    display: grid !important;
    gap: 16px !important;
}

.form-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-stage-addresses .form-grid-two {
    display: grid !important;
    gap: 18px !important;
}

.selected-product-editor {
    display: grid;
    gap: 16px;
    border: 1px solid rgba(53, 214, 255, 0.18);
    background: rgba(255, 255, 255, 0.055);
    border-radius: 24px;
    padding: 18px;
}

.selected-product-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.selected-product-heading h4 {
    margin: 0;
    font-size: 1.1rem;
}

.product-detail-panel {
    display: grid;
    gap: 14px;
}

.toggle-row {
    display: flex !important;
    grid-template-columns: none !important;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 12px 14px;
}

.toggle-row input {
    width: auto;
    min-width: 18px;
}

.product-staged-item {
    grid-template-columns: 1fr auto !important;
}

.staged-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 760px) {
    .form-grid-two,
    .form-grid-three {
        grid-template-columns: 1fr !important;
    }
}

/*PORTAL REVISION V9 - STRUCTURAL FORM, MODAL AND DASHBOARD FIXES*/
.compact-toolbar {
    margin-bottom: 18px;
}

.toolbar-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-actions input[type="date"] {
    min-height: 48px;
    min-width: 180px;
}

.metric-card {
    min-height: 238px !important;
    padding-bottom: 26px !important;
    justify-content: flex-start !important;
}

.metric-ring-shell {
    margin-top: 4px !important;
    margin-bottom: 12px !important;
}

.metric-card em {
    position: relative !important;
    display: block !important;
    margin-top: 2px !important;
    min-height: 22px !important;
    overflow: visible !important;
}

.selector-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    align-items: center !important;
    justify-items: center !important;
    overflow: hidden !important;
    z-index: 9999 !important;
}

.selector-modal.open {
    display: grid !important;
}

.selector-dialog {
    max-height: calc(100vh - 64px) !important;
    overflow: hidden !important;
}

.selector-list {
    max-height: calc(100vh - 230px) !important;
}

.form-stage-addresses .form-grid-two,
.form-stage-addresses .stage-address-grid {
    display: grid !important;
    gap: 22px !important;
    row-gap: 22px !important;
}

.form-stage-addresses [data-stage-address] {
    margin-bottom: 0 !important;
}

.builder-header-row,
.job-product-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.builder-header-row h3,
.job-product-card-header h4 {
    margin: 0;
}

.product-card-list,
.charge-card-list {
    display: grid;
    gap: 16px;
}

.job-product-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(53, 214, 255, 0.20);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

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

.success-summary {
    border: 1px solid rgba(0, 229, 168, 0.26);
    background: rgba(0, 229, 168, 0.10);
    color: var(--color-green);
    border-radius: 18px;
    padding: 14px 16px;
    font-weight: 900;
    margin-bottom: 16px;
}

.create-team-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
    gap: 18px;
    align-items: end;
    padding: 18px;
    margin-bottom: 22px;
    border: 1px solid rgba(53, 214, 255, 0.18);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.055);
}

.create-team-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.create-team-form input {
    min-height: 48px;
}

@media (max-width: 980px) {
    .toolbar-form,
    .builder-header-row,
    .job-product-card-header,
    .create-team-panel,
    .create-team-form {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .form-grid-four {
        grid-template-columns: 1fr !important;
    }
}

/*PORTAL REVISION V10 - MODALS AND DATA MANAGEMENT*/
body.modal-open {
    overflow: hidden;
}

.team-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 22px;
}

.crud-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(10px);
}

.crud-modal.open {
    display: grid;
}

.crud-dialog {
    width: min(100%, 760px);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    display: grid;
    gap: 16px;
    border: 1px solid var(--glass-border);
    background: rgba(7, 27, 32, 0.96);
    border-radius: 28px;
    box-shadow: var(--shadow-soft), var(--shadow-cyan);
    padding: 22px;
}

.table-actions {
    text-align: right;
    white-space: nowrap;
}

.danger-button {
    border: 1px solid rgba(247, 147, 30, 0.40);
    background: rgba(247, 147, 30, 0.14);
    color: #ffe6c4;
    border-radius: 999px;
    min-height: 44px;
    padding: 0 18px;
    cursor: pointer;
    font-weight: 900;
}

.delete-form {
    margin-top: 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.form-section + .form-section,
.form-stage-addresses [data-stage-address] + [data-stage-address] {
    margin-top: 18px !important;
}


/*PORTAL REVISION V11 - STABLE FIXED MODALS AND HIERARCHY STATES*/
.crud-modal,
.selector-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483000 !important;
}

.crud-dialog,
.selector-dialog {
    max-height: calc(100vh - 72px) !important;
}

.toast {
    transition: opacity 220ms ease, transform 220ms ease;
}

.toast-hide {
    opacity: 0;
    transform: translateY(-8px);
}

.locked-row,
.locked-note {
    color: rgba(255, 255, 255, 0.62);
}

.locked-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.72);
    font-weight: 900;
    font-size: 0.86rem;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.hierarchy-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: start;
}

.hierarchy-column {
    min-height: 260px;
}

.hierarchy-list {
    display: grid;
    gap: 10px;
}

.hierarchy-select-card {
    width: 100%;
    border: 1px solid rgba(53, 214, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-white);
    border-radius: 18px;
    padding: 14px;
    text-align: left;
    cursor: pointer;
}

.hierarchy-select-card.selected {
    border-color: var(--color-cyan);
    background: rgba(53, 214, 255, 0.16);
    box-shadow: 0 0 24px rgba(53, 214, 255, 0.16);
}

.hierarchy-select-card strong,
.hierarchy-item-card strong {
    display: block;
}

.hierarchy-select-card span,
.hierarchy-item-card span {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.9rem;
}

.hierarchy-item-card {
    border: 1px solid rgba(53, 214, 255, 0.16);
    background: rgba(255, 255, 255, 0.055);
    border-radius: 18px;
    padding: 14px;
    display: grid;
    gap: 12px;
}

.hierarchy-item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 1180px) {
    .hierarchy-grid {
        grid-template-columns: 1fr;
    }
}

.two-column-hierarchy {
    grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
}

@media (max-width: 1180px) {
    .two-column-hierarchy {
        grid-template-columns: 1fr;
    }
}


/*PORTAL REVISION V12 - BUTTONS, SELECT OPTIONS, JOB COST AND HEADER BALANCE*/
select option {
    color: #061d22;
    background: #ffffff;
}

.primary-button,
.secondary-button,
button.primary-button,
a.primary-button {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(53, 214, 255, 0.42) !important;
    background: linear-gradient(145deg, rgba(53, 214, 255, 0.20), rgba(0, 229, 168, 0.14)) !important;
    color: #eaffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 22px rgba(53, 214, 255, 0.20), 0 10px 26px rgba(0, 0, 0, 0.22) !important;
    backdrop-filter: blur(16px);
}

.primary-button:hover,
.secondary-button:hover {
    border-color: rgba(0, 229, 168, 0.62) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 0 30px rgba(0, 229, 168, 0.24), 0 12px 30px rgba(0, 0, 0, 0.26) !important;
}

.danger-button {
    background: linear-gradient(145deg, rgba(247, 147, 30, 0.16), rgba(247, 147, 30, 0.08)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 18px rgba(247, 147, 30, 0.14);
}

.freight-balance-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(247, 147, 30, 0.38);
    background: rgba(247, 147, 30, 0.13);
    color: #ffd7a6;
    font-weight: 950;
    box-shadow: 0 0 18px rgba(247, 147, 30, 0.15);
}

.job-cost-summary-card {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055));
    border-radius: 28px;
    padding: 22px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 0 26px rgba(247, 147, 30, 0.10);
}

.job-cost-summary-card h3 {
    margin: 0 0 16px;
}

.job-cost-lines {
    display: grid;
    gap: 14px;
}

.job-cost-lines > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    color: rgba(255, 255, 255, 0.78);
}

.job-cost-lines span {
    font-size: 1rem;
}

.job-cost-lines strong {
    font-size: 1.25rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
}

.job-cost-lines .cost-value {
    color: var(--color-orange-light);
}

.job-cost-after {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.job-cost-after strong {
    font-size: 1.55rem;
    font-weight: 950;
    color: #fff3df;
}


/* PORTAL REVISION V13 - JOB STAGE FORM ALIGNMENT */
.stage-address-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

.stage-address-panel {
    display: grid;
    gap: 16px;
    align-content: start;
}

.stage-detail-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(53, 214, 255, 0.18);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.055);
}

.stage-detail-panel[hidden] {
    display: none !important;
}

select option {
    color: #071b20;
    background: #ffffff;
}

@media (max-width: 900px) {
    .stage-address-grid {
        grid-template-columns: 1fr;
    }
}

/* PORTAL REVISION V14 - CREATE JOB STAGE AND NATIVE INPUT POLISH */
.stage-address-grid {
    align-items: start !important;
}

.stage-address-panel {
    align-self: start !important;
    margin-top: 0 !important;
}

.stage-address-panel > .selector-card {
    min-height: 74px;
    display: flex !important;
    align-items: center !important;
}

.stage-address-panel .stage-detail-panel {
    margin-top: 0 !important;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(2);
    opacity: 0.95;
}

input[type="date"],
input[type="time"] {
    color-scheme: dark;
}

/* ALLOCATION BOARD HEIGHT / SCROLL FIX */
.allocation-planner-card {
    overflow: hidden;
}

.allocation-board-planner {
    min-height: 0;
    height: clamp(560px, calc(100vh - 320px), 760px);
}

.allocation-board-planner .allocation-panel {
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.allocation-board-planner .allocation-list {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

.allocation-board-planner .allocation-map,
.allocation-board-planner .allocation-map-placeholder {
    min-height: 0;
    height: 100%;
}

.allocation-board-planner .job-card {
    flex: 0 0 auto;
}

.allocation-board-planner .sortable-ghost {
    border: 1px dashed rgba(53, 214, 255, 0.55);
    background: rgba(53, 214, 255, 0.10);
    min-height: 74px;
}

/*PORTAL REVISION V16 - AUTH AND FREIGHTCOIN HEADER*/
.auth-links-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.secondary-button.disabled,
.secondary-button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

.auth-flow-dialog {
    max-width: 720px;
}

.modal-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.auth-countdown {
    border: 1px solid rgba(44, 219, 241, 0.24);
    background: rgba(44, 219, 241, 0.08);
    border-radius: 18px;
    padding: 12px 14px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 800;
}

.auth-countdown strong {
    color: var(--color-cyan);
}

.verification-wait-card {
    text-align: center;
    display: grid;
    gap: 12px;
    justify-items: center;
}

.verification-wait-card img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(247, 147, 30, 0.35));
}

.freight-balance-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 4px 13px 4px 6px;
    border-radius: 999px;
    border: 1px solid rgba(44, 219, 241, 0.55);
    background: linear-gradient(135deg, rgba(24, 234, 214, 0.92), rgba(44, 219, 241, 0.78));
    color: #052227;
    font-weight: 1000;
    box-shadow: 0 0 18px rgba(24, 234, 214, 0.28), inset 0 0 14px rgba(255, 255, 255, 0.14);
    white-space: nowrap;
}

.freight-balance-pill img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 10px rgba(247, 147, 30, 0.45);
}

/*PORTAL REVISION V17 - AUTH CLEANUP AND HEADER FREIGHTCOINS*/
.auth-card {
    width: min(100%, 500px);
}

.auth-provider-stack {
    display: grid;
    gap: 12px;
    margin-top: 4px;
    width: min(100%, 360px);
}

.auth-provider-button {
    position: relative;
    width: 100%;
    min-height: 58px;
    padding: 12px 22px 12px 58px;
    border-radius: 18px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.auth-provider-button img {
    position: absolute;
    left: 21px;
    top: 50%;
    width: 24px;
    height: 24px;
    object-fit: contain;
    transform: translateY(-50%);
}

.auth-provider-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.auth-provider-button:active:not(:disabled) {
    transform: translateY(0) scale(0.985);
}

.auth-provider-button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.auth-provider-google {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.10);
    color: #171717;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20);
}

.auth-provider-google:hover:not(:disabled) {
    box-shadow: 0 10px 28px rgba(255, 255, 255, 0.15), 0 8px 24px rgba(0, 0, 0, 0.24);
}

.auth-provider-apple {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
}

.auth-provider-apple:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.46);
}

.auth-links-under-login {
    margin-top: 8px;
    justify-content: space-between;
}

.auth-card.has-mascot {
    padding-bottom: 56px;
}

.auth-mascot {
    width: 150px;
    right: -34px;
    bottom: -22px;
}

.password-field-wrapper {
    position: relative;
    display: block;
}

.password-field-wrapper input {
    padding-right: 54px;
}

.password-toggle-button {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 1px solid rgba(53, 214, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.075);
    color: rgba(255, 255, 255, 0.86);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.password-toggle-button.active {
    border-color: rgba(247, 147, 30, 0.48);
    color: #ffd4a0;
    box-shadow: 0 0 12px rgba(247, 147, 30, 0.16);
}

.code-box-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.code-box-row input {
    min-height: 58px;
    padding: 0;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.42rem;
    font-weight: 900;
    color: var(--color-white);
    border-radius: 16px;
}

.validation-summary {
    transition: opacity 220ms ease, transform 220ms ease;
}

.freight-balance-pill {
    gap: 9px;
    min-height: 42px;
    padding: 5px 16px 5px 6px;
    color: #ffffff;
    border: 1px solid rgba(44, 219, 241, 0.62);
    background: linear-gradient(135deg, rgba(14, 67, 80, 0.82), rgba(24, 234, 214, 0.20));
    box-shadow:
        0 0 22px rgba(24, 234, 214, 0.34),
        0 0 34px rgba(53, 214, 255, 0.14),
        inset 0 0 16px rgba(255, 255, 255, 0.08);
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

.freight-coin-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 34% 28%, #ffe1a6 0, #f7931e 48%, #ac5804 100%);
    border: 2px solid rgba(255, 218, 132, 0.92);
    box-shadow:
        0 0 14px rgba(247, 147, 30, 0.58),
        inset 0 0 10px rgba(255, 255, 255, 0.30);
    overflow: hidden;
    flex: 0 0 auto;
}

.freight-balance-pill .freight-coin-icon img {
    width: 27px;
    height: 27px;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: translateY(1px);
}

@media (max-width: 980px) {
    .auth-provider-stack {
        width: 100%;
    }

    .auth-mascot {
        right: auto;
        bottom: auto;
    }

    .code-box-row {
        gap: 7px;
    }

    .code-box-row input {
        min-height: 50px;
        font-size: 1.18rem;
    }
}

/*PORTAL REVISION V18 - USER DETAILS, TRACKING AND ALLOCATION WORKSTATION*/
.auth-brand img,
.portal-brand img {
    filter:
        drop-shadow(0 0 8px rgba(255, 255, 255, 0.42))
        drop-shadow(0 0 16px rgba(53, 214, 255, 0.16));
}

.driver-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.driver-location-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.12);
}

.driver-location-dot.enabled {
    background: #24e6a8;
    box-shadow: 0 0 12px rgba(36, 230, 168, 0.65);
}

.driver-location-dot.disabled {
    background: rgba(255, 255, 255, 0.22);
    box-shadow: none;
}

.allocation-board-planner {
    transition: grid-template-columns 260ms ease;
}

.allocation-board-planner.show-all-drivers {
    grid-template-columns: minmax(460px, 1.75fr) minmax(360px, 1fr);
}

.allocation-board-planner.show-all-drivers .allocation-driver-panel {
    display: none;
}

.allocation-filter-input {
    width: 100%;
    margin: 0 0 12px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(53, 214, 255, 0.24);
    background: rgba(255, 255, 255, 0.075);
    color: var(--color-white);
    font-weight: 800;
}

.allocation-filter-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.optimise-dialog {
    width: min(960px, calc(100vw - 32px));
    max-height: min(88vh, 900px);
    overflow-y: auto;
}

.optimise-modal-grid {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.optimise-section {
    border: 1px solid rgba(53, 214, 255, 0.16);
    background: rgba(255, 255, 255, 0.055);
    border-radius: 20px;
    padding: 14px;
}

.optimise-section h3 {
    margin: 0 0 12px;
    font-family: var(--font-heading);
}

.compact-selector-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.optimise-job-list {
    display: grid;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 6px;
}

.optimise-job-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(5, 24, 29, 0.56);
    border-radius: 16px;
    padding: 10px 12px;
}

.optimise-job-card span {
    display: grid;
    gap: 3px;
}

.optimise-job-card small {
    color: rgba(255, 255, 255, 0.62);
    font-weight: 800;
}

.tracking-card {
    min-height: calc(100vh - 180px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tracking-map,
.tracking-map-placeholder {
    min-height: 560px;
    flex: 1;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(53, 214, 255, 0.18);
}

.tracking-user-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 2px 2px;
}

.tracking-user-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    border: 1px solid rgba(53, 214, 255, 0.22);
    background: rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    color: var(--color-white);
    padding: 10px;
    cursor: pointer;
}

.tracking-user-card.disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.tracking-user-card.selected,
.tracking-user-card.can-track:hover {
    border-color: rgba(247, 147, 30, 0.58);
    box-shadow: 0 0 18px rgba(247, 147, 30, 0.18);
}

.tracking-initials {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: rgba(5, 24, 29, 0.72);
    border: 2px solid rgba(247, 147, 30, 0.72);
    font-family: var(--font-heading);
    font-weight: 1000;
}

.tracking-user-copy {
    display: grid;
    gap: 2px;
    flex: 1;
    min-width: 0;
    text-align: left;
}

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

.tracking-user-copy small {
    color: rgba(255, 255, 255, 0.62);
    font-weight: 800;
}

@media (max-width: 1320px) {
    .allocation-board-planner.show-all-drivers {
        grid-template-columns: 1fr;
    }
}

.count-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(53, 214, 255, 0.32);
    background: rgba(53, 214, 255, 0.12);
    color: var(--color-cyan);
    font-weight: 900;
}

/*PORTAL REVISION V19 - LIVE TRACKING AND CHAT MONITOR*/
.chat-monitor-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) minmax(420px, 1.4fr);
    gap: 18px;
    margin-top: 20px;
}

.chat-room-list,
.chat-live-panel {
    border: 1px solid rgba(53, 214, 255, 0.16);
    background: rgba(5, 24, 29, 0.44);
    border-radius: 24px;
    padding: 14px;
}

.chat-room-list {
    display: grid;
    gap: 10px;
    align-content: start;
    max-height: 620px;
    overflow-y: auto;
}

.chat-room-card {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(53, 214, 255, 0.18);
    background: rgba(255, 255, 255, 0.065);
    color: var(--color-white);
    border-radius: 18px;
    padding: 12px;
    cursor: pointer;
    display: grid;
    gap: 8px;
}

.chat-room-card:hover,
.chat-room-card.selected {
    border-color: rgba(0, 229, 168, 0.54);
    box-shadow: 0 0 20px rgba(0, 229, 168, 0.14);
}

.chat-room-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chat-room-card small {
    color: rgba(255, 255, 255, 0.65);
    font-weight: 800;
    line-height: 1.35;
}

.chat-live-panel h3 {
    margin: 0 0 8px;
    font-family: var(--font-heading);
}

.chat-live-log {
    display: grid;
    gap: 10px;
    max-height: 520px;
    overflow-y: auto;
    margin-top: 16px;
}

.chat-live-item {
    border: 1px solid rgba(247, 147, 30, 0.22);
    background: rgba(247, 147, 30, 0.08);
    border-radius: 16px;
    padding: 10px 12px;
    display: grid;
    gap: 4px;
}

.chat-live-item strong {
    color: #ffd7a6;
}

.chat-live-item span {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 800;
}

@media (max-width: 1100px) {
    .chat-monitor-layout {
        grid-template-columns: 1fr;
    }
}

/* PORTAL V20 - USER AVATARS, TRACKING AND CHAT */
.portal-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: rgba(255,255,255,0.78);
    font-weight: 800;
}

.portal-user-chip img,
.portal-user-initials {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 0 18px rgba(85,218,255,0.22);
    object-fit: cover;
}

.portal-user-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    font-size: 11px;
}

.tracking-user-strip-top {
    margin-bottom: 16px;
}

.tracking-avatar,
.driver-pill-avatar,
.chat-message-avatar img,
.chat-message-avatar span {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 0 18px rgba(247,147,30,0.22);
    flex: 0 0 auto;
}

.driver-pill-avatar {
    width: 24px;
    height: 24px;
}

.chat-workspace-card {
    min-height: calc(100vh - 160px);
}

.chat-workspace-layout {
    display: grid;
    grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
    gap: 16px;
    min-height: 640px;
}

.chat-room-panel {
    display: flex;
    flex-direction: column;
    min-height: 640px;
    border: 1px solid rgba(85, 218, 255, 0.18);
    background: rgba(0, 18, 24, 0.38);
    border-radius: 24px;
    overflow: hidden;
}

.chat-room-panel-header {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.chat-message-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    min-height: 420px;
}

.chat-message {
    display: flex;
    gap: 10px;
    max-width: 82%;
}

.chat-message.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.theirs {
    align-self: flex-start;
}

.chat-message-avatar span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    font-weight: 900;
    font-size: 12px;
}

.chat-message-bubble {
    border: 1px solid rgba(85, 218, 255, 0.18);
    border-radius: 18px;
    background: rgba(255,255,255,0.06);
    padding: 10px 12px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.18);
}

.chat-message.mine .chat-message-bubble {
    border-color: rgba(91, 242, 174, 0.34);
    background: rgba(91, 242, 174, 0.12);
}

.chat-message-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    margin-bottom: 5px;
}

.chat-message-meta strong {
    color: rgba(255,255,255,0.88);
}

.chat-message-bubble p {
    margin: 0;
    white-space: pre-wrap;
    color: rgba(255,255,255,0.82);
    line-height: 1.45;
}

.chat-send-form {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 18, 24, 0.35);
}

.chat-send-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.chat-send-row textarea {
    resize: vertical;
    min-height: 54px;
}

.chat-attachment-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.compact-file-button {
    padding: 8px 12px;
    cursor: not-allowed;
    opacity: 0.65;
}

.compact-file-button input {
    display: none;
}

.chat-attachments {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-image-attachment img {
    width: 150px;
    max-height: 120px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.18);
}

.chat-document-attachment {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(85,218,255,0.28);
    color: #69d9ff;
    background: rgba(85,218,255,0.08);
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}

.chat-reactions,
.chat-message-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.chat-message-actions button,
.chat-reactions span {
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.07);
    border-radius: 999px;
    padding: 3px 8px;
    color: #fff;
    cursor: pointer;
}

.error-text {
    color: #ffb86b !important;
}

@media (max-width: 980px) {
    .chat-workspace-layout {
        grid-template-columns: 1fr;
    }

    .chat-message {
        max-width: 96%;
    }
}


/*PORTAL REVISION V21 - NAV, CHAT WORKSPACE AND LIVE STATUS POLISH*/
.portal-shell {
    min-height: 100vh;
}

.portal-sidebar {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.portal-nav {
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(53, 214, 255, 0.45) rgba(255,255,255,0.05);
}

.portal-nav a.active {
    color: var(--color-white);
    background:
        linear-gradient(135deg, rgba(0, 229, 168, 0.20), rgba(53, 214, 255, 0.14)),
        rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(0, 229, 168, 0.42);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.05) inset,
        0 0 22px rgba(0, 229, 168, 0.16);
}

.chat-workspace-card {
    height: calc(100vh - 150px);
    min-height: 660px;
    display: flex;
    flex-direction: column;
}

.chat-workspace-layout {
    flex: 1;
    min-height: 0;
    height: 100%;
}

.chat-room-list {
    max-height: none;
    height: 100%;
    overflow-y: auto;
}

.chat-room-panel {
    min-height: 0;
    height: 100%;
}

.chat-message-list {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
}

.chat-send-form {
    flex: 0 0 auto;
}

.chat-room-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-reaction-picker {
    position: fixed;
    z-index: 5000;
    display: none;
    gap: 8px;
    flex-wrap: wrap;
    max-width: min(540px, calc(100vw - 48px));
    padding: 8px;
    border-radius: 24px;
    border: 1px solid rgba(53, 214, 255, 0.24);
    background: rgba(5, 24, 29, 0.96);
    box-shadow: 0 18px 50px rgba(0,0,0,0.35), 0 0 22px rgba(53,214,255,0.16);
}

.chat-reaction-picker.open {
    display: flex;
}

.chat-reaction-picker button {
    border: 0;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    cursor: pointer;
    font-size: 18px;
}

.chat-reaction-picker button:hover {
    background: rgba(0, 229, 168, 0.18);
}

.chat-new-message-pill {
    position: absolute;
    left: 50%;
    top: 124px;
    bottom: auto;
    transform: translateX(-50%);
    display: none;
    z-index: 3;
}

.chat-new-message-pill.show {
    display: inline-flex;
}

.chat-room-panel {
    position: relative;
}

.chat-attachment-preview {
    display: none;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.chat-attachment-preview.show {
    display: flex;
}

.chat-attachment-preview span {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.82);
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.chat-attachment-preview button {
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50%;
    background: rgba(2,25,31,.75);
    color: #fff;
    font: inherit;
    line-height: 1;
    cursor: pointer;
}

.tracking-user-strip-top {
    align-items: center;
}

.map-user-time-pill {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.chat-user-picker {
    display: grid;
    gap: 9px;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid rgba(53, 214, 255, 0.16);
    border-radius: 18px;
    padding: 12px;
    background: rgba(255,255,255,0.035);
}

.chat-user-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.86);
    font-weight: 800;
}

.chat-user-picker-row img,
.user-initials-small {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

/* PORTAL REVISION V22 - ALLOCATION AND OPTIMISATION POLISH */
.allocation-board-planner .driver-route-list,
.allocation-board-planner .all-jobs-list {
    padding-bottom: 140px;
    scroll-padding-block: 120px;
}

.allocation-board-planner .allocation-list.sortable-drag-over,
.allocation-board-planner .allocation-list:hover {
    border-radius: 18px;
}

.optimise-dialog {
    width: min(980px, calc(100vw - 32px)) !important;
    max-height: min(92vh, 940px) !important;
}

.optimise-modal-grid {
    gap: 18px !important;
}

.optimise-section {
    padding: 18px !important;
}

.optimise-start-time-wrap {
    margin-top: 14px;
}

.optimise-start-time-wrap[hidden] {
    display: none !important;
}

.optimise-job-list {
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
}

.optimise-job-card {
    min-height: 56px;
}

.optimise-toggle-row {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 12px 14px !important;
    margin-bottom: 10px;
}

.optimise-toggle-row:last-of-type {
    margin-bottom: 14px;
}


/*PORTAL REVISION V23 - SEARCH, CHAT INPUT AND REACTIONS*/
.section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.table-search-input {
    max-width: 320px;
    min-width: 240px;
}

.chat-room-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.chat-room-panel-header-actions {
    margin-left: auto;
}

.chat-send-row-modern {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
}

.chat-plus-button {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid rgba(53, 214, 255, 0.38);
    background: rgba(53, 214, 255, 0.10);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(53, 214, 255, 0.14);
}

.chat-plus-button:hover,
.chat-plus-button:focus {
    background: rgba(0, 229, 168, 0.16);
    border-color: rgba(0, 229, 168, 0.55);
}

.chat-attachment-menu {
    position: fixed;
    z-index: 5200;
    display: none;
    min-width: 180px;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid rgba(53, 214, 255, 0.25);
    background: rgba(5, 24, 29, 0.98);
    box-shadow: 0 18px 50px rgba(0,0,0,0.35), 0 0 22px rgba(53,214,255,0.16);
}

.chat-attachment-menu.open {
    display: grid;
    gap: 6px;
}

.chat-attachment-menu button {
    border: 0;
    border-radius: 13px;
    background: rgba(255,255,255,0.06);
    color: #ffffff;
    cursor: pointer;
    padding: 10px 12px;
    text-align: left;
    font-weight: 800;
}

.chat-attachment-menu button:hover {
    background: rgba(0, 229, 168, 0.16);
}

.chat-reaction-trigger {
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(5, 24, 29, 0.96);
    color: #ffffff;
    cursor: pointer;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(0,0,0,0.28);
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 160ms ease, transform 160ms ease;
}

.chat-message-bubble {
    position: relative;
}

.chat-message:hover .chat-reaction-trigger,
.chat-message:focus-within .chat-reaction-trigger {
    opacity: 1;
    transform: scale(1);
}

.chat-reactions button,
.chat-reactions span {
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.07);
    border-radius: 999px;
    padding: 3px 8px;
    color: #fff;
    cursor: pointer;
}

.chat-message-actions {
    display: none;
}

@media (max-width: 700px) {
    .section-actions {
        justify-content: stretch;
    }

    .table-search-input {
        min-width: 0;
        max-width: none;
        flex: 1 1 100%;
    }

    .chat-room-panel-header {
        flex-direction: column;
    }

    .chat-room-panel-header-actions {
        margin-left: 0;
    }
}

/* PORTAL REVISION V27 - CHAT ROOM SEARCH, PARTICIPANTS AND REACTION AVATARS */
.chat-room-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.chat-room-search {
    width: 100%;
    max-width: none;
    min-width: 0;
    flex: 0 0 auto;
}

.chat-room-list-wrap .chat-room-list {
    flex: 1 1 auto;
    min-height: 0;
}

.chat-reactions {
    align-items: center;
    flex-wrap: wrap;
}

.chat-reaction-avatar {
    position: relative;
    width: 38px;
    height: 38px;
    padding: 0 !important;
    border-radius: 999px;
    overflow: visible;
}

.chat-reaction-avatar img,
.chat-reaction-avatar > span {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    font-size: 11px;
    font-weight: 900;
    color: #ffffff;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
}

.chat-reaction-avatar small {
    position: absolute;
    right: -5px;
    top: -7px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 24, 29, 0.98);
    border: 1px solid rgba(53, 214, 255, 0.25);
    font-size: 13px;
    line-height: 1;
}

.chat-edit-users {
    display: grid;
    gap: 16px;
}

.chat-edit-users[hidden] {
    display: none !important;
}

.chat-edit-user-section {
    border: 1px solid rgba(53, 214, 255, 0.16);
    border-radius: 18px;
    padding: 12px;
    background: rgba(255,255,255,0.035);
}

.chat-edit-user-list {
    display: grid;
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
}

.chat-edit-user-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.chat-edit-user-row:last-child {
    border-bottom: 0;
}

.chat-edit-user-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chat-edit-user-main img {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.16);
}

.chat-edit-user-main strong,
.chat-edit-user-main small {
    display: block;
}

.chat-edit-user-main small {
    color: rgba(255,255,255,0.58);
    font-weight: 800;
    margin-top: 2px;
}

.chat-admin-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.86);
    font-weight: 800;
}

.chat-admin-toggle input {
    width: 20px;
    height: 20px;
    accent-color: #00e5a8;
}

.danger-text {
    color: #ff5959 !important;
    font-weight: 900;
}

@media (max-width: 800px) {
    .chat-edit-user-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

/* PORTAL REVISION V28 - CHAT CONNECTION INDICATOR */
.chat-connection-text {
    margin: 8px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    background: rgba(0,0,0,0.28);
    color: rgba(255,255,255,0.78);
    font-size: 0.74rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-connection-indicator {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 0 0 14px rgba(255, 87, 87, 0.45);
    background: #ff5757;
}

.chat-connection-indicator.connected {
    background: #2ee89d;
    box-shadow: 0 0 14px rgba(46, 232, 157, 0.58);
}

.chat-connection-indicator.disconnected {
    background: #ff5757;
    box-shadow: 0 0 14px rgba(255, 87, 87, 0.45);
}

/*PORTAL REVISION V32 - SLIM DASHBOARD METRICS AND MEMBER ALERT*/
.dashboard-date-toolbar {
    padding-block: 16px !important;
}

.dashboard-grid.dashboard-grid-compact {
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 14px;
}

.metric-card.metric-card-compact {
    --metric-size: 82px;
    --metric-thickness: 7px;
    min-height: 150px !important;
    padding: 16px 14px !important;
    gap: 8px !important;
}

.metric-card.metric-card-compact > span {
    text-align: center;
    justify-self: center;
    align-self: center !important;
    margin: 0 !important;
    font-size: 0.92rem;
    line-height: 1.2;
}

.metric-card.metric-card-compact .metric-ring-shell {
    width: var(--metric-size);
    height: var(--metric-size);
    flex-basis: var(--metric-size);
    box-shadow: inset 0 0 0 8px rgba(7, 27, 32, 0.72), 0 0 20px color-mix(in srgb, var(--metric-color) 18%, transparent);
}

.metric-card.metric-card-compact .metric-ring-shell:after {
    inset: 8px;
}

.metric-card.metric-card-compact .metric-ring-value strong,
.metric-card.metric-card-compact strong {
    font-size: 1.55rem !important;
}

.metric-card.metric-card-compact .metric-ring-value small {
    font-size: 0.72rem !important;
}

.metric-card.metric-card-compact em {
    margin-top: -2px !important;
    font-size: 0.9rem !important;
}

.metric-card.danger {
    --metric-color: #ff5f6f;
    --metric-track: rgba(255, 95, 111, 0.20);
}

.metric-card.purple {
    --metric-color: #b18cff;
    --metric-track: rgba(177, 140, 255, 0.20);
}

.pending-members-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid rgba(255, 95, 111, 0.38);
    background: linear-gradient(145deg, rgba(255, 95, 111, 0.14), rgba(255, 255, 255, 0.055));
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24), 0 0 32px rgba(255, 95, 111, 0.12);
    border-radius: 28px;
    padding: 18px 20px;
    margin-bottom: 22px;
}

.pending-members-alert h2,
.pending-members-alert p {
    margin: 0;
}

.pending-members-alert h2 {
    font-size: 1.18rem;
}

.pending-members-alert p:not(.eyebrow) {
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 700;
}

.portal-nav-link-with-badge {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nav-pending-dot {
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    border-radius: 50%;
    background: #ff3f55;
    box-shadow: 0 0 0 4px rgba(255, 63, 85, 0.16), 0 0 14px rgba(255, 63, 85, 0.65);
}

@media (max-width: 1320px) {
    .dashboard-grid.dashboard-grid-compact {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }
}

@media (max-width: 760px) {
    .dashboard-grid.dashboard-grid-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pending-members-alert {
        align-items: stretch;
        flex-direction: column;
    }
}


/*PORTAL REVISION V33 - DASHBOARD METRICS FINAL LAYOUT*/
.dashboard-grid.dashboard-grid-compact {
    grid-template-columns: repeat(9, minmax(118px, 1fr)) !important;
    gap: 10px !important;
    align-items: stretch !important;
}

.metric-card.metric-card-compact {
    --metric-size: 112px !important;
    --metric-thickness: 9px !important;
    min-height: 158px !important;
    padding: 12px 10px 14px !important;
    gap: 6px !important;
    display: grid !important;
    grid-template-rows: auto 1fr auto !important;
    justify-items: center !important;
    align-items: center !important;
}

.metric-card.metric-card-compact > span {
    width: 100% !important;
    text-align: center !important;
    justify-self: center !important;
    align-self: start !important;
    margin: 0 !important;
    font-size: 0.88rem !important;
    line-height: 1.12 !important;
}

.metric-card.metric-card-compact .metric-ring-shell {
    width: var(--metric-size) !important;
    height: var(--metric-size) !important;
    flex-basis: var(--metric-size) !important;
    margin: 0 auto !important;
    align-self: center !important;
    box-shadow: inset 0 0 0 10px rgba(7, 27, 32, 0.72), 0 0 24px color-mix(in srgb, var(--metric-color) 20%, transparent) !important;
}

.metric-card.metric-card-compact .metric-ring-shell:after {
    inset: 10px !important;
}

.metric-card.metric-card-compact .metric-ring-value strong,
.metric-card.metric-card-compact strong {
    font-size: 2rem !important;
    line-height: 1 !important;
}

.metric-card.metric-card-compact .metric-ring-value small {
    font-size: 0.82rem !important;
}

.metric-card.metric-card-compact em {
    width: 100% !important;
    margin: 0 !important;
    text-align: center !important;
    justify-self: center !important;
    align-self: end !important;
    font-size: 0.9rem !important;
    line-height: 1 !important;
}

@media (max-width: 1500px) {
    .dashboard-grid.dashboard-grid-compact {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    }
}

/*PORTAL REVISION V33 - SHARED CONFIRM MODAL*/
.portal-confirm-dialog {
    width: min(100%, 460px) !important;
}

.portal-confirm-dialog h2 {
    margin: 0 !important;
    color: var(--color-white) !important;
}

.portal-confirm-dialog p {
    margin: 0 !important;
    color: rgba(255, 255, 255, 0.76) !important;
    line-height: 1.55 !important;
}

/*PORTAL REVISION - DASHBOARD METRIC ALIGNMENT*/
.metric-card.metric-card-compact {
    min-height: 190px;
    padding: 12px 10px 14px;
}

.metric-card.metric-card-compact > span {
    justify-self: center;
    text-align: center;
    width: 100%;
    margin: 0 0 4px;
}

.metric-card.metric-card-compact:before,
.metric-card.metric-card-compact:after {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -43%);
}

.metric-card.metric-card-compact .metric-ring-value {
    margin-top: 0;
    align-self: center;
    justify-self: center;
}

.metric-card.metric-card-compact em {
    justify-self: center;
    text-align: center;
    margin-top: 4px;
}


/* PORTAL REVISION V35 - DASHBOARD RING CENTRING */
.dashboard-grid-compact .metric-card,
.dashboard-grid .metric-card.metric-card-compact {
    min-height: 176px !important;
    padding: 14px 8px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    text-align: center !important;
}

.dashboard-grid-compact .metric-card > span,
.dashboard-grid .metric-card.metric-card-compact > span {
    width: 100% !important;
    margin: 0 !important;
    text-align: center !important;
    justify-self: center !important;
    align-self: center !important;
}

.dashboard-grid-compact .metric-card:before,
.dashboard-grid-compact .metric-card:after,
.dashboard-grid .metric-card.metric-card-compact:before,
.dashboard-grid .metric-card.metric-card-compact:after {
    display: none !important;
}

.dashboard-grid-compact .metric-ring-shell,
.dashboard-grid .metric-card.metric-card-compact .metric-ring-shell {
    --metric-size: 126px;
    --metric-thickness: 10px;
    width: var(--metric-size) !important;
    height: var(--metric-size) !important;
    min-width: var(--metric-size) !important;
    min-height: var(--metric-size) !important;
    position: relative !important;
    display: grid !important;
    place-items: center !important;
    margin: 0 auto !important;
    padding: 0 !important;
    flex: 0 0 var(--metric-size) !important;
}

.dashboard-grid-compact .metric-ring-shell:before,
.dashboard-grid .metric-card.metric-card-compact .metric-ring-shell:before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--metric-track) !important;
    box-shadow: inset 0 0 0 12px rgba(7, 27, 32, 0.72), 0 0 28px color-mix(in srgb, var(--metric-color) 18%, transparent) !important;
}

.dashboard-grid-compact .metric-ring-shell:after,
.dashboard-grid .metric-card.metric-card-compact .metric-ring-shell:after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(var(--metric-color) var(--progress), transparent var(--progress));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--metric-thickness) - 1px), #000 calc(100% - var(--metric-thickness)));
    mask: radial-gradient(farthest-side, transparent calc(100% - var(--metric-thickness) - 1px), #000 calc(100% - var(--metric-thickness)));
}

.dashboard-grid-compact .metric-ring-value,
.dashboard-grid .metric-card.metric-card-compact .metric-ring-value {
    position: relative !important;
    z-index: 2 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: baseline !important;
    justify-content: center !important;
    gap: 2px !important;
}

.dashboard-grid-compact .metric-card em,
.dashboard-grid .metric-card.metric-card-compact em {
    width: 100% !important;
    margin: 0 !important;
    text-align: center !important;
    align-self: center !important;
    justify-self: center !important;
}

.chat-connection-text[hidden] {
    display: none !important;
}

/* PORTAL REVISION V37 - GENERIC ATTACHMENT PREVIEW MODALS */
.chat-image-attachment {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.chat-image-attachment:focus-visible,
.chat-document-attachment:focus-visible {
    outline: 2px solid rgba(85,218,255,0.75);
    outline-offset: 3px;
}

button.chat-document-attachment {
    cursor: pointer;
    font-family: inherit;
}

.attachment-preview-dialog {
    width: min(100%, 980px);
    max-height: calc(100vh - 48px);
}

.attachment-photo-dialog {
    width: min(100%, 980px);
}

.attachment-photo-viewer {
    min-height: min(68vh, 720px);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    border-radius: 22px;
    background: rgba(0,0,0,0.26);
    border: 1px solid rgba(255,255,255,0.10);
    padding: 16px;
}

.attachment-photo-viewer img {
    max-width: 100%;
    max-height: min(66vh, 700px);
    object-fit: contain;
    justify-self: center;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.attachment-nav-button {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(85,218,255,0.35);
    background: rgba(85,218,255,0.12);
    color: #ffffff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

.attachment-nav-button:hover {
    background: rgba(85,218,255,0.22);
}

.attachment-document-dialog {
    width: min(100%, 1060px);
}

.attachment-document-frame {
    width: 100%;
    min-height: min(72vh, 760px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    background: rgba(255,255,255,0.96);
}

@media (max-width: 720px) {
    .attachment-photo-viewer {
        grid-template-columns: 1fr;
    }

    .attachment-nav-button {
        justify-self: center;
    }

    .attachment-document-frame {
        min-height: 68vh;
    }
}

/* PORTAL REVISION V38 - ATTACHMENT MODALS ABOVE FULL SITE */
.attachment-preview-modal {
    z-index: 2147483600 !important;
}

.attachment-preview-modal .modal-header-row h2 {
    margin-bottom: 0;
}

/* PORTAL REVISION V39 - PAPERWORK AND FINANCE */
.paperwork-list,
.finance-job-list {
    display: grid;
    gap: 18px;
}

.paperwork-job-card,
.finance-list-card {
    display: grid;
    gap: 18px;
}

.paperwork-job-header,
.finance-job-header,
.paperwork-invoice-panel,
.finance-actions-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.paperwork-job-header h2,
.finance-job-header h3,
.paperwork-invoice-panel h3 {
    margin: 0;
}

.paperwork-stage-list {
    display: grid;
    gap: 14px;
}

.paperwork-stage-card,
.finance-job-card {
    border: 1px solid rgba(53, 214, 255, 0.16);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.055);
    padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.paperwork-stage-card,
.paperwork-stage-main,
.paperwork-document-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.paperwork-stage-main {
    justify-content: flex-start;
}

.paperwork-stage-main p,
.paperwork-invoice-panel p,
.finance-job-header p,
.finance-addresses p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.68);
}

.paperwork-document-actions form,
.finance-actions-row form {
    margin: 0;
}

.paperwork-footer-actions {
    display: flex;
    justify-content: flex-end;
}

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

.finance-summary-card {
    display: grid;
    gap: 18px;
    border-color: rgba(53, 214, 255, 0.18);
}

.finance-summary-card.outstanding {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 32px rgba(179,38,30,0.12);
}

.finance-summary-card.paid {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 32px rgba(53,214,255,0.12);
}

.finance-summary-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.finance-summary-heading h2 {
    margin: 0;
    font-size: 28px;
}

.finance-summary-heading > strong {
    display: grid;
    place-items: center;
    min-width: 74px;
    height: 74px;
    border-radius: 999px;
    border: 1px solid rgba(53, 214, 255, 0.28);
    background: rgba(53, 214, 255, 0.10);
    color: #ffffff;
    font-size: 22px;
}

.finance-money-grid,
.finance-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.finance-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-money-grid div,
.finance-detail-grid div,
.finance-addresses div {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.18);
    padding: 12px;
}

.finance-money-grid span,
.finance-detail-grid span,
.finance-addresses span {
    display: block;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.finance-money-grid strong,
.finance-detail-grid strong {
    display: block;
    color: #ffffff;
    font-size: 14px;
}

.finance-money-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

@media (max-width: 1050px) {
    .finance-summary-grid,
    .finance-addresses {
        grid-template-columns: 1fr;
    }

    .finance-money-grid,
    .finance-detail-grid,
    .finance-money-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .paperwork-stage-card,
    .finance-actions-row,
    .paperwork-job-header,
    .finance-job-header,
    .paperwork-invoice-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .finance-money-grid,
    .finance-detail-grid,
    .finance-money-grid.compact {
        grid-template-columns: 1fr;
    }
}

/* PORTAL REVISION V40 - PAPERWORK FILTERS AND APP FINANCE CARDS */
.auto-filter-submit {
    display: none !important;
}

.app-finance-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.app-finance-summary-card {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    min-height: 230px;
    padding: 24px;
}

.app-finance-summary-card.outstanding {
    --finance-color: #ff5b6b;
    --finance-track: rgba(255, 91, 107, 0.16);
}

.app-finance-summary-card.paid {
    --finance-color: #9ed4ff;
    --finance-track: rgba(158, 212, 255, 0.18);
}

.app-finance-summary-chart {
    width: 156px;
    height: 156px;
    justify-self: center;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at center, rgba(7, 27, 32, 0.96) 0 54%, transparent 55%),
        conic-gradient(var(--finance-color) var(--progress), var(--finance-track) var(--progress));
    box-shadow: inset 0 0 0 13px rgba(7, 27, 32, 0.62), 0 0 34px color-mix(in srgb, var(--finance-color) 26%, transparent);
}

.app-finance-ring-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
    color: var(--color-white);
}

.app-finance-ring-value strong {
    font-size: 2.55rem;
    line-height: 1;
    color: var(--color-white);
}

.app-finance-ring-value small {
    color: var(--finance-color);
    font-weight: 900;
    font-size: 1.05rem;
}

.app-finance-summary-details {
    display: grid;
    gap: 11px;
}

.app-finance-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.app-finance-title-row h2 {
    margin: 0;
    font-size: 1.45rem;
}

.app-finance-title-row.outstanding h2 {
    color: #ff5b6b;
}

.app-finance-title-row.paid h2 {
    color: #9ed4ff;
}

.finance-icon-pill {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid currentColor;
    font-weight: 900;
}

.app-finance-money-row {
    display: grid;
    grid-template-columns: minmax(95px, 1fr) auto;
    gap: 14px;
    align-items: baseline;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 0 9px;
}

.app-finance-money-row span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
}

.app-finance-money-row strong {
    color: var(--color-white);
    font-size: 1.05rem;
    text-align: right;
}

.app-finance-money-row.vat strong {
    color: #f7b731;
}

.app-finance-money-row.cost strong {
    color: #ff684f;
}

.app-finance-money-row.profit strong {
    color: #7cff74;
    font-size: 1.2rem;
}

.app-finance-job-list {
    gap: 22px;
}

.app-finance-job-card {
    display: grid;
    gap: 18px;
    padding: 20px;
}

.app-finance-job-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.app-finance-job-header h3 {
    margin: 0;
    font-size: 1.35rem;
}

.app-finance-job-header p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.68);
}

.app-finance-job-body {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.72fr);
    gap: 22px;
    align-items: start;
}

.app-finance-job-main {
    display: grid;
    gap: 14px;
}

.finance-detail-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.finance-ref-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 4px;
}

.finance-detail-strip div,
.app-finance-addresses div {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.18);
    padding: 13px 14px;
}

.finance-detail-strip span,
.app-finance-addresses span {
    display: block;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.finance-detail-strip strong {
    color: var(--color-white);
    font-size: 0.96rem;
}

.app-finance-addresses {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 2px;
}

.app-finance-addresses p {
    margin: 0;
    line-height: 1.45;
}

.app-finance-job-money {
    display: grid;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    background: rgba(0, 0, 0, 0.14);
    padding: 16px;
}

.app-paid-toggle-form {
    margin: 10px 0 0;
}

.finance-toggle-button {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 999px;
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    align-items: center;
    gap: 10px;
    color: var(--color-white);
    background: transparent;
    cursor: pointer;
    font-weight: 900;
}

.finance-toggle-button i {
    width: 60px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    position: relative;
}

.finance-toggle-button i:after {
    content: "";
    position: absolute;
    width: 28px;
    height: 28px;
    top: 3px;
    left: 4px;
    border-radius: 999px;
    background: #ff5b6b;
    transition: transform .18s ease, background .18s ease;
}

.finance-toggle-button.paid i:after {
    transform: translateX(24px);
    background: #9ed4ff;
}

.app-finance-actions-row {
    justify-content: flex-end;
    padding-top: 4px;
}

@media (max-width: 1180px) {
    .app-finance-summary-grid,
    .app-finance-job-body {
        grid-template-columns: 1fr;
    }

    .app-finance-summary-card {
        grid-template-columns: 160px minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .app-finance-summary-card,
    .finance-detail-strip,
    .app-finance-addresses {
        grid-template-columns: 1fr;
    }

    .app-finance-job-header,
    .app-finance-actions-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* PORTAL REVISION V41 - PAPERWORK EMAIL AND FRIENDLY DOCUMENT MODALS */
.modal-actions-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.modal-copy {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.55;
}

.modal-copy.muted {
    color: rgba(255, 255, 255, 0.62);
}

.paperwork-email-dialog,
.finance-reminder-dialog {
    width: min(100%, 820px);
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.paperwork-email-form {
    gap: 14px;
}

.config-section-label {
    margin: 4px 0 -4px;
    color: var(--color-cyan);
    font-weight: 900;
    font-size: 0.82rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.inner-panel {
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.055);
    border-radius: 20px;
    padding: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.paperwork-email-section {
    display: grid;
    gap: 12px;
}

.boolean-selector-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.14);
    color: var(--color-white);
    font-weight: 800;
}

.boolean-selector-card input {
    width: 22px;
    height: 22px;
    accent-color: var(--color-cyan);
}

.paperwork-email-attachments {
    display: grid;
    gap: 9px;
}

.email-attachment-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    min-height: 66px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.055);
    padding: 12px 14px;
    color: var(--color-white);
}

.email-attachment-card input {
    width: 26px;
    height: 26px;
    accent-color: var(--color-cyan);
}

.email-attachment-card strong,
.email-attachment-card em {
    display: block;
    font-style: normal;
}

.email-attachment-card strong {
    font-weight: 900;
}

.email-attachment-card em {
    margin-top: 4px;
    width: fit-content;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(85, 218, 255, 0.18);
    color: var(--color-white);
    font-size: .74rem;
    font-weight: 900;
}

.email-attachment-card.missing {
    opacity: 0.62;
}

.email-attachment-card.missing em {
    background: rgba(255, 91, 107, 0.24);
}

.paperwork-time-note {
    margin: 6px 0 0 !important;
    color: rgba(255, 255, 255, 0.52) !important;
    font-size: .82rem;
}

.info-row {
    display: grid;
    grid-template-columns: minmax(120px, auto) 1fr;
    gap: 12px;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.info-row:last-child {
    border-bottom: 0;
}

.info-row span {
    color: rgba(255, 255, 255, 0.62);
}

.info-row strong {
    color: var(--color-white);
    text-align: right;
}

/* PORTAL REVISION V42 - JOB DETAILS AND ACTIVITY */
.table-actions-cell {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    white-space: nowrap;
}

.job-detail-card {
    display: grid;
    gap: 18px;
}

.job-detail-header,
.job-detail-address-grid,
.job-detail-grid,
.job-action-grid,
.job-detail-products-list {
    display: grid;
    gap: 14px;
}

.job-detail-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.job-detail-header h2 {
    margin: 0;
    color: #fff;
}

.job-detail-header p,
.job-detail-products p,
.audit-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
}

.job-detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.job-detail-address-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.job-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.document-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.audit-list {
    display: grid;
    gap: 14px;
}

.audit-card {
    display: grid;
    gap: 10px;
}

.audit-header {
    display: flex;
    gap: 12px;
    align-items: center;
}

.audit-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    background: rgba(35, 220, 220, 0.22);
    border: 1px solid rgba(35, 220, 220, 0.35);
}

.audit-header h3 {
    margin: 0;
    color: #fff;
    font-size: 0.95rem;
}

.audit-header p {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.78rem;
}

@media (max-width: 1100px) {
    .job-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .job-action-grid,
    .job-detail-address-grid {
        grid-template-columns: 1fr;
    }
}

/*PORTAL REVISION V43 - MENU, TEAM, FREIGHT COINS AND JOB DETAIL POLISH*/
.sidebar-close-button {
    display: none;
    width: 100%;
    min-height: 42px;
    margin-bottom: 14px;
    border: 1px solid rgba(53, 214, 255, 0.26);
    border-radius: 16px;
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.08);
    font-weight: 900;
}

.freight-balance-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.freight-coin-info-card,
.team-reference-card,
.member-card,
.job-status-grid,
.completion-section,
.signature-box,
.photo-grid,
.checklist-list,
.job-detail-actions-panel {
    border: 1px solid rgba(53, 214, 255, 0.18);
    background: rgba(255, 255, 255, 0.055);
    border-radius: 22px;
    padding: 16px;
}

.team-member-list {
    display: grid;
    gap: 14px;
}

.member-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
}

.member-card.pending {
    border-color: rgba(247, 147, 30, 0.4);
}

.member-meta h3,
.member-meta p {
    margin: 0;
}

.member-meta h3 {
    font-size: 1rem;
}

.member-meta p {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.68);
    font-weight: 700;
}

.member-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.member-actions form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.role-select {
    min-width: 140px;
}

.danger-zone-card {
    border: 1px solid rgba(255, 95, 111, 0.35);
    background: rgba(255, 95, 111, 0.12);
    border-radius: 22px;
    padding: 16px;
}

.danger-zone-card form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    justify-content: space-between;
}

.coin-amount.positive {
    color: #4CAF50;
    font-weight: 900;
}

.coin-amount.negative {
    color: #FF6B6B;
    font-weight: 900;
}

.job-detail-main-grid {
    display: grid;
    gap: 14px;
}

.job-detail-actions-panel {
    display: grid;
    gap: 10px;
}

.job-detail-actions-panel .job-action-grid {
    margin-top: 4px;
}

.value-stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.value-stack {
    display: grid;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.14);
    border-radius: 16px;
    padding: 12px;
}

.value-stack span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 900;
}

.value-stack strong {
    color: #fff;
    font-size: 1rem;
}

.completion-section {
    display: grid;
    gap: 12px;
}

.completion-section h2,
.completion-section h3,
.completion-section p {
    margin: 0;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.photo-grid img,
.signature-box img {
    width: 100%;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid rgba(53, 214, 255, 0.22);
}

.photo-grid img {
    height: 150px;
}

.signature-box img {
    max-height: 220px;
    object-fit: contain;
    background: rgba(255,255,255,0.08);
}

.audit-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
}

@media (max-width: 980px) {
    .sidebar-close-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .member-card {
        grid-template-columns: 1fr;
    }

    .member-actions,
    .member-actions form {
        justify-content: stretch;
    }

    .member-actions > *,
    .member-actions form,
    .member-actions button,
    .member-actions select {
        width: 100%;
    }

    .job-action-grid {
        grid-template-columns: 1fr !important;
    }
}

.attachment-photo-button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    border-radius: 18px;
    overflow: hidden;
}

.attachment-photo-preview {
    width: min(100%, 980px);
    max-height: 78vh;
    object-fit: contain;
    border-radius: 18px;
    background: rgba(0,0,0,0.24);
}

/*PORTAL REVISION V44 - MENU, EMPTY STATES AND MEMBER POLISH*/
.portal-brand img {
    background: rgba(190, 205, 208, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 22px;
    padding: 8px;
    box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.10), 0 8px 22px rgba(0, 0, 0, 0.18);
}

.portal-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.portal-nav {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(53, 214, 255, 0.45) rgba(255,255,255,0.06);
}

.sidebar-user-card {
    border: 1px solid rgba(247, 147, 30, 0.40);
    background: linear-gradient(135deg, rgba(247, 147, 30, 0.22), rgba(0, 188, 212, 0.12));
    border-radius: 24px;
    padding: 14px;
    margin-bottom: 16px;
    box-shadow: 0 18px 38px rgba(247, 147, 30, 0.12);
}

.sidebar-user-main {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.sidebar-user-main img,
.sidebar-user-main .portal-user-initials {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.sidebar-user-main strong,
.sidebar-user-main small {
    display: block;
}

.sidebar-user-main strong {
    color: var(--color-white);
    font-weight: 900;
    line-height: 1.15;
}

.sidebar-user-main small {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.70);
    font-weight: 700;
}

.empty-state,
.allocation-empty {
    min-height: 94px;
    border: 1px dashed rgba(255, 255, 255, 0.22);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.045);
    display: grid;
    place-items: center;
    text-align: center;
    padding: 22px;
    color: rgba(255, 255, 255, 0.74);
    font-weight: 900;
}

.empty-state h3,
.empty-state p {
    margin: 0;
}

.empty-state p {
    margin-top: 7px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.58);
}

.empty-state img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 18px;
    background: rgba(190, 205, 208, 0.42);
    padding: 8px;
    margin-bottom: 10px;
}

.member-main-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.member-avatar {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #243b41;
    color: #fff;
    font-weight: 900;
    flex: 0 0 auto;
    overflow: hidden;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.member-pill {
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 0.72rem;
    font-weight: 900;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.86);
}

.member-pill.role {
    background: rgba(53, 214, 255, 0.16);
    border-color: rgba(53, 214, 255, 0.32);
}

.member-pill.active {
    background: rgba(0, 210, 162, 0.14);
    border-color: rgba(0, 210, 162, 0.38);
}

.member-pill.pending {
    background: rgba(247, 147, 30, 0.18);
    border-color: rgba(247, 147, 30, 0.42);
}

.member-pill.tracking {
    background: rgba(35, 218, 255, 0.14);
    border-color: rgba(35, 218, 255, 0.35);
}

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

@media (max-width: 980px) {
    .portal-topbar .account-menu .portal-user-chip,
    .portal-topbar .account-menu form {
        display: none;
    }
}


/* PORTAL REVISION V45 - POLISH */
.team-logo-wrap {
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid rgba(255, 255, 255, 0.42);
    box-shadow: inset 0 0 18px rgba(255,255,255,0.18), 0 12px 28px rgba(0,0,0,0.18);
}

.freight-package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.freight-package-card {
    border: 1px solid rgba(53, 214, 255, 0.24);
    background: linear-gradient(145deg, rgba(255,255,255,0.11), rgba(0,0,0,0.16));
    border-radius: 26px;
    padding: 20px;
    text-align: center;
    min-height: 150px;
    display: grid;
    align-content: center;
    gap: 10px;
}

.freight-package-card h3,
.freight-package-card p {
    margin: 0;
}

.freight-package-card strong {
    color: #FFD27A;
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    line-height: 1;
}

.freight-audit-actions {
    margin-left: auto;
}

.audit-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 999px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: rgba(53, 214, 255, 0.16);
    border: 1px solid rgba(53, 214, 255, 0.24);
}

.audit-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.signature-summary-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) 1.2fr;
    gap: 14px;
    align-items: stretch;
}

.signature-image-panel {
    border: 1px solid rgba(53, 214, 255, 0.18);
    border-radius: 20px;
    background: rgba(0,0,0,0.12);
    padding: 12px;
    display: grid;
    place-items: center;
    min-height: 180px;
}

.signature-image-panel img {
    max-width: 100%;
    max-height: 190px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
}

.signature-info-panel {
    display: grid;
    gap: 12px;
    align-content: start;
}

.signature-notes-box {
    min-height: 118px;
}

@media (max-width: 860px) {
    .signature-summary-grid {
        grid-template-columns: 1fr;
    }
}

.paperwork-stage-status { margin-top: 8px; display: inline-flex; }

.table-filter-select {
    min-width: 180px;
    width: auto;
}

.freight-audit-scroll {
    max-height: 520px;
    overflow: auto;
    border-radius: 18px;
}

/*PORTAL REVISION V49 - JOBS AND ALLOCATION DATE HEADER ALIGNMENT*/
.allocation-date-actions,
.inline-date-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-date-form input[type="date"],
.allocation-date-actions input[type="date"] {
    min-height: 48px;
    min-width: 180px;
}

.jobs-toolbar-actions {
    align-items: center;
}

@media (max-width: 760px) {
    .allocation-date-actions,
    .inline-date-form {
        width: 100%;
    }

    .inline-date-form input[type="date"],
    .allocation-date-actions input[type="date"] {
        flex: 1;
        min-width: 0;
    }
}

/*PORTAL REVISION V51 - JOBS HEADER CONTROL ALIGNMENT*/
.jobs-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.jobs-toolbar-actions .jobs-date-form,
.jobs-toolbar-actions .inline-refresh-form {
    display: flex;
    align-items: center;
    gap: 0;
}

.jobs-toolbar-actions .jobs-date-form input[type="date"] {
    min-width: 210px;
}

.jobs-toolbar-actions .table-filter-select {
    min-width: 190px;
}

.jobs-toolbar-actions .table-search-input {
    min-width: 260px;
}

.checklist-group-card,
.damage-group-card {
    display: grid;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.12);
    border-radius: 18px;
    padding: 14px;
}

.checklist-group-card h3,
.damage-group-card h3 {
    margin: 0;
    color: #fff;
    font-size: 1rem;
}

@media (max-width: 900px) {
    .jobs-toolbar-actions {
        justify-content: stretch;
    }

    .jobs-toolbar-actions .jobs-date-form,
    .jobs-toolbar-actions .inline-refresh-form,
    .jobs-toolbar-actions .table-filter-select,
    .jobs-toolbar-actions .table-search-input,
    .jobs-toolbar-actions .primary-button {
        width: 100%;
    }

    .jobs-toolbar-actions .jobs-date-form input[type="date"] {
        width: 100%;
        min-width: 0;
    }
}


/* PORTAL REVISION V53 - FINANCE/PAPERWORK TOOLBARS, SETTINGS EDITOR AND CHECKLIST SUMMARY */
.toolbar-actions .secondary-button {
    min-width: 118px;
    flex: 0 0 auto;
}

.toolbar-actions input[type="date"],
.toolbar-actions select,
.toolbar-actions input[type="search"] {
    min-height: 48px;
}

.settings-edit-form {
    display: grid;
    gap: 18px;
}

.settings-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.settings-field {
    display: grid;
    gap: 8px;
}

.settings-field.full {
    margin-top: 14px;
}

.settings-field span {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 900;
}

.settings-field input,
.settings-field textarea {
    width: 100%;
}

.settings-toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.settings-toggle {
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(0,0,0,0.14);
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #fff;
    font-weight: 900;
}

.settings-save-card {
    display: flex;
    justify-content: flex-end;
}

.email-colour-groups {
    display: grid;
    gap: 16px;
}

.email-colour-group {
    display: grid;
    gap: 10px;
}

.email-colour-group h3 {
    margin: 0;
    color: rgba(255,255,255,0.82);
    font-size: 0.92rem;
}

.email-colour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
    gap: 10px;
}

.email-colour-tile {
    min-height: 94px;
    border-radius: 18px;
    padding: 10px;
    display: flex;
    align-items: flex-end;
    background: var(--tile-colour, rgba(53, 214, 255, 0.18));
    border: 1px solid rgba(255,255,255,0.20);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.email-colour-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.38));
}

.email-colour-tile input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.email-colour-tile span {
    position: relative;
    z-index: 1;
    color: #fff;
    font-weight: 900;
    font-size: 0.82rem;
    text-shadow: 0 1px 8px rgba(0,0,0,0.55);
}

.email-colour-tile.selected {
    border-color: var(--color-orange);
    box-shadow: 0 0 0 3px rgba(247, 147, 30, 0.22), 0 0 24px rgba(247, 147, 30, 0.20);
}

.checklist-summary-list {
    display: grid;
    gap: 12px;
}

.compact-checklist-group {
    background: rgba(0, 0, 0, 0.18);
}

.checklist-title-row {
    display: grid;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.16);
    border-radius: 16px;
    padding: 12px;
}

.checklist-title-row span,
.checklist-answer-row span {
    color: rgba(255,255,255,0.62);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.74rem;
    font-weight: 900;
}

.checklist-title-row strong,
.checklist-answer-row strong {
    color: #fff;
    font-size: 1rem;
}

.checklist-answer-list {
    display: grid;
    gap: 8px;
}

.checklist-answer-row {
    display: grid;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(0, 0, 0, 0.20);
    border-radius: 15px;
    padding: 11px 12px;
}

.damage-group-card {
    background: rgba(0,0,0,0.18);
}

@media (max-width: 900px) {
    .toolbar-actions .secondary-button {
        width: 100%;
    }

    .settings-save-card .primary-button {
        width: 100%;
    }
}

/* PORTAL REVISION V54 - SIMPLER COMPLETION DETAILS, COMPLETED CHECKLISTS */
.simple-checklist-summary-list {
    gap: 14px;
}

.simple-checklist-block {
    display: grid;
    gap: 10px;
}

.simple-checklist-block h3,
.simple-damage-product-title {
    margin: 0;
    color: #fff;
    font-family: Manrope, Inter, sans-serif;
    font-weight: 900;
    font-size: 1rem;
}

.simple-checklist-card {
    display: grid;
    gap: 10px;
}

.vertical-checklist-answer-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.vertical-checklist-answer-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
}

.simple-damage-list {
    display: grid;
    gap: 12px;
}

.simple-damage-grid {
    gap: 10px;
}

.completed-checklist-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.42fr) minmax(420px, 0.58fr);
    gap: 18px;
    align-items: start;
}

.completed-checklist-list,
.completed-checklist-detail {
    min-height: 520px;
}

.completed-checklist-items {
    display: grid;
    gap: 10px;
    max-height: 620px;
    overflow-y: auto;
    padding-right: 6px;
}

.completed-checklist-card {
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.completed-checklist-card.selected {
    border-color: rgba(53, 214, 255, 0.8);
    box-shadow: 0 0 0 1px rgba(53, 214, 255, 0.28), 0 0 24px rgba(53, 214, 255, 0.14);
}

.completed-checklist-detail-content {
    display: grid;
    gap: 12px;
}

@media (max-width: 1000px) {
    .completed-checklist-layout {
        grid-template-columns: 1fr;
    }
}


/* PORTAL REVISION V55 - SETTINGS LOGO, ADDRESS EDITOR AND CONFIRMATION INPUT */
.settings-field-grid-spaced {
    margin-top: 16px;
}

.settings-logo-panel {
    display: grid;
    grid-template-columns: minmax(160px, 240px) 1fr;
    gap: 18px;
    align-items: center;
}

.settings-company-logo {
    min-height: 150px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.96);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.24);
}

.settings-company-logo img {
    max-width: 82%;
    max-height: 126px;
    object-fit: contain;
}

.settings-company-logo span {
    color: rgba(0,0,0,0.55);
    font-weight: 900;
}

.settings-logo-actions {
    display: grid;
    gap: 12px;
    justify-items: start;
}

.settings-address-editor {
    margin-top: 18px;
    display: grid;
    gap: 14px;
}

.section-header.compact {
    margin-bottom: 0;
}

.address-map-preview {
    min-height: 220px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(38, 213, 236, 0.24);
    background: rgba(0,0,0,0.18);
}

.address-map-preview iframe {
    width: 100%;
    height: 260px;
    border: 0;
    display: block;
}

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

.portal-confirm-dialog [data-global-confirm-required-wrap] {
    margin-top: 14px;
}

@media (max-width: 760px) {
    .settings-logo-panel {
        grid-template-columns: 1fr;
    }
}

/* PORTAL REVISION V56 - ADDRESS EDITOR REFINEMENT */
.address-editor-split {
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
    align-items: start;
}

.address-editor-heading {
    grid-column: 1 / -1;
}

.address-editor-split .address-map-preview {
    min-height: 390px;
    height: 100%;
}

.address-editor-split .address-map-preview iframe,
.address-editor-split .address-map-preview > div:not(.allocation-empty) {
    height: 390px;
}

.address-editor-controls {
    display: grid;
    gap: 14px;
}

.address-coordinate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.address-coordinate-actions,
.address-actions {
    justify-content: flex-end;
}

.address-editor-loading {
    opacity: 0.72;
    pointer-events: none;
}

.email-colour-tile input:checked + span::after,
.email-colour-tile.selected span::after {
    content: "✓";
    margin-left: 8px;
    color: var(--color-orange);
}

@media (max-width: 980px) {
    .address-editor-split {
        grid-template-columns: 1fr;
    }

    .address-editor-split .address-map-preview,
    .address-editor-split .address-map-preview iframe,
    .address-editor-split .address-map-preview > div:not(.allocation-empty) {
        min-height: 280px;
        height: 280px;
    }
}

/* PORTAL REVISION V57 - REUSABLE ADDRESS EDITOR */
.wide-crud-dialog {
    width: min(1180px, calc(100vw - 32px));
}

.address-contact-grid {
    margin-top: 14px;
}

.settings-address-editor.address-editor-split {
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
    gap: 18px;
    align-items: stretch;
}

.settings-address-editor .address-map-preview {
    min-height: 360px;
    height: 100%;
}

.settings-address-editor .address-map-preview iframe,
.settings-address-editor .address-map-preview > div:not(.allocation-empty) {
    height: 360px;
}

.address-field-grid {
    margin-top: 4px;
}

@media (max-width: 980px) {
    .settings-address-editor.address-editor-split {
        grid-template-columns: 1fr;
    }

    .settings-address-editor .address-map-preview,
    .settings-address-editor .address-map-preview iframe,
    .settings-address-editor .address-map-preview > div:not(.allocation-empty) {
        min-height: 280px;
        height: 280px;
    }
}

/* PORTAL REVISION V58 - COMPLETED CHECKLIST DETAIL SCROLL */
.completed-checklist-detail {
    min-height: 0;
}

.completed-checklist-detail-content {
    max-height: min(68vh, 760px);
    overflow-y: auto;
    padding-right: 8px;
}

.completed-checklist-detail-content::-webkit-scrollbar {
    width: 10px;
}

.completed-checklist-detail-content::-webkit-scrollbar-thumb {
    background: rgba(45, 207, 233, 0.35);
    border-radius: 999px;
}

/* PORTAL REVISION V58 - ADDRESS FILTER */
.portal-search-row .table-filter-select {
    min-width: 190px;
}

.address-editor-status {
    display: none;
    flex: 0 0 100%;
    width: fit-content;
    max-width: 100%;
    margin-top: 2px;
    margin-left: auto;
    padding: 5px 10px;
    border: 1px solid rgba(53, 214, 255, 0.35);
    border-radius: 999px;
    background: rgba(53, 214, 255, 0.13);
    color: var(--color-cyan);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: normal;
}

.address-editor-status.visible {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.address-editor-status.address-editor-status-error {
    border-color: rgba(247, 147, 30, 0.45);
    background: rgba(247, 147, 30, 0.15);
    color: #ffd27a;
}

/* PORTAL REVISION V59 */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(2) !important;
    opacity: 1 !important;
}

.column-title-row .badge-soft,
.section-actions .badge-soft,
.toolbar-actions .badge-soft {
    flex: 0 0 auto;
}

/* PORTAL REVISION V60 - GENERAL CHECKLIST CARDS AND DETAIL VIEW */
.rich-checklist-card {
    display: grid;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.rich-checklist-card.failed,
.checklist-detail-summary.failed,
.checklist-question-card.failed {
    border-color: rgba(255, 59, 59, 0.76);
    background: rgba(255, 59, 59, 0.10);
    box-shadow: 0 0 0 1px rgba(255, 59, 59, 0.18), 0 0 24px rgba(255, 59, 59, 0.10);
}

.rich-checklist-card.passed,
.checklist-detail-summary.passed {
    border-color: rgba(31, 138, 150, 0.52);
    background: rgba(31, 138, 150, 0.08);
}

.rich-checklist-card-top {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
}

.rich-checklist-card-top h3 {
    margin: 0;
    color: #fff;
    font-family: Manrope, Inter, sans-serif;
    font-weight: 900;
    font-size: 1rem;
}

.rich-checklist-card-top p {
    margin: 3px 0 0;
    color: rgba(255,255,255,0.66);
    font-size: 0.84rem;
    font-weight: 700;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(53,214,255,0.28), rgba(247,147,30,0.22));
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    font-weight: 900;
}

.profile-avatar.small {
    width: 40px;
    height: 40px;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.checklist-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.12);
}

.status-pill.success {
    color: #fff;
    background: rgba(31, 138, 150, 0.9);
}

.status-pill.danger {
    color: #fff;
    background: rgba(220, 38, 38, 0.95);
}

.status-pill.warning {
    color: #111827;
    background: rgba(247, 147, 30, 0.96);
}

.status-pill.neutral {
    color: #fff;
    background: rgba(255,255,255,0.10);
}

.checklist-detail-summary {
    display: grid;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    padding: 14px;
    background: rgba(255,255,255,0.06);
}

.checklist-question-card {
    display: grid;
    gap: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 13px 14px;
    background: rgba(0,0,0,0.20);
}

.checklist-question-card span {
    color: #fff;
    font-weight: 900;
    font-family: Manrope, Inter, sans-serif;
}

.checklist-question-card strong {
    color: rgba(255,255,255,0.78);
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.checklist-media-section {
    display: grid;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 18px;
    padding: 14px;
    background: rgba(0,0,0,0.18);
}

.section-header.tight {
    margin-bottom: 0;
}

.checklist-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.checklist-photo-tile {
    display: grid;
    gap: 8px;
}

.checklist-photo-tile button[data-photo-preview-url],
.checklist-signature-panel button[data-photo-preview-url] {
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.checklist-photo-tile img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
}

.checklist-signature-panel {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 10px;
}

.checklist-signature-panel img {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    display: block;
}

.document-row-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    padding: 11px;
    background: rgba(0,0,0,0.18);
}

.document-row-card strong {
    display: block;
    color: #fff;
    font-weight: 900;
}

.document-row-card span {
    display: block;
    color: rgba(255,255,255,0.62);
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

@media (max-width: 700px) {
    .document-row-card {
        grid-template-columns: 1fr;
    }
}

/* PORTAL REVISION V61 - CHECKLIST UPLOAD STATES */
.profile-avatar {
    position: relative;
}

.profile-avatar span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.profile-avatar img {
    position: relative;
    z-index: 1;
}

.inline-form {
    display: inline-flex;
}

.checklist-media-section .section-header.tight {
    gap: 10px;
}

/* PORTAL REVISION V62 - CHECKLIST CARD FIXES */
.profile-avatar,
.profile-avatar.small {
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
}

.profile-avatar img,
.profile-avatar.small img {
    display: block;
    width: 100% !important;
    min-width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
}

.completed-checklist-card .value-stack-grid.compact {
    grid-template-columns: 1fr;
}

/* PORTAL REVISION V62 - KEEP MENU FOCUS SEPARATE FROM ACTIVE STATE */
.portal-nav a:focus:not(.active) {
    color: rgba(255, 255, 255, 0.78);
    background: transparent;
}

/* PORTAL REVISION V63 - CHECKLIST FIREBASE DISPLAY AND TEAM PILL */
.selected-team-pill-rich {
    min-height: 42px;
    gap: 10px;
    padding: 5px 14px 5px 6px;
    color: #ffffff;
    background: linear-gradient(145deg, rgba(6, 36, 42, 0.96), rgba(14, 47, 54, 0.94));
    border: 1px solid rgba(53, 214, 255, 0.36);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.selected-team-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.34);
    color: #06242a;
    font-size: 0.78rem;
    font-weight: 900;
}

.selected-team-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar.has-image {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.profile-avatar.has-image span {
    opacity: 0;
}

.checklist-action-message {
    display: none;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(53, 214, 255, 0.28);
    background: rgba(53, 214, 255, 0.10);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 800;
}

.checklist-action-message.visible {
    display: block;
}

.checklist-action-message.error {
    border-color: rgba(255, 59, 59, 0.55);
    background: rgba(255, 59, 59, 0.12);
}


/* PORTAL REVISION V64 - CHECKLIST AND PROFILE FIXES */
.completed-checklist-card .profile-avatar.small,
.rich-checklist-card .profile-avatar.small {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    border-radius: 50% !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

.completed-checklist-card .profile-avatar.small img,
.rich-checklist-card .profile-avatar.small img {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center center !important;
}

.checklist-photo-tile .delete-form {
    display: flex;
    justify-content: center;
    width: 100%;
}

.allocation-map {
    min-height: 460px;
}

.sidebar-user-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
}

.sidebar-user-actions .secondary-button,
.sidebar-user-actions .text-button {
    width: 100%;
    justify-content: center;
}

.user-profile-grid {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 18px;
    align-items: start;
}

.user-profile-photo-card {
    display: grid;
    gap: 14px;
    justify-items: center;
    text-align: center;
}

.user-profile-photo-preview {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(53,214,255,0.28), rgba(247,147,30,0.22));
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    font-size: 2.4rem;
    font-weight: 900;
}

.user-profile-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 900px) {
    .user-profile-grid {
        grid-template-columns: 1fr;
    }
}

.sidebar-user-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.sidebar-user-actions form {
    width: 100%;
}

.sidebar-user-actions .secondary-button,
.sidebar-user-actions button {
    width: 100%;
    justify-content: center;
}

.feature-request-list {
    display: grid;
    gap: 14px;
}

.feature-request-card {
    margin: 0;
}

.feature-request-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.feature-request-card-header h3 {
    margin: 0;
}

.feature-progress {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.feature-progress > div {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.feature-progress > div > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1f8a96, #35d6ff);
}

.danger-zone-card {
    border-color: rgba(255, 76, 76, 0.45) !important;
}


/* PORTAL REVISION V67 - SUPPORT, FEATURE REQUEST AND USER LAYOUT CLEANUP */
.portal-half-card,
.portal-half-dialog {
    width: min(760px, 100%);
    max-width: 760px;
}

.portal-half-card {
    margin-left: 0;
    margin-right: auto;
}

.portal-half-dialog {
    margin-left: auto;
    margin-right: auto;
}

.support-form,
.user-edit-form {
    display: grid;
    gap: 16px;
}

.support-form input,
.user-edit-form input {
    min-height: 48px;
}

.support-form textarea {
    min-height: 170px;
    resize: vertical;
}

.user-profile-stack {
    display: grid;
    justify-items: center;
    gap: 16px;
    text-align: center;
}

.user-profile-summary {
    display: grid;
    gap: 4px;
}

.user-profile-summary strong {
    color: #fff;
    font-family: Manrope, Inter, sans-serif;
    font-weight: 900;
}

.user-profile-summary span {
    color: rgba(255,255,255,0.72);
}

.user-edit-form {
    width: 100%;
    margin-top: 8px;
    text-align: left;
}

.user-edit-form button {
    width: 100%;
    justify-content: center;
}

.checklist-detail-summary {
    border-color: rgba(31, 138, 150, 0.46) !important;
    background: rgba(31, 138, 150, 0.08) !important;
    box-shadow: none !important;
}

.checklist-delete-form {
    display: flex;
    justify-content: center;
    width: 100%;
}

@media (max-width: 900px) {
    .portal-half-card,
    .portal-half-dialog {
        width: 100%;
        max-width: 100%;
    }
}

/* PORTAL REVISION V68 - FEATURE REQUEST ACTIONS AND LOGO UPLOAD */
.feature-request-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.feature-request-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.feature-request-actions form {
    margin: 0;
}

.feature-request-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.feature-request-footer form {
    margin: 0;
}

.settings-logo-upload-form {
    margin: 0;
}

.hidden-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* PORTAL REVISION V69 - FEATURE REQUEST ACTION BUTTON SIZING */
.feature-request-actions .secondary-button.small,
.feature-request-actions .danger-button.small {
    min-width: 92px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.feature-request-actions .delete-form {
    display: inline-flex;
}

/* PORTAL REVISION V69 - FRIENDLY ERROR PAGE */
.portal-error-card {
    max-width: 720px;
    margin: 40px auto;
    text-align: center;
}

.portal-error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.portal-error-mascot {
    width: 110px;
    height: 110px;
    object-fit: contain;
}

.portal-error-logo {
    max-width: 220px;
    height: auto;
}

.centered-actions {
    justify-content: center;
}

.small-copy {
    font-size: 12px;
}

.inline-upload-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.inline-upload-form input[type="file"] {
    max-width: 320px;
}

.job-photo-manage-grid .checklist-photo-tile {
    align-items: center;
}


/* PORTAL REVISION V74 - LOGIN BRAND AND DASHBOARD RESPONSIVE METRICS */
.auth-card .auth-brand.auth-brand-large {
    position: absolute;
    top: 28px;
    right: 32px;
    justify-content: flex-end;
}

.auth-card .auth-brand.auth-brand-large img {
    width: 86px !important;
    height: 86px !important;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(53, 214, 255, 0.34));
}

.auth-card.has-mascot h1 {
    padding-right: 96px;
    margin-top: 84px;
}

.dashboard-grid.dashboard-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)) !important;
    gap: 14px !important;
    overflow: visible !important;
}

.dashboard-grid-compact .metric-card,
.dashboard-grid .metric-card.metric-card-compact {
    min-width: 0 !important;
    overflow: hidden !important;
}

@media (min-width: 1760px) {
    .dashboard-grid.dashboard-grid-compact {
        grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 560px) {
    .auth-card .auth-brand.auth-brand-large {
        top: 22px;
        right: 24px;
    }

    .auth-card .auth-brand.auth-brand-large img {
        width: 68px !important;
        height: 68px !important;
    }

    .auth-card.has-mascot h1 {
        padding-right: 76px;
        margin-top: 72px;
    }

    .dashboard-grid.dashboard-grid-compact {
        grid-template-columns: 1fr !important;
    }
}

/* Final menu/reward sizing overrides */
.portal-menu-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); max-width:none; gap:14px; }
.portal-menu-card { min-height:102px; border-color:rgba(53,214,255,.42); background:linear-gradient(135deg,rgba(53,214,255,.14),rgba(255,255,255,.055)); }
.portal-menu-icon,.portal-menu-chevron { border-color:rgba(53,214,255,.62); color:var(--color-cyan); background:rgba(53,214,255,.12); }
.weekly-rewards-page { width:100%; max-width:none; margin:0; }
@media(max-width:1100px){.portal-menu-grid{grid-template-columns:1fr}}

/* WORKSPACES AND CUSTOMER PORTAL PARITY */
.workspace-selection-page { width: 100%; }
.workspace-tools-row { display:grid; grid-template-columns:minmax(240px,320px) minmax(0,1fr); gap:14px; align-items:end; margin:0 0 18px; }
.workspace-action-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0; }
.workspace-action-button,.service-style-action { display:grid; grid-template-columns:46px minmax(0,1fr); grid-template-rows:auto auto; align-items:center; gap:2px 12px; min-height:76px; padding:13px 16px; border:1px solid rgba(53,214,255,.38); border-radius:19px; background:linear-gradient(135deg,rgba(53,214,255,.13),rgba(255,255,255,.06)); color:#fff; text-align:left; cursor:pointer; box-shadow:inset 0 1px rgba(255,255,255,.07); }
.workspace-action-button>span,.service-style-action>span { grid-row:1/3; display:inline-flex; width:44px; height:44px; align-items:center; justify-content:center; border:1px solid rgba(53,214,255,.66); border-radius:14px; color:var(--color-cyan); background:rgba(53,214,255,.14); font-size:23px; font-weight:900; }
.workspace-action-button strong,.service-style-action strong { color:#fff; font:800 15px var(--font-heading); }
.service-style-action small { color:rgba(255,255,255,.64); }
.workspace-search-group { display:grid; gap:7px; color:#fff; font-weight:800; }
.workspace-search-group>span { color:var(--color-cyan); font-size:12px; letter-spacing:.12em; text-transform:uppercase; }
.workspace-search { width:100%; height:44px; margin:0; }
.workspace-card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),440px)); align-items:start; gap:18px; }
.workspace-card { display:grid; gap:14px; padding:18px; border:1px solid rgba(255,255,255,.2); border-radius:24px; background:linear-gradient(160deg,rgba(255,255,255,.13),rgba(255,255,255,.055)); box-shadow:0 16px 38px rgba(0,0,0,.18); }
.workspace-card.pending { opacity:1; }
.workspace-logo-wrap { display:grid; place-items:center; height:150px; padding:14px; border-radius:18px; background:#fff; }
.workspace-logo-wrap img { width:100%; height:100%; object-fit:contain; }
.workspace-card-copy h3 { margin:0 0 8px; }
.workspace-pill-row { display:flex; flex-wrap:wrap; gap:7px; }
.workspace-role-pill,.workspace-status-pill { display:inline-flex; min-height:26px; align-items:center; padding:4px 10px; border-radius:999px; color:#fff; font-size:11px; font-weight:900; }
.workspace-role-pill.owner { background:#6a1b9a; }.workspace-role-pill.admin{background:#1565c0}.workspace-role-pill.user{background:#4c5b60}.workspace-role-pill.customer{background:#ff4f9a;color:#fff}.workspace-status-pill.active{background:rgba(0,229,168,.18);border:1px solid rgba(0,229,168,.5)}.workspace-status-pill.pending{background:rgba(247,147,30,.18);border:1px solid rgba(247,147,30,.5)}

.customer-metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.customer-metric-grid a { display:grid; gap:8px; padding:18px; border:1px solid rgba(53,214,255,.28); border-radius:20px; background:rgba(255,255,255,.07); }
.customer-metric-grid span { color:rgba(255,255,255,.68); font-weight:800; }.customer-metric-grid strong { color:var(--color-cyan); font:900 30px var(--font-heading); }
.customer-action-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.customer-filter-tabs { margin-bottom:12px; }.customer-job-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:14px; }
.customer-job-card { display:grid; gap:12px; }.customer-job-card-header { display:flex; justify-content:space-between; gap:14px; }.customer-job-card-header h3,.customer-job-card-header p { margin:0; }
.customer-stage-list { display:grid; gap:9px; }.customer-stage-list>div { display:grid; gap:3px; padding:10px 12px; border-radius:14px; background:rgba(0,0,0,.16); }.customer-stage-list span,.customer-stage-list small { color:rgba(255,255,255,.67); }
.customer-enquiry-page,.customer-details-page,.customer-workspace-dashboard,.customer-jobs-page,.tracked-job-page,.contact-page-card { width:100%; }
.customer-enquiry-form { max-width:none; }.customer-enquiry-form>.pf-inner-card { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }.customer-enquiry-form>.pf-inner-card h3,.customer-enquiry-form>.pf-inner-card label:last-child { grid-column:1/-1; }
.customer-detail-grid,.tracked-job-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }.customer-detail-grid article { display:grid; gap:8px; }
.tracked-job-page { display:grid; gap:16px; }.tracked-job-hero { display:flex; align-items:center; justify-content:space-between; gap:20px; }.tracked-job-hero img { width:140px; height:90px; object-fit:contain; padding:8px; border-radius:14px; background:#fff; }
.tracked-driver-row { display:flex; align-items:center; gap:12px; }.tracked-driver-row img { width:58px; height:58px; object-fit:cover; border:2px solid var(--color-orange); border-radius:999px; }.tracked-items { display:grid; gap:8px; }

/* MENU CARDS NOW FOLLOW THE ELECTRIC-BLUE CONFIG/SERVICE TREATMENT */
.portal-menu-grid { grid-template-columns:repeat(3,minmax(0,1fr)); max-width:none; }
.portal-menu-card { grid-template-columns:50px minmax(0,1fr) 34px; min-height:102px; border-color:rgba(53,214,255,.42); background:linear-gradient(135deg,rgba(53,214,255,.14),rgba(255,255,255,.055)); }
.portal-menu-icon,.portal-menu-chevron { border-color:rgba(53,214,255,.62); color:var(--color-cyan); background:rgba(53,214,255,.12); }
.weekly-rewards-page { width:100%; max-width:none; margin:0; }
.weekly-rewards-grid { display:grid; grid-template-columns:minmax(320px,.82fr) minmax(430px,1.18fr); gap:24px; align-items:start; }
.weekly-rewards-overview,.weekly-rewards-activity { display:grid; gap:12px; }.weekly-rewards-grid .config-section-label { margin:0; }.weekly-activity-card { min-height:100%; }
.contact-page-card .support-form { grid-template-columns:minmax(260px,.7fr) minmax(420px,1.3fr); align-items:start; max-width:none; }.contact-page-card .support-form label:last-of-type { grid-row:1/3; grid-column:2; }.contact-page-card .support-form .form-footer-actions { grid-column:1/-1; }

@media(max-width:1100px){.portal-menu-grid,.workspace-action-grid,.customer-action-grid{grid-template-columns:1fr}.weekly-rewards-grid{grid-template-columns:1fr}.customer-job-list{grid-template-columns:1fr}.contact-page-card .support-form{grid-template-columns:1fr}.contact-page-card .support-form label:last-of-type{grid-row:auto;grid-column:auto}.customer-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.workspace-card-grid{grid-template-columns:1fr}.workspace-logo-wrap{height:120px}.customer-metric-grid,.customer-detail-grid,.tracked-job-grid{grid-template-columns:1fr}.customer-enquiry-form>.pf-inner-card{grid-template-columns:1fr}.customer-enquiry-form>.pf-inner-card h3,.customer-enquiry-form>.pf-inner-card label:last-child{grid-column:auto}.tracked-job-hero{align-items:flex-start;flex-direction:column}.section-header{align-items:flex-start}.section-header>.secondary-button{width:100%}}


/* PORTAL REVISION V74 - JOB PRODUCT CARD ACTIONS */
.job-product-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 760px) {
    .job-product-card-actions {
        justify-content: flex-start;
        width: 100%;
    }
}

/* PORTAL REVISION V75 - LOGIN LOGO, UPLOAD BUTTONS AND COMPLETION CARDS */
.notification-centre-wrap{position:relative}.web-push-button{position:relative}.notification-bell-badge{position:absolute;top:-6px;right:-6px;display:grid;place-items:center;min-width:21px;height:21px;padding:0 5px;border:2px solid #073b43;border-radius:999px;background:var(--color-orange);color:#091b20;font-size:10px;font-weight:900}.notification-centre{position:absolute;z-index:1200;top:calc(100% + 14px);right:0;display:grid;width:min(440px,calc(100vw - 24px));max-height:min(690px,calc(100vh - 100px));padding:16px;border:1px solid rgba(53,214,255,.38);border-radius:24px;background:linear-gradient(155deg,rgba(14,61,69,.985),rgba(5,39,46,.99));box-shadow:0 24px 70px rgba(0,0,0,.48);transform-origin:top right;transition:opacity .2s ease,transform .2s ease}.notification-centre[aria-hidden="true"]{pointer-events:none;opacity:0;transform:translateY(-10px) scale(.97)}.notification-centre[aria-hidden="false"]{opacity:1;transform:none}.notification-centre-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.notification-centre-header h3,.notification-centre-header p{margin:0}.notification-centre-header>div>p:last-child{margin-top:3px;color:rgba(255,255,255,.65);font-size:12px}.notification-centre-actions{display:flex;gap:8px;margin:13px 0 6px}.notification-push-status{min-height:17px;margin:0 0 8px;color:rgba(255,255,255,.62);font-size:11px}.notification-push-status.error{color:#ffd29b}.notification-list{display:grid;gap:9px;overflow-y:auto;overscroll-behavior:contain}.notification-card{display:grid;border:1px solid rgba(255,255,255,.14);border-radius:18px;background:rgba(255,255,255,.075);overflow:hidden}.notification-card.unread{border-color:rgba(247,147,30,.45);background:linear-gradient(135deg,rgba(247,147,30,.09),rgba(255,255,255,.075))}.notification-card-main{display:grid;grid-template-columns:auto 44px minmax(0,1fr);align-items:center;gap:10px;width:100%;padding:12px;border:0;background:transparent;color:#fff;text-align:left;cursor:pointer}.notification-card-main>i{width:9px;height:9px;border-radius:50%;background:var(--color-orange);box-shadow:0 0 12px rgba(247,147,30,.65)}.notification-card.read .notification-card-main{grid-template-columns:44px minmax(0,1fr);padding-left:31px}.notification-avatar{display:grid;place-items:center;width:44px;height:44px;border:2px solid var(--color-orange);border-radius:50%;background:#1e3e45;color:#fff;font-weight:900}.notification-avatar.company{font-size:21px}.notification-card-main>span:last-child{display:grid;gap:2px}.notification-card-main strong{font-size:13px}.notification-card-main small{color:rgba(255,255,255,.76);line-height:1.35}.notification-card-main em{color:rgba(255,255,255,.5);font-size:10px;font-style:normal}.notification-card-actions{display:flex;justify-content:flex-end;gap:8px;padding:0 12px 10px}.notification-card-actions button{border:0;background:transparent;color:var(--color-cyan);font-size:11px;font-weight:800;cursor:pointer}.notification-card-actions button.danger{color:#ff7676}.notification-empty{display:grid;place-items:center;gap:4px;padding:32px 12px;color:rgba(255,255,255,.68)}.notification-empty[hidden]{display:none}.notification-empty img{width:64px;height:64px;object-fit:contain}.portal-banner-host{position:fixed;z-index:2500;top:14px;left:50%;width:min(620px,calc(100vw - 24px));transform:translateX(-50%);pointer-events:none}.portal-banner{display:grid;grid-template-columns:54px minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;padding:11px 14px;border:1px solid rgba(255,255,255,.3);border-radius:20px;background:rgba(21,101,192,.96);color:#fff;box-shadow:0 18px 55px rgba(0,0,0,.42);opacity:0;transform:translateY(-130%);transition:opacity .25s ease,transform .3s cubic-bezier(.2,.8,.2,1);pointer-events:auto;text-align:left}.portal-banner.visible{opacity:1;transform:none}.portal-banner.leaving{opacity:0;transform:translateY(-120%)}.portal-banner.success{background:rgba(0,112,91,.97)}.portal-banner.error{background:rgba(176,0,32,.97)}.portal-banner.warning{background:rgba(184,103,0,.97)}.portal-banner img{width:52px;height:52px;padding:4px;border-radius:14px;background:#fff;object-fit:contain}.portal-banner>span{display:grid;gap:2px}.portal-banner strong{font:800 14px var(--font-heading)}.portal-banner small{font-size:12px;line-height:1.35}.portal-banner b{padding:5px;font-size:18px}.customer-users-dialog{width:min(720px,calc(100vw - 30px))}.customer-user-list{display:grid;gap:10px;max-height:480px;margin-top:14px;overflow:auto}.customer-user-card{display:flex;align-items:center;justify-content:space-between;gap:14px}.customer-user-card h4,.customer-user-card p{margin:0 0 4px}.customer-user-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.customer-user-actions form{margin:0}.push-toast{cursor:pointer}
@media(max-width:720px){.notification-centre{position:fixed;top:74px;right:10px;left:10px;width:auto;max-height:calc(100dvh - 90px)}.portal-banner-host{top:8px}.portal-banner{grid-template-columns:44px minmax(0,1fr) auto}.portal-banner img{width:42px;height:42px}.customer-user-card{align-items:flex-start;flex-direction:column}.customer-user-actions{width:100%}}

/* Role and overlay parity refinements. */
.notification-centre{grid-template-rows:auto auto auto minmax(0,1fr) auto;width:min(350px,calc(100vw - 24px));height:calc(100dvh - 96px);max-height:none}
.notification-list{min-height:0}
.notification-empty{align-self:center}
.delete-form{margin:0;padding:0;border-top:0}
.member-actions .delete-form,.table-actions-cell .delete-form{display:inline-flex;align-items:center}
.member-pill.role.customer{background:#ff4f9a;color:#fff;border-color:rgba(255,255,255,.18)}
.customer-table-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;white-space:normal}
.customer-table-actions .secondary-button{flex:0 0 auto}
@media(max-width:720px){.notification-centre{height:calc(100dvh - 84px);max-height:none}}
@media(max-width:720px){.customer-table-actions{align-items:stretch;flex-direction:column}.customer-table-actions .secondary-button{width:100%}}
.customer-enquiry-stage-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.customer-enquiry-stage-grid article{display:grid;gap:12px}@media(max-width:760px){.customer-enquiry-stage-grid{grid-template-columns:1fr}}
.web-push-button{display:grid;place-items:center;width:44px;height:44px;border:1px solid rgba(53,214,255,.48);border-radius:999px;background:rgba(53,214,255,.1);color:#fff;cursor:pointer}.web-push-button.active{border-color:#00e5a8;box-shadow:0 0 18px rgba(0,229,168,.3)}
.tracked-parity-layout{display:grid;grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);gap:16px;align-items:start}.tracked-column{display:grid;gap:16px}.tracked-company-header{display:flex;align-items:center;gap:15px}.tracked-company-header>img{width:74px;height:74px;object-fit:contain;padding:7px;border-radius:16px;background:#fff}.tracked-company-header h3,.tracked-company-header p{margin:0}.tracked-pill-row{display:flex;flex-wrap:wrap;gap:7px;margin:9px 0}.tracked-pill{display:inline-flex;padding:5px 10px;border-radius:999px;background:rgba(255,255,255,.12);font-size:11px;font-weight:900}.tracked-pill.collection{background:#1565c0}.tracked-pill.delivery{background:#6a1b9a}.customer-tracking-map{width:100%;height:330px;border-radius:18px;overflow:hidden;background:rgba(255,255,255,.07)}.tracked-detail-item{display:grid;gap:3px;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.1)}.tracked-photo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.tracked-photo-grid img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:12px}.tracked-signature{max-width:280px;max-height:130px;object-fit:contain;padding:8px;border-radius:12px;background:#fff}
@media(max-width:980px){.tracked-parity-layout{grid-template-columns:1fr}.customer-tracking-map{height:290px}}
@media(max-width:620px){.tracked-company-header{align-items:flex-start}.tracked-company-header>img{width:58px;height:58px}.customer-tracking-map{height:250px}.tracked-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.workspace-action-button { grid-template-columns:38px minmax(0,1fr); min-height:62px; padding:9px 12px; gap:8px; }
.workspace-action-button>span { width:36px; height:36px; border-radius:12px; font-size:19px; }
@media(max-width:1100px){.workspace-tools-row{grid-template-columns:1fr}.workspace-action-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:620px){.workspace-action-grid{grid-template-columns:1fr}}

.auth-welcome-header {
    position: relative;
    min-height: 138px;
    display: flex;
    align-items: flex-end;
    padding-right: 150px;
    margin-bottom: 8px;
}

.auth-welcome-header::after {
    content: "";
    position: absolute;
    top: -18px;
    right: -8px;
    width: 190px;
    height: 190px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(53, 214, 255, 0.52) 0%, rgba(31, 138, 150, 0.22) 42%, rgba(53, 214, 255, 0) 72%);
    filter: blur(4px);
    pointer-events: none;
}

.auth-card .auth-brand.auth-brand-large {
    position: absolute !important;
    top: -6px !important;
    right: 0 !important;
    z-index: 2;
}

.auth-card .auth-brand.auth-brand-large img {
    width: 132px !important;
    height: 132px !important;
    filter: drop-shadow(0 0 14px rgba(53, 214, 255, 0.9)) drop-shadow(0 0 34px rgba(31, 138, 150, 0.72));
}

.auth-card.has-mascot h1 {
    padding-right: 0 !important;
    margin-top: 0 !important;
}

.inline-upload-form input.visually-hidden-upload {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.completion-product-list {
    display: grid;
    gap: 14px;
}

.completion-product-card {
    border: 1px solid rgba(53, 214, 255, 0.22);
    background: rgba(4, 30, 36, 0.46);
    border-radius: 22px;
    padding: 16px;
    display: grid;
    gap: 14px;
}

.completion-product-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.completion-product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.completion-card-block {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 12px;
}

.completion-card-block h4 {
    margin: 0 0 10px;
}

.completion-form-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

@media (max-width: 560px) {
    .auth-welcome-header {
        min-height: 112px;
        padding-right: 112px;
    }

    .auth-welcome-header::after {
        width: 150px;
        height: 150px;
    }

    .auth-card .auth-brand.auth-brand-large img {
        width: 104px !important;
        height: 104px !important;
    }
}

/* PORTAL REVISION V76 - COMPLETION DETAILS MODALS */
.auth-card .auth-brand.auth-brand-large {
    top: -18px !important;
    right: -10px !important;
}

.auth-card .auth-brand.auth-brand-large::before {
    width: 190px !important;
    height: 190px !important;
    inset: -34px !important;
    opacity: 1 !important;
    background: radial-gradient(circle, rgba(53, 214, 255, 0.75) 0%, rgba(31, 138, 150, 0.44) 44%, rgba(53, 214, 255, 0) 76%) !important;
    filter: blur(7px) !important;
}

.auth-card .auth-brand.auth-brand-large img {
    width: 166px !important;
    height: 166px !important;
    filter: drop-shadow(0 0 20px rgba(53, 214, 255, 1)) drop-shadow(0 0 48px rgba(31, 138, 150, 0.92)) !important;
}

.crud-dialog.wide-dialog {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 56px);
    overflow-y: auto;
}

.horizontal-option-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 8px;
}

.option-pill-button {
    flex: 0 0 auto;
    border: 1px solid rgba(53, 214, 255, 0.32);
    border-radius: 999px;
    background: rgba(14, 47, 54, 0.72);
    color: #ffffff;
    font-weight: 800;
    padding: 10px 14px;
    cursor: pointer;
}

.option-pill-button.selected {
    border-color: rgba(53, 214, 255, 0.9);
    box-shadow: 0 0 18px rgba(53, 214, 255, 0.24);
    background: rgba(31, 138, 150, 0.38);
}

.checklist-question-form {
    display: grid;
    gap: 12px;
}

.checklist-question-input {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 14px;
    background: rgba(2, 20, 25, 0.36);
}

.compact-file-upload {
    margin: 0;
}

.readonly-completion-form {
    opacity: 0.8;
}

/* PORTAL REVISION V77 - COMPLETION DETAILS REFINEMENTS */
.auth-card .auth-brand.auth-brand-large {
    top: -30px !important;
    right: -20px !important;
}

.auth-card .auth-brand.auth-brand-large::before,
.auth-welcome-header::after {
    width: 250px !important;
    height: 250px !important;
    background: radial-gradient(circle, rgba(53, 214, 255, 0.94) 0%, rgba(31, 138, 150, 0.58) 42%, rgba(53, 214, 255, 0) 76%) !important;
    filter: blur(8px) !important;
}

.auth-card .auth-brand.auth-brand-large img {
    width: 196px !important;
    height: 196px !important;
    filter: drop-shadow(0 0 28px rgba(53, 214, 255, 1)) drop-shadow(0 0 70px rgba(31, 138, 150, 1)) !important;
}

.ref-line-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.scan-toggle-button {
    gap: 8px;
}

.scan-toggle-icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.scan-toggle-on {
    border-color: rgba(0, 229, 168, 0.65) !important;
    color: #ffffff !important;
    background: rgba(0, 229, 168, 0.16) !important;
}

.scan-toggle-on .scan-toggle-icon {
    background: rgba(0, 229, 168, 0.95);
    color: #06242a;
}

.scan-toggle-off {
    border-color: rgba(255, 92, 120, 0.65) !important;
    color: #ffffff !important;
    background: rgba(255, 92, 120, 0.14) !important;
}

.scan-toggle-off .scan-toggle-icon {
    background: rgba(255, 92, 120, 0.95);
    color: #ffffff;
}

.checklist-title-row {
    gap: 10px;
    flex-wrap: wrap;
}

.checklist-title-row form {
    margin-left: auto;
}

@media (max-width: 760px) {
    .ref-line-grid {
        grid-template-columns: 1fr !important;
    }
}

/* PORTAL REVISION V78 - GLOBAL SCROLLBARS, BRAND RESTORE AND INPUT ICONS */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(31, 138, 150, 0.88) rgba(255, 255, 255, 0.06);
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(31, 138, 150, 0.95), rgba(53, 214, 255, 0.55));
    border: 2px solid rgba(4, 20, 24, 0.72);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(53, 214, 255, 0.82), rgba(31, 138, 150, 1));
}

.auth-welcome-header {
    min-height: 138px !important;
    padding-right: 150px !important;
}

.auth-welcome-header::after {
    top: -18px !important;
    right: -8px !important;
    width: 190px !important;
    height: 190px !important;
    border-radius: 999px !important;
    background: radial-gradient(circle, rgba(53, 214, 255, 0.52) 0%, rgba(31, 138, 150, 0.22) 42%, rgba(53, 214, 255, 0) 72%) !important;
    filter: blur(4px) !important;
}

.auth-card .auth-brand.auth-brand-large {
    top: -6px !important;
    right: 0 !important;
}

.auth-card .auth-brand.auth-brand-large::before {
    display: none !important;
}

.auth-card .auth-brand.auth-brand-large img {
    width: 132px !important;
    height: 132px !important;
    filter: drop-shadow(0 0 14px rgba(53, 214, 255, 0.9)) drop-shadow(0 0 34px rgba(31, 138, 150, 0.72)) !important;
}

.portal-brand {
    justify-content: center;
}




input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(2.25) !important;
    opacity: 1 !important;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    color-scheme: dark !important;
}

.paperwork-blocked-pill {
    display: inline-flex;
    width: fit-content;
    margin-top: 8px;
}

.status-pill.warning {
    color: #ffd27a;
    border-color: rgba(247, 147, 30, 0.45);
    background: rgba(247, 147, 30, 0.15);
}

@media (max-width: 560px) {
    .auth-welcome-header {
        min-height: 112px !important;
        padding-right: 112px !important;
    }

    .auth-welcome-header::after {
        width: 150px !important;
        height: 150px !important;
    }

    .auth-card .auth-brand.auth-brand-large img {
        width: 104px !important;
        height: 104px !important;
    }
}


/* PORTAL REVISION V79 - APP SETTINGS, WHITE LOGO GLOW AND UPLOAD MODAL */
.auth-welcome-header::after {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.26) 42%, rgba(255, 255, 255, 0) 72%) !important;
}

.auth-card .auth-brand.auth-brand-large img {
    filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 34px rgba(255, 255, 255, 0.48)) !important;
}




.portal-upload-dialog {
    width: min(620px, calc(100vw - 32px));
}

.portal-upload-drop-zone {
    display: grid;
    gap: 10px;
    place-items: center;
    min-height: 190px;
    padding: 24px;
    border: 1px dashed rgba(53, 214, 255, 0.52);
    border-radius: 22px;
    background: rgba(4, 30, 36, 0.48);
    text-align: center;
    color: #ffffff;
}

.portal-upload-drop-zone.dragging {
    border-color: rgba(0, 229, 168, 0.9);
    box-shadow: 0 0 24px rgba(0, 229, 168, 0.18);
    background: rgba(0, 229, 168, 0.1);
}

.portal-upload-drop-zone span,
.portal-upload-disclaimer {
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
}

.portal-upload-selected {
    border: 1px solid rgba(0, 229, 168, 0.36);
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(0, 229, 168, 0.1);
    color: #ffffff;
    font-weight: 800;
}

.paperwork-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.paperwork-ref-card {
    border: 1px solid rgba(53, 214, 255, 0.2);
    border-radius: 16px;
    padding: 10px 12px;
    background: rgba(2, 20, 25, 0.34);
}

.paperwork-ref-card span {
    display: block;
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.paperwork-ref-card strong {
    color: #ffffff;
}

.paperwork-invoice-panel {
    border-color: rgba(111, 196, 255, 0.42) !important;
    background: radial-gradient(circle at top left, rgba(111, 196, 255, 0.22), rgba(4, 30, 36, 0.5) 56%) !important;
    box-shadow: 0 0 26px rgba(111, 196, 255, 0.16) !important;
}

.paperwork-action-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.paperwork-action-stack .paperwork-blocked-pill {
    text-transform: none !important;
    white-space: normal;
}

/* PORTAL REVISION V80 - LOGIN LOGO GLOW REBALANCE */
.auth-welcome-header::after {
    display: none !important;
}

.auth-card .auth-brand.auth-brand-large {
    top: -8px !important;
    right: 8px !important;
    width: 150px !important;
    height: 150px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
}

.auth-card .auth-brand.auth-brand-large::before {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 164px !important;
    height: 164px !important;
    transform: translate(-50%, -50%) !important;
    border-radius: 999px !important;
    opacity: 1 !important;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.52) 0%, rgba(255, 255, 255, 0.24) 32%, rgba(255, 255, 255, 0.08) 54%, rgba(255, 255, 255, 0) 74%) !important;
    filter: blur(10px) !important;
    pointer-events: none !important;
}

.auth-card .auth-brand.auth-brand-large img {
    position: relative !important;
    z-index: 2 !important;
    width: 132px !important;
    height: 132px !important;
    object-fit: contain !important;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.34)) !important;
}

@media (max-width: 560px) {
    .auth-card .auth-brand.auth-brand-large {
        top: 2px !important;
        right: 8px !important;
        width: 112px !important;
        height: 112px !important;
    }

    .auth-card .auth-brand.auth-brand-large::before {
        width: 126px !important;
        height: 126px !important;
    }

    .auth-card .auth-brand.auth-brand-large img {
        width: 104px !important;
        height: 104px !important;
    }
}


/* PORTAL REVISION V81 - LOGIN LOGO WHITE HALO FIX */
.auth-welcome-header::after {
    display: none !important;
}

.auth-card .auth-brand.auth-brand-large {
    top: -8px !important;
    right: 6px !important;
    width: 172px !important;
    height: 172px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    background: transparent !important;
}

.auth-card .auth-brand.auth-brand-large::before {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 246px !important;
    height: 246px !important;
    transform: translate(-50%, -50%) !important;
    border-radius: 999px !important;
    opacity: 1 !important;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.72) 0%,
        rgba(255, 255, 255, 0.48) 22%,
        rgba(255, 255, 255, 0.26) 42%,
        rgba(255, 255, 255, 0.10) 64%,
        rgba(255, 255, 255, 0) 82%
    ) !important;
    filter: blur(24px) !important;
    pointer-events: none !important;
    z-index: 0 !important;
}

.auth-card .auth-brand.auth-brand-large::after {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 174px !important;
    height: 174px !important;
    transform: translate(-50%, -50%) !important;
    border-radius: 999px !important;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.42) 0%,
        rgba(255, 255, 255, 0.18) 42%,
        rgba(255, 255, 255, 0) 74%
    ) !important;
    filter: blur(8px) !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

.auth-card .auth-brand.auth-brand-large img {
    position: relative !important;
    z-index: 2 !important;
    width: 142px !important;
    height: 142px !important;
    object-fit: contain !important;
    background: transparent !important;
    filter:
        drop-shadow(0 0 16px rgba(255, 255, 255, 0.78))
        drop-shadow(0 0 34px rgba(255, 255, 255, 0.46))
        drop-shadow(0 0 62px rgba(255, 255, 255, 0.22)) !important;
}

@media (max-width: 560px) {
    .auth-card .auth-brand.auth-brand-large {
        top: 0 !important;
        right: 4px !important;
        width: 126px !important;
        height: 126px !important;
    }

    .auth-card .auth-brand.auth-brand-large::before {
        width: 184px !important;
        height: 184px !important;
        filter: blur(20px) !important;
    }

    .auth-card .auth-brand.auth-brand-large::after {
        width: 132px !important;
        height: 132px !important;
    }

    .auth-card .auth-brand.auth-brand-large img {
        width: 106px !important;
        height: 106px !important;
    }
}


/* PORTAL REVISION V82 - PAPERWORK, FINANCE AND NATIVE CONTROL POLISH */
.paperwork-invoice-panel {
    border: 1px solid rgba(158, 212, 255, 0.52) !important;
    border-radius: 24px !important;
    padding: 18px !important;
    background: rgba(255, 255, 255, 0.055) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 24px rgba(158, 212, 255, 0.18) !important;
}

.paperwork-ref-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100%;
}

.paperwork-ref-card {
    min-width: 0;
}

.paperwork-ref-card strong {
    display: block;
    overflow-wrap: anywhere;
}

.app-finance-title-row {
    gap: 0 !important;
}

.finance-icon-pill {
    display: none !important;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    color: #ffffff !important;
    color-scheme: dark !important;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(2.8) contrast(1.15) !important;
    opacity: 1 !important;
    cursor: pointer;
}

.receipt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 0 10px;
}

.receipt-row span {
    color: rgba(255, 255, 255, 0.72);
    font-weight: 800;
}

.receipt-row strong {
    color: #ffffff;
    font-weight: 900;
    text-align: right;
}

@media (max-width: 720px) {
    .paperwork-ref-grid {
        grid-template-columns: 1fr !important;
    }
}


/* PORTAL REVISION V83 - PAPERWORK REFS, ROUTE COST SUMMARY AND USER DELETE */
.paperwork-job-header {
    display: grid !important;
    gap: 16px !important;
}

.paperwork-job-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.paperwork-job-title-row > div {
    min-width: 0;
}

.paperwork-ref-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    margin-top: 0 !important;
}

.paperwork-ref-card {
    width: 100% !important;
    padding: 12px 14px !important;
}

.optimise-cost-summary-card {
    margin-top: 10px;
}

.optimise-cost-summary-card .job-cost-lines {
    gap: 12px;
}

.user-delete-section {
    display: grid;
    gap: 14px;
    margin-top: 8px;
    border-color: rgba(255, 95, 95, 0.36) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 22px rgba(255, 95, 95, 0.12) !important;
}

.user-delete-section h3 {
    margin: 2px 0 6px;
}

.user-delete-section form {
    margin: 0;
}

@media (max-width: 720px) {
    .paperwork-job-title-row {
        flex-direction: column;
    }

    .paperwork-ref-grid {
        grid-template-columns: 1fr !important;
    }
}

/*PORTAL REVISION V84 - ROUTE OPTIMISE JOB SELECTION*/
.optimise-job-list {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 12px !important;
    max-height: 360px !important;
    overflow-y: auto !important;
    padding-right: 6px !important;
}

.optimise-job-card {
    display: inline-flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    width: auto !important;
    min-width: 250px !important;
    max-width: 360px !important;
    flex: 1 1 280px !important;
    padding: 12px 14px !important;
}

.optimise-job-card input[type="checkbox"] {
    flex: 0 0 auto !important;
    margin-top: 3px !important;
}

.optimise-job-content {
    display: grid !important;
    gap: 5px !important;
    min-width: 0 !important;
}

.optimise-job-main {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
}

.optimise-job-main strong {
    white-space: nowrap !important;
}

.optimise-job-main em {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 24px !important;
    height: 24px !important;
    padding: 0 8px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(53, 214, 255, 0.28) !important;
    background: rgba(53, 214, 255, 0.12) !important;
    color: var(--color-cyan) !important;
    font-style: normal !important;
    font-size: 0.76rem !important;
    font-weight: 950 !important;
}

.optimise-job-card small {
    line-height: 1.3 !important;
}

.optimise-job-status {
    color: rgba(255, 255, 255, 0.68) !important;
}

/*PORTAL REVISION V85 - ROUTE OPTIMISE JOB ROWS AND STRATEGY TEXT*/
.route-strategy-description {
    display: grid !important;
    gap: 4px !important;
    margin-top: 12px !important;
    padding: 12px 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 16px !important;
    background: rgba(5, 24, 29, 0.42) !important;
}

.route-strategy-description strong {
    color: rgba(255, 255, 255, 0.92) !important;
    font-weight: 950 !important;
}

.route-strategy-description span {
    color: rgba(255, 255, 255, 0.68) !important;
    font-size: 0.92rem !important;
    font-weight: 750 !important;
    line-height: 1.35 !important;
}

.optimise-job-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    max-height: 360px !important;
    overflow-y: auto !important;
    padding-right: 6px !important;
}

.optimise-job-card {
    display: grid !important;
    grid-template-columns: 18px auto auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: none !important;
    padding: 10px 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(5, 24, 29, 0.56) !important;
    border-radius: 14px !important;
}

.optimise-job-card input[type="checkbox"] {
    justify-self: start !important;
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
}

.optimise-job-number {
    color: rgba(255, 255, 255, 0.94) !important;
    font-weight: 950 !important;
    white-space: nowrap !important;
}

.optimise-job-stage-type {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(53, 214, 255, 0.28) !important;
    background: rgba(53, 214, 255, 0.12) !important;
    color: var(--color-cyan) !important;
    font-style: normal !important;
    font-size: 0.76rem !important;
    font-weight: 950 !important;
    line-height: 1 !important;
}

.optimise-job-address {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: rgba(255, 255, 255, 0.68) !important;
    font-weight: 800 !important;
}

.optimise-job-status {
    justify-self: end !important;
    color: rgba(66, 245, 145, 0.9) !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
}

.optimise-job-card:has(input:disabled) .optimise-job-status {
    color: rgba(255, 167, 38, 0.92) !important;
}

@media (max-width: 900px) {
    .optimise-job-card {
        grid-template-columns: 18px auto auto minmax(0, 1fr) !important;
    }

    .optimise-job-status {
        grid-column: 4 !important;
        justify-self: start !important;
    }
}


/*PORTAL REVISION V86 - OPTIMISE HEADER, JOB BADGES AND MAP PADDING SUPPORT*/
.optimise-dialog .modal-header-row h2 {
    max-width: 980px !important;
    line-height: 1.2 !important;
}

.optimise-job-stage-type.collection {
    border: none !important;
    background: linear-gradient(145deg, var(--color-cyan), var(--color-cyan-dark)) !important;
    color: var(--color-white) !important;
    box-shadow: 0 0 18px rgba(53, 214, 255, 0.22) !important;
}

.optimise-job-stage-type.delivery {
    border: none !important;
    background: linear-gradient(145deg, var(--color-orange-light), var(--color-orange)) !important;
    color: var(--color-white) !important;
    box-shadow: 0 0 18px rgba(247, 147, 30, 0.24) !important;
}

/* PORTAL REVISION V87 - UPLOAD MODALS, PAPERWORK SUMMARY AND CONTROL ICON POLISH */
.paperwork-job-summary {
    display: grid;
    gap: 16px;
}

.paperwork-job-summary .job-detail-header {
    margin: 0;
}

.paperwork-job-value-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.paperwork-job-ref-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.paperwork-job-summary .value-stack {
    min-width: 0;
}

.paperwork-job-summary .value-stack strong {
    overflow-wrap: anywhere;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
    color: #ffffff !important;
    color-scheme: dark !important;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator {
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: #35d6ff;
}

@media (max-width: 980px) {
    .paperwork-job-value-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .paperwork-job-value-grid,
    .paperwork-job-ref-grid {
        grid-template-columns: 1fr !important;
    }
}


.portal-maintenance-page {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.portal-maintenance-card {
    width: min(420px, calc(100vw - 32px));
    margin: 0 auto;
    border: 1px solid rgba(53, 214, 255, 0.38);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(14, 47, 54, 0.76)),
        rgba(14, 47, 54, 0.92);
    box-shadow:
        0 0 28px rgba(53, 214, 255, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
    padding: 36px 28px;
}

.portal-maintenance-content,
.portal-setting-disabled-card {
    display: grid;
    gap: 14px;
    justify-items: center;
    text-align: center;
}

.portal-maintenance-logo img {
    width: 132px;
    max-width: 70vw;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(53, 214, 255, 0.24));
}

.portal-upload-logo img,
.portal-setting-disabled-card img {
    width: 74px;
    height: 74px;
    object-fit: contain;
}

.portal-maintenance-mascot {
    width: min(145px, 45vw);
    max-height: 145px;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(53, 214, 255, 0.25));
}

.portal-maintenance-icon {
    width: 44px;
    height: 34px;
    position: relative;
    margin-top: 4px;
}

.portal-maintenance-icon::before {
    content: "";
    position: absolute;
    left: 5px;
    bottom: 7px;
    width: 28px;
    height: 18px;
    border: 3px solid var(--color-orange);
    border-radius: 20px;
    border-top-color: transparent;
}

.portal-maintenance-icon::after {
    content: "";
    position: absolute;
    left: 13px;
    bottom: 16px;
    width: 18px;
    height: 18px;
    border: 3px solid var(--color-orange);
    border-left-color: transparent;
    border-bottom-color: transparent;
    border-radius: 50%;
}

.portal-maintenance-icon span {
    position: absolute;
    left: 8px;
    top: 3px;
    width: 34px;
    height: 3px;
    border-radius: 999px;
    background: var(--color-orange);
    transform: rotate(45deg);
    transform-origin: left center;
}

.portal-maintenance-card h1 {
    margin: 4px 0 0;
    font-size: clamp(24px, 4vw, 31px);
    line-height: 1.18;
    color: #ffffff;
}

.portal-maintenance-message {
    margin: 0;
    max-width: 330px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 15px;
    line-height: 1.38;
}

.portal-maintenance-small {
    margin: 0;
    max-width: 330px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
    line-height: 1.38;
}

.portal-maintenance-button {
    margin-top: 8px;
    min-width: 240px;
    border-color: rgba(247, 147, 30, 0.92);
    background:
        linear-gradient(135deg, rgba(247, 147, 30, 0.34), rgba(247, 147, 30, 0.18)),
        rgba(247, 147, 30, 0.12);
    box-shadow:
        0 0 18px rgba(247, 147, 30, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.portal-upload-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.portal-upload-unavailable,
.portal-setting-disabled-card {
    border: 1px solid rgba(247, 147, 30, 0.42);
    border-radius: 18px;
    background: rgba(247, 147, 30, 0.08);
    color: rgba(255, 255, 255, 0.86);
    padding: 16px;
}

.portal-setting-disabled-card {
    margin-top: 16px;
}

.portal-setting-disabled-card strong {
    color: #ffffff;
    font-size: 18px;
}

.portal-setting-disabled-card span {
    color: rgba(255, 255, 255, 0.72);
}

/* PORTAL REVISION V90 - ADDRESS LOOKUP DISABLED MAP STATE */
.address-map-disabled {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border: 1px solid rgba(53, 214, 255, 0.28);
    border-radius: 18px;
    background: rgba(6, 31, 36, 0.55);
    color: rgba(255, 255, 255, 0.78);
    font-weight: 800;
    text-align: center;
}





.portal-error-warning-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 2px solid rgba(247, 147, 30, 0.95);
    border-radius: 999px;
    color: var(--color-orange);
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 900;
    box-shadow: 0 0 18px rgba(247, 147, 30, 0.28);
}

/* PORTAL REVISION V96 - COMPANY SETTINGS ADDRESS SPACING */
.settings-edit-form .address-editor-heading {
    padding-top: 14px;
}


/* PORTAL REVISION V97 - CHAT REACTION AND LOCKED PILL ALIGNMENT */
.chat-message-bubble .chat-reactions {
    margin-top: 6px;
    margin-bottom: 0;
    transform: none;
}

.chat-message:has(.chat-reactions) {
    margin-bottom: 0;
}

.chat-message.mine .chat-message-bubble .chat-reactions {
    justify-content: flex-end;
}

.chat-reaction-picker button.selected {
    background: rgba(247, 147, 30, 0.28);
    border: 1px solid rgba(247, 147, 30, 0.62);
    box-shadow: 0 0 0 2px rgba(247, 147, 30, 0.12);
}

/* PORTAL REVISION V98 - ENQUIRY LIFECYCLE, MY JOBS AND CUSTOMER JOB CARDS */
.enquiry-description-section { margin-bottom: 0; }
.enquiry-photo-picker { position: relative; overflow: hidden; cursor: pointer; }
.enquiry-photo-picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.enquiry-photo-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.enquiry-photo-preview-grid > .staged-empty { grid-column: 1 / -1; width: 100%; min-height: 70px; display: grid; place-items: center; }
.enquiry-existing-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.enquiry-photo-preview-card,
.enquiry-photo-preview-grid > a { display: grid; gap: 7px; min-width: 0; padding: 8px; border: 1px solid rgba(53,214,255,.2); border-radius: 14px; background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.enquiry-photo-preview-card img,
.enquiry-photo-preview-grid > a img { width: 100%; height: 118px; object-fit: cover; border-radius: 10px; }
.enquiry-photo-preview-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.enquiry-update-wide,.stage-update-wide { width:100%; justify-content:center; margin-top:12px; }
.stage-edit-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; width:100%; }
.stage-edit-actions > button { width:100%; min-height:44px; justify-content:center; }
.customer-job-card-list { display: grid; gap: 16px; margin-top: 18px; }
.customer-job-card { padding: 18px; border: 1px solid rgba(255,255,255,.16); border-radius: 22px; background: rgba(255,255,255,.065); box-shadow: inset 0 1px rgba(255,255,255,.06); }
.customer-job-card-header,
.customer-job-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.customer-job-card-header h3 { margin: 3px 0; }
.customer-job-company { display:flex; align-items:center; gap:12px; min-width:0; }
.customer-job-company img,
.customer-job-company-placeholder { width:52px; height:52px; flex:0 0 52px; border-radius:50%; object-fit:cover; background:rgba(255,255,255,.92); border:2px solid rgba(247,147,30,.8); display:grid; place-items:center; color:#0c3038; font-weight:900; }
.customer-job-company h3,.customer-job-company p { margin:0; }
.customer-job-pill-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.lifecycle-pill { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 12px; border-radius: 999px; font-weight: 900; font-size: 12px; }
.lifecycle-pill.enquiry { color: #000; background: #ffb74d; }
.lifecycle-pill.quote { color: #fff; background: #b066ff; }
.lifecycle-pill.live-job { color: #061b22; background: #35d8ff; }
.lifecycle-pill.job-type { color:#fff; background:#455a64; }
.lifecycle-pill.completed { color:#051f16; background:#20d692; }
.lifecycle-pill.part-completed { color:#1d1304; background:var(--color-orange); }
.lifecycle-pill.incomplete { color:#fff; background:#e44747; }
.status-pill.customer-completed { color:#000; background:#69ff5e; }
.status-pill.customer-in-progress { color:#fff; background:#ffb74d; }
.status-pill.customer-allocated { color:#fff; background:#4aa8ff; }
.status-pill.customer-unallocated { color:#fff; background:#4a4a4a; }
.customer-job-reference-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 10px; margin-top: 14px; }
.customer-job-reference-row > span,
.detail-value-card { display: grid; gap: 5px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(2,23,28,.34); }
.customer-job-reference-row small,
.detail-value-card small { color: var(--color-cyan); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.customer-job-description { margin: 14px 0 0; }
.customer-job-stage-list { display: grid; gap: 10px; margin-top: 14px; }
.customer-job-stage-card { display: grid; grid-template-columns: auto minmax(180px,1fr) minmax(120px,auto) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 15px; background: rgba(2,23,28,.35); }
.customer-job-stage-card:has(.drop-order-badge) { grid-template-columns:auto auto minmax(180px,1fr) minmax(120px,auto) auto; }
.drop-order-badge { width:36px; height:36px; display:grid; place-items:center; border-radius:50%; background:#8f4bd5; color:#fff!important; font-weight:900; }
.customer-job-summary-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; margin-top:12px; }
.customer-job-stage-card > div { display: grid; gap: 3px; }
.customer-job-stage-card span:not(.status-pill):not(.cd-badge), .customer-job-stage-card small { color: rgba(255,255,255,.67); }
.detail-section { margin-top: 18px; }
.detail-tile-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; }
.detail-value-card span { color: rgba(255,255,255,.72); }
.customer-finance-card { padding: 16px; border: 1px solid rgba(53,214,255,.2); border-radius: 18px; background: rgba(53,214,255,.055); }
.finance-summary-row { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:8px 0; }
.finance-summary-row.vat strong { color:var(--color-orange); }
.finance-summary-row.total { font-weight:900; }
.finance-summary-row.total strong { color:var(--color-green); }
.customer-finance-card hr { border:0; border-top:1px solid rgba(255,255,255,.08); }
.empty-placeholder-card { min-height:110px; display:grid; place-items:center; align-content:center; gap:6px; padding:18px; text-align:center; border:1px dashed rgba(255,255,255,.18); border-radius:16px; background:rgba(2,23,28,.28); }
.empty-placeholder-card span { color:rgba(255,255,255,.68); }
.customer-users-dialog .customer-user-list { margin:0 0 14px; }
.customer-user-card { display:grid; grid-template-columns:1fr; gap:12px; align-items:stretch; }
.customer-user-card-top { display:flex; justify-content:flex-start; }
.customer-user-identity { display:flex; align-items:center; gap:12px; min-width:0; }
.customer-user-identity img,.customer-user-avatar { width:52px; height:52px; flex:0 0 52px; border-radius:50%; object-fit:cover; background:#173940; border:1px solid rgba(255,255,255,.22); display:grid; place-items:center; color:#fff; font-weight:900; }
.customer-user-identity h4,.customer-user-identity p { margin:0; }
.customer-user-actions { justify-content:flex-end; }
.customer-user-add-button { margin-top:2px; }
.quote-response-form { display: grid; gap: 10px; width: min(620px,100%); }
.quote-response-form > div { display: flex; gap: 10px; }
.success-button { border: 1px solid rgba(0,229,168,.72); border-radius: 999px; padding: 10px 18px; background: rgba(0,229,168,.18); color: #fff; font-weight: 900; cursor: pointer; }
.inline-action-form { display: inline; }

@media (max-width: 720px) {
    .customer-job-card-header { align-items: flex-start; }
    .customer-job-card-actions { flex-direction: column; align-items: flex-end; }
    .customer-job-stage-card { grid-template-columns: auto 1fr; }
    .customer-job-stage-card:has(.drop-order-badge) { grid-template-columns:auto auto 1fr; }
    .customer-job-stage-card > div:nth-of-type(2), .customer-job-stage-card > .status-pill { grid-column: 2; }
    .stage-edit-actions { grid-template-columns:1fr; }
}

.feature-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.feature-request-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.feature-request-footer-actions form {
    margin: 0;
}

.feature-contribution-summary {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(53, 214, 255, 0.18);
    background: rgba(53, 214, 255, 0.06);
}

.portal-toast-stack {
    width: 100%;
    padding: 14px;
    box-sizing: border-box;
    pointer-events: none;
}

.portal-toast-stack .toast {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    pointer-events: none;
}


/* PORTAL REVISION V107 - MOBILE LAYOUT CONTAINMENT ONLY */
@media (max-width: 980px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .portal-main,
    .portal-content,
    .content-card,
    .compact-toolbar,
    .table-wrap,
    .portal-table,
    .allocation-board,
    .allocation-board-planner,
    .tracking-card,
    .chat-workspace-card,
    .finance-list-card,
    .job-form-card,
    .paperwork-job-card {
        min-width: 0;
        max-width: 100%;
    }

    .portal-content {
        width: 100%;
        padding: 18px 14px 28px;
        gap: 18px;
        overflow-x: hidden;
    }

    .portal-topbar {
        min-height: 0;
        padding: 14px;
        gap: 12px;
    }

    .portal-topbar > div:not(.account-menu) {
        min-width: 0;
    }

    .portal-topbar h1 {
        font-size: clamp(1.28rem, 6vw, 1.72rem);
        overflow-wrap: anywhere;
    }

    .account-menu {
        min-width: 0;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .content-card {
        width: 100%;
        padding: 18px;
        border-radius: 22px;
        overflow: hidden;
    }

    .section-header,
    .toolbar-form,
    .compact-toolbar .toolbar-form,
    .dashboard-date-toolbar .toolbar-form,
    .allocation-planner-header {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .section-header > *,
    .toolbar-form > *,
    .allocation-planner-header > * {
        min-width: 0;
    }

    .section-actions,
    .toolbar-actions,
    .jobs-toolbar-actions,
    .data-grid-actions,
    .feature-header-actions,
    .modal-actions-inline,
    .app-finance-actions-row,
    .allocation-date-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 10px;
    }

    .section-actions > *,
    .toolbar-actions > *,
    .jobs-toolbar-actions > *,
    .data-grid-actions > *,
    .feature-header-actions > *,
    .allocation-date-actions > *,
    .section-actions input,
    .toolbar-actions input,
    .toolbar-actions select,
    .jobs-toolbar-actions input,
    .jobs-toolbar-actions select,
    .data-grid-actions button,
    .data-grid-actions a {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .dashboard-grid,
    .dashboard-grid-compact,
    .finance-summary-grid,
    .app-finance-summary-grid,
    .value-stack-grid,
    .form-grid-two,
    .form-grid-three,
    .form-grid-four,
    .stage-address-grid,
    .completion-form-grid,
    .signature-summary-grid,
    .paperwork-job-value-grid,
    .paperwork-job-ref-grid,
    .app-finance-job-body,
    .finance-detail-strip,
    .app-finance-addresses,
    .settings-grid {
        grid-template-columns: 1fr !important;
    }

    .table-wrap {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        border-radius: 18px;
        padding-bottom: 4px;
    }

    .portal-table {
        min-width: 680px;
    }

    .portal-table th,
    .portal-table td {
        white-space: nowrap;
    }

    .driver-selector-strip,
    .tracking-user-strip,
    .selector-row,
    .compact-selector-row {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .allocation-board-planner,
    .allocation-board-planner.show-all-drivers {
        grid-template-columns: 1fr !important;
        align-items: stretch;
    }

    .allocation-board-planner.show-all-drivers .allocation-driver-panel {
        display: flex;
    }

    .allocation-panel {
        min-width: 0;
        min-height: 0;
        height: auto;
        padding: 14px;
    }

    .allocation-map-panel {
        min-height: 430px;
    }

    .allocation-board-planner .allocation-map,
    .allocation-board-planner .allocation-map-placeholder,
    .allocation-map,
    .allocation-map-placeholder {
        display: block;
        width: 100%;
        min-height: 360px !important;
        height: 360px !important;
        flex: 0 0 auto;
    }

    .allocation-board-planner .allocation-list {
        max-height: 58vh;
        overflow-y: auto;
        padding-right: 0;
    }

    .tracking-card {
        padding-right: 18px;
    }

    .tracking-map,
    .tracking-map-placeholder {
        width: 100%;
        min-height: 420px !important;
        height: 420px !important;
    }

    .tracking-user-card {
        flex: 0 0 min(280px, 82vw);
    }

    .chat-workspace-card {
        height: auto;
        min-height: calc(100dvh - 128px);
    }

    .chat-workspace-layout {
        grid-template-columns: 1fr !important;
        min-height: 0;
        height: auto;
    }

    .chat-room-panel {
        height: auto;
        min-height: 74dvh;
    }

    .chat-room-list-wrap .chat-room-list,
    .chat-room-list {
        max-height: 38dvh;
    }

    .chat-message-list {
        min-height: 54dvh;
        height: auto;
    }

    .chat-send-row,
    .chat-send-row-modern {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .chat-send-row button[type="submit"],
    .chat-send-row-modern button[type="submit"] {
        grid-column: 1 / -1;
        width: 100%;
    }

    .app-finance-summary-card {
        grid-template-columns: 1fr !important;
        justify-items: center;
        text-align: center;
    }

    .app-finance-summary-details,
    .finance-detail-strip,
    .app-finance-addresses {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .portal-content {
        padding: 14px 10px 24px;
        gap: 14px;
    }

    .portal-topbar {
        padding: 12px 10px;
    }

    .content-card {
        padding: 14px;
        border-radius: 20px;
    }

    .portal-toast-stack {
        padding: 10px;
    }

    .portal-table {
        min-width: 620px;
    }

    .allocation-board-planner .allocation-map,
    .allocation-board-planner .allocation-map-placeholder,
    .allocation-map,
    .allocation-map-placeholder {
        min-height: 340px !important;
        height: 340px !important;
    }

    .tracking-map,
    .tracking-map-placeholder {
        min-height: 380px !important;
        height: 380px !important;
    }

    .chat-message {
        max-width: 100%;
    }

    .chat-message-list {
        padding: 12px;
    }
}

/* PORTAL REVISION V108 - MOBILE ALLOCATION HEIGHTS AND CHAT MESSAGE CAP */
@media (max-width: 980px) {
    .allocation-board-planner,
    .allocation-board-planner.show-all-drivers {
        height: auto !important;
        min-height: 0;
        gap: 18px;
    }

    .allocation-board-planner .allocation-panel {
        height: auto !important;
        min-height: 520px;
        overflow: hidden;
    }

    .allocation-board-planner .allocation-map-panel {
        min-height: 520px;
    }

    .allocation-board-planner .allocation-map,
    .allocation-board-planner .allocation-map-placeholder,
    .allocation-map,
    .allocation-map-placeholder {
        min-height: 440px !important;
        height: 440px !important;
    }

    .allocation-board-planner .allocation-list {
        min-height: 360px;
        max-height: 68dvh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .allocation-board-planner .allocation-driver-empty {
        min-height: 180px;
    }

    .chat-workspace-card {
        height: auto !important;
        min-height: 0;
    }

    .chat-workspace-layout {
        height: auto !important;
        min-height: 0;
    }

    .chat-room-panel {
        height: min(760px, calc(100dvh - 150px)) !important;
        min-height: 560px;
        max-height: 760px;
    }

    .chat-message-list {
        flex: 1 1 auto;
        min-height: 0 !important;
        height: auto !important;
        overflow-y: auto;
    }

    .chat-send-form {
        flex: 0 0 auto;
    }
}

@media (max-width: 560px) {
    .allocation-board-planner .allocation-panel {
        min-height: 500px;
    }

    .allocation-board-planner .allocation-map-panel {
        min-height: 500px;
    }

    .allocation-board-planner .allocation-map,
    .allocation-board-planner .allocation-map-placeholder,
    .allocation-map,
    .allocation-map-placeholder {
        min-height: 410px !important;
        height: 410px !important;
    }

    .allocation-board-planner .allocation-list {
        min-height: 340px;
        max-height: 70dvh;
    }

    .chat-room-panel {
        height: min(700px, calc(100dvh - 130px)) !important;
        min-height: 520px;
        max-height: 700px;
    }
}


/* ==================================================================
   Requested Portal Polish
================================================================== */

.auth-card.has-mascot::after {
    content: "";
    position: absolute;
    pointer-events: none;
    left: auto;
    right: -170px;
    bottom: -170px;
    top: auto;
    width: 360px;
    height: 360px;
    opacity: 0.58;
    background: radial-gradient(circle, rgba(247, 147, 30, 0.72), rgba(247, 147, 30, 0.22) 42%, transparent 72%);
}

.password-toggle-button span::before {
    content: "";
    display: block;
    width: 21px;
    height: 21px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.team-toolbar-split {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.data-section-header {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1rem;
}

.data-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}

.data-page-search-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.data-page-search-row input[type="search"],
.data-page-search-row select {
    min-width: min(100%, 280px);
}

.allocation-date-actions-inline {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    flex-wrap: nowrap;
}

.allocation-date-actions-inline input[type="date"] {
    min-width: 180px;
}

.tracking-card .section-header {
    margin-bottom: 0.65rem;
}

.tracking-card .tracking-user-strip-top {
    margin-top: 0.25rem;
}

.settings-save-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.settings-save-card h2 {
    margin: 0;
}

.settings-save-card p {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .team-toolbar-split,
    .data-page-actions,
    .data-page-search-row,
    .allocation-date-actions-inline,
    .settings-save-card {
        align-items: stretch;
        justify-content: stretch;
        flex-direction: column;
    }

    .data-page-search-row input[type="search"],
    .data-page-search-row select,
    .allocation-date-actions-inline input[type="date"] {
        width: 100%;
        min-width: 0;
    }
}

.coin-negative {
    color: var(--color-orange-light) !important;
}


/* Portal V2 tracking layout */
.tracking-card .section-header {
    margin-bottom: 6px;
}

.tracking-card {
    gap: 8px;
}

.tracking-user-strip-top {
    margin-top: 0;
    padding-top: 0;
}

/* PORTAL V2 FOLLOW-UP FIXES */
.data-section-header,
.data-page-actions,
.data-grid-actions,
.data-page-search-row {
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
}

.data-page-actions {
    margin-left: 0;
    margin-right: auto;
}

.tracking-card {
    gap: 6px;
}

.tracking-card .section-header {
    margin-bottom: 0;
}

.tracking-user-strip,
.tracking-user-strip-top {
    margin-top: 0;
    padding-top: 0;
}

[data-invite-code-input] {
    text-transform: uppercase;
}


/* PORTAL V4 DATA PAGE TOOLBAR FIXES */
.data-section-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.data-page-actions,
.data-grid-actions {
    width: auto;
    margin-left: auto;
    margin-right: 0;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
}

.data-page-search-row {
    align-items: center;
    justify-content: flex-start;
    text-align: left;
}

@media (max-width: 760px) {
    .data-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .data-page-actions,
    .data-grid-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        text-align: left;
    }
}

/* ==========================================================================
   MODAL SCROLL FIX
   ========================================================================== */

body.modal-open {
    overflow: hidden;
}

.crud-modal,
.selector-modal {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    align-items: start !important;
    justify-items: center !important;
    place-items: start center !important;
    padding: 24px !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.crud-modal.open,
.selector-modal.open {
    display: grid !important;
}

.crud-dialog,
.selector-dialog {
    width: min(100%, 760px) !important;
    max-height: none !important;
    margin: 24px auto !important;
}

.selector-dialog {
    grid-template-rows: auto auto minmax(0, auto) !important;
}

.selector-list {
    max-height: none !important;
    overflow: visible !important;
}

.attachment-preview-dialog,
.attachment-document-dialog,
.attachment-photo-dialog {
    max-height: none !important;
}

@media (max-width: 640px) {
    .crud-modal,
    .selector-modal {
        padding: 12px !important;
    }

    .crud-dialog,
    .selector-dialog {
        width: 100% !important;
        margin: 12px auto !important;
        padding: 18px !important;
        border-radius: 22px !important;
    }
}


/* ==========================================================================
   MODAL MOBILE VIEWPORT SAFE AREA FIX
   ========================================================================== */

.crud-modal,
.selector-modal {
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    align-items: flex-start !important;
    justify-items: center !important;
    place-items: start center !important;
    padding: 24px 24px calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.crud-modal.open,
.selector-modal.open {
    display: grid !important;
}

.crud-dialog,
.selector-dialog {
    width: min(100%, 760px) !important;
    max-height: none !important;
    margin: 24px auto 0 !important;
}

.selector-dialog {
    grid-template-rows: auto auto minmax(0, auto) !important;
}

.selector-list {
    max-height: none !important;
    overflow: visible !important;
}

.attachment-preview-dialog,
.attachment-document-dialog,
.attachment-photo-dialog {
    max-height: none !important;
}

@media (max-width: 640px) {
    .crud-modal,
    .selector-modal {
        padding: 12px 12px calc(120px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .crud-dialog,
    .selector-dialog {
        width: 100% !important;
        margin: 12px auto 0 !important;
        padding: 18px !important;
        border-radius: 22px !important;
    }
}



/*PORTAL REVISION V25 - COMPACT AUTH PROVIDERS AND CATALOG TABS*/
.auth-provider-stack {
    gap: 10px;
    width: min(100%, 360px);
}

.auth-provider-button {
    min-height: 48px;
    padding: 8px 18px 8px 50px;
    border-radius: 16px;
    font-size: 15px;
}

.auth-provider-button img {
    left: 18px;
    width: 20px;
    height: 20px;
}

.catalog-page {
    overflow: visible;
}

.catalog-page-header {
    margin-bottom: 16px;
}

.catalog-tab-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.catalog-tab-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 78px;
    padding: 13px 15px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    color: rgba(255, 255, 255, 0.76);
    background:
        radial-gradient(circle at 18% 10%, rgba(53, 214, 255, 0.12), transparent 46%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
    box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.025);
    cursor: pointer;
    text-align: left;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.catalog-tab-card:hover {
    transform: translateY(-1px);
    border-color: rgba(53, 214, 255, 0.40);
    color: #ffffff;
}

.catalog-tab-card[aria-selected="true"] {
    color: #ffffff;
    border-color: rgba(53, 214, 255, 0.72);
    background:
        radial-gradient(circle at 18% 12%, rgba(53, 214, 255, 0.24), transparent 48%),
        linear-gradient(145deg, rgba(31, 138, 150, 0.28), rgba(255, 255, 255, 0.055));
    box-shadow:
        0 0 22px rgba(53, 214, 255, 0.20),
        inset 0 0 18px rgba(53, 214, 255, 0.08);
}

.catalog-tab-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #35d6ff;
    background: rgba(53, 214, 255, 0.10);
    border: 1px solid rgba(53, 214, 255, 0.24);
    box-shadow: 0 0 14px rgba(53, 214, 255, 0.10);
}

.catalog-tab-card[aria-selected="true"] .catalog-tab-icon {
    color: #ffffff;
    background: linear-gradient(145deg, rgba(31, 138, 150, 0.90), rgba(53, 214, 255, 0.42));
    border-color: rgba(255, 255, 255, 0.34);
    box-shadow: 0 0 16px rgba(53, 214, 255, 0.34);
}

.catalog-tab-icon svg {
    width: 24px;
    height: 24px;
}

.catalog-tab-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.catalog-tab-copy strong {
    font-size: 15px;
    font-weight: 900;
    line-height: 1.15;
}

.catalog-tab-copy small {
    overflow: hidden;
    color: rgba(255, 255, 255, 0.54);
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-tab-card[aria-selected="true"] .catalog-tab-copy small {
    color: rgba(255, 255, 255, 0.72);
}

.catalog-panel {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.catalog-panel[hidden] {
    display: none !important;
}

.catalog-panel-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.catalog-panel-heading h3 {
    margin: 2px 0 0;
}

@media (max-width: 760px) {
    .catalog-tab-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .catalog-tab-card {
        min-height: 64px;
        padding: 10px 12px;
    }

    .catalog-tab-icon {
        width: 38px;
        height: 38px;
    }

    .catalog-panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .catalog-panel-heading .data-page-actions {
        justify-content: flex-start;
    }
}


/* JOB DETAIL FINANCE */
.job-finance-card {
    display: grid;
    gap: 14px;
}

.job-finance-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.job-finance-summary .app-finance-money-row {
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    background: rgba(4, 24, 29, 0.34);
}

.job-finance-summary .app-finance-money-row span {
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.job-finance-summary .app-finance-money-row strong {
    font-size: 1.15rem;
}

.job-finance-summary .app-finance-money-row.profit {
    border-color: rgba(124, 255, 116, 0.24);
    box-shadow: 0 0 22px rgba(124, 255, 116, 0.07);
}

@media (max-width: 980px) {
    .job-finance-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .job-finance-summary {
        grid-template-columns: 1fr;
    }
}


/* PORTAL REVISION V117 - CHECKLIST/DAMAGE CATALOG TABS AND PADDYMDEV TOPBAR LINK */
.catalog-tab-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.paddymdev-topbar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 58px;
    padding: 5px 10px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 0 18px rgba(255, 255, 255, 0.14),
        0 0 22px rgba(53, 214, 255, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease;
}

.paddymdev-topbar-link:hover {
    transform: translateY(-1px);
    border-color: rgba(53, 214, 255, 0.78);
    box-shadow:
        0 0 22px rgba(255, 255, 255, 0.22),
        0 0 28px rgba(53, 214, 255, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.paddymdev-topbar-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 760px) {
    .catalog-tab-grid-two {
        grid-template-columns: 1fr;
    }

    .paddymdev-topbar-link {
        width: 76px;
        height: 46px;
        padding: 4px 7px;
        border-radius: 12px;
    }
}

/* DAMAGE HIERARCHY DRILL-DOWN */
.damage-selection-context {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border: 1px solid rgba(53, 214, 255, 0.18);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(53, 214, 255, 0.075), rgba(255, 255, 255, 0.025));
}

.damage-selection-context-label {
    color: rgba(255, 255, 255, 0.56);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.damage-selection-context strong {
    color: #ffffff;
    font-size: 14px;
}

.damage-selection-context .muted {
    margin-left: auto;
    font-size: 12px;
}

.damage-selection-context-split > div {
    display: grid;
    gap: 2px;
    min-width: 140px;
}

.damage-change-selection {
    margin-left: auto;
}

.damage-drilldown-link {
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 0;
    border: 0;
    color: #ffffff;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.damage-drilldown-link span {
    font-weight: 850;
}

.damage-drilldown-link small {
    color: #35d6ff;
    font-size: 11px;
    font-weight: 700;
}

.damage-drilldown-table tbody tr {
    transition: background 0.16s ease, box-shadow 0.16s ease;
}

.damage-drilldown-table tbody tr:hover {
    background: rgba(53, 214, 255, 0.055);
}

.damage-drilldown-table tbody tr.is-selected {
    background: rgba(53, 214, 255, 0.10);
    box-shadow: inset 3px 0 0 #35d6ff;
}

[data-add-damage-location]:disabled,
[data-add-damage-type]:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

@media (max-width: 760px) {
    .damage-selection-context,
    .damage-selection-context-split {
        align-items: flex-start;
        flex-direction: column;
    }

    .damage-selection-context .muted,
    .damage-change-selection {
        margin-left: 0;
    }
}

/* PORTAL REVISION V118 - COHESIVE SIDEBAR BRAND, NAVIGATION AND ACCOUNT FOOTER */
.portal-sidebar {
    padding: 16px 14px 14px;
    gap: 0;
}

.portal-brand {
    flex: 0 0 auto;
    justify-content: center;
    margin: 0 0 12px;
    padding: 8px 0 14px;
    border-bottom: 1px solid rgba(53, 214, 255, 0.12);
}

.portal-brand-logo-shell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 104px;
    padding: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 26px;
    background: #d8dde0;
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.94);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.portal-brand:hover .portal-brand-logo-shell,
.portal-brand:focus-visible .portal-brand-logo-shell {
    transform: translateY(-1px);
    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(53, 214, 255, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.portal-brand-logo-shell img,
.portal-brand .portal-brand-logo-shell img {
    display: block;
    width: 82px !important;
    height: 82px !important;
    padding: 0 !important;
    object-fit: contain;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
}

.portal-nav {
    flex: 1 1 auto;
    min-height: 0;
    display: block;
    padding: 0 4px 12px 0;
}

.portal-nav-section {
    display: grid;
    gap: 5px;
}

.portal-nav-section + .portal-nav-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.portal-nav-section-label {
    display: block;
    padding: 0 12px 4px;
    color: rgba(53, 214, 255, 0.70);
    font-size: 0.67rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.portal-nav a {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.15;
}

.portal-nav a:hover,
.portal-nav a:focus {
    border-color: rgba(53, 214, 255, 0.12);
    background: rgba(255, 255, 255, 0.055);
}

.portal-nav a.active {
    border-color: rgba(0, 229, 168, 0.38);
    background:
        linear-gradient(135deg, rgba(0, 229, 168, 0.17), rgba(53, 214, 255, 0.11)),
        rgba(255, 255, 255, 0.055);
    box-shadow:
        inset 3px 0 0 rgba(0, 229, 168, 0.92),
        0 8px 20px rgba(0, 0, 0, 0.12);
}

.sidebar-user-card {
    flex: 0 0 auto;
    margin: 0;
    padding: 12px;
    border: 1px solid rgba(53, 214, 255, 0.20);
    border-radius: 19px;
    background:
        linear-gradient(145deg, rgba(53, 214, 255, 0.075), rgba(255, 255, 255, 0.035)),
        rgba(4, 25, 30, 0.72);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sidebar-user-main {
    min-width: 0;
    margin: 0;
    gap: 10px;
}

.sidebar-user-main img,
.sidebar-user-main .portal-user-initials {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.20);
}

.sidebar-user-copy {
    min-width: 0;
}

.sidebar-user-main strong,
.sidebar-user-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-main strong {
    font-size: 0.92rem;
}

.sidebar-user-main small {
    margin-top: 2px;
    font-size: 0.76rem;
}

.sidebar-user-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.sidebar-user-actions form {
    width: 100%;
}

.sidebar-user-actions .secondary-button,
.sidebar-user-actions button {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 13px;
    font-size: 0.82rem;
}

@media (max-width: 980px) {
    .portal-sidebar {
        width: min(300px, calc(100vw - 34px));
        padding-top: 14px;
        box-shadow: 22px 0 60px rgba(0, 0, 0, 0.42);
    }

    .portal-brand {
        padding-top: 4px;
    }

    .portal-brand-logo-shell {
        width: 102px;
        height: 94px;
        border-radius: 23px;
    }

    .portal-brand-logo-shell img,
    .portal-brand .portal-brand-logo-shell img {
        width: 74px !important;
        height: 74px !important;
    }
}


/* PORTAL REVISION V119 - LOGIN BRAND SHELL */
.auth-welcome-header::after,
.auth-card .auth-brand.auth-brand-large::before,
.auth-card .auth-brand.auth-brand-large::after {
    display: none !important;
}

.auth-card .auth-brand.auth-brand-large {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    filter: none !important;
}

.auth-brand-logo-shell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 104px;
    padding: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 26px;
    background: #d8dde0;
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.auth-card .auth-brand.auth-brand-large .auth-brand-logo-shell img {
    display: block;
    width: 82px !important;
    height: 82px !important;
    padding: 0 !important;
    object-fit: contain !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
}

@media (max-width: 560px) {
    .auth-welcome-header {
        min-height: 104px !important;
        padding-right: 108px !important;
    }

    .auth-card .auth-brand.auth-brand-large {
        top: 2px !important;
        right: 2px !important;
    }

    .auth-brand-logo-shell {
        width: 96px;
        height: 90px;
        padding: 8px;
        border-radius: 22px;
    }

    .auth-card .auth-brand.auth-brand-large .auth-brand-logo-shell img {
        width: 70px !important;
        height: 70px !important;
    }
}

/* PORTAL REVISION V120 - MOBILE SIDEBAR SCROLL AND COMPACT TOPBAR BRAND */
@media (max-width: 980px) {
    body.portal-menu-open {
        overflow: hidden;
    }

    .portal-sidebar {
        height: 100dvh;
        max-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }

    .sidebar-close-button {
        position: sticky;
        top: 0;
        z-index: 4;
        flex: 0 0 auto;
        margin-bottom: 10px;
        background: rgba(7, 31, 37, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .portal-brand {
        flex: 0 0 auto;
    }

    .portal-nav {
        flex: 0 0 auto;
        min-height: auto;
        overflow: visible;
        padding-right: 0;
        padding-bottom: 0;
    }

    .sidebar-user-card {
        flex: 0 0 auto;
        margin-top: 16px;
        margin-bottom: 0;
    }
}

@media (max-width: 640px) {
    .portal-topbar {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 70px;
        align-items: center;
        gap: 10px;
        padding: 10px;
    }

    .menu-button {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
    }

    .portal-title-block {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .portal-title-block .eyebrow {
        margin-bottom: 2px;
        font-size: 0.66rem;
    }

    .portal-title-block h1 {
        max-width: 100%;
        font-size: clamp(1.12rem, 5.2vw, 1.5rem);
        line-height: 1.08;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .account-menu {
        display: contents;
        width: auto;
    }

    .paddymdev-topbar-link {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        width: 70px;
        height: 44px;
        padding: 4px 7px;
        border-radius: 12px;
        box-shadow:
            0 7px 18px rgba(0, 0, 0, 0.18),
            inset 0 1px 0 rgba(255, 255, 255, 0.96);
    }

    .selected-team-pill-rich {
        grid-column: 1 / 3;
        grid-row: 2;
        min-width: 0;
        max-width: 100%;
        margin: 0;
        justify-self: stretch;
    }

    .selected-team-pill-rich > span:last-child {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .freight-balance-pill {
        grid-column: 3;
        grid-row: 2;
        min-width: 0;
        min-height: 42px;
        margin: 0;
        padding-right: 12px;
        justify-self: stretch;
    }
}

@media (max-width: 380px) {
    .portal-topbar {
        grid-template-columns: 42px minmax(0, 1fr) 62px;
        gap: 8px;
    }

    .menu-button {
        width: 42px;
        height: 42px;
    }

    .paddymdev-topbar-link {
        width: 62px;
        height: 40px;
        padding: 3px 6px;
        border-radius: 11px;
    }

    .portal-title-block h1 {
        font-size: 1.08rem;
    }

    .selected-team-pill-rich {
        padding-right: 10px;
        font-size: 0.76rem;
    }

    .freight-balance-pill {
        gap: 5px;
        padding: 4px 8px 4px 5px;
        font-size: 0.78rem;
    }

    .freight-coin-icon {
        width: 31px;
        height: 31px;
    }
}


/* PORTAL REVISION V121 - MOBILE TEAM AND FREIGHTCOIN STACK */
@media (max-width: 640px) {
    .selected-team-pill-rich {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        max-width: 100%;
        justify-self: stretch;
    }

    .freight-balance-pill {
        grid-column: 1 / -1;
        grid-row: 3;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
        justify-self: stretch;
        justify-content: center;
        padding: 5px 14px 5px 6px;
    }
}


/* Account menu parity */
.portal-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.portal-menu-card {
    display: flex;
    min-height: 150px;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
    border: 1px solid rgba(14, 58, 69, 0.12);
    border-radius: 18px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(14, 58, 69, 0.08);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.portal-menu-card:hover,
.portal-menu-card:focus {
    transform: translateY(-2px);
    border-color: rgba(244, 162, 97, 0.65);
    box-shadow: 0 16px 34px rgba(14, 58, 69, 0.12);
}

.portal-menu-card strong {
    font-family: Manrope, Arial, sans-serif;
    font-size: 19px;
    color: #0e3a45;
}

.portal-menu-card > span:last-child {
    color: #6b7c81;
    line-height: 1.55;
}

@media (max-width: 900px) {
    .portal-menu-grid {
        grid-template-columns: 1fr;
    }
}

/* Kotlin parity: chat rooms, account menu and weekly rewards */
.chat-room-card {
    position: relative;
    display: block;
    padding: 0;
    overflow: visible;
}

.chat-room-card.selected {
    border-color: rgba(0, 229, 168, 0.54);
    box-shadow: 0 0 20px rgba(0, 229, 168, 0.14);
}

.chat-room-open {
    display: grid;
    width: 100%;
    gap: 9px;
    padding: 14px;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.chat-room-title-row {
    padding-right: 30px;
}

.chat-room-title-row strong {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 900;
}

.chat-room-participant-names {
    color: rgba(255, 255, 255, 0.68);
    font-size: 13px;
    line-height: 1.35;
}

.chat-room-avatar-row {
    display: flex;
    gap: 7px;
    min-height: 34px;
}

.chat-room-avatar-row img,
.chat-room-avatar-initials {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    object-fit: cover;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 900;
}

.chat-room-last-message-card,
.pf-inner-card {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 16px;
    background: rgba(4, 29, 35, 0.44);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.chat-room-last-message-card strong {
    color: var(--color-orange, #f7931e);
    font-size: 12px;
}

.chat-room-last-message-card > span {
    display: -webkit-box;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.chat-room-last-message-card small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.chat-room-card-menu-button,
.chat-header-menu-button {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.chat-room-card-menu-button {
    position: absolute;
    z-index: 4;
    top: 9px;
    right: 8px;
}

.chat-room-card-menu,
.chat-header-menu {
    position: absolute;
    z-index: 50;
    display: none;
    width: 160px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 15px;
    background: rgba(20, 54, 62, 0.98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.chat-room-card-menu {
    top: 42px;
    right: 8px;
}

.chat-header-menu {
    top: 44px;
    right: 0;
}

.chat-room-card-menu.open,
.chat-header-menu.open {
    display: grid;
}

.chat-room-card-menu button,
.chat-header-menu button {
    padding: 9px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #fff;
    text-align: left;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.chat-room-card-menu button:hover,
.chat-header-menu button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.chat-room-panel-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.chat-room-panel-header-actions {
    position: relative;
}

.chat-room-selected-participants {
    max-width: 680px;
    margin: 5px 0 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: 12px;
}

.chat-typing-indicator {
    display: flex;
    min-height: 34px;
    align-items: center;
    gap: 9px;
    padding: 5px 18px 9px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

.chat-typing-avatars {
    display: inline-flex;
    align-items: center;
    padding-left: 16px;
}

.chat-typing-avatar {
    display: inline-flex;
    width: 30px;
    height: 30px;
    margin-left: -16px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.86);
    border-radius: 999px;
    background: var(--color-teal-light, #18444c);
    color: #fff;
    box-shadow: 0 0 12px rgba(247, 147, 30, 0.2);
    font-size: 10px;
    font-weight: 900;
    z-index: calc(4 - var(--typing-avatar-index));
}

.chat-typing-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portal-menu-page .section-header {
    margin-bottom: 8px;
}

.portal-menu-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 900px;
}

.portal-menu-card {
    min-height: 0;
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-color: rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 36px rgba(0, 0, 0, 0.16);
}

.portal-menu-icon,
.portal-menu-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(247, 147, 30, 0.5);
    border-radius: 999px;
    color: #fff;
}

.portal-menu-icon {
    width: 48px;
    height: 48px;
    color: #ffc107;
    font-size: 22px;
}

.portal-menu-chevron {
    width: 34px;
    height: 34px;
    font-size: 28px;
}

.portal-menu-copy {
    display: grid;
    gap: 4px;
}

.portal-menu-copy strong {
    color: #fff;
}

.portal-menu-copy > span {
    color: rgba(255, 255, 255, 0.67);
    line-height: 1.4;
}

.weekly-rewards-page {
    max-width: 980px;
    margin-inline: auto;
}

.config-section-label {
    margin: 18px 4px 9px;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 900;
}

.weekly-how-card {
    gap: 10px;
    padding: 20px;
    border-radius: 22px;
}

.weekly-how-card h3,
.weekly-how-card p {
    margin: 0;
}

.weekly-how-card h3 {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 17px;
}

.weekly-how-card p {
    color: rgba(255, 255, 255, 0.84);
}

.weekly-goal-status {
    margin-top: 3px;
    color: var(--color-orange, #f7931e);
}

.weekly-goal-status.complete {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #4caf50;
}

.weekly-goal-status.complete > span:last-child {
    display: grid;
    gap: 2px;
}

.weekly-goal-status small {
    color: rgba(255, 255, 255, 0.75);
}

.weekly-star {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    font-size: 25px;
}

.weekly-controls {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
    text-align: center;
}

.weekly-controls strong {
    color: #fff;
}

.weekly-circle-button {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(247, 147, 30, 0.55);
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    font-size: 34px;
    line-height: 1;
}

.weekly-circle-button.disabled {
    opacity: 0.35;
}

.weekly-activity-card {
    gap: 17px;
    padding: 20px;
    border-radius: 22px;
}

.weekly-day-row {
    display: grid;
    gap: 8px;
}

.weekly-day-row > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.weekly-day-row strong {
    color: #fff;
}

.weekly-day-row span {
    color: rgba(255, 255, 255, 0.7);
}

.weekly-progress-track {
    position: relative;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.weekly-progress-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--color-orange, #f7931e);
}

.weekly-progress-track > span.complete {
    background: #4caf50;
}

.weekly-progress-track i {
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 620px) {
    .weekly-day-row > div:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }
    .portal-menu-card { grid-template-columns: 44px minmax(0, 1fr) 32px; padding: 13px; }
    .portal-menu-icon { width: 42px; height: 42px; }
}

/* CHAT DIRECT-HUB PARITY: compact header and full-height conversation workspace */
.chat-workspace-card {
    height: calc(100dvh - 82px);
    min-height: 650px;
    padding: 12px 18px 18px;
    position: relative;
}

.chat-page-header {
    display: block;
    margin-bottom: 8px;
}

.chat-page-heading {
    display: grid;
    justify-items: start;
    gap: 2px;
}

.chat-page-heading .eyebrow,
.chat-page-heading h2,
.chat-page-heading .muted {
    margin-bottom: 0;
}

.chat-page-heading .muted {
    max-width: 330px;
    line-height: 1.35;
    white-space: normal;
}

.chat-room-title-row {
    justify-content: flex-start;
}

.chat-room-unread-circle {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    border-radius: 999px;
    background: var(--color-orange, #f7931e);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 0 14px rgba(247, 147, 30, 0.28);
}

.chat-workspace-layout {
    flex: 1 1 auto;
    min-height: 0;
}

@media (max-width: 980px) {
    .chat-workspace-card {
        height: auto !important;
        min-height: 0;
        padding: 14px;
    }

    .chat-room-panel {
        padding: 0;
    }
}

/* Final responsive chat sizing: use the available portal viewport without
   sacrificing the room list on compact screens. */
.chat-workspace-card {
    height: calc(100dvh - 48px);
    min-height: 700px;
}

.chat-room-panel,
.chat-room-list-wrap,
.chat-room-list {
    min-height: 0;
}

@media (max-width: 980px) {
    .chat-workspace-card {
        height: auto !important;
        min-height: 0;
    }

    .chat-room-list-wrap .chat-room-list,
    .chat-room-list {
        max-height: 34dvh;
    }

    .chat-room-panel {
        height: min(820px, calc(100dvh - 96px)) !important;
        min-height: 600px;
        max-height: 820px;
    }
}

@media (max-width: 560px) {
    .chat-workspace-card {
        padding: 10px;
    }

    .chat-room-list-wrap .chat-room-list,
    .chat-room-list {
        max-height: 32dvh;
    }

    .chat-room-panel {
        height: calc(100dvh - 76px) !important;
        min-height: 560px;
        max-height: none;
    }

    .chat-new-message-pill {
        top: 136px;
        bottom: auto;
        max-width: calc(100% - 28px);
        white-space: nowrap;
    }
}

/* Final menu/reward sizing overrides */
.portal-menu-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); max-width:none; gap:14px; }
.portal-menu-card { min-height:102px; border-color:rgba(53,214,255,.42); background:linear-gradient(135deg,rgba(53,214,255,.14),rgba(255,255,255,.055)); }
.portal-menu-icon,.portal-menu-chevron { border-color:rgba(53,214,255,.62); color:var(--color-cyan); background:rgba(53,214,255,.12); }
.weekly-rewards-page { width:100%; max-width:none; margin:0; }
@media(max-width:1100px){.portal-menu-grid{grid-template-columns:1fr}}

/* WORKSPACE LOGOS: keep every source image inside the fixed white logo panel. */
.workspace-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.workspace-logo-wrap img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    flex: 0 1 auto;
}

/* PORTAL PARITY V73 - role navigation, messaging, location, customer and tracking polish */
h1,h2,h3,h4,h5,h6,.primary-button,.secondary-button,.danger-button,.portal-nav { font-family:var(--font-heading); }
.selected-team-copy{display:grid;gap:3px;min-width:0;line-height:1.05}.selected-team-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.84rem}.selected-team-copy .workspace-role-pill{justify-self:start;min-height:18px;padding:2px 7px;font-size:9px}
.portal-nav-dialog-button{display:block;width:100%;padding:11px 14px;border:0;border-radius:14px;background:transparent;color:rgba(255,255,255,.78);font-family:var(--font-heading);font-weight:800;text-align:left;cursor:pointer}.portal-nav-dialog-button:hover,.portal-nav-dialog-button:focus{background:rgba(53,214,255,.1);color:#fff}
.location-sharing-nav-button.active{border:1px solid rgba(0,229,168,.45);background:rgba(0,229,168,.14);color:var(--color-green);box-shadow:0 0 15px rgba(0,229,168,.12)}
.location-sharing-button{display:grid;place-items:center;gap:1px;min-width:48px;height:48px;padding:4px 8px;border:1px solid rgba(53,214,255,.38);border-radius:999px;background:rgba(7,35,41,.72);color:rgba(255,255,255,.74);cursor:pointer}.location-sharing-button>span{font-size:20px;line-height:18px}.location-sharing-button small{font-size:8px;font-weight:900}.location-sharing-button.active{border-color:var(--color-green);background:rgba(0,229,168,.16);color:var(--color-green);box-shadow:0 0 18px rgba(0,229,168,.25)}
.global-message-dialog{width:min(720px,calc(100vw - 28px))}.global-message-users{max-height:340px}.chat-user-picker-row{display:grid;grid-template-columns:18px 32px minmax(0,1fr);align-items:center}.chat-user-picker-row>input[type="checkbox"]{width:16px!important;height:16px!important;min-width:16px!important;margin:0!important;padding:0!important}.chat-user-picker-row>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-user-picker-row.compact{grid-template-columns:minmax(0,1fr) 18px;padding:7px 8px;border-radius:12px}.chat-picker-person{display:grid;grid-template-columns:32px minmax(0,1fr);align-items:center;gap:10px;min-width:0}.chat-picker-person>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.count-pill{display:inline-grid!important;place-items:center;width:22px;min-width:22px;height:22px;min-height:22px;padding:0!important;border:0!important;border-radius:999px!important;background:var(--color-orange,#f7931e);color:#fff;font-family:var(--font-heading);font-size:11px;font-weight:900;line-height:1;box-shadow:0 0 14px rgba(247,147,30,.28)}
.portal-upload-selected-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.portal-upload-selected-row[hidden]{display:none}.portal-upload-selected-row .portal-upload-selected{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.member-avatar.customer-avatar{background:#243b41}.customer-address-heading{margin-top:24px}.customer-address-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.customer-address-card{display:grid;align-content:start;gap:12px}.customer-address-card>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:10px}.customer-address-card h3,.customer-address-card p{margin:0}.customer-address-contact{display:grid;gap:4px;color:rgba(255,255,255,.68)}
.general-checklist-selector{grid-template-columns:48px minmax(0,1fr) auto!important;align-items:center!important;text-align:left!important;gap:16px!important;min-height:92px!important}.checklist-selector-icon{display:grid;place-items:center;width:46px;height:46px;border:1px solid rgba(53,214,255,.5);border-radius:16px;background:rgba(53,214,255,.12);color:var(--color-cyan);font-size:22px;font-weight:900}.general-checklist-selector strong{font:800 1.15rem var(--font-heading)}.general-checklist-selector small{color:var(--color-cyan);font-weight:900}
.contact-support-layout{display:grid;grid-template-columns:minmax(0,.88fr) minmax(360px,1.12fr);gap:24px;align-items:stretch;margin-top:22px}.contact-support-layout .support-form{display:grid;grid-template-columns:1fr!important;align-content:start;max-width:none}.contact-support-layout .support-form label:last-of-type{grid-row:auto!important;grid-column:auto!important}.contact-support-layout .support-form .form-footer-actions{grid-column:auto!important}.contact-support-story{position:relative;display:flex;flex-direction:column;justify-content:center;min-height:430px;padding:38px;overflow:hidden;border:1px solid rgba(53,214,255,.28);border-radius:24px;background:linear-gradient(135deg,rgba(255,255,255,.09),rgba(53,214,255,.05))}.contact-support-story img{position:absolute;right:26px;bottom:18px;width:min(36%,220px);max-height:230px;object-fit:contain;opacity:.9}.contact-support-story h3{max-width:75%;margin:9px 0 14px;font-size:clamp(2.3rem,4.2vw,4.8rem);line-height:.96;letter-spacing:-.055em}.contact-support-story>p:not(.eyebrow),.contact-support-story small{max-width:62%;color:rgba(255,255,255,.72);font-size:1rem;line-height:1.55}.contact-support-story small{margin-top:16px;font-weight:700}.support-form textarea{min-height:260px}
.tracked-items-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.tracked-location-sections{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:14px}.tracked-location-sections section{display:grid;align-content:start;gap:7px;padding:13px;border:1px solid rgba(255,255,255,.1);border-radius:15px;background:rgba(0,0,0,.14)}.tracked-location-sections p,.tracked-location-sections strong{margin:0}.tracked-location-sections a{color:var(--color-cyan);font-weight:750}.customer-driver-map-marker{position:absolute;display:grid;place-items:center;width:48px;height:48px;transform:translate(-24px,-24px);overflow:hidden;border:3px solid var(--color-orange);border-radius:50%;background:#fff;box-shadow:0 5px 16px rgba(0,0,0,.38)}.customer-driver-map-marker img{width:42px;height:42px;border-radius:50%;object-fit:cover}.customer-driver-map-marker span{color:var(--color-orange);font-size:24px}.tracked-driver-row{margin-top:12px}.tracked-driver-row p{margin:4px 0 0;color:rgba(255,255,255,.65)}
@media(max-width:1050px){.contact-support-layout{grid-template-columns:1fr}.contact-support-story{min-height:340px}.tracked-location-sections{grid-template-columns:1fr}.tracked-items-row{grid-template-columns:1fr}}
@media(max-width:700px){.selected-team-pill-rich{max-width:178px}.selected-team-copy strong{font-size:.72rem}.location-sharing-button{min-width:42px;width:42px;height:42px}.location-sharing-button small{display:none}.customer-address-grid{grid-template-columns:1fr}.general-checklist-selector{grid-template-columns:42px minmax(0,1fr)!important}.general-checklist-selector small{grid-column:2}.contact-support-story{padding:26px;min-height:390px}.contact-support-story h3{max-width:100%;font-size:2.7rem}.contact-support-story>p:not(.eyebrow),.contact-support-story small{max-width:76%}.contact-support-story img{width:38%;right:12px}.account-menu{gap:6px}}

/* Compact checklist chooser and labelled customer contact cards. */
.general-checklist-choice-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;margin-top:18px}.general-checklist-selector{display:flex!important;min-height:0!important;height:auto!important;padding:15px 17px!important;gap:4px!important;align-items:flex-start!important;justify-content:center!important;flex-direction:column!important}.general-checklist-selector strong{font:800 .98rem var(--font-heading)!important}.general-checklist-selector small{color:var(--color-cyan);font-size:.76rem;font-weight:800}.customer-address-card-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.customer-address-values{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}.customer-address-values>div{display:flex;flex-direction:column;gap:4px;padding:11px 12px;border:1px solid rgba(112,210,226,.14);border-radius:12px;background:rgba(3,25,31,.32)}.customer-address-values .wide{grid-column:1/-1}.customer-address-values small,.tracked-value-grid small,.tracked-location-details small,.tracked-reference-grid small,.tracked-signature-panel small{color:var(--color-cyan);font-size:.68rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.customer-address-values strong{overflow-wrap:anywhere}

/* Customer tracking follows the mobile detail flow while using portal cards. */
.tracked-top-grid{display:grid;grid-template-columns:minmax(300px,.8fr) minmax(420px,1.2fr);gap:16px;margin-bottom:16px}.tracked-top-summary{display:grid;gap:16px}.tracked-company-header{display:grid!important;grid-template-columns:58px minmax(0,1fr);gap:14px;align-items:start}.tracked-job-logo{width:58px;height:58px;border-radius:50%;overflow:hidden;background:rgba(255,255,255,.1);display:grid;place-items:center}.tracked-job-logo img{width:100%;height:100%;object-fit:cover;position:relative;z-index:1}.tracked-job-logo-fallback{grid-area:1/1;font-weight:900;color:rgba(255,255,255,.55)}.tracked-reference-grid{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.tracked-reference-grid>div{display:flex;flex-direction:column;gap:4px}.tracked-map-card{display:flex;flex-direction:column;min-height:100%}.tracked-map-card .customer-tracking-map{height:300px;min-height:250px}.tracked-location-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:13px}.tracked-location-details>div{display:flex;flex-direction:column;align-items:flex-start;gap:5px;padding:10px 11px;border-radius:12px;background:rgba(3,25,31,.34);border:1px solid rgba(112,210,226,.12)}.tracked-location-details>div:nth-child(3){grid-column:1/-1}.tracked-wide-section{margin-top:16px}.tracked-section-heading,.tracked-item-heading{display:flex;align-items:center;justify-content:space-between;gap:14px}.tracked-product-list{display:grid;gap:12px;margin-top:13px}.tracked-item-row{padding:15px;border-radius:16px;border:1px solid rgba(112,210,226,.16);background:rgba(3,25,31,.28)}.tracked-item-heading>div{display:flex;flex-direction:column;gap:3px}.tracked-item-heading small{color:var(--color-muted)}.tracked-value-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-top:13px}.tracked-value-grid.compact{grid-template-columns:repeat(3,minmax(0,1fr))}.tracked-value-grid>div{display:flex;flex-direction:column;gap:4px;min-width:0}.tracked-value-grid strong{overflow-wrap:anywhere}.tracked-subsummary{display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid rgba(255,255,255,.1);padding-top:10px;margin-top:10px}.tracked-subsummary span{color:var(--color-muted)}.tracked-inline-details{display:grid;gap:5px;padding:8px 0 2px}.tracked-inline-details>span{display:flex;flex-wrap:wrap;gap:8px;color:var(--color-muted);font-size:.82rem}.tracked-inline-details small{display:block;width:100%}.tracked-placeholder{margin-top:12px;padding:14px;border:1px dashed rgba(112,210,226,.25);border-radius:13px;color:var(--color-muted)}.tracked-compact-list{display:grid;gap:8px;margin-top:12px}.tracked-compact-list>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px;border-radius:12px;background:rgba(3,25,31,.32)}.tracked-signature-panel{display:flex;flex-direction:column;gap:8px;margin-top:14px}.tracked-signature-panel .tracked-signature{max-width:260px;max-height:130px;object-fit:contain;background:#fff;border-radius:12px;padding:8px}

@media(max-width:900px){.tracked-top-grid{grid-template-columns:1fr}.tracked-map-card .customer-tracking-map{height:270px}.tracked-value-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.general-checklist-choice-grid{grid-template-columns:1fr}.customer-address-values,.tracked-location-details,.tracked-reference-grid,.tracked-value-grid,.tracked-value-grid.compact{grid-template-columns:1fr}.tracked-location-details>div:nth-child(3){grid-column:auto}.tracked-company-header{grid-template-columns:48px minmax(0,1fr)}.tracked-job-logo{width:48px;height:48px}.tracked-item-heading,.tracked-section-heading{align-items:flex-start}.tracked-subsummary{align-items:flex-start;flex-direction:column;gap:4px}.tracked-compact-list>div{align-items:flex-start;flex-direction:column}}

/* Customer finance totals mirror the three mobile summary cards. */
.customer-invoice-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:16px}.customer-invoice-summary{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:14px;min-height:96px;padding:16px;text-decoration:none}.customer-invoice-summary-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;font:900 21px var(--font-heading);background:color-mix(in srgb,var(--summary-color) 16%,transparent);color:var(--summary-color)}.customer-invoice-summary>span:nth-child(2){display:grid;gap:4px}.customer-invoice-summary strong{color:#fff;font:800 15px var(--font-heading)}.customer-invoice-summary small{color:rgba(255,255,255,.65);font-weight:650}.customer-invoice-summary b{color:var(--summary-color);font:800 18px var(--font-heading)}.customer-invoice-summary.outstanding{--summary-color:#ff5b6b}.customer-invoice-summary.paid{--summary-color:#57d66b}.customer-invoice-summary.total{--summary-color:#35d6ff}@media(max-width:980px){.customer-invoice-summary-grid{grid-template-columns:1fr}}@media(max-width:560px){.customer-invoice-summary{grid-template-columns:42px minmax(0,1fr);min-height:84px}.customer-invoice-summary-icon{width:42px;height:42px}.customer-invoice-summary b{grid-column:2}}

/* TRACKING PARITY V2 - Kotlin customer stage detail hierarchy and status colours. */
.tracked-top-grid{grid-template-columns:minmax(320px,.82fr) minmax(440px,1.18fr);align-items:stretch}
.tracked-top-summary{grid-template-rows:auto auto minmax(0,1fr);align-content:stretch;gap:12px;min-width:0}
.tracked-top-summary>.pf-inner-card{min-height:0;padding:14px 16px}
.tracked-company-header{grid-template-columns:54px minmax(0,1fr)!important;gap:12px!important;align-items:start!important}
.tracked-job-logo{width:54px;height:54px;background:#fff;border:2px solid rgba(53,214,255,.35);padding:4px}
.tracked-job-logo img{width:100%;height:100%;object-fit:contain;border-radius:50%;padding:0}
.tracked-job-logo-fallback{color:#1b4149}
.tracked-job-copy h3,.tracked-job-copy p{margin:0}.tracked-job-copy>strong{display:block;margin-top:2px}
.tracked-pill-row{margin:7px 0 0}.tracked-pill{min-height:23px;align-items:center;padding:4px 9px;line-height:1.1}
.tracked-pill.collection{background:#42a5f5}.tracked-pill.delivery{background:#ffa726}.tracked-pill.job-type{background:rgba(255,255,255,.13)}
.tracked-pill.stage-status.completed{background:#69ff5e;color:#07170b}.tracked-pill.stage-status.in-progress{background:#ffb74d;color:#fff}.tracked-pill.stage-status.allocated{background:#4aa8ff;color:#fff}.tracked-pill.stage-status.unallocated{background:#555;color:#fff}
.tracked-pill.tracking-status.available{background:#2e7d32}.tracked-pill.tracking-status.unavailable{background:#455a64}.tracked-pill.tracking-status.waiting{background:#ef6c00}.tracked-pill.tracking-status.unknown{background:#616161}
.tracked-reference-grid{margin-top:2px}.tracked-reference-grid>div{padding:7px 9px;border-radius:10px;background:rgba(3,25,31,.27)}
.tracked-eta-card,.tracked-data-card{display:grid;align-content:start;gap:10px}.tracked-eta-card p,.tracked-data-card p{margin:0}
.tracked-eta-values{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.tracked-eta-values>div,.tracked-data-values>div{display:flex;flex-direction:column;gap:4px;min-width:0;padding:8px 10px;border:1px solid rgba(112,210,226,.12);border-radius:11px;background:rgba(3,25,31,.3)}
.tracked-eta-values small,.tracked-data-values small,.tracked-damage-list small,.tracked-info-row small{color:var(--color-cyan);font-size:.68rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase}
.tracked-data-values{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.tracked-data-values>.wide{grid-column:1/-1}.tracked-data-values strong{overflow-wrap:anywhere}
.tracked-map-card{height:100%;min-height:560px}.tracked-map-card .customer-tracking-map{height:auto;min-height:500px;flex:1}
.tracked-value-grid.compact.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.tracked-subsection{margin-top:13px;padding-top:12px;border-top:1px solid rgba(255,255,255,.12)}.tracked-subsection h4{margin:0 0 10px;font-size:.84rem}
.tracked-subsection .allocation-empty.compact{min-height:70px;margin-top:0;border-radius:13px;padding:12px}
.tracked-damage-list{display:grid;gap:9px}.tracked-damage-list>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;padding:11px;border-radius:12px;background:rgba(3,25,31,.32)}.tracked-damage-list span{display:flex;flex-direction:column;gap:4px}.tracked-damage-list .wide{grid-column:1/-1}
.tracked-info-row{display:flex;flex-direction:column;gap:4px;margin-top:12px;padding:10px 11px;border-radius:12px;background:rgba(3,25,31,.32)}
.tracked-photo-grid,.tracked-compact-list,.tracked-wide-section>.allocation-empty{margin-top:13px}
@media(max-width:1050px){.tracked-top-grid{grid-template-columns:1fr}.tracked-map-card{min-height:390px}.tracked-map-card .customer-tracking-map{min-height:330px}}
@media(max-width:600px){.tracked-top-summary>.pf-inner-card{padding:13px}.tracked-company-header{grid-template-columns:46px minmax(0,1fr)!important}.tracked-job-logo{width:46px;height:46px}.tracked-eta-values,.tracked-data-values,.tracked-value-grid.compact.two,.tracked-damage-list>div{grid-template-columns:1fr}.tracked-data-values>div:nth-child(3),.tracked-damage-list .wide{grid-column:auto}.tracked-map-card{min-height:330px}.tracked-map-card .customer-tracking-map{min-height:270px}.tracked-job-page>.section-header{align-items:flex-start;gap:12px}.tracked-job-page>.section-header .secondary-button{padding:9px 12px;font-size:.76rem}}

.tracked-completion-lower{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(260px,.65fr);gap:12px;margin-top:13px}.tracked-completion-notes,.tracked-signature-panel{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-height:128px;margin:0;padding:13px;border:1px solid rgba(112,210,226,.14);border-radius:13px;background:rgba(3,25,31,.32)}.tracked-completion-notes small{color:var(--color-cyan);font-size:.68rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.tracked-completion-notes strong{white-space:pre-wrap;overflow-wrap:anywhere}.tracked-signature-panel .tracked-placeholder{width:100%;margin:0}
@media(max-width:700px){.tracked-completion-lower{grid-template-columns:1fr}.tracked-completion-notes,.tracked-signature-panel{min-height:0}}

/* CUSTOMER TRACKING, ADDRESS SEARCH AND SHARED PHOTO VIEWER */
.customer-address-search{max-width:430px;margin:0 0 14px}.customer-address-search label{display:grid;gap:6px}.customer-address-search input{width:100%}
.customer-job-card-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.tracked-data-pill-row{display:flex;gap:8px;flex-wrap:wrap;margin:0}.tracked-pill.driver-travel{background:var(--color-cyan);color:#05232a;font-weight:900}
.photo-viewer-trigger{appearance:none;border:0;padding:0;margin:0;background:transparent;color:inherit;cursor:pointer;display:block;width:100%;border-radius:inherit;overflow:hidden}.photo-viewer-trigger img{display:block;width:100%;height:100%;object-fit:cover}
.global-photo-viewer .attachment-photo-dialog{width:min(94vw,1100px);max-width:1100px}.global-photo-viewer-stage{position:relative;display:grid;place-items:center;min-height:260px}.global-photo-viewer-stage .attachment-photo-preview{max-width:100%;max-height:76vh;object-fit:contain}.photo-viewer-nav{position:absolute;z-index:2;top:50%;transform:translateY(-50%);width:46px;height:46px;border-radius:50%;border:1px solid rgba(53,214,255,.55);background:rgba(3,25,31,.85);color:#fff;font-size:2rem;line-height:1;cursor:pointer}.photo-viewer-nav.previous{left:12px}.photo-viewer-nav.next{right:12px}
@media(max-width:600px){.customer-address-search{max-width:none}.customer-job-card-actions{width:100%;justify-content:stretch}.customer-job-card-actions>a{flex:1}.photo-viewer-nav{width:38px;height:38px}.photo-viewer-nav.previous{left:5px}.photo-viewer-nav.next{right:5px}}


/* PORTAL REVISION V101 - EDIT STAGE LOADING AND ENQUIRY PHOTO POLISH */
.form-stage-addresses .stage-address-grid { align-items: start !important; }
.form-stage-addresses .stage-address-panel { align-self: start !important; align-content: start !important; margin: 0 !important; padding-top: 0 !important; transform: none !important; }
.form-stage-addresses .stage-address-panel > .selector-card { margin: 0 !important; min-height: 74px !important; }
.enquiry-photo-preview-card { border-radius: 18px; overflow: hidden; }
.enquiry-photo-preview-card .photo-viewer-trigger { border-radius: 13px; overflow: hidden; }
.enquiry-photo-preview-card img { border-radius: 13px; }
.enquiry-photo-preview-grid .photo-viewer-trigger, .enquiry-photo-readonly-grid .photo-viewer-trigger { border-radius: 16px; overflow: hidden; }
.enquiry-photo-preview-grid .photo-viewer-trigger img, .enquiry-photo-readonly-grid .photo-viewer-trigger img { border-radius: 16px; }

/* PORTAL REVISION V34 - VISIBLE SIGNALR CONNECTION BADGES */
.signalr-connection-badge {
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(255, 87, 87, 0.4);
    background: rgba(255, 87, 87, 0.12);
    color: #ff9b9b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.signalr-connection-badge > span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #ff5757;
    box-shadow: 0 0 12px rgba(255, 87, 87, 0.55);
}
.signalr-connection-badge.connected {
    border-color: rgba(46, 232, 157, 0.42);
    background: rgba(46, 232, 157, 0.13);
    color: #72f2bd;
}
.signalr-connection-badge.connected > span {
    background: #2ee89d;
    box-shadow: 0 0 12px rgba(46, 232, 157, 0.65);
}
.signalr-connection-badge.disconnected > span { background: #ff5757; }
.customer-live-tracking-row { margin-top: 12px; }


/* PORTAL REVISION V102 - CUSTOMER TRACKING BRIDGE, DOT-ONLY STATUS AND STAGE ALIGNMENT */
.signalr-connection-badge { width: 12px !important; min-width: 12px !important; height: 12px !important; min-height: 12px !important; padding: 0 !important; border: 0 !important; background: transparent !important; gap: 0 !important; overflow: visible; }
.signalr-connection-badge > span { width: 11px !important; height: 11px !important; display: block; }
.form-stage-addresses .stage-address-grid > .stage-address-panel,
.form-stage-addresses .stage-address-grid > .stage-address-panel + .stage-address-panel { margin-top: 0 !important; padding-top: 0 !important; transform: translateY(0) !important; align-self: start !important; }
.form-stage-addresses .stage-address-grid > .stage-address-panel > .selector-card { margin-top: 0 !important; }


/* Final mobile parity pass: preserve existing layouts while allowing them to stack cleanly. */
@media(max-width:760px){
html,body{max-width:100%;overflow-x:hidden}
.content-card,.pf-inner-card,.crud-dialog,.chat-layout,.chat-room-panel,.chat-list-panel,.tracked-job-page{min-width:0;max-width:100%}
.chat-layout{grid-template-columns:1fr!important}.chat-list-panel{max-height:38vh}.chat-room-panel{min-height:58vh}.chat-messages{min-height:280px;max-height:none}.chat-compose-row{grid-template-columns:auto minmax(0,1fr) auto}.chat-attachment-preview{max-width:100%;overflow:hidden}.chat-attachment-preview span{max-width:100%;overflow-wrap:anywhere}.chat-attachments{max-width:100%}.chat-image-attachment img{max-width:100%;height:auto}.chat-document-attachment{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.dashboard-grid,.customer-dashboard-grid,.planning-grid,.job-detail-grid,.job-form-grid,.enquiry-form-grid,.tracked-top-summary,.tracked-top-grid{grid-template-columns:1fr!important}
.table-scroll,.responsive-table,.planning-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.data-table{min-width:640px}
.crud-dialog{width:calc(100vw - 20px)!important;max-height:calc(100dvh - 20px);margin:10px}.crud-modal{padding:0!important}.modal-header-row,.crud-modal-header,.section-header{flex-wrap:wrap}.modal-actions-inline,.modal-header-actions,.customer-job-card-actions{width:100%;flex-wrap:wrap}.modal-actions-inline>* ,.modal-header-actions>* ,.customer-job-card-actions>*{min-width:0}
.customer-tracking-map,.tracking-map,.allocation-map,.job-map{width:100%!important;height:280px!important;min-height:240px!important}.tracked-pill-row{flex-wrap:wrap}.tracked-data-values{grid-template-columns:1fr!important}.tracked-data-values .wide{grid-column:auto!important}
.form-grid,.two-column-grid,.three-column-grid,.four-column-grid,.responsive-grid{grid-template-columns:1fr!important}.button-row,.form-actions,.dialog-actions{flex-wrap:wrap}.button-row>*,.form-actions>*,.dialog-actions>*{flex:1 1 140px}
}
@media(max-width:420px){.chat-compose-row{gap:6px}.chat-plus-button,.chat-send-button{width:40px;min-width:40px}.content-card{padding:12px}.pf-inner-card{padding:12px}.data-table{min-width:560px}}



.chat-document-attachment{display:flex!important;align-items:center;gap:10px;max-width:280px;padding:10px 12px!important;border-radius:16px!important;text-align:left!important}.chat-document-icon{display:grid;place-items:center;width:46px;height:54px;border-radius:10px;background:rgba(255,255,255,.92);color:#c62828;font-weight:900;font-size:12px;flex:0 0 auto}.chat-document-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-connection-indicator.connected{background:#2ee6a6!important;box-shadow:0 0 12px rgba(46,230,166,.8)}

.chat-message-action-menu{position:fixed;z-index:10040;display:none;min-width:180px;max-width:min(360px,calc(100vw - 20px));padding:8px;border-radius:18px;border:1px solid rgba(53,214,255,.25);background:rgba(5,24,29,.98);box-shadow:0 18px 50px rgba(0,0,0,.35),0 0 22px rgba(53,214,255,.16)}
.chat-message-action-menu.open{display:grid;gap:6px}
.chat-message-action-menu>[data-message-action]{width:100%;border:0;border-radius:13px;background:rgba(255,255,255,.06);color:#fff;cursor:pointer;padding:10px 12px;text-align:left;font-weight:800}
.chat-message-action-menu>[data-message-action]:hover{background:rgba(0,229,168,.16)}
.chat-message-action-reactions{display:flex;gap:6px;flex-wrap:wrap;padding:2px 2px 8px;margin-bottom:2px;border-bottom:1px solid rgba(53,214,255,.18)}
.chat-message-action-reactions button{display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:999px;background:rgba(255,255,255,.08);color:#fff;cursor:pointer;font-size:18px}
.chat-message-action-reactions button:hover,.chat-message-action-reactions button.selected{background:rgba(0,229,168,.18)}

.customer-details-page .customer-address-table-section { margin-top: 24px; }

/* Shared live-update connection status */
.signalr-status-card{display:flex;align-items:center;justify-content:space-between;gap:14px;min-width:260px;padding:12px 14px;border:1px solid rgba(53,214,255,.38);border-radius:18px;background:rgba(7,42,48,.82);box-shadow:inset 0 0 0 1px rgba(255,255,255,.025);transition:border-color .2s ease,box-shadow .2s ease,background .2s ease}
.signalr-status-card-main{display:flex;align-items:center;gap:11px;min-width:0}
.signalr-status-light{width:15px;height:15px;flex:0 0 15px;border-radius:50%;background:#ff5757;box-shadow:0 0 12px rgba(255,87,87,.7)}
.signalr-status-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.signalr-status-copy strong{font-family:Manrope,Inter,sans-serif;font-size:14px;font-weight:900;color:#fff;line-height:1.2}
.signalr-status-copy small{font-size:11px;font-weight:650;color:rgba(255,255,255,.68);line-height:1.35}
.signalr-status-retry{flex:0 0 auto;padding:8px 13px;border:1px solid rgba(255,87,87,.9);border-radius:999px;background:rgba(255,87,87,.15);color:#ffb2b2;font:800 12px Manrope,Inter,sans-serif;cursor:pointer}
.signalr-status-retry:hover{background:rgba(255,87,87,.25)}
.signalr-status-card.disconnected{border-color:rgba(255,87,87,.82);box-shadow:0 0 0 1px rgba(255,87,87,.12),0 0 18px rgba(255,87,87,.08)}
.signalr-status-card.connected{border-color:rgba(46,230,166,.46);background:rgba(7,54,48,.78)}
.signalr-status-card.connected .signalr-status-light{background:#2ee6a6;box-shadow:0 0 12px rgba(46,230,166,.75)}
.signalr-status-card.connected .signalr-status-retry{display:none}
@media(max-width:720px){.signalr-status-card{width:100%;min-width:0}.chat-room-panel-header-actions:has(.signalr-status-card){flex-wrap:wrap}.signalr-status-copy small{white-space:normal}}

/* Notification centre compact cards and non-stretching list */
.notification-list{align-content:start;grid-auto-rows:max-content}
.notification-card{min-height:0}
.notification-card-main{min-height:0;padding:10px 11px;grid-template-columns:auto 38px minmax(0,1fr);gap:9px}
.notification-card.read .notification-card-main{grid-template-columns:38px minmax(0,1fr);padding-left:28px}
.notification-avatar{width:38px;height:38px;font-size:12px}
.notification-avatar.company{font-size:18px}
.notification-card-main>span:last-child{gap:1px}
.notification-card-main strong{font-size:12px;line-height:1.25}
.notification-card-main small{font-size:11px;line-height:1.3}
.notification-card-main em{font-size:9px}
.notification-card-actions{padding:0 11px 8px}
.notification-card-actions button{font-size:10px;padding:3px 4px}

/* Quote response lifecycle parity */
.quote-response-card,
.quote-response-result { display: grid; gap: 12px; }
.quote-response-result > .detail-value-card { margin: 0; }
.quote-response-admin-card .quote-response-result { max-width: 760px; }

/* Kotlin parity: quote response result pills */
.lifecycle-pill.customer-completed {
    background: #69ff5e;
    color: #000;
    border-color: rgba(105, 255, 94, .78);
}
.lifecycle-pill.incomplete {
    color: #fff;
}

/* Tracking inner-card labels use the same readable hierarchy as Damage headings. */
.tracked-eta-values small,.tracked-data-values small,.tracked-damage-list small,.tracked-info-row small,.tracked-completion-notes small{color:rgba(255,255,255,.92);font-size:.86rem;font-weight:800;letter-spacing:0;text-transform:none}

/* PORTAL REVISION V113 - quote actions, tracking push parity and checklist summaries */
.job-action-grid > form {
    display: flex;
    margin: 0;
    min-width: 0;
}
.job-action-grid > a,
.job-action-grid > form > button {
    width: 100%;
    min-height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
}
.tracked-checklist-summary-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}
.tracked-checklist-summary-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(112, 210, 226, .14);
    background: rgba(3, 25, 31, .32);
}
.tracked-checklist-summary-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.tracked-checklist-summary-heading > div {
    display: grid;
    gap: 3px;
}
.tracked-checklist-summary-heading strong {
    color: #fff;
    font-weight: 900;
}
.tracked-checklist-summary-heading span,
.tracked-checklist-summary-heading em {
    color: rgba(255, 255, 255, .66);
    font-size: .82rem;
    font-style: normal;
    font-weight: 700;
}
.tracked-checklist-answer-list {
    display: grid;
    gap: 8px;
}
.tracked-checklist-answer-list > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
    gap: 12px;
    align-items: start;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .16);
}
.tracked-checklist-answer-list small {
    color: rgba(255, 255, 255, .72);
    font-weight: 750;
    line-height: 1.35;
}
.tracked-checklist-answer-list strong {
    color: #fff;
    font-weight: 900;
    text-align: right;
    overflow-wrap: anywhere;
}
@media(max-width: 620px) {
    .tracked-checklist-summary-heading,
    .tracked-checklist-answer-list > div {
        grid-template-columns: 1fr;
        display: grid;
    }
    .tracked-checklist-answer-list strong {
        text-align: left;
    }
}

/* PORTAL REVISION V99 - FINAL TRACKING / ENQUIRY POLISH */
.portal-table td.table-actions-cell {
    display: table-cell;
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}
.portal-table td.table-actions-cell .table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 14px;
}
.tracked-checklist-summary-heading span {
    display: none;
}

/* FIRST-TIME WORKSPACE WELCOME */
.workspace-selection-page-new-user {
    display: grid;
    place-items: start center;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding-top: 8px;
}

.workspace-welcome-card {
    width: min(100%, 880px);
    padding: 26px;
    border: 1px solid rgba(255,255,255,.20);
    border-radius: 26px;
    background: linear-gradient(160deg,rgba(255,255,255,.13),rgba(255,255,255,.055));
    box-shadow: 0 0 12px rgba(31,138,150,.18), 0 20px 50px rgba(0,0,0,.22);
}

.workspace-welcome-mascot {
    display: grid;
    place-items: center;
    width: 230px;
    height: 210px;
    margin: -8px auto 0;
    background: radial-gradient(circle,rgba(255,179,71,.46) 0%,rgba(255,158,44,.22) 42%,rgba(255,140,0,.08) 65%,transparent 74%);
}

.workspace-welcome-mascot img {
    width: 190px;
    height: 190px;
    object-fit: contain;
    filter: drop-shadow(0 14px 22px rgba(0,0,0,.24));
}

.workspace-welcome-heading {
    text-align: center;
}

.workspace-welcome-heading h2 {
    margin: 2px 0 8px;
    color: #fff;
    font-size: clamp(1.75rem,4vw,2.35rem);
    font-weight: 900;
}

.workspace-welcome-heading > p:last-child,
.workspace-welcome-footer {
    color: rgba(255,255,255,.72);
}

.workspace-welcome-options {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.workspace-welcome-option {
    display: grid;
    gap: 15px;
    padding: 17px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 22px;
    background: rgba(255,255,255,.055);
}

.workspace-welcome-option.create { box-shadow: 0 0 18px rgba(247,147,30,.14); }
.workspace-welcome-option.join { box-shadow: 0 0 18px rgba(31,138,150,.16); }
.workspace-welcome-option.track { box-shadow: 0 0 18px rgba(123,97,255,.17); }

.workspace-welcome-option-heading {
    display: grid;
    grid-template-columns: 44px minmax(0,1fr);
    gap: 14px;
    align-items: center;
}

.workspace-welcome-number {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    font: 900 15px var(--font-heading);
}

.workspace-welcome-option.create .workspace-welcome-number { border: 1px solid rgba(247,147,30,.65); background: rgba(247,147,30,.18); }
.workspace-welcome-option.join .workspace-welcome-number { border: 1px solid rgba(31,138,150,.75); background: rgba(31,138,150,.20); }
.workspace-welcome-option.track .workspace-welcome-number { border: 1px solid rgba(123,97,255,.75); background: rgba(123,97,255,.20); }

.workspace-welcome-option h3 {
    margin: 0 0 4px;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
}

.workspace-welcome-option p {
    margin: 0;
    color: rgba(255,255,255,.68);
    font-size: .83rem;
    line-height: 1.45;
}

.workspace-welcome-button {
    width: 100%;
    min-height: 56px;
    border-radius: 20px;
    color: #fff;
    font: 900 1rem var(--font-heading);
    cursor: pointer;
    transition: transform .12s ease,filter .12s ease;
}

.workspace-welcome-button:hover { filter: brightness(1.14); transform: translateY(-1px); }
.workspace-welcome-button:active { transform: scale(.98); }
.workspace-welcome-button.create { border: 2px solid #f7931e; background: linear-gradient(180deg,rgba(247,147,30,.28),rgba(247,147,30,.10)); box-shadow: 0 0 22px rgba(247,147,30,.30), inset 0 1px rgba(255,255,255,.14); }
.workspace-welcome-button.join { border: 2px solid #1f8a96; background: linear-gradient(180deg,rgba(31,138,150,.30),rgba(31,138,150,.10)); box-shadow: 0 0 22px rgba(31,138,150,.32), inset 0 1px rgba(255,255,255,.14); }
.workspace-welcome-button.track { border: 2px solid #7b61ff; background: linear-gradient(180deg,rgba(123,97,255,.30),rgba(123,97,255,.10)); box-shadow: 0 0 22px rgba(123,97,255,.34), inset 0 1px rgba(255,255,255,.14); }

.workspace-welcome-footer {
    margin: 18px 0 0;
    text-align: center;
    font-size: .78rem;
}

@media (max-width: 620px) {
    .workspace-selection-page-new-user { padding: 0; }
    .workspace-welcome-card { padding: 18px 14px; border-radius: 22px; }
    .workspace-welcome-mascot { width: 190px; height: 175px; }
    .workspace-welcome-mascot img { width: 160px; height: 160px; }
    .workspace-welcome-option { padding: 14px; }
}

/* PORTAL REVISION V72 - KOTLIN PARITY ADDRESS EDITOR */
.settings-address-editor {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.address-location-card,
.address-details-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 18px;
    background: rgba(13,47,54,0.72);
}

.address-location-card h4 {
    margin: 0;
    color: #fff;
    font: 800 1rem var(--font-heading);
}

.address-search-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
}

.address-search-tab {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    background: #1e3e45;
    color: #fff;
    font: 800 .82rem var(--font-heading);
    cursor: pointer;
    transition: background .25s ease, border-color .25s ease, color .25s ease, opacity .25s ease;
}

.address-search-tab.active {
    border-color: var(--color-cyan);
    background: var(--color-cyan);
    color: #06242a;
}

.address-search-tab.disabled,
.address-search-tab:disabled {
    color: rgba(255,255,255,.35);
    cursor: default;
}

.address-search-pane {
    display: grid;
    gap: 12px;
    animation: addressPaneIn .3s ease both;
}

.address-search-pane[hidden],
.address-search-pane > [hidden],
.address-searching[hidden],
.address-search-results[hidden],
.address-search-minimum[hidden],
.address-map-preview[hidden] {
    display: none !important;
}

.address-search-help,
.address-search-minimum {
    margin: 0;
    color: rgba(255,255,255,.70);
    font-size: .82rem;
    line-height: 1.45;
}

.address-search-minimum {
    color: rgba(255,255,255,.55);
    font-size: .76rem;
}

.address-searching {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 6px;
    color: rgba(255,255,255,.70);
    font-size: .82rem;
}

.address-search-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.18);
    border-top-color: var(--color-orange);
    border-radius: 50%;
    animation: addressSpinner .75s linear infinite;
}

.address-search-field {
    padding-top: 6px;
}

.address-search-field > span {
    color: var(--color-cyan);
}

.address-search-results {
    display: grid;
    gap: 6px;
    padding-top: 6px;
}

.address-results-heading {
    margin-bottom: 1px;
    color: var(--color-cyan);
    font: 800 .82rem var(--font-heading);
}

.address-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 14px;
    background: rgba(30,62,69,.78);
    color: #fff;
    text-align: left;
    cursor: pointer;
}

.address-suggestion:hover {
    border-color: rgba(53,214,255,.42);
    background: rgba(30,62,69,.98);
}

.address-suggestion-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.address-suggestion-copy strong {
    color: #fff;
    font: 700 .88rem var(--font-heading);
    line-height: 1.35;
}

.address-suggestion-copy small {
    color: rgba(255,255,255,.50);
    font-size: .7rem;
    line-height: 1.35;
}

.address-suggestion-select {
    flex: 0 0 auto;
    color: var(--color-orange);
    font: 800 .76rem var(--font-heading);
}

.address-coordinate-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
}

.address-apply-button {
    width: 100%;
}

.settings-address-editor .address-map-preview {
    min-height: 240px;
    height: 240px;
    border-radius: 28px;
    overflow: hidden;
}

.settings-address-editor .address-map-preview iframe,
.settings-address-editor .address-map-preview > div:not(.allocation-empty) {
    width: 100%;
    height: 240px;
}

.address-details-section,
.address-contact-section {
    display: grid;
    gap: 12px;
}

.address-details-section .section-header,
.address-contact-section .section-header {
    margin: 0;
}

.address-details-card {
    gap: 8px;
}

.address-contact-card {
    grid-template-columns: repeat(2,minmax(0,1fr));
}

.settings-address-editor.address-editor-loading .address-map-preview {
    position: relative;
    opacity: .72;
}

@keyframes addressSpinner {
    to { transform: rotate(360deg); }
}

@keyframes addressPaneIn {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 700px) {
    .address-coordinate-grid,
    .address-contact-card {
        grid-template-columns: 1fr;
    }
}

/* POCKET FREIGHT COMPACT JOB CARD PARITY */
.pf-job-card-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.pf-job-summary-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(53, 214, 255, 0.20);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.pf-job-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.pf-job-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.pf-company-logo {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 900;
}

.pf-company-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pf-job-title-block {
    min-width: 0;
}

.pf-job-title-block h3,
.pf-job-title-block p,
.pf-job-title-block small {
    margin: 0;
}

.pf-job-title-block h3 {
    overflow: hidden;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 850;
    line-height: 1.22;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pf-job-title-block p {
    margin-top: 2px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pf-job-title-block small {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.72rem;
    font-weight: 750;
}

.pf-pill-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.pf-job-top-pills {
    justify-content: flex-end;
}

.status-pill.pf-pill-job-type {
    border-color: rgba(144, 164, 174, 0.34);
    background: rgba(69, 90, 100, 0.88);
    color: #fff;
}

.status-pill.pf-pill-payment-type {
    border-color: rgba(144, 164, 174, 0.34);
    background: rgba(84, 110, 122, 0.90);
    color: #fff;
}

.pf-reference-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.pf-reference-grid > div,
.pf-summary-lines > div,
.pf-finance-details-panel {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(4, 24, 29, 0.26);
}

.pf-reference-grid > div {
    padding: 9px 11px;
}

.pf-reference-grid span,
.pf-summary-lines span,
.pf-finance-detail-line span,
.pf-finance-stage-row > div > span {
    display: block;
    margin-bottom: 3px;
    color: rgba(255, 255, 255, 0.54);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pf-reference-grid strong {
    display: block;
    overflow-wrap: anywhere;
    color: #fff;
    font-size: 0.79rem;
    line-height: 1.35;
}

.pf-summary-lines {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.pf-summary-lines-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pf-summary-lines > div {
    padding: 9px 11px;
}

.pf-summary-lines p {
    margin: 0;
    overflow-wrap: anywhere;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.78rem;
    line-height: 1.4;
}

.pf-stage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.pf-stage-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.035);
}

.pf-stage-card .cd-badge,
.pf-finance-stage-row .cd-badge {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.pf-stage-card-copy {
    min-width: 0;
}

.pf-stage-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.pf-stage-card-heading strong {
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
}

.pf-stage-card-heading .status-pill {
    min-height: 23px;
    padding: 3px 8px;
    font-size: 0.62rem;
}

.pf-stage-card p {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.75rem;
    line-height: 1.38;
}

.pf-stage-meta {
    display: flex;
    gap: 8px 12px;
    flex-wrap: wrap;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.68rem;
    font-weight: 700;
}

.pf-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.pf-enquiry-card .pf-summary-lines > div:first-child p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* PAPERWORK COMPACT DOCUMENT GRID */
.paperwork-job-card-compact {
    overflow: hidden;
}

.pf-paperwork-summary {
    display: grid;
    gap: 0;
}

.paperwork-document-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.paperwork-document-card {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    min-height: 190px;
    padding: 14px !important;
    border: 1px solid rgba(53, 214, 255, 0.18) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.045) !important;
}

.paperwork-stage-main {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.paperwork-stage-copy {
    min-width: 0;
}

.paperwork-stage-copy > strong {
    display: block;
    color: #fff;
    font-size: 0.86rem;
    line-height: 1.3;
}

.paperwork-stage-address {
    margin: 4px 0 8px !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: rgba(255, 255, 255, 0.68) !important;
    font-size: 0.76rem !important;
    line-height: 1.42 !important;
}

.paperwork-invoice-circle {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(53, 214, 255, 0.92);
    color: #062b34;
    font-size: 0.82rem;
    font-weight: 950;
}

.paperwork-document-actions-bottom {
    display: grid !important;
    gap: 7px;
    margin-top: auto;
}

.paperwork-button-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.paperwork-button-row form {
    margin: 0;
}

.paperwork-button-row .small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.72rem;
}

.primary-button.paperwork-collection-button:not(:disabled) {
    border-color: rgba(53, 214, 255, 0.52);
    background: #18bfe8;
    color: #062b34;
}

.primary-button.paperwork-delivery-button:not(:disabled) {
    border-color: rgba(247, 147, 30, 0.58);
    background: var(--color-orange);
    color: #152126;
}

.paperwork-blocked-pill {
    width: fit-content;
    max-width: 100%;
    min-height: 24px;
    white-space: normal !important;
    text-align: left;
}

.paperwork-footer-actions {
    display: flex !important;
    justify-content: flex-end !important;
    margin-top: 12px;
}

/* FINANCE JOB CARD PARITY */
.pf-finance-job-card {
    padding: 16px !important;
    border-radius: 22px !important;
    background: rgba(255, 255, 255, 0.045) !important;
}

.pf-finance-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.75fr);
    gap: 12px;
    margin-top: 14px;
    min-width: 0;
}

.pf-finance-details-panel {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 12px;
}

.pf-finance-detail-line {
    min-width: 0;
}

.pf-finance-detail-line strong {
    color: #fff;
    font-size: 0.8rem;
}

.pf-finance-reference-grid,
.pf-finance-details-panel .pf-summary-lines {
    margin-top: 0;
}

.pf-finance-stage-list {
    display: grid;
    gap: 7px;
}

.pf-finance-stage-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.025);
}

.pf-finance-stage-row p {
    margin: 0;
    overflow-wrap: anywhere;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.76rem;
    line-height: 1.4;
}

.pf-finance-money-panel {
    min-width: 0;
    align-self: stretch;
    padding: 12px !important;
    border-radius: 16px !important;
}

.pf-finance-money-panel .app-finance-money-row {
    min-height: 35px;
}

.pf-finance-job-card > .pf-card-actions {
    margin-top: 10px;
}

@media (max-width: 1100px) {
    .paperwork-document-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pf-finance-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .pf-job-summary-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .pf-job-top-pills {
        justify-content: flex-start;
    }

    .pf-stage-grid,
    .pf-reference-grid,
    .pf-summary-lines-inline,
    .paperwork-document-grid {
        grid-template-columns: 1fr;
    }

    .pf-job-title-block h3,
    .pf-job-title-block p {
        white-space: normal;
    }

    .pf-card-actions,
    .paperwork-footer-actions {
        width: 100%;
    }

    .pf-card-actions > *,
    .paperwork-footer-actions > * {
        flex: 1 1 auto;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .pf-job-summary-card,
    .pf-finance-job-card {
        padding: 12px !important;
        border-radius: 18px !important;
    }

    .pf-company-logo {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .paperwork-document-card {
        min-height: 0;
        padding: 12px !important;
    }

    .paperwork-button-row > *,
    .paperwork-button-row form,
    .paperwork-button-row form button {
        flex: 1 1 auto;
    }
}

/* FINANCE DETAILS STAY INSIDE ONE CLEAN CONTAINER */
.pf-finance-details-panel .pf-reference-grid > div,
.pf-finance-details-panel .pf-summary-lines > div {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.pf-finance-details-panel .pf-reference-grid,
.pf-finance-details-panel .pf-summary-lines {
    padding-top: 9px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.pf-finance-details-panel .pf-finance-stage-list {
    padding-top: 9px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.pf-finance-details-panel .pf-finance-stage-row {
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}


/* PORTAL REVISION V100 - MOBILE CARD PARITY */
.job-card-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    min-height: 24px;
    padding: 4px 10px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    font-family: var(--font-heading);
    font-size: .72rem;
    font-weight: 850;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}
.job-card-pill.completed,.job-card-pill.paid,.job-card-pill.customer-completed { background:#1e8e3e; color:#fff; }
.job-card-pill.incomplete { background:#b3261e; color:#fff; }
.job-card-pill.in-progress,.job-card-pill.customer-in-progress { background:var(--color-orange); color:#fff; }
.job-card-pill.allocated,.job-card-pill.customer-allocated { background:#1565c0; color:#fff; }
.job-card-pill.unallocated,.job-card-pill.customer-unallocated { background:#4a4a4a; color:#fff; }
.job-card-pill.enquiry { background:#ffb74d; color:#172126; }
.job-card-pill.quote { background:#7e57c2; color:#fff; }
.job-card-pill.live-job { background:#1565c0; color:#fff; }
.job-card-pill.not-sent { background:#6a1b9a; color:#fff; }
.job-card-pill.invoiced { background:#1565c0; color:#fff; }
.job-card-pill.due { background:#9a7b00; color:#fff; }
.job-card-pill.due-today { background:#c55f00; color:#fff; }
.job-card-pill.overdue,.job-card-pill.danger { background:#b3261e; color:#fff; }
.job-card-pill.warning { background:#8f6500; color:#fff; }
.job-card-pill.neutral { background:#546e7a; color:#fff; }
.job-card-pill.pf-pill-job-type { background:#455a64; color:#fff; }
.job-card-pill.pf-pill-payment-type { background:#546e7a; color:#fff; }

.pf-stage-card-heading .job-card-pill { min-height:22px; padding:3px 8px; font-size:.64rem; }

/* PAPERWORK DOCUMENT CARDS */
.paperwork-document-grid { align-items:start; gap:8px; }
.paperwork-document-card {
    min-height:0 !important;
    gap:10px !important;
    padding:12px !important;
    justify-content:flex-start !important;
}
.paperwork-stage-copy { flex:1 1 auto; }
.paperwork-stage-address { margin:3px 0 7px !important; line-height:1.35 !important; }
.paperwork-stage-status { margin-top:0 !important; }
.paperwork-document-actions-bottom { margin-top:2px !important; gap:6px !important; }
.paperwork-button-row { gap:6px; }
.paperwork-blocked-pill { margin-top:0 !important; font-size:.68rem; white-space:normal; }

/* CUSTOMER JOBS USE THE SAME CARD FAMILY */
.pf-customer-job-card { margin:0; }
.customer-job-card-list { display:grid; gap:12px; margin-top:14px; }
.customer-filter-tabs { display:none !important; }

@media(max-width:760px) {
    .job-card-pill { white-space:normal; text-align:center; }
}

.job-card-pill.open { background:#4a4a4a; color:#fff; }
.job-card-pill.active { background:var(--color-orange); color:#fff; }
.job-card-pill.collected { background:#18bfe8; color:#062b34; }

.paperwork-document-card .primary-button,
.paperwork-document-card .secondary-button { border-radius:999px; }
.paperwork-document-card .paperwork-collection-button:not(:disabled) { background:#18bfe8; color:#062b34; border-color:#18bfe8; }
.paperwork-document-card .paperwork-delivery-button:not(:disabled) { background:var(--color-orange); color:#172126; border-color:var(--color-orange); }
.paperwork-document-card form .primary-button:not(.paperwork-collection-button):not(.paperwork-delivery-button):not(:disabled) { background:var(--color-cyan); color:#062b34; border-color:var(--color-cyan); }


/* PORTAL REVISION V101 - PAPERWORK / FINANCE PARITY CLEANUP */
.job-card-pill.completed,.job-card-pill.customer-completed { background:#1e8e3e; color:#fff; }
.job-card-pill.paid { background:#4aa8ff; color:#fff; }

.paperwork-document-grid {
    align-items:stretch;
    gap:10px;
}
.paperwork-document-card {
    display:grid !important;
    grid-template-rows:auto auto 1fr;
    min-height:0 !important;
    padding:12px !important;
    gap:10px !important;
    align-content:start;
}
.paperwork-stage-main {
    display:grid !important;
    grid-template-columns:32px minmax(0,1fr);
    align-items:start !important;
    justify-content:stretch !important;
    gap:10px !important;
    flex-wrap:nowrap !important;
    width:100%;
}
.paperwork-stage-main .cd-badge,
.paperwork-invoice-circle {
    width:32px !important;
    height:32px !important;
    min-width:32px !important;
    margin:0 !important;
}
.paperwork-stage-copy {
    min-width:0;
    width:100%;
}
.paperwork-stage-copy > strong {
    margin:0;
    font-size:.84rem;
    line-height:1.25;
}
.paperwork-stage-address {
    margin:3px 0 0 !important;
    min-height:0 !important;
    font-size:.75rem !important;
    line-height:1.35 !important;
    overflow-wrap:anywhere;
    word-break:normal;
}
.paperwork-status-row {
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:6px;
    flex-wrap:wrap;
    min-width:0;
}
.paperwork-status-row .job-card-pill {
    min-height:22px;
    padding:3px 8px;
    font-size:.66rem;
}
.paperwork-blocked-pill {
    margin:0 !important;
    white-space:normal !important;
    text-align:left;
}
.paperwork-document-actions-bottom {
    display:flex !important;
    align-items:flex-end !important;
    justify-content:flex-end !important;
    align-self:end;
    width:100%;
    min-width:0;
    margin-top:0 !important;
    gap:0 !important;
}
.paperwork-button-row {
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:6px;
    flex-wrap:wrap;
    width:100%;
}
.paperwork-button-row form { margin:0; }
.paperwork-button-row .small {
    min-height:30px;
    padding:5px 10px;
    font-size:.70rem;
}

.create-job-total-card {
    border:1px solid rgba(53,214,255,.16);
    border-radius:18px;
    background:rgba(255,255,255,.045);
}
.create-job-total-card .section-header { margin-bottom:8px; }
.create-job-total-card h3 { margin:0; }
.create-job-finance-summary {
    padding:10px 12px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:14px;
    background:rgba(0,0,0,.08);
}
.create-job-finance-summary .app-finance-money-row { min-height:34px; }

@media(max-width:760px) {
    .paperwork-document-card { grid-template-rows:auto auto auto; }
    .paperwork-document-actions-bottom,
    .paperwork-button-row { justify-content:flex-end !important; }
    .paperwork-button-row > *,
    .paperwork-button-row form,
    .paperwork-button-row form button { flex:0 0 auto !important; }
}

/* PORTAL REVISION V102 - EXACT KOTLIN STATUS / STAGE COLOURS */
.job-card-pill.not-sent { background:#b066ff; color:#fff; }
.job-card-pill.due { background:#6d5b1f; color:#fff; }
.job-card-pill.due-today { background:#f57c00; color:#fff; }
.job-card-pill.overdue,.job-card-pill.danger { background:#b71c1c; color:#fff; }
.job-card-pill.collected { background:#42a5f5; color:#fff; }
.cd-badge.collection { background:#42a5f5; color:#fff; box-shadow:0 0 18px rgba(66,165,245,.24); }
.cd-badge.delivery { background:#ffa726; color:#fff; box-shadow:0 0 18px rgba(255,167,38,.24); }
.paperwork-document-card .paperwork-collection-button:not(:disabled) { background:#42a5f5; color:#fff; border-color:#42a5f5; }
.paperwork-document-card .paperwork-delivery-button:not(:disabled) { background:#ffa726; color:#fff; border-color:#ffa726; }


/* PORTAL REVISION V103 - DETACHED LISTS / PAPERWORK ACTION PINNING */
.pf-job-card-list,
.paperwork-list,
.app-finance-job-list {
    margin-top: 16px;
}

/* JOB CARDS SIT DIRECTLY ON THE PAGE BELOW THEIR TOOLBAR */
.dashboard-date-toolbar + .pf-job-card-list,
.dashboard-date-toolbar + .allocation-empty,
.finance-summary-grid + .app-finance-job-list,
.finance-summary-grid + .allocation-empty {
    margin-top: 16px;
}

/* PAPERWORK DOCUMENT CARDS FILL THE GRID CELL AND PIN ACTIONS TO THE BOTTOM RIGHT */
.paperwork-document-grid {
    align-items: stretch !important;
}
.paperwork-document-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
    align-self: stretch !important;
}
.paperwork-document-actions-bottom {
    display: flex !important;
    width: 100% !important;
    margin-top: auto !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    align-self: stretch !important;
}
.paperwork-button-row {
    width: auto !important;
    margin-left: auto !important;
    justify-content: flex-end !important;
}

/* DETACHED FINANCE JOB LIST - NO LARGE OUTER CARD */
.app-finance-job-list {
    display: grid;
    gap: 14px;
}

@media (max-width: 760px) {
    .pf-job-card-list,
    .paperwork-list,
    .app-finance-job-list {
        margin-top: 12px;
    }
}


/* PORTAL REVISION V104 - UNIFORM DETACHED JOB CARDS / EMPTY STATES */
/* ALL DETACHED JOB CARDS USE THE SAME PANEL BACKGROUND AS THE HEADER CARDS */
.pf-job-summary-card,
.pf-finance-job-card {
    background: var(--panel-bg) !important;
    border-color: var(--glass-border) !important;
    box-shadow: var(--shadow-soft), var(--shadow-cyan) !important;
    backdrop-filter: blur(18px);
}

/* EMPTY RESULTS USE A NORMAL CONTENT CARD WITH THE PLACEHOLDER INSIDE */
.pf-empty-state-card {
    margin-top: 16px;
    padding: 16px !important;
}

.pf-empty-state-card .allocation-empty {
    width: 100%;
    margin: 0;
}

/* CLIENT-SIDE FILTER EMPTY STATES SHOULD MATCH THE SAME DARK PANEL TREATMENT */
.pf-job-card-list > .allocation-empty.table-search-empty,
.app-finance-job-list > .allocation-empty.table-search-empty {
    border: 1px dashed rgba(255, 255, 255, 0.18);
    background: var(--panel-bg);
}

/* PORTAL REVISION V106 - JOB DETAIL / FINANCE FORM PARITY */
.job-form-section-label {
    margin: 4px 2px 0 !important;
}

.create-job-total-card,
.job-cost-summary-card {
    padding: 16px;
    border-radius: 20px;
}

.create-job-finance-summary {
    padding: 0;
    border: 0;
    background: transparent;
}

.job-finance-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.job-finance-summary .app-finance-money-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-width: 0;
    min-height: 52px;
    padding: 12px 14px;
}

.job-finance-summary .app-finance-money-row span {
    flex: 0 1 auto;
    min-width: 0;
    font-size: .82rem;
    white-space: nowrap;
}

.job-finance-summary .app-finance-money-row strong {
    flex: 0 0 auto;
    min-width: 0;
    font-size: 1.08rem;
    white-space: nowrap;
}

.job-finance-summary .app-finance-money-row.profit strong {
    font-size: 1.14rem;
}

.job-detail-summary-card {
    gap: 14px;
}

.job-detail-summary-header {
    margin-bottom: 2px;
}

.job-detail-info-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: rgba(0,0,0,.12);
}

.job-detail-info-panel > div {
    min-width: 0;
}

.job-detail-info-panel span:not(.job-card-pill),
.job-detail-stage-card > div > span {
    display: block;
    margin-bottom: 5px;
    color: rgba(255,255,255,.58);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.job-detail-info-panel strong {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.job-detail-stage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.job-detail-stage-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: rgba(0,0,0,.12);
}

.job-detail-stage-card strong {
    display: block;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.job-finance-card .section-header {
    margin-bottom: 0;
}

.job-action-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

@media (max-width: 760px) {
    .job-finance-summary,
    .job-detail-info-panel,
    .job-detail-stage-grid {
        grid-template-columns: 1fr;
    }

    .job-finance-summary .app-finance-money-row {
        min-height: 48px;
    }
}

/* PORTAL REVISION V122 - APP PRICING SUMMARY / MULTIPLE PRODUCT ENTRY PARITY */
.job-pricing-summary-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: rgba(0,0,0,.12);
}

.create-job-total-card.job-pricing-summary-card,
.multiple-product-finance-card.job-pricing-summary-card {
    padding: 12px;
}

.job-pricing-summary-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.job-pricing-summary-section > h3 {
    margin: 0;
    color: #fff;
    font-size: .82rem;
    font-weight: 800;
}

.job-pricing-summary-row,
.ftcoin-receipt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 30px;
}

.job-pricing-summary-row span,
.ftcoin-receipt-row span {
    color: rgba(255,255,255,.65);
    font-size: .82rem;
    font-weight: 600;
}

.job-pricing-summary-row strong,
.ftcoin-receipt-row strong {
    color: #fff;
    font-size: .96rem;
    font-weight: 700;
}

.job-pricing-summary-row.vat strong,
.ftcoin-receipt-row.cost strong {
    color: var(--orange, #ff9f43);
}

.job-pricing-summary-row.cost strong {
    color: #ff6b6b;
}

.job-pricing-summary-row.total span,
.job-pricing-summary-row.total strong,
.job-pricing-summary-row.profit span,
.job-pricing-summary-row.profit strong,
.ftcoin-receipt-row.after span,
.ftcoin-receipt-row.after strong {
    font-weight: 800;
}

.job-pricing-summary-row.profit strong {
    color: #52d273;
}

.job-pricing-summary-divider {
    height: 1px;
    width: 100%;
    background: rgba(255,255,255,.08);
}

.ftcoin-receipt-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ftcoin-receipt-card > h3 {
    margin: 0 0 2px;
    font-size: .82rem;
}

.multiple-product-modal {
    z-index: 2500;
}

.multiple-product-dialog {
    width: min(760px, calc(100vw - 28px));
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.multiple-product-info,
.multiple-product-equivalent {
    margin: 0;
    color: rgba(255,255,255,.70);
    font-size: .78rem;
    font-weight: 600;
}

.multiple-product-inner-card {
    margin: 0;
}

.multiple-product-pricing-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.multiple-product-actions {
    position: sticky;
    bottom: -1px;
    margin-top: 2px;
    padding-top: 12px;
    background: var(--panel-bg);
}

@media (max-width: 640px) {
    .multiple-product-pricing-tabs {
        grid-template-columns: 1fr;
    }
}


/* PORTAL REVISION V123 - SHARED APP-STYLE FORM HEADERS / BUTTONS / MULTI-PRICING TABS */
.pf-form-section-title {
    margin: 4px 2px 0;
    color: rgba(255,255,255,.85);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.primary-button,
.secondary-button,
.danger-button,
.pocket-freight-button {
    min-height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-size: .95rem;
    font-weight: 800;
    line-height: 1.15;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.danger-button,
.pocket-freight-button.danger {
    border: 1px solid rgba(255,82,82,.72) !important;
    background: linear-gradient(145deg, rgba(220,38,38,.62), rgba(153,27,27,.50)) !important;
    color: #fff !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 0 20px rgba(239,68,68,.22), 0 10px 26px rgba(0,0,0,.22) !important;
}

.danger-button:hover,
.pocket-freight-button.danger:hover {
    border-color: rgba(255,110,110,.92) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 28px rgba(239,68,68,.30), 0 12px 30px rgba(0,0,0,.26) !important;
}

.stage-edit-actions > .primary-button,
.stage-edit-actions > .danger-button {
    min-height: 46px;
    font-size: .95rem;
}

.multiple-product-pricing-tab {
    width: 100%;
    min-height: 52px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 999px;
    background: #1e3e45;
    color: #fff;
    font-family: var(--font-heading);
    font-size: .95rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.multiple-product-pricing-tab.selected {
    border-color: #1F8A96;
    background: #1F8A96;
    color: #fff;
    box-shadow: 0 0 22px rgba(31,138,150,.28);
}


/* Notification profile photo parity */
.notification-avatar{overflow:hidden}
.notification-avatar img{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%}


/* DATE RANGE FILTERS */
.date-range-form { display:flex; align-items:flex-end; gap:10px; flex-wrap:wrap; }
.date-filter-field { display:flex; flex-direction:column; gap:5px; margin:0; }
.date-filter-field > span { font-size:0.78rem; font-weight:700; color:var(--muted, #64748b); text-transform:none; letter-spacing:0; }
.date-filter-field input[type="date"] { min-width:150px; }
@media (max-width: 760px) { .date-range-form, .toolbar-actions { align-items:stretch; } .date-filter-field { width:100%; } .date-filter-field input[type="date"] { width:100%; min-width:0; } }

/* EMAIL PAPERWORK DIALOG */
.paperwork-email-dialog .paperwork-email-form { margin-top: 8px; gap: 14px; }
.paperwork-dialog-section-heading { margin: 0 0 8px; text-transform:none !important; letter-spacing:normal !important; }
.paperwork-email-dialog .paperwork-email-section { margin-top:0; }


/* PORTAL REVISION V63 - CONSISTENT TWO-ROW FILTER HEADERS */
.pf-filter-toolbar {
    padding: 20px 24px;
}

.pf-filter-toolbar-form {
    display: grid;
    gap: 14px;
}

.pf-filter-toolbar-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
}

.pf-filter-toolbar-summary {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    min-width: 0;
}

.pf-filter-toolbar-summary .eyebrow {
    margin-bottom: 5px;
}

.pf-filter-toolbar-summary h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.2rem, 1.8vw, 1.55rem);
    line-height: 1.15;
}

.pf-filter-toolbar-summary .badge-soft {
    margin-bottom: 2px;
    white-space: nowrap;
}

.pf-filter-toolbar-dates {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex: 0 0 auto;
}

.pf-filter-toolbar-dates .date-filter-field {
    gap: 6px;
}

.pf-filter-toolbar .date-filter-field > span,
.pf-allocation-filter-header .date-filter-field > span {
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    opacity: .9;
}

.pf-filter-toolbar-dates input[type="date"] {
    min-width: 205px;
    min-height: 48px;
}

.pf-filter-toolbar-bottom {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
}

.pf-filter-toolbar-bottom select {
    min-width: 205px;
    min-height: 48px;
}

.pf-filter-toolbar-bottom .pf-filter-toolbar-search {
    flex: 1 1 300px;
    min-width: 240px;
    min-height: 48px;
}

.pf-filter-toolbar-bottom .inline-refresh-form,
.pf-filter-toolbar-bottom > .secondary-button,
.pf-filter-toolbar-bottom > .primary-button {
    flex: 0 0 auto;
}

.pf-allocation-filter-header {
    display: grid;
    gap: 14px;
}

.pf-allocation-status-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

@media (max-width: 980px) {
    .pf-filter-toolbar-top {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .pf-filter-toolbar-dates {
        width: 100%;
    }

    .pf-filter-toolbar-dates .date-filter-field {
        flex: 1 1 0;
    }

    .pf-filter-toolbar-dates input[type="date"] {
        width: 100%;
        min-width: 0;
    }

    .pf-filter-toolbar-bottom {
        flex-wrap: wrap;
    }

    .pf-filter-toolbar-bottom select {
        flex: 1 1 200px;
    }
}

@media (max-width: 620px) {
    .pf-filter-toolbar {
        padding: 17px;
    }

    .pf-filter-toolbar-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .pf-filter-toolbar-dates {
        flex-direction: column;
        gap: 10px;
    }

    .pf-filter-toolbar-dates .date-filter-field,
    .pf-filter-toolbar-bottom > *,
    .pf-filter-toolbar-bottom .inline-refresh-form,
    .pf-allocation-status-row > * {
        width: 100%;
    }

    .pf-filter-toolbar-bottom {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .pf-filter-toolbar-bottom .pf-filter-toolbar-search {
        min-width: 0;
        flex-basis: auto;
    }

    .pf-allocation-status-row {
        align-items: stretch;
        flex-direction: column;
    }
}

/* PORTAL REVISION V64 - COMPACT FILTER CONTROL PARITY */
@media (min-width: 981px) {
    .pf-filter-toolbar-bottom select,
    .pf-filter-toolbar-bottom .table-filter-select {
        flex: 0 0 225px;
        width: 225px;
        min-width: 225px;
        max-width: 225px;
    }

    .pf-filter-toolbar-bottom .pf-filter-toolbar-search,
    .pf-filter-toolbar-bottom .table-search-input.pf-filter-toolbar-search {
        flex: 0 1 350px;
        width: 350px;
        min-width: 280px;
        max-width: 350px;
    }

    .pf-filter-toolbar-bottom .inline-refresh-form,
    .pf-filter-toolbar-bottom > .secondary-button,
    .pf-filter-toolbar-bottom > .primary-button {
        flex: 0 0 auto;
    }
}

@media (min-width: 621px) and (max-width: 980px) {
    .pf-filter-toolbar-bottom select,
    .pf-filter-toolbar-bottom .table-filter-select {
        flex: 0 1 225px;
        width: 225px;
        min-width: 190px;
        max-width: 225px;
    }

    .pf-filter-toolbar-bottom .pf-filter-toolbar-search,
    .pf-filter-toolbar-bottom .table-search-input.pf-filter-toolbar-search {
        flex: 1 1 300px;
        width: auto;
        min-width: 240px;
        max-width: none;
    }
}

/* PORTAL REVISION V120 - FILTER HEADER CONTENT SPACING PARITY */
/* LET THE PORTAL CONTENT GRID OWN THE GAP BELOW FILTER HEADERS. */
/* THIS MATCHES THE ADMIN DASHBOARD CHART-TO-HEADER SPACING WITHOUT STACKING EXTRA MARGINS. */
.portal-content > .pf-filter-toolbar + .pf-job-card-list,
.portal-content > .pf-filter-toolbar + .pf-empty-state-card,
.portal-content > .pf-filter-toolbar + .paperwork-list,
.portal-content > .pf-filter-toolbar + .finance-summary-grid,
.portal-content > .pf-filter-toolbar + .app-finance-job-list,
.portal-content > .pf-filter-toolbar + .completed-checklist-layout,
.portal-content > .pf-filter-toolbar + .allocation-empty {
    margin-top: 0 !important;
}

/* FINANCE IS ALSO A STACK OF DIRECT PAGE SECTIONS, SO DO NOT ADD AN EXTRA
   BOTTOM/TOP MARGIN ON TOP OF THE PORTAL GRID GAP. */
.portal-content > .finance-summary-grid {
    margin-bottom: 0 !important;
}

.portal-content > .finance-summary-grid + .app-finance-job-list,
.portal-content > .finance-summary-grid + .pf-empty-state-card,
.portal-content > .finance-summary-grid + .allocation-empty {
    margin-top: 0 !important;
}

/* PORTAL REVISION V121 - TIGHTER FILTER-TO-CONTENT SPACING */
/* KEEP THE NORMAL 24PX PAGE SECTION RHYTHM ELSEWHERE, BUT PULL CONTENT
   IMMEDIATELY FOLLOWING THE NEW FILTER HEADERS CLOSER TO THE HEADER. */
.portal-content > .pf-filter-toolbar {
    margin-bottom: -10px !important;
}

/* PORTAL REVISION V121 - COMPACT WORKSPACE CARDS */
/* FIT MORE WORKSPACES PER ROW AND REMOVE THE OVERSIZED CARD/LOGO TREATMENT. */
.workspace-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 320px));
    justify-content: start;
    gap: 14px;
}

.workspace-card {
    gap: 10px;
    padding: 14px;
    border-radius: 20px;
}

.workspace-logo-wrap {
    height: 120px;
    padding: 10px;
    border-radius: 15px;
}

.workspace-card-copy h3 {
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.workspace-card .primary-button.wide,
.workspace-card .secondary-button.wide {
    min-height: 44px;
}

@media (max-width: 980px) {
    .workspace-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 620px) {
    .portal-content > .pf-filter-toolbar {
        margin-bottom: -6px !important;
    }

    .workspace-card-grid {
        grid-template-columns: 1fr;
    }
}


/* PORTAL REVISION V122 - WORKSPACE GRID ALIGNMENT */
/* USE THE SAME COLUMN RHYTHM FOR SEARCH/ACTIONS AND WORKSPACE CARDS. */
.workspace-tools-row {
    grid-template-columns: repeat(4, minmax(280px, 320px));
    justify-content: start;
    align-items: end;
    gap: 14px;
}

.workspace-tools-row > .workspace-action-button {
    width: 100%;
}

@media (max-width: 1380px) {
    .workspace-tools-row {
        grid-template-columns: repeat(2, minmax(280px, 320px));
    }
}

@media (max-width: 720px) {
    .workspace-tools-row {
        grid-template-columns: 1fr;
    }
}

/* PORTAL REVISION V124 - WORKSPACE PAGE CONTAINMENT / BALANCED EDGE PADDING */
/* LET THE GRID ITEM STRETCH NATURALLY INSTEAD OF ADDING AN EXPLICIT 100% WIDTH,
   WHICH CAN LEAVE THE WORKSPACE PANEL LOOKING FLUSH AGAINST THE RIGHT EDGE. */
.workspace-selection-page:not(.workspace-selection-page-new-user) {
    width: auto !important;
    min-width: 0;
    max-width: 100%;
    justify-self: stretch;
    margin-inline: 0;
    padding-left: 30px;
    padding-right: 30px;
    overflow: hidden;
}

.workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-tools-row,
.workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-card-grid {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 980px) {
    .workspace-selection-page:not(.workspace-selection-page-new-user) {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* PORTAL REVISION V125 - WORKSPACE FLUID GRID PARITY */
/* ONE FLUID LAYOUT SYSTEM: ACTIONS FILL FOUR EQUAL COLUMNS, WORKSPACE CARDS
   FILL THREE EQUAL COLUMNS. BOTH SHARE THE SAME CONTAINER EDGES AND GAP. */
.workspace-selection-page:not(.workspace-selection-page-new-user) {
    box-sizing: border-box;
    overflow: visible;
}

.workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-tools-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    min-width: 0;
    margin-bottom: 18px;
}

.workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-tools-row > * {
    min-width: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-search-group,
.workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-search,
.workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-action-button {
    min-width: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    min-width: 0;
    max-width: none;
    justify-content: stretch;
}

.workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
}

.workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-card form,
.workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-card form .wide {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 1180px) {
    .workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-tools-row,
    .workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-tools-row,
    .workspace-selection-page:not(.workspace-selection-page-new-user) .workspace-card-grid {
        grid-template-columns: 1fr;
    }
}

/* PORTAL REVISION V123 - ANDROID CARD / PILL PARITY */
.auth-body {
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.16), transparent 24%),
        radial-gradient(circle at 82% 82%, rgba(247, 147, 30, 0.42), transparent 34%),
        radial-gradient(circle at 74% 26%, rgba(53, 214, 255, 0.20), transparent 30%),
        radial-gradient(circle at 54% 70%, rgba(0, 229, 168, 0.14), transparent 28%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.075) 0, rgba(255, 255, 255, 0.075) 1px, transparent 1px, transparent 58px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.052) 0, rgba(255, 255, 255, 0.052) 1px, transparent 1px, transparent 58px),
        linear-gradient(145deg, #71878d 0%, #0e454d 27%, #062b32 55%, #071c22 100%);
    background-attachment: fixed;
}

.job-card-pill {
    --pill-rgb: 84, 110, 122;
    border: 1px solid rgba(var(--pill-rgb), .70) !important;
    background: rgba(var(--pill-rgb), .28) !important;
    color: #fff !important;
}
.job-card-pill.pf-pill-white { --pill-rgb: 255, 255, 255; }
.job-card-pill.created { --pill-rgb: 255, 255, 255; }
.job-card-pill.unallocated,.job-card-pill.customer-unallocated,.job-card-pill.open { --pill-rgb: 74, 74, 74; }
.job-card-pill.allocated { --pill-rgb: 126, 87, 194; }
.job-card-pill.customer-allocated,.job-card-pill.paid { --pill-rgb: 74, 168, 255; }
.job-card-pill.in-progress { --pill-rgb: 41, 182, 246; }
.job-card-pill.customer-in-progress { --pill-rgb: 255, 183, 77; }
.job-card-pill.completed { --pill-rgb: 102, 187, 106; }
.job-card-pill.customer-completed { --pill-rgb: 105, 255, 94; }
.job-card-pill.cancelled,.job-card-pill.danger,.job-card-pill.incomplete,.job-card-pill.overdue { --pill-rgb: 239, 83, 80; }
.job-card-pill.enquiry { --pill-rgb: 255, 183, 77; }
.job-card-pill.quote,.job-card-pill.not-sent { --pill-rgb: 176, 102, 255; }
.job-card-pill.live-job,.job-card-pill.invoiced { --pill-rgb: 53, 216, 255; }
.job-card-pill.collection,.job-card-pill.collected { --pill-rgb: 66, 165, 245; }
.job-card-pill.delivery { --pill-rgb: 255, 167, 38; }
.job-card-pill.warning,.job-card-pill.due { --pill-rgb: 255, 183, 77; }
.job-card-pill.due-today { --pill-rgb: 245, 124, 0; }
.job-card-pill.neutral { --pill-rgb: 84, 110, 122; }
.job-card-pill.allocated-user { --pill-rgb: 247, 147, 30; }
.job-card-pill.pf-pill-job-type,.job-card-pill.pf-pill-payment-type { --pill-rgb: 255, 255, 255; }

.pf-stage-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}

.pf-stage-card-heading-row,
.paperwork-stage-heading-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pf-stage-card-heading-row strong,
.paperwork-stage-heading-row strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #fff;
    font-family: var(--font-heading);
    font-size: .84rem;
    font-weight: 850;
}

.pf-stage-pill-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pf-stage-address-panel,
.customer-finance-stage-details {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    background: rgba(255,255,255,.055);
}

.pf-stage-address-panel > span,
.customer-finance-stage-details .pf-finance-detail-line > span {
    display: block;
    margin-bottom: 3px;
    color: rgba(255,255,255,.62);
    font-family: var(--font-heading);
    font-size: .66rem;
    font-weight: 850;
    letter-spacing: .02em;
    text-transform: none;
}

.pf-stage-address-panel p {
    margin: 0 !important;
    color: rgba(255,255,255,.92) !important;
    font-size: .78rem !important;
    font-weight: 650;
    line-height: 1.4 !important;
}

.paperwork-document-card {
    grid-template-rows: auto auto auto 1fr !important;
}

.paperwork-stage-address-panel {
    width: 100%;
}

.customer-paperwork-stage-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.customer-paperwork-stage-card {
    min-width: 0;
}

.customer-paperwork-documents {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.paperwork-sent-copy {
    margin: 0;
    color: rgba(255,255,255,.55);
    font-size: .70rem;
    font-weight: 600;
}

.customer-finance-stage-details {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.customer-finance-stage-details .pf-finance-detail-line {
    padding: 0;
    border: 0;
}

.customer-finance-stage-details .pf-finance-detail-line strong {
    display: block;
    color: rgba(255,255,255,.92);
    line-height: 1.4;
}

@media (max-width: 760px) {
    .customer-paperwork-stage-list {
        grid-template-columns: 1fr;
    }
}
