: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);
}

.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;
}

.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: #06242a;
    background: linear-gradient(145deg, var(--color-green), var(--color-cyan));
    box-shadow: 0 12px 28px rgba(53, 214, 255, 0.22);
}

.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%, 300px);
}

.auth-provider-stack .secondary-button {
    width: 100%;
}

.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%;
    bottom: 96px;
    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;
}

.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 {
    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: linear-gradient(135deg, rgba(180, 91, 210, 0.95), rgba(53, 214, 255, 0.55));
    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;
    }
}


/* 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 */
.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;
}

.portal-brand-logo-glow {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
}

.portal-brand-logo-glow::before {
    content: "";
    position: absolute;
    inset: -12px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(53, 214, 255, 0.42) 0%, rgba(31, 138, 150, 0.18) 46%, rgba(53, 214, 255, 0) 74%);
    filter: blur(4px);
}

.portal-brand-logo-glow img,
.portal-brand img {
    position: relative;
    width: 64px !important;
    height: 64px !important;
    object-fit: contain;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    filter: drop-shadow(0 0 10px rgba(53, 214, 255, 0.62));
}

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-brand-logo-glow {
    width: 82px !important;
    height: 82px !important;
}

.portal-brand-logo-glow::before {
    inset: -14px !important;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.24) 44%, rgba(255, 255, 255, 0) 74%) !important;
}

.portal-brand-logo-glow img,
.portal-brand img {
    width: 74px !important;
    height: 74px !important;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.72)) !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-maintenance-logo-glow {
    width: 142px !important;
    height: 142px !important;
    margin-bottom: 4px;
}

.portal-maintenance-logo-glow::before {
    inset: -24px !important;
    background: radial-gradient(circle, rgba(53, 214, 255, 0.58) 0%, rgba(31, 138, 150, 0.28) 42%, rgba(53, 214, 255, 0) 74%) !important;
    filter: blur(7px) !important;
}

.portal-maintenance-logo-glow 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-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: 10px;
    margin-bottom: -48px;
    transform: translateY(48px);
}

.chat-message:has(.chat-reactions) {
    margin-bottom: 44px;
}

.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);
}

.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;
    }
}
