﻿/* ==========================================
   CARRIER DASHBOARD â€“ Premium Workspace
   ========================================== */

/* Global hidden utility */
.hidden { display: none !important; }

/* Hide number input spinners globally */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
    -webkit-appearance: textfield;
    appearance: textfield;
}

/* Layout */
.dash-layout {
    display: flex;
    min-height: 100vh;
    opacity: 0;
    transition: opacity 0.3s ease;
    --dash-sidebar-width: 240px;
    --dash-sidebar-collapsed-width: 74px;
    --dash-sidebar-current-width: var(--dash-sidebar-width);
    /* â”€â”€ Design Tokens â”€â”€ */
    --dash-radius-xs: 6px;
    --dash-radius-sm: 8px;
    --dash-radius-md: 10px;
    --dash-radius-lg: 12px;
    --dash-radius-pill: 999px;
    --dash-shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --dash-shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    --dash-shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --dash-shadow-lg: 0 8px 32px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --dash-shadow-xl: 0 16px 48px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
    --dash-transition: 0.2s ease;
    --dash-focus-ring: 0 0 0 2px rgba(99,102,241,0.15);
    --dash-border-color: rgba(0,0,0,0.06);
    --dash-hover-bg: rgba(79,70,229,0.04);
    /* â”€â”€ Component Tokens â”€â”€ */
    --dash-card-radius: var(--dash-radius-lg);
    --dash-card-header-padding: 0.9375rem 1.25rem;
    --dash-card-body-padding: 1.25rem;
    --dash-card-table-padding: 1rem 0.5rem 0;
    --dash-toolbar-gap: 0.5rem;
    --dash-control-height: 26px;
    --dash-control-font-size: 0.68rem;
    --dash-search-width: 190px;
    --dash-status-filter-width: 105px;
    --dash-fuel-filter-width: 86px;
    --dash-add-button-width: 124px;
    --dash-import-button-width: 86px;
}
.dash-layout.ready {
    opacity: 1;
    --dash-table-font-size: 0.6875rem;
    --dash-table-head-font-size: 0.625rem;
    --dash-row-height: 34px;
    --dash-cell-min-height: 32px;
    --dash-action-column-width: 52px;
    --dash-action-button-size: 22px;
    background: #f5f6fa;
    background-attachment: fixed;
}

/* Work Orders */
.wo-app {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wo-hero {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.wo-hero-actions,
.wo-toolbar-group,
.wo-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wo-toolbar {
    align-items: flex-end;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
}

.wo-filter {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gray-500);
}

.wo-filter .form-select-sm {
    min-width: 140px;
    height: 30px;
    padding: 0 1.75rem 0 0.55rem;
    font-size: 0.7rem;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
}

.wo-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
}

.wo-category-costs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wo-category-costs-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    color: var(--gray-900);
    font-size: 0.72rem;
}

.wo-category-costs-head span {
    color: var(--gray-500);
    font-size: 0.7rem;
}

.wo-cost-table th:not(:first-child),
.wo-cost-table td:not(:first-child) {
    text-align: right;
}

.wo-cost-table th:first-child,
.wo-cost-table td:first-child {
    min-width: 190px;
}

.wo-cost-table td:last-child {
    color: var(--gray-900);
}

.wo-cost-table {
    font-size: 0.7rem;
}

.wo-cost-table th,
.wo-cost-table td {
    padding: 0.42rem 0.65rem;
}

.wo-cost-table th {
    font-size: 0.58rem;
}

.wo-summary-card {
    padding: 0.65rem 0.75rem;
    border-right: 1px solid var(--gray-200);
    background: #fff;
}

.wo-summary-card:last-child {
    border-right: 0;
}

.wo-summary-card span {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-400);
}

.wo-summary-card strong {
    font-size: 1rem;
    color: var(--gray-900);
}

.wo-table-wrap {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    background: #fff;
}

.wo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
}

.wo-table th,
.wo-table td {
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    text-align: left;
    vertical-align: middle;
}

.wo-table th {
    font-size: 0.63rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gray-500);
    background: rgba(79, 70, 229, 0.03);
}

.wo-number {
    font-weight: 700;
    color: var(--gray-900);
}

.wo-small {
    margin-top: 0.15rem;
    font-size: 0.72rem;
    color: var(--gray-500);
}

.wo-status {
    display: inline-flex;
    align-items: center;
    padding: 0.26rem 0.65rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
}

.wo-status--green { background: rgba(16, 185, 129, 0.12); color: #059669; }
.wo-status--amber { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.wo-status--blue { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.wo-status--gray { background: rgba(107, 114, 128, 0.12); color: #6b7280; }
.wo-status--slate { background: rgba(100, 116, 139, 0.12); color: #475569; }

.wo-empty {
    text-align: center;
    color: var(--gray-500);
    padding: 1.5rem 1rem;
}

.wo-row-actions {
    text-align: right;
}

.wo-modal {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem 0.75rem;
}

.wo-modal.hidden {
    display: none;
}

.wo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(4px);
}

.wo-modal-panel {
    position: relative;
    z-index: 1;
    width: 96vw;
    max-width: 1100px;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--dash-radius-lg);
    background: #fff;
    box-shadow: var(--dash-shadow-xl);
}

.wo-modal-panel.wo-preview-open {
    width: 98vw;
    max-width: 1600px;
}

.wo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1.1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    flex-shrink: 0;
}

.wo-modal-header h2 {
    margin: 0;
    color: var(--gray-900);
    font-size: 0.9rem;
    font-weight: 700;
}

.wo-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.wo-modal-close {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--dash-radius-sm);
    background: transparent;
    color: var(--gray-400);
    font-size: 1.15rem;
    cursor: pointer;
}

.wo-modal-close:hover {
    color: var(--gray-700);
    background: rgba(0, 0, 0, 0.06);
}

.wo-modal-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.wo-preview-pane {
    width: min(44vw, 640px);
    min-width: 340px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid #dbe3ee;
    background: #eef3f9;
}

.wo-preview-pane.hidden {
    display: none;
}

.wo-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid #dbe3ee;
    background: #fff;
}

.wo-preview-title-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.wo-preview-title {
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wo-preview-file {
    max-width: 360px;
    overflow: hidden;
    color: #64748b;
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wo-preview-close {
    padding: 0 0.2rem;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.wo-preview-close:hover { color: #334155; }

.wo-preview-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.45rem 0.7rem;
    border-bottom: 1px solid #dbe3ee;
    background: #f8fafc;
}

.wo-preview-progress-track {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.wo-preview-progress-bar {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: #3b82f6;
    transition: width 0.25s ease, background 0.25s ease;
}

.wo-preview-progress-bar.is-done { background: #10b981; }
.wo-preview-progress-bar.is-error { background: #ef4444; }

.wo-preview-status {
    min-height: 1em;
    color: #64748b;
    font-size: 0.68rem;
}

.wo-preview-status.is-error { color: #b91c1c; }

.wo-preview-mount {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0.65rem;
}

.wo-preview-mount iframe,
.wo-preview-mount img {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    border-radius: 8px;
    background: #fff;
}

.wo-preview-mount img {
    object-fit: contain;
}

.wo-modal-nav {
    width: 130px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0.6rem 0;
    overflow-y: auto;
    border-right: 1px solid rgba(0, 0, 0, 0.07);
    background: #f8fafc;
}

.wo-modal-nav a {
    display: block;
    padding: 0.42rem 0.75rem;
    border-left: 2px solid transparent;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.wo-modal-nav a:hover,
.wo-modal-nav a:focus {
    color: #374151;
    background: rgba(0, 0, 0, 0.04);
    outline: none;
}

.wo-modal-nav a.is-active {
    color: #4f46e5;
    border-left-color: #4f46e5;
    background: rgba(79, 70, 229, 0.05);
}

.wo-form {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 0.9rem 1rem;
    background: #f5f7fb;
    scroll-behavior: smooth;
}

.wo-ai-reader-status {
    min-height: 1em;
    padding-top: 0.35rem;
    color: var(--gray-500);
    font-size: 0.7rem;
    line-height: 1.4;
}

.wo-ai-reader-status.is-error {
    color: #b91c1c;
}

.wo-ai-dropzone {
    min-height: 58px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.6rem 0.75rem;
    border: 1.5px dashed #c7d2fe;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8faff 0%, #f3f6ff 100%);
    cursor: pointer;
    transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}

.wo-ai-dropzone:hover,
.wo-ai-dropzone:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.13);
}

.wo-ai-dropzone.drag-over {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.wo-ai-dropzone.is-reading {
    border-style: solid;
    border-color: #93c5fd;
    background: linear-gradient(180deg, #eff6ff 0%, #e9f2ff 100%);
    cursor: wait;
}

.wo-ai-drop-main {
    color: #1e293b;
    font-size: 0.75rem;
    font-weight: 700;
}

.wo-ai-drop-sub {
    color: #64748b;
    font-size: 0.7rem;
}

.wo-grid {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.wo-grid--last { margin-bottom: 0; }

.wo-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wo-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wo-field {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.wo-field > span {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
}

#woModal .wo-field > input,
#woModal .wo-field > select,
#woModal .wo-field > textarea,
#woModal .wo-inline-add > input {
    width: 100%;
    min-height: 30px;
    box-sizing: border-box;
    padding: 0.32rem 0.45rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font-family: inherit;
    font-size: 0.78rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#woModal .wo-field > input:focus,
#woModal .wo-field > select:focus,
#woModal .wo-field > textarea:focus,
#woModal .wo-inline-add > input:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

#woModal .wo-field > input[readonly] {
    color: #64748b;
    background: #f8fafc;
}

.wo-field--full {
    margin-top: 0.3rem;
}

.wo-inline-add {
    display: flex;
    gap: 0.45rem;
}

.wo-section {
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.75rem 0.75rem;
    scroll-margin-top: 0.5rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #dde4ee;
}

.wo-section:last-child { margin-bottom: 0; }
.wo-section:target {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.wo-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #e7edf5;
    color: #64748b;
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wo-section-head .btn {
    min-height: 24px;
    padding: 0 0.55rem;
    font-size: 0.66rem;
    text-transform: none;
    letter-spacing: 0;
}

.wo-line-table-wrap {
    border-radius: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid rgba(29, 28, 29, 0.10);
    background: #fff;
}

.wo-line-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.67rem;
}

.wo-line-table th,
.wo-line-table td {
    padding: 0.16rem 0.32rem;
    border-bottom: 1px solid rgba(29, 28, 29, 0.08);
    vertical-align: middle;
    text-align: left;
}

.wo-line-table th {
    height: 23px;
    font-size: 0.54rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    color: #8a8f98;
    background: #f8fafc;
}

#wo-s-labor .wo-line-table th:nth-child(1) { width: auto; }
#wo-s-labor .wo-line-table th:nth-child(2) { width: 126px; }
#wo-s-labor .wo-line-table th:nth-child(3) { width: 76px; }
#wo-s-labor .wo-line-table th:nth-child(4) { width: 72px; }
#wo-s-labor .wo-line-table th:nth-child(5) { width: 86px; }
#wo-s-labor .wo-line-table th:nth-child(6) { width: 32px; }

#wo-s-parts .wo-line-table th:nth-child(1) { width: 145px; }
#wo-s-parts .wo-line-table th:nth-child(2) { width: auto; }
#wo-s-parts .wo-line-table th:nth-child(3) { width: 126px; }
#wo-s-parts .wo-line-table th:nth-child(4) { width: 56px; }
#wo-s-parts .wo-line-table th:nth-child(5) { width: 72px; }
#wo-s-parts .wo-line-table th:nth-child(6) { width: 86px; }
#wo-s-parts .wo-line-table th:nth-child(7) { width: 32px; }
.dash-account-role {
    padding: 0 14px 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
}

.wo-line-table .form-input,
.wo-line-table .form-select {
    min-height: 22px;
    height: 22px;
    width: 100%;
    padding: 0 0.28rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    box-shadow: none;
    font-size: 0.67rem;
    line-height: 1.1;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.wo-line-table input[type="number"] {
    font-variant-numeric: tabular-nums;
}

.wo-line-table .form-input:hover,
.wo-line-table .form-select:hover {
    border-color: rgba(29, 155, 209, 0.35);
    background: rgba(29, 155, 209, 0.05);
}

.wo-line-table .form-input:focus,
.wo-line-table .form-select:focus {
    border-color: rgba(29, 155, 209, 0.55);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(29, 155, 209, 0.12);
}

.wo-line-table tbody tr:hover td {
    background: rgba(29, 28, 29, 0.035);
}

.wo-line-subtotal {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 0.67rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}


.wo-time-conversion {
    display: block;
    margin-top: 0.05rem;
    color: var(--gray-500);
    font-size: 0.52rem;
    line-height: 1;
    white-space: nowrap;
}
.wo-line-empty td {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.78rem;
    padding: 0.75rem 0.9rem;
    background: rgba(29, 28, 29, 0.02);
}

.wo-line-remove {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #dc2626;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.62;
    transition: opacity 0.12s ease, background 0.12s ease;
}

.wo-line-remove:hover {
    opacity: 1;
    background: #fef2f2;
}

.wo-textarea {
    min-height: 90px;
    resize: vertical;
}

.wo-attachment-panel {
    padding: 0.65rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.wo-attachment-head {
    margin-bottom: 0.55rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
}

.wo-attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wo-attachment-empty {
    padding: 0.65rem 0.7rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.03);
    color: var(--gray-500);
    font-size: 0.78rem;
}

.wo-attachment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.7rem;
    border-radius: 10px;
    background: rgba(79, 70, 229, 0.04);
}

.wo-attachment-meta {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.wo-attachment-meta a {
    color: var(--gray-800);
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wo-attachment-meta span {
    font-size: 0.7rem;
    color: var(--gray-500);
}

.wo-attachment-remove {
    border: 0;
    background: transparent;
    color: #dc2626;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 1080px) {
    .wo-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .wo-hero,
    .wo-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 860px) {
    .wo-modal-nav {
        display: none;
    }
    .wo-modal-panel.wo-preview-open {
        width: 100vw;
        max-width: 100vw;
    }
    .wo-modal-panel.wo-preview-open .wo-modal-body {
        flex-direction: column;
    }
    .wo-modal-panel.wo-preview-open .wo-preview-pane {
        width: 100%;
        min-width: 0;
        min-height: 280px;
        max-height: 46vh;
        border-right: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }
}

@media (max-width: 720px) {
    .wo-modal {
        padding: 0;
    }
    .wo-modal-panel {
        width: 100vw;
        max-height: 100dvh;
        height: 100dvh;
        border: 0;
        border-radius: 0;
    }
    .wo-modal-nav {
        display: none;
    }
    .wo-form {
        padding: 0.65rem;
    }
    .wo-modal-header {
        padding: 0.6rem 0.7rem;
    }
    .wo-modal-header-actions .btn-secondary {
        display: none;
    }
    .wo-grid--three,
    .wo-grid--two {
        grid-template-columns: 1fr;
    }
    .wo-line-table thead {
        display: none;
    }
    .wo-line-table {
        min-width: 0;
    }
    .wo-line-table,
    .wo-line-table tbody,
    .wo-line-table tr,
    .wo-line-table td {
        display: block;
        width: 100%;
    }
    .wo-line-table tr {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    .wo-line-table td {
        border-bottom: 0;
        padding: 0.22rem 0.55rem;
    }
    .wo-line-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.6rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--gray-400);
        margin-bottom: 0.1rem;
    }
    .wo-table {
        font-size: 0.72rem;
    }
    .wo-table th,
    .wo-table td {
        padding: 0.65rem 0.7rem;
    }
}

/* Sidebar */
.dash-sidebar {
    width: var(--dash-sidebar-current-width);
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    box-shadow: 1px 0 16px rgba(0, 0, 0, 0.04);
}

.dash-layout.sidebar-collapsed {
    --dash-sidebar-current-width: var(--dash-sidebar-collapsed-width);
}

.dash-sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--dash-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.dash-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: var(--gray-800);
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
}

.dash-logo svg {
    color: var(--primary);
}

.dash-sidebar-toggle {
    border: none;
    background: rgba(255, 255, 255, 0.72);
    color: var(--gray-500);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    box-shadow: none;
    transition: all var(--dash-transition);
    flex-shrink: 0;
}

.dash-sidebar-toggle:hover {
    color: var(--gray-700);
    background: rgba(79, 70, 229, 0.08);
}
.dash-sidebar-toggle:focus,
.dash-sidebar-toggle:focus-visible {
    outline: none;
    box-shadow: none;
}

.dash-layout.sidebar-collapsed .dash-sidebar-toggle svg {
    transform: rotate(180deg);
}

.dash-nav {
    flex: 1;
    padding: 0.75rem 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5625rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all var(--dash-transition);
    border-radius: var(--dash-radius-sm);
    position: relative;
}

.dash-nav-item:hover {
    background: rgba(79, 70, 229, 0.06);
    color: var(--gray-800);
}

.dash-nav-item.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.dash-nav-item svg {
    flex-shrink: 0;
    color: var(--gray-400);
    transition: color var(--dash-transition);
}

.dash-nav-item:hover svg {
    color: var(--gray-600);
}

.dash-nav-item.active svg {
    color: var(--primary);
}

.dash-sidebar-footer {
    padding: 0.5rem 0.625rem;
    border-top: 1px solid var(--dash-border-color);
    margin-top: auto;
}

.dash-sidebar-footer .dash-nav-item {
    margin-top: 0;
    font-size: 0.7rem;
}

.dash-nav-item-company {
    margin-top: 0;
}

.dash-nav-item-company span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: none;
    font-size: 0.75rem;
}

.dash-nav-item-settings {
    margin-top: 0;
}

/* â”€â”€ Company Dashboard â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.company-unified-body {
    display: grid;
    gap: 1rem;
}

.company-tabs {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 0.1rem 0 0.35rem;
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.company-tab {
    border: none;
    background: transparent;
    color: var(--gray-500);
    border-radius: 0;
    padding: 0.15rem 0;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color var(--dash-transition), border-color var(--dash-transition);
}

.company-tab:hover {
    color: var(--gray-700);
}

.company-tab.active {
    color: var(--primary);
    border-color: var(--primary);
}

.company-tab-panel {
    display: none;
}

.company-tab-panel.active {
    display: block;
}

.company-fleet-map-note {
    margin: 0 0 0.75rem;
    color: var(--gray-500);
    font-size: 0.75rem;
}

.company-fleet-map-head-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.user-desk-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.55rem;
}

.user-desk-workspace-panel {
    min-height: 520px;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.user-desk-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.user-desk-toolbar select {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    color: var(--gray-700);
    font-size: 0.74rem;
    padding: 0.38rem 0.48rem;
}

.user-desk-canvas {
    min-height: 560px;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    position: relative;
    overflow: auto;
}

.user-desk-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: move;
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.user-desk-card-remove {
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.85);
    color: var(--gray-500);
    border-radius: 7px;
    width: 22px;
    height: 22px;
    line-height: 1;
    font-size: 0.85rem;
    cursor: pointer;
}

.user-desk-card,
.user-desk-empty {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 12px rgba(14, 22, 36, 0.06);
}

.user-desk-empty {
    color: var(--gray-500);
    font-size: 0.75rem;
    padding: 0.8rem;
    max-width: 360px;
}

.user-desk-card h4 {
    margin: 0;
    font-size: 0.75rem;
    color: var(--gray-700);
}

.user-desk-card-body {
    padding: 0.58rem 0.65rem 0.65rem;
    overflow: auto;
    height: calc(100% - 40px);
}

.user-desk-card-float {
    position: absolute;
    min-width: 280px;
    min-height: 170px;
}

.user-desk-resize {
    position: absolute;
    width: 14px;
    height: 14px;
    right: 6px;
    bottom: 6px;
    border-right: 2px solid rgba(100, 116, 139, 0.5);
    border-bottom: 2px solid rgba(100, 116, 139, 0.5);
    cursor: se-resize;
    border-radius: 0 0 4px 0;
}

.user-desk-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.3rem;
}

.user-desk-list li {
    font-size: 0.71rem;
    color: var(--gray-600);
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
}

.user-desk-list small {
    color: var(--gray-500);
}

.user-desk-pill {
    font-size: 0.62rem;
    border-radius: 999px;
    padding: 0.12rem 0.4rem;
    font-weight: 700;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.user-desk-kpis {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    margin-bottom: 0.45rem;
}

.user-desk-kpi-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gray-800);
}

.user-desk-kpi-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}

.user-desk-card canvas {
    width: 100% !important;
    max-height: 150px;
}

.company-fleet-map-shell {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(220px, 1fr);
    gap: 0.7rem;
    min-height: 410px;
}

.company-fleet-map-canvas-wrap {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(241, 245, 249, 0.55);
}

#companyFleetMapCanvas {
    width: 100%;
    height: 100%;
    min-height: 410px;
}

.company-fleet-map-full {
    width: 100%;
}

.company-fleet-map-canvas-wrap.company-fleet-map-canvas-full {
    border-radius: 10px;
}

.company-fleet-map-canvas-full #companyFleetMapCanvas {
    min-height: calc(100vh - 220px);
}

.company-fleet-map-side {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    padding: 0.6rem;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0.45rem;
    min-height: 410px;
}

.company-fleet-map-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--gray-600);
    font-weight: 700;
}

.company-fleet-map-side-head strong {
    color: var(--gray-800);
}

.company-fleet-map-side-foot {
    font-size: 0.66rem;
    color: var(--gray-500);
}

.company-fleet-map-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.company-fleet-map-stat {
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.625rem 0.75rem;
    display: grid;
    gap: 0.2rem;
}

.company-fleet-map-label {
    font-size: 0.675rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
}

.company-fleet-map-stat strong {
    font-size: 0.8rem;
    color: var(--gray-700);
}

.company-calendar-count {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-500);
}

.company-calendar-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.75rem;
}

.company-calendar-controls label {
    font-size: 0.72rem;
    color: var(--gray-600);
    font-weight: 600;
}

.company-calendar-controls input[type="date"] {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.95);
    color: var(--gray-700);
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
}

.company-calendar-controls select {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.95);
    color: var(--gray-700);
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
}

.company-calendar-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.4rem;
}

.company-calendar-item,
.company-calendar-empty {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.72);
    padding: 0.5rem 0.625rem;
}

.company-calendar-empty {
    color: var(--gray-500);
    font-size: 0.72rem;
}

.company-calendar-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-700);
}

.company-calendar-meta {
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    font-size: 0.67rem;
    color: var(--gray-500);
}

.settings-row-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.settings-card-grid {
    margin: 0.5rem 0 0.7rem;
}

@media (max-width: 980px) {
    .company-fleet-map-shell {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        min-height: 0;

    .wo-category-costs-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }
    }

    #companyFleetMapCanvas,
    .company-fleet-map-side {
        min-height: 300px;
    }

    .company-fleet-map-canvas-full #companyFleetMapCanvas {
        min-height: calc(100vh - 260px);
    }
}

.company-calendar-status {
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    font-weight: 700;
    font-size: 0.625rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.06);
}

.company-calendar-status.open {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.company-calendar-status.in-progress,
.company-calendar-status.pending {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.company-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.company-block-head h3 {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--gray-700);
}

/* â”€â”€ FMCSA Lookup Bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.fmcsa-lookup-bar {
    background: rgba(79, 70, 229, 0.03);
    border: 1px solid rgba(79, 70, 229, 0.12);
    border-radius: var(--dash-radius-md);
    padding: 0.75rem 0.875rem;
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
}
.company-locked-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    margin-bottom: 1rem;
    border-radius: var(--dash-radius-md);
    background: rgba(79, 70, 229, 0.04);
    border: 1px solid rgba(79, 70, 229, 0.12);
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.4;
}
.company-locked-notice svg {
    flex-shrink: 0;
    color: var(--primary);
    opacity: 0.6;
}
.company-locked-notice .company-change-btn {
    margin-left: auto;
    flex-shrink: 0;
}
.company-locked-notice.hidden { display: none; }
.field-locked {
    background: rgba(0, 0, 0, 0.02) !important;
    color: var(--gray-500) !important;
    cursor: not-allowed;
}
.fmcsa-lookup-bar.fmcsa-lookup-done {
    background: rgba(16, 185, 129, 0.04);
    border-color: rgba(16, 185, 129, 0.15);
}
.fmcsa-lookup-hint {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin: 0 0 0.45rem;
}
.fmcsa-lookup-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.fmcsa-lookup-combo {
    display: flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    flex: 1;
    max-width: 280px;
    transition: border-color var(--dash-transition), box-shadow var(--dash-transition);
}
.fmcsa-lookup-combo:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.08);
}
.fmcsa-lookup-type {
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--gray-600);
    border: none;
    background: rgba(0, 0, 0, 0.03);
    padding: 0.42rem 0.2rem 0.42rem 0.5rem;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.3rem center;
    padding-right: 1.1rem;
    width: 58px;
    min-width: 58px;
}
.fmcsa-lookup-sep {
    width: 1px;
    height: 18px;
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}
.fmcsa-lookup-input {
    flex: 1;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-700);
    border: none;
    outline: none;
    padding: 0.42rem 0.55rem;
    background: transparent;
    min-width: 0;
}
.fmcsa-lookup-input::placeholder { color: var(--gray-400); }
.fmcsa-lookup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: none;
    border-radius: 8px;
    background: var(--primary, #4f46e5);
    color: #fff;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0 0.75rem;
    height: 34px;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background var(--dash-transition), opacity var(--dash-transition);
}
.fmcsa-lookup-btn:hover:not(:disabled) { background: #4338ca; }
.fmcsa-lookup-btn:disabled { opacity: 0.5; cursor: default; }
.fmcsa-lookup-btn.searching svg {
    animation: fmcsaSpin 0.8s linear infinite;
}
@keyframes fmcsaSpin {
    to { transform: rotate(360deg); }
}

/* â”€â”€ FMCSA Verify Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.fmcsa-verify-card {
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: var(--dash-radius-md);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.25rem;
    overflow: hidden;
    animation: fmcsaVerifyIn 0.2s ease;
}
@keyframes fmcsaVerifyIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.fmcsa-verify-card.hidden { display: none; }
.fmcsa-verify-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: rgba(79, 70, 229, 0.04);
    border-bottom: 1px solid rgba(79, 70, 229, 0.08);
}
.fmcsa-verify-header h4 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-700);
}
.fmcsa-verify-status {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}
.fmcsa-verify-status.fmcsa-status-ok {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}
.fmcsa-verify-status.fmcsa-status-bad {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}
.fmcsa-verify-body {
    padding: 0.75rem 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.15rem 1.5rem;
}
.fmcsa-verify-row {
    display: flex;
    flex-direction: column;
    padding: 0.3rem 0;
}
.fmcsa-verify-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-400);
}
.fmcsa-verify-value {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-700);
}
.fmcsa-verify-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(0, 0, 0, 0.015);
}

/* â”€â”€ FMCSA Carrier Snapshot â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.fmcsa-hint {
    font-size: 0.82rem;
    color: var(--gray-400);
    margin: 0;
    line-height: 1.6;
}
.fmcsa-hint strong { color: var(--gray-600); }

.fmcsa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}
.fmcsa-card {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--dash-radius-md);
    padding: 0.75rem 0.875rem;
    background: rgba(0, 0, 0, 0.012);
}
.fmcsa-card h4 {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    margin: 0 0 0.5rem;
}
.fmcsa-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.22rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}
.fmcsa-row:last-child { border-bottom: none; }
.fmcsa-row-label {
    font-size: 0.72rem;
    color: var(--gray-400);
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 0.75rem;
}
.fmcsa-row-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-700);
    text-align: right;
    word-break: break-word;
}
.fmcsa-fetched-at {
    font-size: 0.68rem;
    color: var(--gray-300);
    margin: 0.75rem 0 0;
    text-align: right;
}

/* â”€â”€ Compliance Section â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#section-compliance .dash-card-header {
    min-height: 36px;
    padding: 0.3rem 0.75rem;
}
#section-compliance .dash-card-body {
    padding: 1rem 0.5rem 0;
}

/* â”€â”€ Inspection Badges â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.insp-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
}
.badge-green { background: rgba(16,185,129,0.12); color: #059669; }
.badge-red { background: rgba(239,68,68,0.12); color: #dc2626; }
.badge-yellow { background: rgba(245,158,11,0.12); color: #b45309; }
.badge-gray { background: rgba(107,114,128,0.1); color: #6b7280; }
#inspectionsTable tbody tr { cursor: default; }
#inspectionsTable tbody td { color: #1f2937; }
#inspectionsTable tbody tr:hover { background: #f0f4ff; }
#inspectionsTable tbody tr.insp-resolved { opacity: 0.55; }
#inspectionsTable tbody tr.insp-resolved:hover { opacity: 0.8; }

.insp-action-btn {
    background: none;
    border: none;
    border-radius: var(--dash-radius-xs);
    padding: 0;
    cursor: pointer;
    color: var(--gray-400);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--dash-action-button-size);
    height: var(--dash-action-button-size);
    transition: all var(--dash-transition);
    line-height: 1;
    opacity: 0;
}
#inspectionsTable tbody tr:hover .insp-action-btn { opacity: 1; }
.insp-action-btn:hover { color: var(--primary); background: rgba(79,70,229,0.08); }
.insp-action-btn.btn-delete:hover { color: var(--danger); background: rgba(220,38,38,0.06); }

/* Inline status selects */
.insp-status-cell { display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; }
.insp-status-select {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    border-radius: 20px;
    padding: 0.15rem 0.5rem;
    font-size: var(--dash-table-font-size);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    outline: none;
    transition: opacity 0.15s;
}
.insp-status-select:hover { opacity: 0.8; }
.insp-status-select.is-open { background: rgba(239,68,68,0.1); color: #dc2626; }
.insp-status-select.is-under-review { background: rgba(99,102,241,0.1); color: #4f46e5; }
.insp-status-select.is-disputed { background: rgba(245,158,11,0.1); color: #b45309; }
.insp-status-select.is-resolved { background: rgba(16,185,129,0.1); color: #059669; }
.insp-status-select.is-pending { background: rgba(245,158,11,0.1); color: #b45309; }
.insp-status-select.is-paid { background: rgba(16,185,129,0.1); color: #059669; }
.insp-status-select.is-pay-disputed { background: rgba(249,115,22,0.1); color: #c2410c; }
.insp-status-select.is-waived { background: rgba(107,114,128,0.1); color: #6b7280; }

/* Inline assignee select */
.insp-assign-select {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 6px;
    padding: 0.15rem 0.4rem;
    font-size: var(--dash-table-font-size);
    color: #334155;
    background: #fff;
    cursor: pointer;
    outline: none;
    max-width: 100%;
    transition: border-color 0.15s;
}
.insp-assign-select:hover { border-color: rgba(79,70,229,0.3); }
.insp-assign-select:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.1); }

.compliance-inspections-section {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}
.compliance-inspections-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}
.compliance-inspections-header h3 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

.compliance-snapshot {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.compliance-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.25rem;
}
.compliance-stat-card {
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    padding: 0.3rem 0.3rem;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    transition: transform var(--dash-transition), box-shadow var(--dash-transition);
}
.compliance-stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}
.compliance-stat-value {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.compliance-stat-label {
    display: block;
    font-size: 0.48rem;
    color: var(--gray-400);
    margin-top: 0.05rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.compliance-stat-sub {
    display: block;
    font-size: 0.48rem;
    color: var(--gray-400);
    margin-top: 0.02rem;
    font-weight: 500;
}
.compliance-block {
    margin: 0;
}
.compliance-block h3 {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-500);
    margin: 0 0 0.4rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Collapsible compliance blocks */
.compliance-collapsible .compliance-block-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    -webkit-user-select: none;
    user-select: none;
    margin: 0;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color var(--dash-transition);
}
.compliance-collapsible .compliance-block-toggle:hover {
    color: var(--gray-700);
}
.compliance-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: var(--gray-400);
}
.compliance-collapsible.open .compliance-chevron {
    transform: rotate(180deg);
}
.compliance-block-body {
    display: none;
    padding-top: 0.3rem;
}
.compliance-collapsible.open .compliance-block-body {
    display: block;
}
.compliance-fetched-at {
    font-size: 0.68rem;
    color: var(--gray-300);
    margin: 0;
    white-space: nowrap;
}
.compliance-authority {
    font-size: 0.7rem;
    color: var(--gray-300);
    margin: 0.1rem 0 0;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 640px) {
    .compliance-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.fmcsa-reminders {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.fmcsa-reminder {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
}
.fmcsa-reminder span {
    overflow: hidden;
    text-overflow: ellipsis;
}
.fmcsa-reminder svg { flex-shrink: 0; }
.fmcsa-reminder-info {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    color: #2563eb;
}
.fmcsa-reminder-warning {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.18);
    color: #b45309;
}
.fmcsa-reminder-danger {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.18);
    color: #dc2626;
}
a.fmcsa-reminder-link {
    text-decoration: none;
    cursor: pointer;
    transition: filter var(--dash-transition), box-shadow var(--dash-transition);
}
a.fmcsa-reminder-link:hover {
    filter: brightness(0.95);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.fmcsa-reminder-arrow {
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity var(--dash-transition), transform var(--dash-transition);
}
a.fmcsa-reminder-link:hover .fmcsa-reminder-arrow {
    opacity: 1;
    transform: translateX(2px);
}
.fmcsa-no-reminders {
    font-size: 0.82rem;
    color: var(--gray-400);
    margin: 0;
}

.compliance-reminders-inline {
    margin-top: 0.75rem;
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--dash-card-radius);
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* â”€â”€ Integration Widgets â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.integration-widgets-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 0.75rem;
}

.dash-layout .dash-card.integrations-hub-card {
    max-width: 940px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    overflow: visible;
}

.dash-layout .dash-card.integrations-hub-card:hover {
    box-shadow: none;
}

.dash-layout .dash-card.integrations-hub-card .dash-card-header {
    min-height: 0;
    padding: 0 0 0.75rem;
    border-bottom: 0;
    background: transparent;
}

.dash-layout .dash-card.integrations-hub-card .dash-card-body {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.integrations-app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0;
}

.integrations-app-tile-minimal {
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 110px;
    min-height: 110px;
    margin: 0;
    border-radius: 12px;
    padding: 0.75rem 0.55rem;
}

.integration-active-dot {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cbd5e1;
}

.integration-active-dot.is-active {
    background: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.14);
}

.integrations-app-tile-minimal .integrations-app-name {
    text-align: center;
    font-size: 0.8rem;
}

.integrations-app-tile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    border-radius: 10px;
    padding: 0.75rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.integrations-app-tile:hover {
    border-color: rgba(15, 23, 42, 0.26);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.integrations-app-avatar {
    width: 52px;
    height: 52px;
    border-radius: 0;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.integrations-app-avatar img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.integrations-app-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.integrations-app-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.integrations-app-sub {
    font-size: 0.63rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-top: 0.12rem;
}

.integrations-app-status {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.18rem 0.48rem;
    white-space: nowrap;
}

.integrations-app-tile.connected {
    border-color: rgba(5, 150, 105, 0.36);
    background: #f0fdf4;
}

.integrations-app-tile.connected .integrations-app-status {
    color: #065f46;
    background: #d1fae5;
    border-color: #a7f3d0;
}

.integrations-widget-row {
    margin-top: 0;
}

.integrations-widget-row .integration-widget {
    width: 100%;
    max-width: none;
}

.integrations-options-panel {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 10px;
    background: #ffffff;
    padding: 0.8rem;
}

.integrations-search-wrap {
    position: relative;
    width: min(360px, 100%);
    margin: 0 0 1rem auto;
}

.dash-layout .dash-card.integrations-hub-card .integrations-search-wrap {
    align-self: flex-end;
}

.integrations-search-input {
    height: 36px;
    border-radius: var(--dash-radius-md);
    padding-left: 0.75rem;
    box-shadow: none;
}

.integrations-search-results {
    top: calc(100% + 0.35rem);
    z-index: 40;
}

.integrations-search-results .overview-lookup-result {
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
}

.samsara-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.samsara-modal.hidden {
    display: none;
}

.samsara-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.44);
}

.samsara-modal-panel {
    position: relative;
    width: min(760px, 94vw);
    max-height: min(88vh, 920px);
    overflow: auto;
    contain: layout paint;
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.32);
}

.integrations-options-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.integrations-options-actions {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.samsara-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: #fff;
    color: #64748b;
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.samsara-modal-close:hover {
    background: #f8fafc;
    color: #0f172a;
}

.samsara-brand-lockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin: 0.1rem 0 1.15rem;
}

.samsara-brand-lockup img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
}
.stellar-app-avatar { overflow: hidden; background: #17164b; }
.stellar-app-avatar img { width: 32px; height: 32px; object-fit: contain; }
.stellar-brand-lockup img { width: min(270px, 74vw); height: auto; object-fit: contain; }
.stellar-connection-progress { margin: 0.15rem 0 1rem; padding: 0.72rem 0.82rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; }
.stellar-progress-head { display: flex; align-items: center; gap: 0.65rem; }
.stellar-progress-spinner { flex: 0 0 auto; width: 17px; height: 17px; border: 2px solid #cbd5e1; border-top-color: #1d6fa4; border-radius: 50%; animation: stellar-progress-spin 800ms linear infinite; }
.stellar-connection-progress.is-complete .stellar-progress-spinner { border-color: #16a34a; animation: none; }
.stellar-connection-progress.is-error { border-color: #fecaca; background: #fff7f7; }
.stellar-connection-progress.is-error .stellar-progress-spinner { border-color: #dc2626; animation: none; }
.stellar-progress-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 0.08rem; }
.stellar-progress-copy strong { color: #172033; font-size: 0.78rem; line-height: 1.25; }
.stellar-progress-copy span { overflow: hidden; color: #64748b; font-size: 0.7rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.stellar-progress-value { flex: 0 0 auto; color: #475569; font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.stellar-progress-track { height: 5px; margin-top: 0.58rem; overflow: hidden; border-radius: 3px; background: #e2e8f0; }
.stellar-progress-track span { display: block; width: 0; height: 100%; background: #1d6fa4; transition: width 220ms ease; }
.stellar-connection-progress.is-complete .stellar-progress-track span { background: #16a34a; }
.stellar-connection-progress.is-error .stellar-progress-track span { background: #dc2626; }
@keyframes stellar-progress-spin { to { transform: rotate(360deg); } }
.integrations-account-sync { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: var(--gray-500); cursor: pointer; }
.integrations-account-sync:hover { color: var(--primary); }
.integrations-account-sync svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

.samsara-login-form {
    margin: 0;
}

.samsara-login-btn {
    min-width: 94px;
    padding: 0.48rem 1.2rem;
}

.integrations-account-form {
    padding: 0.2rem 0.9rem 0.9rem;
    margin-bottom: 0.7rem;
}

.samsara-account-label {
    max-width: 20rem;
    margin: 0.4rem auto 0.8rem;
}

.samsara-account-label label {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.samsara-account-label label span {
    align-self: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.samsara-account-label label input {
    width: 100%;
}

.samsara-modal input {
    transition: none;
}

.samsara-api-row {
    border-top: 1px solid #e2e8f0;
    padding-top: 0.8rem;
}

.samsara-api-form {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 0.8rem;
    margin: 0;
    padding: 0 0.2rem;
}

.integrations-account-form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.integrations-account-form label span {
    font-size: 0.7rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.integrations-account-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.integrations-account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    padding: 0.25rem 0.15rem;
    border-top: 1px solid #e2e8f0;
    background: transparent;
}

.integrations-account-item .integration-active-dot {
    position: static;
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: 0.55rem;
}

.integrations-account-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.integrations-account-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
}

.integrations-account-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.integrations-account-delete:hover {
    color: #dc2626;
}

.integrations-account-delete svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.integrations-account-sub {
    font-size: 0.68rem;
    color: #64748b;
}

.integrations-account-badges {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.integrations-account-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    color: #334155;
    background: #ffffff;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.integrations-account-chip.ok {
    border-color: #86efac;
    background: #dcfce7;
    color: #166534;
}

.integrations-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.55rem;
}

.integrations-account-note {
    margin-top: 0.6rem;
    font-size: 0.69rem;
    color: #64748b;
}

@media (max-width: 560px) {
    .samsara-api-form {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .samsara-api-form .integration-widget-actions {
        justify-content: flex-end;
    }
}

.org-authority-form {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem;
    background: #ffffff;
}

.org-authority-form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.org-authority-form label span {
    font-size: 0.7rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.integration-widget {
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    min-width: 240px;
    max-width: 360px;
    transition: box-shadow var(--dash-transition), border-color var(--dash-transition);
}

.integration-widget:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.09);
    border-color: rgba(0, 0, 0, 0.1);
}

.integration-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    gap: 0.75rem;
}

.integration-widget-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.integration-widget-icon {
    width: 30px;
    height: 30px;
    border-radius: 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.integration-widget-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

.integration-widget-name-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.integration-widget-name {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}

.integration-widget-sub {
    font-size: 0.5625rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.integration-widget-right {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.integration-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gray-300);
    flex-shrink: 0;
    transition: background 0.25s, box-shadow 0.25s;
}

.integration-status-dot.connected {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.integration-status-label {
    font-size: 0.6875rem;
    color: var(--gray-400);
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.2s;
}

.integration-status-label.connected {
    color: #059669;
}

.integration-chevron {
    color: var(--gray-300);
    flex-shrink: 0;
    transition: transform 0.2s ease, color var(--dash-transition);
}

.integration-widget-header:hover .integration-chevron {
    color: var(--gray-500);
}

.integration-widget.open .integration-chevron {
    transform: rotate(180deg);
}

.integration-widget-body {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.75rem 0.875rem;
    background: rgba(0, 0, 0, 0.012);
}

.integration-widget-body.hidden {
    display: none;
}

.integration-widget-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin: 0 0 0.625rem;
    line-height: 1.5;
}

.integration-widget-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Samsara Webhook Setup Section ──────────────── */
.samsara-webhook-section {
    margin-top: 0;
}

.samsara-webhook-section.hidden {
    display: none;
}

.samsara-webhook-divider {
    height: 1px;
    background: rgba(0,0,0,0.07);
    margin: 0.625rem 0 0.75rem;
}

.samsara-webhook-heading {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    margin: 0 0 0.3rem;
}

.samsara-webhook-hint {
    font-size: 0.715rem;
    color: var(--gray-400);
    margin: 0 0 0.625rem;
    line-height: 1.5;
}

.samsara-webhook-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.55rem;
}

.samsara-webhook-label {
    font-size: 0.695rem;
    font-weight: 600;
    color: var(--gray-500);
}

.samsara-webhook-copyrow {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.samsara-webhook-url {
    flex: 1;
    font-size: 0.69rem;
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    color: var(--gray-700, #374151);
    word-break: break-all;
    line-height: 1.5;
    user-select: all;
}

.samsara-webhook-copy {
    flex-shrink: 0;
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 6px;
    padding: 0.28rem 0.45rem;
    color: var(--gray-500);
    cursor: pointer;
    transition: background var(--dash-transition);
}

.samsara-webhook-copy:hover {
    background: rgba(0,0,0,0.08);
    color: var(--gray-700, #374151);
}

.samsara-webhook-secret-row {
    display: flex;
    gap: 0.4rem;
}

.samsara-webhook-secret-input {
    flex: 1;
    font-size: 0.75rem;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    outline: none;
    background: #fff;
    color: var(--gray-700, #374151);
    transition: border-color var(--dash-transition);
}

.samsara-webhook-secret-input:focus {
    border-color: var(--primary, #2563eb);
}

.samsara-webhook-secret-status {
    display: block;
    font-size: 0.695rem;
    min-height: 1em;
    color: var(--success, #16a34a);
}

.samsara-webhook-secret-status.err {
    color: var(--danger, #dc2626);
}

/* â”€â”€ Company Task Widgets â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.company-task-widgets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.company-task-widget {
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    min-width: 220px;
    flex: 1;
    max-width: 400px;
    transition: box-shadow var(--dash-transition), border-color var(--dash-transition);
}

.company-task-widget:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.1);
}

.company-task-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.875rem;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    gap: 0.5rem;
}

.company-task-widget-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-700);
}

.company-task-widget-title svg {
    color: var(--gray-400);
    flex-shrink: 0;
}

.company-task-widget-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.company-task-count {
    font-size: 0.625rem;
    font-weight: 700;
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    min-width: 1.25rem;
    text-align: center;
    line-height: 1.5;
}

.company-task-count.has-overdue {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.company-task-chevron {
    color: var(--gray-300);
    flex-shrink: 0;
    transition: transform 0.2s ease, color var(--dash-transition);
}

.company-task-widget-header:hover .company-task-chevron {
    color: var(--gray-500);
}

.company-task-widget.collapsed .company-task-chevron {
    transform: rotate(-90deg);
}

.company-task-widget-body {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(0, 0, 0, 0.012);
    padding: 0.5rem 0;
    overflow: hidden;
    transition: max-height 0.22s ease;
}

.company-task-widget.collapsed .company-task-widget-body {
    display: none;
}

.company-task-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 220px;
    overflow-y: auto;
}

.company-task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0.875rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    cursor: default;
    transition: background var(--dash-transition);
}

.company-task-item:last-child {
    border-bottom: none;
}

.company-task-item:hover {
    background: rgba(79, 70, 229, 0.03);
}

.company-task-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.28rem;
}

.company-task-info {
    flex: 1;
    min-width: 0;
}

.company-task-title-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.company-task-meta-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.1rem;
    flex-wrap: wrap;
}

.company-task-entity {
    font-size: 0.625rem;
    color: var(--gray-400);
    font-weight: 500;
    text-transform: capitalize;
}

.company-task-due {
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 4px;
    padding: 0.05rem 0.3rem;
}

.company-task-due.overdue {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.08);
}

.company-task-due.soon {
    color: #b45309;
    background: rgba(245, 158, 11, 0.08);
}

.company-task-due.ok {
    color: var(--gray-400);
}

.company-task-empty {
    padding: 0.75rem 0.875rem;
    font-size: 0.75rem;
    color: var(--gray-400);
    font-style: italic;
}

.company-task-view-all {
    display: block;
    padding: 0.45rem 0.875rem 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity var(--dash-transition);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    margin-top: 0.25rem;
}

.company-task-view-all:hover {
    opacity: 1;
}

.company-dashboard-layout {
    display: block;
}

.company-dashboard-panel {
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--dash-radius-md);
    padding: 0.75rem;
}

.company-dashboard-panel-wide {
    width: 100%;
}

.company-dashboard-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
}

.company-dashboard-panel-head h3 {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--gray-700);
}

.company-dashboard-subtitle {
    margin: 0.625rem 0 0.45rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
}

.company-dashboard-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.company-check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.62);
}

.company-check-item input {
    margin-top: 0.15rem;
}

.company-check-item span {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.company-check-item strong {
    font-size: 0.75rem;
    color: var(--gray-700);
}

.company-check-item small {
    font-size: 0.6875rem;
    color: var(--gray-500);
    line-height: 1.25;
}

.company-user-invite-row {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr 0.9fr auto;
    gap: 0.45rem;
    margin-bottom: 0.625rem;
}

.company-user-invite-row input,
.company-user-invite-row select,
.company-template-form input,
.company-template-form select {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: transparent;
    padding: 0.4375rem 0.625rem;
    color: var(--gray-800);
    font-size: 0.75rem;
    font-weight: 500;
}

.company-user-table-wrap {
    overflow-x: auto;
}

.org-users-shell {
    padding: 0;
}

.org-users-topbar {
    border-bottom: 1px solid var(--dash-border-color);
}

.org-users-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.24rem 0.62rem;
    border: 1px solid var(--dash-border-color);
    border-radius: 999px;
    background: #fff;
    color: var(--gray-600);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.org-users-body {
    padding-top: 0.75rem;
}

.org-users-intro {
    margin: 0 0 0.65rem;
    color: var(--gray-600);
    font-size: 0.78rem;
    line-height: 1.3;
}

.org-users-form {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.8rem;
}

.org-users-filterbar {
    padding: 0.65rem 0.95rem;
    gap: 0.55rem;
    border: 1px solid var(--dash-border-color);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.org-users-filterbar .org-users-field {
    min-width: 150px;
}

.org-users-filterbar .org-users-field.search {
    min-width: 230px;
}

.org-users-filterbar .filter-input,
.org-users-filterbar .filter-select {
    height: 30px;
    font-size: 0.76rem;
}

.org-users-filterbar .unit-search-wrap svg {
    left: 0.52rem;
}

.org-users-cta-group {
    margin-left: auto;
}

.org-users-add-btn {
    height: 30px;
    min-width: 92px;
    padding: 0 0.65rem;
    font-size: 0.69rem;
    line-height: 1;
    letter-spacing: 0.02em;
}

.org-user-add-icon {
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0;
}

.org-user-add-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.org-users-table-wrap {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
}

.org-users-shell .company-user-table th,
.org-users-shell .company-user-table td {
    font-size: 0.75rem;
}

.org-users-shell .company-user-table th {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--gray-500);
}

.org-users-shell .company-user-table tbody tr:hover {
    background: rgba(29, 155, 209, 0.035);
}

.company-user-name {
    color: var(--gray-900);
    font-weight: 700;
}

.company-user-profile-meta {
    margin-top: 0.14rem;
    color: var(--gray-500);
    font-size: 0.65rem;
    line-height: 1.3;
}

.org-users-shell .company-user-row-role {
    min-width: 120px;
    border-radius: 7px;
    border: 1px solid var(--border-color);
    background: #fff;
    padding: 0.25rem 1.25rem 0.25rem 0.38rem;
    font-size: 0.7rem;
}

.company-user-status {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.65625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.company-user-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
}

.company-user-status.active {
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
}

.company-user-status.pending {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.company-user-status.inactive {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.org-users-shell .company-user-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.org-users-shell .company-user-actions .btn {
    height: 22px;
    min-height: 22px;
    border-radius: 7px;
    font-size: 0.64rem;
    font-weight: 700;
    padding: 0 0.4rem;
    line-height: 1;
}

.org-users-shell .company-user-actions .btn.btn-danger,
.org-users-shell .company-user-actions .btn.btn-secondary {
    box-shadow: none;
}

.org-users-shell .company-user-actions .btn.btn-danger {
    padding: 0 0.38rem;
}

.company-user-row-clickable {
    cursor: pointer;
}

.org-user-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
}

.org-user-icon-btn:hover:not(:disabled) {
    background: rgba(29, 155, 209, 0.08);
    color: var(--primary);
}

.org-user-icon-btn-danger:hover:not(:disabled) {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}

.org-user-icon-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.org-user-icon-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.org-user-modal-open {
    overflow: hidden;
}

.org-user-profile-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.org-user-profile-modal.hidden {
    display: none;
}

.org-user-profile-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
}

.org-user-profile-panel {
    position: relative;
    width: min(520px, 94vw);
    padding: 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--dash-shadow-xl);
}

.org-user-profile-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--gray-500);
    font-size: 1.2rem;
    cursor: pointer;
}

.org-user-profile-hero {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding-right: 2rem;
    margin-bottom: 1.1rem;
}

.org-user-profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e8f4f8;
    color: #256b8a;
    font-size: 1rem;
    font-weight: 800;
}

.org-user-profile-hero h2 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1rem;
}

.org-user-profile-hero p {
    margin: 0.2rem 0 0;
    color: var(--gray-500);
    font-size: 0.72rem;
}

.org-user-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.org-user-profile-grid > div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.org-user-profile-grid span {
    color: var(--gray-500);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.org-user-profile-grid strong {
    overflow-wrap: anywhere;
    color: var(--gray-800);
    font-size: 0.76rem;
    font-weight: 600;
}

.org-user-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.org-user-modal.hidden {
    display: none;
}

.org-user-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.42);
}

.org-user-modal-panel {
    position: relative;
    width: min(760px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    border: 1px solid var(--dash-border-color);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 20px 45px rgba(17, 24, 39, 0.2);
}

.org-user-form {
    display: flex;
    max-height: calc(100vh - 2rem);
    flex-direction: column;
    contain: layout paint;
}

.org-user-modal-header,
.org-user-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 0 0 auto;
    padding: 0.85rem 1rem;
}

.org-user-modal-header {
    border-bottom: 1px solid var(--dash-border-color);
}

.org-user-modal-header h2 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1rem;
    line-height: 1.25;
}

.org-user-modal-header p {
    margin: 0.18rem 0 0;
    color: var(--gray-500);
    font-size: 0.7rem;
}

.org-user-modal-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--gray-500);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.org-user-modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.org-user-modal-body {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.8fr);
    gap: 0;
    min-height: 0;
    overflow-y: auto;
}

.org-user-form-section {
    padding: 1rem;
}

.org-user-form-section + .org-user-form-section {
    border-left: 1px solid var(--dash-border-color);
    background: var(--gray-50);
}

.org-user-form-section-head {
    margin-bottom: 0.75rem;
    color: var(--gray-800);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.org-user-form-grid {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.org-user-form-grid:last-child {
    margin-bottom: 0;
}

.org-user-form-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.org-user-form-grid label,
.org-user-role-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.28rem;
}

.org-user-form-grid label > span,
.org-user-role-field > span {
    color: var(--gray-600);
    font-size: 0.65rem;
    font-weight: 700;
}

.org-user-form-grid input,
.org-user-form-grid select,
.org-user-role-field select {
    width: 100%;
    height: 34px;
    border: 1px solid var(--dash-border-color);
    border-radius: 7px;
    background: #fff;
    padding: 0 0.55rem;
    color: var(--gray-900);
    font: inherit;
    font-size: 0.75rem;
    outline: none;
}

.org-user-form-grid input:focus,
.org-user-form-grid select:focus,
.org-user-role-field select:focus {
    border-color: #1d9bd1;
    box-shadow: 0 0 0 2px rgba(29, 155, 209, 0.13);
}

.org-user-form-grid input:disabled,
.org-user-role-field select:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
}

.org-user-role-field small {
    min-height: 2.4em;
    color: var(--gray-500);
    font-size: 0.65rem;
    line-height: 1.35;
}

.org-user-setting-list {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.org-user-setting-list > label {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 0.5rem;
    align-items: start;
    padding: 0.55rem;
    border: 1px solid var(--dash-border-color);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.org-user-setting-list input {
    margin: 0.15rem 0 0;
}

.org-user-setting-list strong,
.org-user-setting-list small {
    display: block;
}

.org-user-setting-list strong {
    color: var(--gray-800);
    font-size: 0.7rem;
}

.org-user-setting-list small {
    margin-top: 0.12rem;
    color: var(--gray-500);
    font-size: 0.62rem;
    line-height: 1.35;
}

.org-user-modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--dash-border-color);
    background: #fff;
}

@media (max-width: 920px) {
    .org-users-filterbar .org-users-field,
    .org-users-filterbar .org-users-field.search,
    .org-users-cta-group {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }

    .org-users-add-btn {
        width: 100%;
    }

    .org-user-modal-body {
        grid-template-columns: 1fr;
    }

    .org-user-form-section + .org-user-form-section {
        border-top: 1px solid var(--dash-border-color);
        border-left: 0;
    }
}

@media (max-width: 560px) {
    .org-user-modal {
        align-items: end;
        padding: 0;
    }

    .org-user-modal-panel,
    .org-user-form {
        width: 100%;
        max-height: 94vh;
        border-radius: 10px 10px 0 0;
    }

    .org-user-form-grid--two {
        grid-template-columns: 1fr;
    }
}

.company-template-form {
    display: grid;
    grid-template-columns: 1.1fr 1fr auto;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.company-template-tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.75rem;
}

.company-template-tool-grid label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.71875rem;
    color: var(--gray-600);
}

.company-template-list {
    display: grid;
    gap: 0.5rem;
}

.company-template-item {
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--dash-radius-md);
    padding: 0.625rem;
}

.company-template-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
}

.company-template-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-700);
}

.company-template-dept {
    font-size: 0.625rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.company-template-tools {
    margin-top: 0.375rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.company-template-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
}

.company-template-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.company-template-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    color: var(--gray-500);
}

/* â”€â”€ Settings Page â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.settings-group {
    padding: 1.25rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.settings-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    margin: 0 0 0.875rem;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row-danger .settings-row-label {
    color: #dc2626;
}

.settings-row-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.settings-row-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.settings-row-desc {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.settings-company-select {
    width: min(390px, 48vw);
    height: 32px;
    font-size: 0.72rem;
}

.settings-company-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.settings-company-head .settings-group-title {
    margin-bottom: 0.15rem;
}

.settings-company-head p {
    margin: 0;
    font-size: 0.72rem;
    color: var(--gray-500);
}

.settings-company-scope {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.65rem;
    color: var(--gray-600);
}

.settings-company-scope > span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16a34a;
}

.settings-company-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}

.settings-company-preview > div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.settings-company-preview-label,
#settingsCompanyTimeZoneLabel {
    font-size: 0.65rem;
    color: var(--gray-500);
}

#settingsCompanyTimePreview {
    font-size: 0.8rem;
    color: var(--gray-900);
}

#settingsCompanyTimeZoneLabel {
    text-align: right;
}

.settings-company-save-row {
    justify-content: flex-end;
}

.settings-company-save-row .settings-row-desc:not(:empty) {
    margin-right: auto;
}

@media (max-width: 720px) {
    .settings-company-head,
    .settings-company-preview,
    .settings-row-inline {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-company-select {
        width: 100%;
    }

    #settingsCompanyTimeZoneLabel {
        text-align: left;
    }
}

/* Toggle switch */
.settings-toggle {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    cursor: pointer;
}

.settings-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-toggle-track {
    width: 36px;
    height: 20px;
    background: var(--gray-300);
    border-radius: var(--dash-radius-pill);
    transition: background var(--dash-transition);
    position: relative;
}

.settings-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.settings-toggle input:checked + .settings-toggle-track {
    background: var(--primary);
}

.settings-toggle input:checked + .settings-toggle-track::after {
    transform: translateX(16px);
}

.btn-danger {
    background: #dc2626;
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* â”€â”€ Global .btn override for the dashboard â”€â”€ */
/* Ensures all .btn instances inside .dash-layout are consistently rounded
   and show their SVG icons. Scoped so it doesn't bleed into login/other pages. */
.dash-layout .btn {
    border-radius: var(--dash-radius-sm);
    font-weight: 600;
    font-family: inherit;
    white-space: nowrap;
    transition: all var(--dash-transition);
    line-height: 1;
}

.dash-layout .btn svg {
    display: inline-flex;
    flex-shrink: 0;
    width: 13px;
    height: 13px;
}

.dash-layout .btn-primary {
    background: #256b8a;
    color: #fff;
    border-color: #256b8a;
    box-shadow: 0 1px 4px rgba(37, 107, 138, 0.2);
}

.dash-layout {
    --primary: #256b8a;
    --primary-dark: #1e5872;
}

.dash-layout .btn-primary:hover {
    background: #1e5872;
    border-color: #1e5872;
    box-shadow: 0 4px 12px rgba(37, 107, 138, 0.24);
    transform: translateY(-1px);
}

.dash-layout .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(37, 107, 138, 0.2);
}

.dash-layout .btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: var(--gray-600);
    border-color: rgba(0, 0, 0, 0.09);
}

.dash-layout .btn-secondary:hover {
    background: var(--white);
    border-color: rgba(37, 107, 138, 0.25);
    color: #256b8a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dash-layout .btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    border-radius: var(--dash-radius-xs);
}

.dash-layout .btn-sm svg {
    width: 12px;
    height: 12px;
}

.dash-layout .btn-danger {
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: var(--dash-radius-sm);
}

.dash-layout .btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
    transform: translateY(-1px);
}

.dash-layout .btn-icon {
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: var(--dash-radius-xs);
}

.dash-nav-group-dropdown .dash-nav-item {
    padding-left: 1.375rem;
    font-size: 0.78125rem;
}

.dash-nav-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.dash-nav-group-chevron {
    margin-left: auto;
    color: var(--gray-400);
    flex-shrink: 0;
    transition: transform var(--dash-transition), color var(--dash-transition);
}

.dash-nav-group.open .dash-nav-group-chevron {
    transform: rotate(180deg);
    color: var(--gray-600);
}

.dash-nav-group-dropdown {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.22s ease;
}

.dash-nav-group.open .dash-nav-group-dropdown {
    max-height: 200px;
}

.dash-nav-count {
    margin-left: auto;
    font-size: 0.6875rem;
    color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
    padding: 0.125rem 0.5rem;
    font-weight: 600;
    border-radius: var(--dash-radius-pill);
    min-width: 1.25rem;
    text-align: center;
}

/* Main Content */
.dash-main {
    flex: 1;
    margin-left: var(--dash-sidebar-current-width);
    display: flex;
    flex-direction: column;
}

.dash-layout.sidebar-collapsed .dash-logo span,
.dash-layout.sidebar-collapsed .dash-nav .overview-lookup,
.dash-layout.sidebar-collapsed .dash-nav-item > span,
.dash-layout.sidebar-collapsed .dash-nav-group-chevron {
    display: none;
}

.dash-layout.sidebar-collapsed .dash-sidebar-header {
    padding: 1.1rem 0.75rem 0.9rem;
}

.dash-layout.sidebar-collapsed .dash-logo {
    gap: 0;
    justify-content: center;
}

.dash-layout.sidebar-collapsed .dash-nav {
    padding: 0.75rem 0.4rem;
}

.dash-layout.sidebar-collapsed .dash-nav-item {
    justify-content: center;
    padding: 0.58rem 0.45rem;
    gap: 0;
}

.dash-layout.sidebar-collapsed .dash-sidebar-footer {
    padding: 0.5rem 0.4rem;
}

@media (min-width: 769px) {
    .dash-layout { --dash-sidebar-current-width: var(--dash-sidebar-collapsed-width); }
    .dash-sidebar-toggle { display: none; }
    .dash-sidebar-header { justify-content: center; padding: 1rem 0.5rem; }
    .dash-logo span,
    .dash-nav .overview-lookup,
    .dash-nav-item > span,
    .dash-nav-group-chevron { display: none; }
    .dash-logo { justify-content: center; gap: 0; width: 42px; height: 38px; }
    .dash-logo svg { width: 20px; height: 20px; }
    .dash-nav { padding: 0.65rem 0.5rem; gap: 3px; overflow: visible; }
    .dash-nav-group { align-items: center; }
    .dash-nav > .dash-nav-item,
    .dash-nav-group > .dash-nav-item,
    .dash-sidebar-footer .dash-nav-item {
        justify-content: center;
        width: 44px;
        min-height: 40px;
        padding: 0;
        gap: 0;
    }
    .dash-nav-group > .dash-nav-item svg:first-child,
    .dash-sidebar-footer .dash-nav-item svg:first-child { width: 18px; height: 18px; }
    .dash-nav-group-dropdown {
        position: fixed;
        z-index: 80;
        top: var(--nav-flyout-top, 72px);
        left: calc(var(--dash-sidebar-collapsed-width) + 9px);
        width: 230px;
        max-height: none;
        padding: 0.45rem;
        overflow: visible;
        border: 1px solid #dbe3ec;
        border-radius: 8px;
        background: rgba(255,255,255,0.98);
        box-shadow: 0 14px 34px rgba(15,23,42,0.16), 0 2px 8px rgba(15,23,42,0.08);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateX(-5px);
        transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
    }
    .dash-nav-group-dropdown::before {
        content: attr(data-menu-label);
        display: block;
        padding: 0.42rem 0.55rem 0.5rem;
        color: #64748b;
        font-size: 0.64rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
    .dash-nav-group-dropdown::after {
        content: '';
        position: absolute;
        top: 14px;
        left: -5px;
        width: 9px;
        height: 9px;
        border-left: 1px solid #dbe3ec;
        border-bottom: 1px solid #dbe3ec;
        background: #fff;
        transform: rotate(45deg);
    }
    .dash-nav-group.open .dash-nav-group-dropdown {
        max-height: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(0);
    }
    .dash-layout.sidebar-collapsed .dash-nav-group-dropdown .dash-nav-item,
    .dash-nav-group-dropdown .dash-nav-item {
        justify-content: flex-start;
        width: 100%;
        min-height: 36px;
        padding: 0.45rem 0.55rem;
        gap: 0.6rem;
        border-radius: 6px;
    }
    .dash-layout.sidebar-collapsed .dash-nav-group-dropdown .dash-nav-item > span,
    .dash-nav-group-dropdown .dash-nav-item > span { display: inline; }
    .dash-nav-group-dropdown .dash-nav-flyout-home {
        margin-bottom: 0.3rem;
        box-shadow: inset 0 -1px #e5e7eb;
        color: #334155;
        font-weight: 700;
    }
    .dash-nav-group-dropdown .dash-nav-count { display: inline-flex; margin-left: auto; }
    .dash-sidebar-footer { display: grid; justify-items: center; gap: 3px; padding: 0.5rem; }
}

.dash-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    position: sticky;
    top: 0;
    z-index: 40;
}

.dash-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: -0.02em;
}

/* Profile status chip (topbar) */
.profile-status-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: 0.9rem;
    margin-right: auto;
}
.profile-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    background: transparent;
    padding: 0.15rem 0.3rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #16a34a;
    cursor: pointer;
    transition: background 0.15s;
}
.profile-status-chip:hover { background: rgba(0,0,0,0.04); }
.profile-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 3px #22c55e, 0 0 8px rgba(34,197,94,0.85), 0 0 14px rgba(34,197,94,0.5);
    flex-shrink: 0;
    animation: profileStatusGlow 2.2s ease-in-out infinite;
}
@keyframes profileStatusGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
.profile-status-chip[data-status="inactive"],
.profile-status-chip[data-status="sold"] { color: #dc2626; }
.profile-status-chip[data-status="inactive"] .profile-status-dot,
.profile-status-chip[data-status="sold"] .profile-status-dot {
    background: #ef4444;
    box-shadow: 0 0 3px #ef4444, 0 0 8px rgba(239,68,68,0.85), 0 0 14px rgba(239,68,68,0.5);
}
.profile-status-chip[data-status="maintenance"],
.profile-status-chip[data-status="inshop"],
.profile-status-chip[data-status="reserved"] { color: #b45309; }
.profile-status-chip[data-status="maintenance"] .profile-status-dot,
.profile-status-chip[data-status="inshop"] .profile-status-dot,
.profile-status-chip[data-status="reserved"] .profile-status-dot {
    background: #f59e0b;
    box-shadow: 0 0 3px #f59e0b, 0 0 8px rgba(245,158,11,0.85), 0 0 14px rgba(245,158,11,0.5);
}
.profile-dnd-chip {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #dc2626;
    text-transform: uppercase;
}
.profile-status-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 170px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    padding: 0.3rem;
    z-index: 200;
}
.profile-status-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--gray-700);
    text-align: left;
    cursor: pointer;
}
.profile-status-option:hover { background: rgba(0,0,0,0.05); }
.profile-status-option.active { font-weight: 700; color: var(--primary); }
.profile-status-option-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* Profile subheader (quick facts) */
.profile-subheader {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 0.9rem;
    padding: 0.4rem 1.5rem 0.6rem;
    background: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.profile-subheader-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.74rem;
    color: var(--gray-500);
    white-space: nowrap;
}
.profile-subheader-item strong { color: var(--gray-700); font-weight: 600; }
.profile-subheader-item button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    color: var(--gray-700);
    font-weight: 600;
    cursor: pointer;
}
.profile-subheader-item button:hover { color: var(--gray-700); }
.profile-copy-value svg { color: var(--gray-400); flex-shrink: 0; }
.profile-copy-value:hover svg { color: currentColor; }
.profile-subheader-item a { color: var(--primary); font-weight: 600; text-decoration: none; }
.profile-subheader-item a:hover { text-decoration: underline; }

/* Floating close button */
.profile-float-close {
    position: fixed;
    top: 68px;
    right: 1.5rem;
    z-index: 210;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--gray-500);
    cursor: pointer;
    transition: color 0.15s;
}
.profile-float-close:hover { color: #dc2626; }

/* Save footer */
.profile-save-footer {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.06);
    background: #fff;
}
.btn-profile-save {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(79,70,229,0.25);
    transition: all 0.15s;
}
.btn-profile-save:hover { background: var(--primary-dark, #4338ca); box-shadow: 0 4px 14px rgba(79,70,229,0.35); }
#detailTruckName, #detailTruckStatus, #detailTrailerName, #detailTrailerStatus, #detailDriverName, #detailDriverStatus { display: none !important; }

.dash-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-notifications { position: relative; }
.notifications-btn { position: relative; }
.notifications-count {
    position: absolute;
    top: -3px;
    right: -4px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
}
.notifications-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 10030;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: 420px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(29,28,29,0.1);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(29,28,29,0.12);
}
.notifications-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(29,28,29,0.08);
    color: #1d1c1d;
    font-size: 0.82rem;
}
.notifications-refresh {
    border: none;
    background: transparent;
    color: #8a8f98;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 2px;
}
.notifications-refresh:hover { color: #1264a3; }
.notifications-list { max-height: 360px; overflow-y: auto; }
.notifications-empty {
    padding: 28px 16px;
    color: #8a8f98;
    font-size: 0.78rem;
    text-align: center;
}
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid rgba(29,28,29,0.06);
    background: #fff;
    color: #1d1c1d;
    cursor: pointer;
    text-align: left;
}
.notification-item:hover { background: rgba(29,155,209,0.06); }
.notification-item-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }
.notification-item-copy strong { font-size: 0.78rem; font-weight: 600; color: #1d1c1d; }
.notification-item-copy span { overflow: hidden; color: #616061; font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.notification-item time { color: #8a8f98; font-size: 0.68rem; white-space: nowrap; }

/* Engraved icon button — subtle tool in the topbar */
.topbar-engraved-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 6px;
    border: none;
    border-radius: 5px;
    background: none;
    cursor: pointer;
    outline: none;
    color: rgba(60, 60, 80, 0.35);
    box-shadow: none;
    transition: color 0.18s, box-shadow 0.18s, background 0.18s;
}
.topbar-engraved-btn:hover {
    color: rgba(60, 60, 80, 0.65);
    background: rgba(0, 0, 0, 0.04);
    box-shadow: none;
}
.topbar-engraved-btn:active {
    box-shadow: none;
    background: rgba(0, 0, 0, 0.06);
}
.topbar-engraved-btn:focus,
.topbar-engraved-btn:focus-visible {
    outline: none;
    box-shadow: none;
}

/* Theme toggle icon swap */
#themeToggleBtn .icon-moon { display: none; }
html[data-theme="dark"] #themeToggleBtn .icon-sun { display: none; }
html[data-theme="dark"] #themeToggleBtn .icon-moon { display: block; }

/* Dark mode uses native colors so semantic states and media stay accurate. */
html[data-theme="dark"] body {
    background: #101419;
}
html[data-theme="dark"] .dash-layout {
    --primary: #52b8e2;
    --primary-dark: #3194be;
    --dash-border-color: rgba(226, 232, 240, 0.1);
    --dash-hover-bg: rgba(82, 184, 226, 0.09);
    --dash-focus-ring: 0 0 0 3px rgba(82, 184, 226, 0.18);
    --dash-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --dash-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.24), 0 8px 24px rgba(0, 0, 0, 0.12);
    --dash-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.24);
    --gray-50: #171c22;
    --gray-100: #1e252d;
    --gray-200: #2b343e;
    --gray-300: #46515d;
    --gray-400: #84909d;
    --gray-500: #a5afb9;
    --gray-600: #bac3cc;
    --gray-700: #d1d7de;
    --gray-800: #e5e9ed;
    --gray-900: #f4f6f8;
    --white: #1b2128;
    color-scheme: dark;
    background: #101419;
    filter: none;
}

.dash-account-trigger {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    cursor: pointer;
    transition: color var(--dash-transition);
}

.dash-account-trigger:hover .dash-user-email {
    color: var(--primary);
}

.dash-account-trigger:focus-visible {
    outline: 2px solid rgba(79, 70, 229, 0.28);
    outline-offset: 2px;
}

.dash-account-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dbeafe, #c4b5fd);
    color: var(--primary-dark);
    font-size: 0.8125rem;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.dash-account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dash-account-copy {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    line-height: 1;
    padding-bottom: 0.125rem;
}

.dash-user-email {
    font-size: 0.75rem;
    color: var(--gray-700);
    background: none;
    padding: 0;
    border-radius: 0;
    border: none;
    font-weight: 700;
}

/* Account dropdown */
.dash-account-wrap {
    position: relative;
}

.dash-account-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    padding: 4px 0;
}

.dash-account-dropdown[hidden] {
    display: none;
}

.dash-account-dd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--gray-700, #374151);
    text-align: left;
    transition: background 0.12s;
}

.dash-account-dd-item:hover {
    background: var(--gray-50, #f9fafb);
}

.dash-account-dd-divider {
    height: 1px;
    background: var(--border, #e5e7eb);
    margin: 4px 0;
}

.dash-account-dd-signout {
    color: #dc2626;
}

.dash-account-dd-signout:hover {
    background: #fef2f2;
}

/* Sections */
.dash-section {
    display: none;
    padding: 1.75rem 1rem;
}

.dash-section.active {
    display: block;
}
#section-driver-profile, #section-truck-profile, #section-trailer-profile {
    padding: 0;
}

/* Cards â€“ Glassmorphism */
.dash-card {
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--dash-card-radius);
    box-shadow: var(--dash-shadow-sm);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.dash-card:hover {
    box-shadow: var(--dash-shadow-md);
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: var(--dash-card-header-padding);
    border-bottom: 1px solid var(--dash-border-color);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.6) 0%, rgba(241, 245, 249, 0.3) 100%);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.dash-card-header h2 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: -0.015em;
}

/* Duplicate section-title cleanup */
.dup-section-heading {
    display: none !important;
}

.dup-header-shell {
    display: none !important;
}

/* Collapse chevron */
.dash-card-header .section-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-left: 0.5rem;
    color: var(--gray-400);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s ease;
}
.dash-card.collapsed .dash-card-header .section-chevron {
    transform: rotate(-90deg);
    color: var(--gray-500);
}
.dash-card-header:hover .section-chevron {
    color: var(--primary);
}

.dash-card-header-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--dash-toolbar-gap);
    margin-left: auto;
}

.dash-card-header-actions .dash-toolbar-add {
    margin-left: 0;
}

#section-dispatch-board .load-board-icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
}

#section-dispatch-board .load-board-icon-action:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

#section-dispatch-board .load-board-icon-action:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

#section-dispatch-board .load-board-icon-action svg {
    width: 16px;
    height: 16px;
}

#loadsTable .row-actions,
#loadsTable .row-actions .cell,
#loadsTable .row-actions button {
    border: 0;
    outline: 0;
    box-shadow: none;
    background: transparent;
}

#section-dispatch-board .load-filterbar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid rgba(29, 28, 29, 0.08);
    background: #fff;
}

#section-dispatch-board .load-filterbar .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

#section-dispatch-board .load-filterbar .filter-group label {
    color: #6b7280;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

#section-dispatch-board .load-filterbar .filter-input,
#section-dispatch-board .load-filterbar .filter-select {
    height: 30px;
    padding: 0 0.6rem;
    border: 1px solid rgba(29, 28, 29, 0.12);
    border-radius: 6px;
    background: #fff;
    color: var(--gray-800);
    font-family: inherit;
    font-size: 0.8125rem;
    box-shadow: none;
}

#section-dispatch-board .load-filterbar .filter-input:focus,
#section-dispatch-board .load-filterbar .filter-select:focus {
    outline: none;
    border-color: rgba(29, 155, 209, 0.55);
    box-shadow: 0 0 0 3px rgba(29, 155, 209, 0.13);
}

#section-dispatch-board .load-filterbar .filter-group.search {
    flex: 0 1 220px;
    min-width: 180px;
}

#section-dispatch-board .load-filterbar .filter-group.search .filter-input {
    width: 100%;
}

#section-dispatch-board .load-filterbar .filter-group.status .filter-select {
    width: 108px;
}

#section-dispatch-board .load-filterbar .filter-group.sort .filter-select {
    width: 125px;
}

@media (max-width: 560px) {
    #section-dispatch-board .load-filterbar .filter-group,
    #section-dispatch-board .load-filterbar .filter-group.search {
        flex: 1 1 100%;
        width: 100%;
    }

    #section-dispatch-board .load-filterbar .filter-input,
    #section-dispatch-board .load-filterbar .filter-select,
    #section-dispatch-board .load-filterbar .filter-group.status .filter-select,
    #section-dispatch-board .load-filterbar .filter-group.sort .filter-select {
        width: 100%;
    }
}

html[data-theme="dark"] #section-dispatch-board .load-filterbar {
    background: #171c22;
    border-color: #2a333d;
}

html[data-theme="dark"] #section-dispatch-board .load-filterbar .filter-group label {
    color: #7f8b97;
}

html[data-theme="dark"] #section-dispatch-board .load-filterbar .filter-input,
html[data-theme="dark"] #section-dispatch-board .load-filterbar .filter-select {
    color: #dce2e7;
    background: #12171c;
    border-color: #343e48;
}

html[data-theme="dark"] #section-dispatch-board .load-filterbar .filter-input::placeholder {
    color: #697581;
}

/* Collapsible card body */
.dash-card-body {
    padding: var(--dash-card-body-padding);
    overflow: hidden;
}

.dash-card > .dash-card-body > * {
    overflow: hidden;
}
.dash-card.collapsed > .dash-card-body {
    grid-template-rows: 0fr;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}
.dash-card.collapsed > .dash-card-header {
    border-bottom-color: transparent;
}

/* Card body with table needs no bottom padding */
.dash-card-body:has(.dash-table-wrap) {
    padding: var(--dash-card-table-padding);
}

/* Profile Hero */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.profile-photo-wrapper {
    position: relative;
    flex-shrink: 0;
}

.profile-photo {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    background: linear-gradient(135deg, #e0e7ff, #f3e8ff);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo-edit {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 26px;
    height: 26px;
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--dash-transition);
    color: var(--gray-500);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.profile-photo-edit:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.profile-hero-info h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.125rem;
    letter-spacing: -0.01em;
}

.profile-hero-info p {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* Profile tabs */
.profile-tabs {
    display: flex; gap: 2px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 24px; margin-top: 24px;
}
.profile-tab {
    background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px 16px; font-size: 0.875rem; font-weight: 500;
    color: var(--gray-500); cursor: pointer; margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s; border-radius: 0;
}
.profile-tab:hover { color: var(--gray-800); }
.profile-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.profile-tab-panel { display: none; }
.profile-tab-panel.active { display: block; }

/* Notification toggles */
.profile-notif-section { margin-bottom: 24px; }
.profile-notif-section h4 {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--gray-500);
    margin-bottom: 10px; padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}
.profile-notif-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 10px 0;
    border-bottom: 1px solid var(--gray-50); cursor: pointer;
}
.profile-notif-row:last-child { border-bottom: none; }
.profile-notif-text span { display: block; font-size: 0.875rem; font-weight: 500; color: var(--gray-800); }
.profile-notif-text small { display: block; font-size: 0.78rem; color: var(--gray-500); margin-top: 1px; }
/* Toggle switch */
.profile-toggle {
    -webkit-appearance: none; appearance: none;
    flex-shrink: 0; width: 36px; height: 20px; border-radius: 999px;
    background: var(--gray-200); cursor: pointer; position: relative;
    transition: background 0.2s; outline-offset: 2px;
}
.profile-toggle::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: left 0.2s;
}
.profile-toggle:checked { background: var(--primary); }
.profile-toggle:checked::after { left: 18px; }

/* Security section */
.profile-security-info {
    background: var(--gray-50); border: 1px solid var(--gray-200);
    border-radius: 10px; padding: 4px 16px; margin-bottom: 24px;
}
.profile-security-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--gray-200);
}
.profile-security-row:last-child { border-bottom: none; }
.profile-security-row strong { font-size: 0.875rem; font-weight: 600; color: var(--gray-800); }
.profile-security-badge {
    background: rgba(34,197,94,0.1); color: #16a34a;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px;
    flex-shrink: 0;
}

/* Dashboard Forms */
.dash-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group-full {
    grid-column: 1 / -1;
}

.company-address-toggle-row {
    margin-top: -0.125rem;
}

.company-address-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-size: 0.75rem;
    color: var(--gray-600);
    cursor: pointer;
}

.company-address-toggle input {
    position: static;
    opacity: 1;
    pointer-events: auto;
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.company-address-toggle-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--gray-600);
    line-height: 1.35;
    text-transform: none;
}

.dash-form-actions {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
}

/* Dashboard Tables â€“ Spreadsheet Board */
.dash-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: var(--dash-radius-md);
    border: 1px solid var(--dash-border-color);
    transition: opacity var(--dash-transition);
    cursor: default;
    background: #fff;
    box-shadow: var(--dash-shadow-xs);
}

.table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
}

.dash-table {
    width: 100%;
    min-width: 1020px;
    border-collapse: collapse;
    font-size: var(--dash-table-font-size);
    table-layout: fixed;
    cursor: default;
}

.dash-table th {
    text-align: left;
    padding: 7px 8px;
    font-weight: 700;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #f3f4f6;
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.dash-table th:last-child {
    border-right: none;
}

.dash-table td {
    padding: 0;
    border-bottom: 1px solid #f3f4f6;
    border-right: 1px solid #f3f4f6;
    color: var(--gray-700);
    position: relative;
    height: var(--dash-row-height);
    vertical-align: middle;
}

.dash-table td:last-child {
    border-right: none;
}

.dash-table td strong {
    color: var(--gray-800);
    font-weight: 600;
}

.dash-table .text-muted {
    color: var(--gray-400);
    font-size: var(--dash-table-font-size);
}

/* Scrollable table container */
.dash-table-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    border-radius: 6px;
}

.dash-table-scroll::-webkit-scrollbar {
    height: 6px;
}

.dash-table-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}

.dash-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.dash-table-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* Shared column helpers */
.col-validation { width: 3%; min-width: 28px; }

.vin-cell {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

/* Cell wrapper for click-to-edit */
.cell {
    display: flex;
    align-items: center;
    padding: 0 0.35rem;
    height: 100%;
    min-height: var(--dash-cell-min-height);
    cursor: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-primary {
    color: var(--primary-dark);
}

.cell-link {
    width: 100%;
    border: none;
    background: none;
    font: inherit;
    text-align: left;
}

.cell-link-unit {
    justify-content: flex-start;
    color: var(--primary-dark);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--dash-transition), box-shadow var(--dash-transition);
}

.cell-link-unit:hover {
    background: none;
    color: var(--primary);
}

.cell-link-unit:focus-visible {
    outline: none;
    box-shadow: none;
    background: none;
}

.cell-link-unit:focus,
.cell-link-unit:active {
    outline: none;
    box-shadow: none;
    background: none;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cell-editable {
    cursor: text;
    border: 1px solid transparent;
    border-radius: 0;
    margin: 0;
    padding: 0 8px;
    min-height: var(--dash-cell-min-height);
    transition: border-color var(--dash-transition), background var(--dash-transition);
}

.cell-editable:hover {
    border-color: #c7d2fe;
    background: #fafbff;
}

/* Inline edit input */
.cell-input {
    width: 100%;
    height: 100%;
    padding: 0 8px;
    margin: 0;
    border: 1px solid #6366f1;
    background: #fff;
    font-size: var(--dash-table-font-size);
    font-family: inherit;
    font-weight: 500;
    color: #111827;
    outline: none;
    box-shadow: inset 0 0 0 1px #6366f1;
    border-radius: 0;
    transition: border-color var(--dash-transition), background var(--dash-transition), box-shadow var(--dash-transition);
}

.cell-input:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: inset 0 0 0 1px #6366f1;
}

/* Inline status select */
.cell-status-select {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: calc(var(--dash-control-height) - 4px);
    padding: 0 1.25rem 0 0.375rem;
    border: none;
    background: transparent;
    font-size: var(--dash-table-font-size);
    font-weight: 600;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
    outline: none;
    border-radius: 999px;
    transition: box-shadow var(--dash-transition), background var(--dash-transition);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.375rem center;
}

.cell-status-select:hover {
    box-shadow: 0 0 0 2px #c7d2fe;
}

.load-status-select {
    appearance: none;
    min-width: 104px;
    height: 24px;
    padding: 0 1.35rem 0 0.5rem;
    border: 0;
    font-family: inherit;
    font-size: var(--dash-table-font-size);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
}

.load-status-select:hover,
.load-status-select:focus {
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.18);
}

.load-status-select:disabled {
    cursor: wait;
    opacity: 0.65;
}

.cell-status-select:focus {
    box-shadow: 0 0 0 2px #6366f1;
}

/* Row states */
.dash-table tbody tr {
    transition: background 0.1s;
}

.dash-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.dash-table tbody tr[data-id] {
    cursor: default;
}

.dash-table tbody tr[data-id] td:not(.col-status):not(.row-actions):not(.col-validation),
.dash-table tbody tr[data-id] td:not(.col-status):not(.row-actions):not(.col-validation) .cell,
.dash-table tbody tr[data-id] td:not(.col-status):not(.row-actions):not(.col-validation) strong {
    cursor: pointer;
}

.dash-table tbody tr:hover {
    background: #f0f4ff;
}

.dash-table tbody tr.row-editing {
    background: #fffbeb;
}

.dash-table tbody tr:last-child td {
    border-bottom: none;
}

.dash-table td {
    height: var(--dash-row-height);
}

/* Compact row actions */
.row-actions {
    text-align: center;
    white-space: nowrap;
    min-width: var(--dash-action-column-width);
    width: var(--dash-action-column-width);
    flex-shrink: 0;
}

.row-actions .cell {
    justify-content: center;
    gap: 4px;
    padding: 0 0.25rem;
}

.row-actions button {
    background: none;
    border: none;
    cursor: pointer;
    width: var(--dash-action-button-size);
    height: var(--dash-action-button-size);
    padding: 0;
    color: var(--gray-400);
    border-radius: var(--dash-radius-xs);
    transition: all var(--dash-transition);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.dash-table tbody tr:hover .row-actions button {
    opacity: 1;
}

.row-actions button:hover {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
}

.row-actions .btn-delete:hover {
    color: var(--danger);
    background: rgba(220, 38, 38, 0.06);
}

/* Table Toolbar (search + filter) */
.dash-table-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--dash-radius-md);
}

.dash-search-wrap {
    position: relative;
    flex: 0 0 var(--dash-search-width);
    width: var(--dash-search-width);
    min-width: var(--dash-search-width);
    max-width: var(--dash-search-width);
}

.dash-search-wrap svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    transition: color 0.2s ease;
}

.dash-search-wrap:focus-within svg {
    color: var(--primary);
}

.dash-search {
    width: 100%;
    height: var(--dash-control-height);
    padding: 0 0.625rem 0 1.75rem;
    font-size: var(--dash-control-font-size);
    border: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #111827;
    font-weight: 500;
    transition: border-color var(--dash-transition), background var(--dash-transition), box-shadow var(--dash-transition);
}

.dash-search:hover {
    border-color: #c7d2fe;
    background: #fafbff;
}

.dash-search:focus {
    outline: none;
    border-color: #6366f1;
    background: #fff;
    box-shadow: inset 0 0 0 1px #6366f1;
}

.dash-search::placeholder {
    color: #c6cbd2;
    font-weight: 400;
}

.dash-filter,
.dash-sort {
    height: var(--dash-control-height);
    padding: 0 1.5rem 0 0.5rem;
    font-size: var(--dash-control-font-size);
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #111827;
    cursor: pointer;
    transition: border-color var(--dash-transition), background var(--dash-transition), box-shadow var(--dash-transition);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 10px 6px;
    flex: 0 0 auto;
}

.dash-filter {
    width: var(--dash-status-filter-width);
    min-width: var(--dash-status-filter-width);
}

#truckFuelFilter {
    width: var(--dash-fuel-filter-width);
    min-width: var(--dash-fuel-filter-width);
}

.dash-filter:hover,
.dash-sort:hover {
    border-color: #c7d2fe;
    background: #fafbff;
}

.dash-filter:focus,
.dash-sort:focus {
    outline: none;
    border-color: #6366f1;
    background: #fff;
    box-shadow: inset 0 0 0 1px #6366f1;
}

/* Sort dropdown */
.dash-sort {
    width: 125px;
    min-width: 110px;
}

/* Table Column Picker */
.table-col-picker-wrap {
    position: relative;
    margin-left: auto;
}

.table-col-picker-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1;
    font-family: inherit;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: background var(--dash-transition), border-color var(--dash-transition), color var(--dash-transition);
}

.table-col-picker-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.table-col-picker-btn:active {
    background: #e5e7eb;
}

.table-col-picker-btn svg {
    display: none;
}

.table-col-dropdown {
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 156px;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.1) transparent;
    transform-origin: top right;
    animation: colDropdownIn 0.15s ease;
}

.table-col-dropdown::-webkit-scrollbar { width: 5px; }
.table-col-dropdown::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }

.table-col-dropdown.hidden {
    display: none;
}

@keyframes colDropdownIn {
    from { opacity: 0; transform: scale(0.95) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.dash-table-wrap.col-transitioning {
    opacity: 0.3;
}

/* Column drag-reorder */
.dash-table thead th[data-col-key] {
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    transition: background 0.15s, box-shadow 0.15s;
}
.dash-table thead th[data-col-key]:active { cursor: grabbing; }
.dash-table thead th.th-dragging {
    opacity: 0.35;
    background: rgba(99,102,241,0.06);
}
.dash-table thead th.th-drag-over {
    box-shadow: inset -3px 0 0 0 #6366f1;
    background: rgba(99,102,241,0.04);
}

/* Column drag-reorder */
.dash-table thead th[data-col-key] {
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    transition: background 0.15s, box-shadow 0.15s;
}
.dash-table thead th[data-col-key]:active { cursor: grabbing; }
.dash-table thead th.th-dragging {
    opacity: 0.35;
    background: rgba(99,102,241,0.06);
}
.dash-table thead th.th-drag-over {
    box-shadow: inset -3px 0 0 0 #6366f1;
    background: rgba(99,102,241,0.04);
}

/* Checkbox column */
.col-checkbox {
    width: 15px !important;
    min-width: 15px;
    max-width: 15px;
    text-align: center;
    padding: 0 !important;
    position: relative;
    vertical-align: middle;
}
th.col-checkbox,
td.col-checkbox {
    padding: 0 !important;
    line-height: 0;
    vertical-align: middle;
}

.col-checkbox input[type="checkbox"],
.bulk-cb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    border-radius: 1px;
    background: #fff;
    cursor: pointer;
    position: relative;
    display: block;
    margin: 0 auto;
    transition: background var(--dash-transition), border-color var(--dash-transition), box-shadow var(--dash-transition), transform var(--dash-transition);
}

.col-checkbox input[type="checkbox"]:hover,
.bulk-cb:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
    transform: scale(1.05);
}

.col-checkbox input[type="checkbox"]:checked,
.bulk-cb:checked {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.25);
}

.col-checkbox input[type="checkbox"]:checked::after,
.bulk-cb:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0.5px;
    width: 4px;
    height: 7px;
    border: solid white;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.col-checkbox input[type="checkbox"]:focus-visible,
.bulk-cb:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.row-selected {
    background: #eef2ff !important;
}

.row-selected:hover {
    background: #e0e7ff !important;
}

/* Bulk action bar */
.bulk-bar {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(79, 70, 229, 0.04);
    border: 1px solid rgba(79, 70, 229, 0.12);
    border-radius: var(--dash-radius-sm);
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.06);
}

.bulk-bar.visible {
    display: flex;
}

.bulk-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-right: 0.25rem;
}

.bulk-btn {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--dash-transition);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bulk-btn-status {
    background: var(--white);
    color: var(--primary);
    border-color: rgba(79, 70, 229, 0.2);
}

.bulk-btn-status:hover {
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.3);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.1);
}

.bulk-btn-export {
    background: var(--white);
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.2);
}

.bulk-btn-export:hover {
    background: rgba(22, 163, 74, 0.06);
    border-color: rgba(22, 163, 74, 0.3);
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.1);
}

.bulk-btn-delete {
    background: var(--white);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
    margin-left: auto;
}

.bulk-btn-delete:hover {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.1);
}

/* Inline truck select */
.inline-truck-select {
    width: 100%;
    max-width: 130px;
    height: 30px;
    padding: 0 20px 0 8px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 30px;
    border: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #111827;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 10px 6px;
    transition: border-color var(--dash-transition), background var(--dash-transition), box-shadow var(--dash-transition);
}

.inline-truck-select:hover {
    border-color: #c7d2fe;
    background: #fafbff;
}

.inline-truck-select:focus {
    outline: none;
    border-color: #6366f1;
    background: #fff;
    box-shadow: var(--dash-focus-ring);
}

.inline-truck-select:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: transparent;
}

.inline-truck-select option {
    font-weight: 500;
    padding: 4px 8px;
}

/* Toolbar add button */
.dash-toolbar-add {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: var(--dash-add-button-width);
    border-radius: var(--dash-radius-sm);
    font-weight: 700;
    min-height: var(--dash-control-height);
    font-size: var(--dash-control-font-size);
    padding: 0 0.75rem;
    box-shadow: 0 1px 4px rgba(79, 70, 229, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex-shrink: 0;
}

.dash-toolbar-add:hover {
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.dash-toolbar-add:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(79, 70, 229, 0.2);
}

.dash-toolbar-add svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Toolbar action group */
.dash-toolbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--dash-toolbar-gap);
    flex-shrink: 0;
}

/* Secondary toolbar button */
.dash-toolbar-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: var(--dash-import-button-width);
    border-radius: var(--dash-radius-sm);
    font-weight: 600;
    min-height: var(--dash-control-height);
    font-size: var(--dash-control-font-size);
    padding: 0 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--gray-600);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--dash-transition);
    flex-shrink: 0;
}

.dash-toolbar-secondary:hover {
    background: var(--white);
    border-color: rgba(79, 70, 229, 0.2);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.dash-toolbar-secondary:active {
    transform: translateY(0);
    box-shadow: none;
}

.dash-toolbar-secondary svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
}

.status-badge.active {
    color: #18794e;
    background: #edf8f2;
    box-shadow: inset 0 0 0 1px rgba(24, 121, 78, 0.14);
}

.status-badge.inactive {
    color: var(--gray-500);
    background: rgba(107, 114, 128, 0.1);
}

.status-badge.maintenance,
.status-badge.home-time {
    color: #b45309;
    background: rgba(217, 119, 6, 0.1);
}

.status-badge.inshop,
.status-badge.pending {
    color: #b45309;
    background: rgba(217, 119, 6, 0.1);
}

.status-badge.training,
.status-badge.reserved {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.1);
}

.status-badge.sold,
.status-badge.terminated {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

.status-badge.suspended {
    color: #991b1b;
    background: rgba(153, 27, 27, 0.12);
}

/* Empty State */
.dash-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.dash-empty p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.overview-workspace-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.875rem;
}

.overview-workspace-tile {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 12px;
    padding: 0.875rem;
}

.overview-workspace-tile h3 {
    font-size: 0.8125rem;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.overview-workspace-tile p {
    font-size: 0.6875rem;
    color: var(--gray-500);
    line-height: 1.4;
}

.overview-lookup {
    position: relative;
    margin-bottom: 1.25rem;
    max-width: 540px;
}

.dash-nav .overview-lookup {
    margin: 0.125rem 0 0.5rem;
    max-width: none;
    width: 100%;
}

.dash-nav .overview-lookup-input {
    height: 34px;
    border-radius: var(--dash-radius-md);
    padding: 0 0.625rem 0 2rem;
    font-size: 0.75rem;
    box-shadow: none;
}

.dash-nav .overview-lookup-results {
    left: 0;
    right: 0;
    top: calc(100% + 0.375rem);
    z-index: 60;
    padding: 0.25rem;
    border-radius: var(--dash-radius-md);
    box-shadow: var(--dash-shadow-lg);
}

.dash-nav .overview-lookup-result {
    align-items: flex-start;
    gap: 0.3rem;
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
}

.dash-nav .overview-lookup-result:hover,
.dash-nav .overview-lookup-result.active {
    background: rgba(79, 70, 229, 0.06);
}

.dash-nav .overview-lookup-result-type {
    min-width: auto;
    padding: 0;
    border-radius: 0;
    background: none;
    color: var(--gray-500);
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: right;
}

.dash-nav .overview-lookup-result-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    width: 100%;
}

.dash-nav .overview-lookup-result-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
    width: 100%;
}

.dash-nav .overview-lookup-result-copy strong {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
}

.dash-nav .overview-lookup-result-meta,
.dash-nav .overview-lookup-result-detail {
    display: block;
    font-size: 0.595rem;
    color: var(--gray-500);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.dash-nav .overview-lookup-result-detail {
    color: var(--gray-600);
}

.overview-lookup-shell {
    position: relative;
}

.overview-lookup-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    z-index: 1;
}

.overview-lookup-input {
    width: 100%;
    height: 42px;
    padding: 0 1rem 0 2.6rem;
    border-radius: var(--dash-radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.76);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    font-size: 0.8125rem;
    color: var(--gray-700);
    box-shadow: var(--dash-shadow-lg);
    transition: border-color var(--dash-transition), box-shadow var(--dash-transition), background var(--dash-transition);
}

.overview-lookup-input:hover {
    background: rgba(255, 255, 255, 0.9);
}

.overview-lookup-input:focus {
    outline: none;
    border-color: rgba(79, 70, 229, 0.28);
    box-shadow: 0 10px 28px rgba(95, 108, 159, 0.12), 0 0 0 3px rgba(79, 70, 229, 0.08);
    background: rgba(255, 255, 255, 0.95);
}

.overview-lookup-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    display: none;
    padding: 0.375rem;
    border-radius: var(--dash-radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: var(--dash-shadow-xl);
    z-index: 20;
}

.overview-lookup-results.open {
    display: block;
}

.overview-lookup-result {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border: none;
    border-radius: 12px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background var(--dash-transition), transform var(--dash-transition);
}

.overview-lookup-result:hover,
.overview-lookup-result.active {
    background: rgba(79, 70, 229, 0.07);
}

.overview-lookup-result-type {
    min-width: 58px;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
}

.overview-lookup-result-type.truck {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.overview-lookup-result-type.trailer {
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
}

.overview-lookup-result-type.driver {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

.overview-lookup-result-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.overview-lookup-result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.overview-lookup-result-copy strong {
    font-size: 0.8125rem;
    color: var(--gray-800);
    font-weight: 700;
}

.overview-lookup-result-meta,
.overview-lookup-result-detail {
    font-size: 0.6875rem;
    color: var(--gray-500);
    line-height: 1.45;
}

/* Overview Cards */
.overview-grid {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}

/* Dropdown wrapper */
.overview-dropdown {
    flex: 1;
    min-width: 0;
    position: relative;
}
.overview-dropdown[data-type="drivers"] { order: -1; }

.overview-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--dash-radius-md);
    padding: 0.35rem 0.55rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: transform var(--dash-transition),
                box-shadow var(--dash-transition),
                border-color var(--dash-transition);
    box-shadow: var(--dash-shadow-xs);
    position: relative;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
}

.overview-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--dash-radius-md);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.overview-dropdown[data-type="trucks"] .overview-card::before {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.04), rgba(37, 99, 235, 0.01));
}

.overview-dropdown[data-type="trailers"] .overview-card::before {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.04), rgba(217, 119, 6, 0.01));
}

.overview-dropdown[data-type="drivers"] .overview-card::before {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.04), rgba(124, 58, 237, 0.01));
}

.overview-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--dash-shadow-md);
    border-color: rgba(255, 255, 255, 0.95);
}

.overview-card:hover::before {
    opacity: 1;
}

.overview-card:hover .overview-card-icon {
    transform: scale(1.04);
}

.overview-card:hover .overview-card-arrow {
    opacity: 1;
}

.overview-card:active {
    transform: translateY(0);
    transition-duration: 0.1s;
}

.overview-dropdown.open .overview-card {
    border-color: rgba(0, 0, 0, 0.1);
    border-radius: var(--dash-radius-md) var(--dash-radius-md) 0 0;
}

.overview-dropdown.open .overview-card-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* Icon circle */
.overview-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.25s ease, background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.overview-card-icon svg {
    width: 14px;
    height: 14px;
    filter: drop-shadow(0 1px 0 rgba(255,255,255,0.7));
    transition: filter 0.3s ease;
}

.overview-card-icon.trucks {
    background: rgba(0, 0, 0, 0.04);
    color: var(--gray-400);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.08), 0 1px 0 rgba(255,255,255,0.6);
}

.overview-card-icon.trailers {
    background: rgba(0, 0, 0, 0.04);
    color: var(--gray-400);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.08), 0 1px 0 rgba(255,255,255,0.6);
}

.overview-card-icon.drivers {
    background: rgba(0, 0, 0, 0.04);
    color: var(--gray-400);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.08), 0 1px 0 rgba(255,255,255,0.6);
}

.overview-card-icon.active-units {
    background: rgba(0, 0, 0, 0.04);
    color: var(--gray-400);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.08), 0 1px 0 rgba(255,255,255,0.6);
}

/* Color up on hover */
.overview-card:hover .overview-card-icon.trucks {
    background: linear-gradient(135deg, #dbeafe, #93c5fd);
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18);
}

.overview-card:hover .overview-card-icon.trailers {
    background: linear-gradient(135deg, #fef3c7, #fcd34d);
    color: #d97706;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.18);
}

.overview-card:hover .overview-card-icon.drivers {
    background: linear-gradient(135deg, #f3e8ff, #d8b4fe);
    color: #7c3aed;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.18);
}

.overview-card:hover .overview-card-icon.active-units {
    background: linear-gradient(135deg, #dcfce7, #86efac);
    color: #16a34a;
    box-shadow: 0 2px 8px rgba(22, 163, 106, 0.18);
}

.overview-card:hover .overview-card-icon svg {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.12));
}

/* Keep colored when dropdown is open */
.overview-dropdown.open .overview-card-icon.trucks {
    background: linear-gradient(135deg, #dbeafe, #93c5fd);
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18);
}
.overview-dropdown.open .overview-card-icon.trailers {
    background: linear-gradient(135deg, #fef3c7, #fcd34d);
    color: #d97706;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.18);
}
.overview-dropdown.open .overview-card-icon.drivers {
    background: linear-gradient(135deg, #f3e8ff, #d8b4fe);
    color: #7c3aed;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.18);
}

/* Info block */
.overview-card-info {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.overview-card-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.overview-card-label {
    display: block;
    font-size: 0.5rem;
    color: var(--gray-400);
    margin-top: 0.02rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.45px;
}

/* Arrow indicator */
.overview-card-arrow {
    flex-shrink: 0;
    color: var(--gray-300);
    width: 12px;
    height: 12px;
    opacity: 0.55;
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
    position: relative;
    z-index: 1;
}

.overview-card:hover .overview-card-arrow {
    color: var(--gray-500);
    opacity: 0.9;
}

/* Dropdown panel */
.overview-dropdown-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    border-radius: 0 0 var(--dash-radius-md) var(--dash-radius-md);
    max-height: 280px;
    overflow-y: auto;
    box-shadow: var(--dash-shadow-lg);
}

.overview-dropdown.open .overview-dropdown-panel {
    display: block;
}

.overview-dropdown-panel::-webkit-scrollbar {
    width: 4px;
}

.overview-dropdown-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 4px;
}

.overview-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    cursor: pointer;
    transition: background var(--dash-transition);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    text-decoration: none;
    color: inherit;
}

.overview-dropdown-item:last-child {
    border-bottom: none;
}

.overview-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.overview-dropdown-item-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
}

.overview-dropdown[data-type="trucks"] .overview-dropdown-item-icon {
    background: #dbeafe;
    color: #2563eb;
}

.overview-dropdown[data-type="trailers"] .overview-dropdown-item-icon {
    background: #fef3c7;
    color: #d97706;
}

.overview-dropdown[data-type="drivers"] .overview-dropdown-item-icon {
    background: #f3e8ff;
    color: #7c3aed;
}

.overview-dropdown-item-info {
    flex: 1;
    min-width: 0;
}

.overview-dropdown-item-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-dropdown-item-meta {
    display: block;
    font-size: 0.6rem;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-dropdown-item-status {
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.overview-dropdown-item-status.active {
    background: #dcfce7;
    color: #16a34a;
}

.overview-dropdown-item-status.maintenance {
    background: #fef3c7;
    color: #d97706;
}

.overview-dropdown-item-status.inactive {
    background: #fee2e2;
    color: #dc2626;
}

.overview-dropdown-empty {
    padding: 0.75rem 0.55rem;
    text-align: center;
    font-size: 0.7rem;
    color: var(--gray-400);
}

.overview-details {
    max-width: 520px;
}

@media (max-width: 1180px) {
    .overview-grid {
        display: flex;
    }
}

@media (max-width: 900px) {
    .overview-grid {
        display: flex;
        flex-wrap: wrap;
    }

    .overview-dropdown {
        flex: 1 1 45%;
    }

    .company-dashboard-layout {
        display: block;
    }

    .company-tabs {
        width: 100%;
    }

    .company-dashboard-check-grid {
        grid-template-columns: 1fr;
    }

    .company-user-invite-row,
    .company-template-form {
        grid-template-columns: 1fr;
    }

    .company-template-tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Overview Alerts */
.overview-alerts {
    width: 100%;
    margin-bottom: 1.25rem;
}

.overview-alerts:empty {
    display: none;
    margin-bottom: 0;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    white-space: nowrap;
    overflow: hidden;
}
.alert-item span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-item:last-child {
    margin-bottom: 0;
}
a.alert-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: filter var(--dash-transition), box-shadow var(--dash-transition);
}
a.alert-link:hover {
    filter: brightness(0.95);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.alert-link-arrow {
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity var(--dash-transition), transform var(--dash-transition);
}
a.alert-link:hover .alert-link-arrow {
    opacity: 1;
    transform: translateX(2px);
}

.alert-item svg {
    flex-shrink: 0;
}

.alert-warning {
    color: #92400e;
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.25);
}

.alert-danger {
    color: #991b1b;
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.18);
}

.alert-info {
    color: #1e40af;
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.15);
}

.alert-unassigned {
    padding: 0;
    white-space: normal;
    overflow: visible;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

.alert-unassigned.open {
    z-index: 100;
}

.alert-unassigned-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: default;
}

.alert-unassigned-header svg {
    flex-shrink: 0;
}

.alert-unassigned-header span {
    flex: 1;
    min-width: 0;
}

.alert-unassigned-header .alert-unassigned-chevron {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.alert-unassigned.open .alert-unassigned-chevron {
    transform: rotate(180deg);
    opacity: 0.8;
}

.alert-unassigned-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(37, 99, 235, 0.08);
    display: none;
}

.alert-unassigned.open .alert-unassigned-list {
    display: block;
}

.alert-unassigned-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    border-bottom: 1px solid rgba(37, 99, 235, 0.05);
    font-size: 0.7rem;
    transition: background var(--dash-transition);
}

.alert-unassigned-row:last-child {
    border-bottom: none;
}

.alert-unassigned-row:hover {
    background: rgba(37, 99, 235, 0.03);
}

.alert-unassigned-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.alert-unassigned-name:hover {
    text-decoration: underline;
}

.alert-unassigned-meta {
    font-size: 0.62rem;
    color: var(--gray-500);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Truck assign button */
.alert-assign-wrap {
    position: relative;
    flex-shrink: 0;
}

.alert-assign-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: var(--gray-400);
    transition: background var(--dash-transition), border-color var(--dash-transition), color var(--dash-transition);
}

.alert-assign-btn:hover {
    background: #dbeafe;
    border-color: rgba(37, 99, 235, 0.25);
    color: #2563eb;
}

.alert-assign-btn svg {
    width: 13px;
    height: 13px;
}

.alert-assign-popup {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    z-index: 200;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--dash-radius-sm);
    box-shadow: var(--dash-shadow-lg);
    min-width: 120px;
    max-height: 180px;
    overflow-y: auto;
}

.alert-assign-wrap.open .alert-assign-popup {
    display: block;
}

.alert-assign-popup::-webkit-scrollbar {
    width: 3px;
}

.alert-assign-popup::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.alert-assign-option {
    display: block;
    width: 100%;
    padding: 0.3rem 0.5rem;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--gray-700);
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s ease;
}

.alert-assign-option:hover {
    background: rgba(37, 99, 235, 0.06);
}

.alert-assign-option:first-child {
    border-radius: 8px 8px 0 0;
}

.alert-assign-option:last-child {
    border-radius: 0 0 8px 8px;
}

@media (max-width: 900px) {
    .overview-alerts {
        max-width: 100%;
    }

    .alert-dropdown-item {
        padding: 0.5rem 0.6rem;
    }
}

.overview-breakdown {
    display: flex;
    flex-direction: column;
}

.overview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.overview-row:last-child {
    border-bottom: none;
}

.overview-row-label {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.overview-row-value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--gray-800);
}

/* Modal overrides for dashboard — skipped for task-profile which manages its own card */
.dash-layout .modal:not(.modal-task-profile):not(.modal-task-form) .modal-content,
.dash-layout ~ .modal:not(.modal-task-profile):not(.modal-task-form) .modal-content {
    border-radius: var(--dash-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--dash-shadow-xl);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.dash-layout .modal:not(.modal-task-profile):not(.modal-task-form) .modal-header,
.dash-layout ~ .modal:not(.modal-task-profile):not(.modal-task-form) .modal-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.125rem 1.5rem;
}

.dash-layout .modal:not(.modal-task-profile):not(.modal-task-form) .modal-header h2,
.dash-layout ~ .modal:not(.modal-task-profile):not(.modal-task-form) .modal-header h2 {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.dash-layout .modal:not(.modal-task-profile):not(.modal-task-form) .modal-close,
.dash-layout ~ .modal:not(.modal-task-profile):not(.modal-task-form) .modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--dash-radius-sm);
    transition: all var(--dash-transition);
}

.dash-layout .modal:not(.modal-task-profile):not(.modal-task-form) .modal-close:hover,
.dash-layout ~ .modal:not(.modal-task-profile):not(.modal-task-form) .modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--gray-700);
}

.dash-layout .modal:not(.modal-task-profile):not(.modal-task-form) .modal-body,
.dash-layout ~ .modal:not(.modal-task-profile):not(.modal-task-form) .modal-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

/* Ensure Add New Load modal always scrolls within viewport */
#loadModal {
    align-items: flex-start !important;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

#loadModal .modal-content.modal-lg {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem) !important;
    margin: 0 auto;
    overflow: hidden;
}

#loadModal .modal-body {
    overflow-y: auto !important;
    max-height: calc(100vh - 8rem) !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable both-edges;
}

.dash-layout .modal:not(.modal-task-profile):not(.modal-task-form),
.dash-layout ~ .modal:not(.modal-task-profile):not(.modal-task-form) {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 11000;
}

/* Compatibility: dashboard JS toggles the hidden class instead of .open */
.dash-layout .modal:not(.hidden),
.dash-layout ~ .modal:not(.hidden) {
    display: flex;
}

.dash-form-actions .btn {
    border-radius: var(--dash-radius-md);
    font-weight: 600;
    padding: 0.5rem 1.25rem;
}

.dash-empty .btn {
    border-radius: var(--dash-radius-sm);
}

/* Form inputs â€“ hover-to-edit style */
.dash-form input,
.dash-form select {
    border-radius: var(--dash-radius-sm);
    border: 1px solid transparent;
    background: transparent;
    padding: 0 8px;
    height: 30px;
    color: #111827;
    font-size: 0.75rem;
    font-weight: 500;
    transition: border-color var(--dash-transition), background var(--dash-transition), box-shadow var(--dash-transition);
}

.dash-form select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 20px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.dash-form input:hover,
.dash-form select:hover {
    border-color: #c7d2fe;
    background: #fafbff;
}

.dash-form input:focus,
.dash-form select:focus {
    background: #fff;
    border-color: #6366f1;
    box-shadow: var(--dash-focus-ring);
}

.dash-form input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: transparent;
    border-color: rgba(0, 0, 0, 0.06);
}

.dash-form input::placeholder {
    color: #c6cbd2;
    font-weight: 400;
}

/* Modal inputs â€“ same hover-to-edit style */
.dash-layout ~ .modal .form-group input,
.dash-layout ~ .modal .form-group select {
    border-radius: var(--dash-radius-sm);
    border: 1px solid transparent;
    background: transparent;
    padding: 0 8px;
    height: 30px;
    color: #111827;
    font-size: 0.75rem;
    font-weight: 500;
    transition: border-color var(--dash-transition), background var(--dash-transition), box-shadow var(--dash-transition);
}

.dash-layout ~ .modal .form-group select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 20px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.dash-layout ~ .modal .form-group input:hover,
.dash-layout ~ .modal .form-group select:hover {
    border-color: #c7d2fe;
    background: #fafbff;
}

.dash-layout ~ .modal .form-group input:focus,
.dash-layout ~ .modal .form-group select:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: var(--dash-focus-ring);
}

.dash-layout ~ .modal .form-group input::placeholder {
    color: #c6cbd2;
    font-weight: 400;
}

/* Form label refinement for hover-to-edit */
.dash-form .form-group label,
.dash-layout ~ .modal .form-group label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.25rem;
    transition: color var(--dash-transition);
}

.dash-form .form-group:focus-within label,
.dash-layout ~ .modal .form-group:focus-within label {
    color: var(--primary);
}

.dash-layout ~ .modal .form-actions {
    padding-top: 0.5rem;
}

.dash-layout ~ .modal .form-actions .btn {
    font-weight: 600;
}

/* â”€â”€ Expandable form sections â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.form-expand-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    margin: 0.75rem 0 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-400);
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.form-expand-toggle:hover {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.04);
    border-color: rgba(79, 70, 229, 0.08);
}

.form-expand-toggle svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.form-expand-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.form-expand-toggle[aria-expanded="true"] {
    color: var(--primary);
}

.form-expand-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                margin 0.35s ease;
    margin-top: 0;
}

.form-expand-section.open {
    max-height: 600px;
    opacity: 1;
    margin-top: 0.75rem;
}

/* Expand section inner spacing */
.form-expand-section > .form-group:first-child,
.form-expand-section > .form-row:first-child,
.form-expand-section > .dash-form-grid:first-child {
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

/* â”€â”€ Sheet-Style Modal (Trucks, Trailers, Drivers) â”€â”€ */
.sheet-modal {
    width: 96vw;
    max-width: 1200px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.sheet-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sheet-header-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.sheet-row-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    padding: 0.25rem 0.625rem;
    background: rgba(79, 70, 229, 0.06);
    border-radius: 8px;
    letter-spacing: 0.01em;
}

.sheet-modal-body {
    flex: 1;
    overflow: auto;
    padding: 0 !important;
    min-height: 0;
}

.sheet-wrap {
    width: 100%;
    height: 100%;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.sheet-wrap::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.sheet-wrap::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 3px;
}

.sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    table-layout: fixed;
}

.sheet-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.sheet-table thead th {
    background: var(--gray-50);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-400);
    padding: 0.375rem 0.5rem;
    text-align: left;
    border-bottom: 2px solid rgba(0, 0, 0, 0.08);
    border-right: 1px solid rgba(0, 0, 0, 0.04);
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.sheet-table thead th:last-child {
    border-right: none;
}

.sheet-table .row-num-col {
    width: 36px;
    text-align: center;
    color: var(--gray-300);
}

.sheet-table .row-action-col {
    width: 36px;
}

/* Body rows */
.sheet-table tbody tr {
    transition: background 0.1s ease;
}

/* Alternating row backgrounds */
.sheet-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

.sheet-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.035);
}

.sheet-table tbody tr.row-has-data {
    background: rgba(79, 70, 229, 0.015);
}

.sheet-table tbody tr.row-has-data:nth-child(even) {
    background: rgba(79, 70, 229, 0.025);
}

.sheet-table tbody tr.row-has-data:hover {
    background: rgba(79, 70, 229, 0.05);
}

/* Active row â€” contains the cell being edited */
.sheet-table tbody tr:has(.cell-editing) {
    background: rgba(79, 70, 229, 0.04) !important;
}

/* Row number */
.sheet-table tbody .sheet-row-num {
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gray-300);
    padding: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    -webkit-user-select: none;
    user-select: none;
    transition: color 0.1s ease, background 0.1s ease;
}

.sheet-table tbody tr:hover .sheet-row-num {
    color: var(--gray-500);
    background: rgba(79, 70, 229, 0.04);
}

.sheet-table tbody tr:has(.cell-editing) .sheet-row-num {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.07);
    font-weight: 700;
}

/* Cells */
.sheet-table td {
    padding: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-right: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
}

.sheet-table td:last-child {
    border-right: none;
}

.sheet-table td:not(.sheet-row-num):not(.sheet-row-action) {
    cursor: text;
}

/* â”€â”€ Sheet cell: read-only display â”€â”€â”€â”€â”€â”€ */
.sheet-cell {
    display: flex;
    align-items: center;
    min-height: 28px;
    padding: 0 0.4rem;
    border: 1px solid transparent;
    transition: background var(--dash-transition), border-color var(--dash-transition), box-shadow var(--dash-transition);
    -webkit-user-select: none;
    user-select: none;
    position: relative;
}

.sheet-cell-text {
    flex: 1;
    min-width: 0;
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 28px;
}

.sheet-cell-text.placeholder {
    color: var(--gray-300);
    font-weight: 400;
}

/* Hover affordance â€” subtle highlight + border hint */
.sheet-cell:hover {
    background: rgba(79, 70, 229, 0.04);
    border-color: rgba(79, 70, 229, 0.15);
    border-radius: 2px;
}

/* Pencil icon hint on hover */
.sheet-cell::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity var(--dash-transition);
    pointer-events: none;
}

.sheet-cell:hover::after {
    opacity: 0.5;
}

/* â”€â”€ Sheet cell: editing state â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sheet-cell.cell-editing {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15), 0 2px 8px rgba(79, 70, 229, 0.08);
    z-index: 3;
    position: relative;
    border-radius: 2px;
}

.sheet-cell.cell-editing::after {
    display: none;
}

.sheet-cell.cell-editing .sheet-cell-text {
    display: none;
}

/* Cell input (only visible when editing) */
.sheet-cell input,
.sheet-cell select {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 36px;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--gray-800);
    font-weight: 500;
}

.sheet-cell.cell-editing input,
.sheet-cell.cell-editing select {
    display: block;
}

.sheet-cell input::placeholder {
    color: var(--gray-300);
    font-weight: 400;
}

.sheet-cell select {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    padding-right: 1.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.25rem center;
}

/* Validation error */
.sheet-cell.cell-invalid {
    background: rgba(220, 38, 38, 0.04);
    border-color: rgba(220, 38, 38, 0.3);
}

.sheet-cell.cell-invalid .sheet-cell-text {
    color: #dc2626;
}

.sheet-cell.cell-invalid::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
    opacity: 0.7;
}

.sheet-cell.cell-invalid:hover::after {
    opacity: 1;
}

/* Duplicate unit warning */
.sheet-cell.cell-duplicate {
    background: rgba(217, 119, 6, 0.06);
    border-color: rgba(217, 119, 6, 0.3);
}

.sheet-cell.cell-duplicate .sheet-cell-text {
    color: #b45309;
}

/* Field-level warning (VIN length, state code, year range) */
.sheet-cell.cell-warning {
    background: rgba(234, 179, 8, 0.06);
    border-color: rgba(234, 179, 8, 0.35);
}

.sheet-cell.cell-warning .sheet-cell-text {
    color: #a16207;
}

.sheet-cell.cell-warning::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a16207' stroke-width='2'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
    opacity: 0.7;
}

.sheet-cell.cell-warning:hover::after {
    opacity: 1;
}

/* Row delete */
.sheet-row-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin: 0 auto;
    border: none;
    background: transparent;
    color: var(--gray-300);
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--dash-transition);
    opacity: 0;
}

.sheet-table tbody tr:hover .sheet-row-delete {
    opacity: 1;
}

.sheet-row-delete:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
}

/* Footer */
.sheet-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    gap: 1rem;
}

.sheet-footer-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.sheet-footer-info svg {
    flex-shrink: 0;
    color: var(--gray-300);
}

.sheet-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.sheet-footer-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border-radius: var(--dash-radius-md);
    font-weight: 600;
}

/* Row action column */
.sheet-row-action {
    padding: 0;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dash-sidebar {
        width: 100%;
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.5);
        border-radius: 0;
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
    }

    .dash-sidebar-header,
    .dash-sidebar-footer {
        display: none;
    }

    .dash-sidebar-toggle {
        display: none;
    }

    .dash-nav {
        display: flex;
        flex-direction: row;
        padding: 0;
        gap: 0;
        overflow-x: auto;
    }

    .dash-nav-item {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.625rem;
        white-space: nowrap;
        border-radius: 0;
    }

    .dash-nav-item-company {
        margin-top: 0;
    }

    .dash-nav-item-nested {
        padding-left: 0.75rem;
        font-size: 0.625rem;
    }

    .dash-nav-group-dropdown .dash-nav-item {
        padding-left: 0.75rem;
        font-size: 0.625rem;
    }

    .dash-nav .overview-lookup {
        display: none;
    }

    .dash-nav-count {
        display: none;
    }

    .dash-main {
        margin-left: 0;
        padding-bottom: 70px;
    }

    .dash-section {
        padding: 1rem;
    }

    .dash-table-toolbar {
        gap: var(--dash-toolbar-gap);
    }

    .dash-search-wrap {
        flex: 0 1 var(--dash-search-width);
        width: min(100%, var(--dash-search-width));
        min-width: 0;
        max-width: 100%;
    }

    .dash-toolbar-actions {
        flex: 0 0 auto;
        justify-content: flex-start;
    }

    .dash-toolbar-add {
        margin-left: 0;
    }

    .dash-card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .dash-card-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .overview-workspace-grid {
        grid-template-columns: 1fr;
    }

    .overview-lookup {
        max-width: 100%;
    }

    .overview-lookup-result {
        padding: 0.6875rem 0.75rem;
    }

    .overview-lookup-result-type {
        min-width: 52px;
    }

    .dash-form-grid {
        grid-template-columns: 1fr;
    }

    .profile-hero {
        flex-direction: column;
        text-align: center;
    }

    .dash-card {
        border-radius: var(--dash-card-radius);
    }

    .overview-card {
        border-radius: var(--dash-radius-lg);
    }

    .sheet-modal {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0 !important;
    }

    .sheet-footer {
        flex-direction: column;
        gap: 0.75rem;
    }

    .sheet-footer-info {
        display: none;
    }

    .sheet-footer-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* â”€â”€ Dropdown Edit Button â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.dropdown-edit-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    transition: all var(--dash-transition);
    opacity: 0.5;
}

.dropdown-edit-btn:hover {
    opacity: 1;
    background: rgba(79, 70, 229, 0.06);
    border-color: rgba(79, 70, 229, 0.15);
    color: var(--primary);
}

/* â”€â”€ Dropdown Editor Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.dropdown-editor-modal {
    max-width: 440px;
    width: 100%;
}

.dropdown-editor-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0.75rem;
    max-height: 260px;
    overflow-y: auto;
}

.dropdown-editor-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.625rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: background var(--dash-transition);
}

.dropdown-editor-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.dropdown-editor-value {
    font-size: 0.6875rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--gray-500);
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 6px;
    border-radius: 3px;
    min-width: 70px;
}

.dropdown-editor-label {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
}

.dropdown-editor-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    transition: all var(--dash-transition);
    flex-shrink: 0;
}

.dropdown-editor-remove:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger, #ef4444);
}

.dropdown-editor-add {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.dropdown-editor-add input {
    flex: 1;
    padding: 0.375rem 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--gray-700);
    background: var(--white);
    transition: border-color var(--dash-transition);
}

.dropdown-editor-add input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.dropdown-editor-add input::placeholder {
    color: var(--gray-400);
}

.dropdown-editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* â”€â”€ Validation Row Indicators â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.row-validation-warning {
    background: rgba(255, 193, 7, 0.08);
}
.row-validation-error {
    background: rgba(220, 53, 69, 0.08);
}

/* Indicator column */
.col-validation {
    display: none;
}
th.col-validation {
    display: none;
}

/* Validation indicator inside checkbox cell */
.col-checkbox .validation-indicator {
    position: absolute;
    top: 1px;
    right: 0;
    pointer-events: auto;
}

/* Indicator button */
.validation-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    padding: 2px;
    cursor: default;
    position: relative;
    border-radius: 4px;
    pointer-events: auto;
}

.dash-table th.col-validation + th {
    padding-left: 0;
}

.dash-table td.col-validation + td .cell,
.dash-table td.col-validation + td .cell-editable,
.dash-table td.col-validation + td .cell-link,
.dash-table td.col-validation + td .cell-input {
    padding-left: 0;
}
.validation-indicator svg {
    flex-shrink: 0;
}
.vi-warning svg {
    stroke: #e6a817;
}
.vi-error svg {
    stroke: #dc3545;
}
/* Custom tooltip on hover */
.vi-tooltip {
    display: none;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 6px;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.75rem;
    line-height: 1.45;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    text-align: left;
    font-weight: 400;
    min-width: 120px;
}
.vi-tooltip strong {
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}
.validation-indicator:hover .vi-tooltip {
    display: block;
}

/* Expandable detail row */
.validation-detail-row td {
    padding: 0 !important;
    border-top: none !important;
}
.validation-detail {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 14px 10px;
    font-size: 0.8rem;
    line-height: 1.5;
    border-radius: 0 0 6px 6px;
}
.validation-detail svg {
    flex-shrink: 0;
    margin-top: 2px;
}
.vd-warning .validation-detail {
    background: rgba(255, 193, 7, 0.1);
    color: #92600a;
}
.vd-warning .validation-detail svg {
    stroke: #e6a817;
}
.vd-error .validation-detail {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
}
.vd-error .validation-detail svg {
    stroke: #dc3545;
}
.validation-detail ul {
    margin: 0;
    padding: 0;
    list-style: disc inside;
}
.validation-detail li {
    margin: 1px 0;
}

/* Legacy badge (remove later) */
.validation-badge {
    display: none;
}

/* â”€â”€ VIN Input Wrapper & Status â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.vin-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.vin-input-wrap input {
    flex: 1;
    padding-right: 2rem;
}
.vin-status {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    pointer-events: none;
}
.vin-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(79, 70, 229, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: vin-spin 0.6s linear infinite;
}
@keyframes vin-spin {
    to { transform: rotate(360deg); }
}
.vin-valid .vin-status svg { filter: drop-shadow(0 0 2px rgba(22, 163, 74, 0.3)); }

/* Sheet grid VIN decode states */
.vin-sheet-loading .sheet-cell-text::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    border: 2px solid rgba(79, 70, 229, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: vin-spin 0.6s linear infinite;
    vertical-align: middle;
}
.vin-sheet-valid {
    background: rgba(22, 163, 74, 0.06) !important;
    border-color: rgba(22, 163, 74, 0.25) !important;
}

/* â”€â”€ Compact Sheet Cells â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sheet-cell {
    min-height: 32px;
    padding: 0 0.5rem;
}
.sheet-cell-text {
    font-size: 0.75rem;
    line-height: 32px;
}
.sheet-cell input,
.sheet-cell select {
    min-height: 30px;
    font-size: 0.75rem;
}
.sheet-table th {
    font-size: 0.6875rem;
    padding: 0.375rem 0.5rem;
}
.sheet-row-num {
    font-size: 0.6875rem;
}

/* â”€â”€ Autocomplete Dropdown â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.autocomplete-list {
    position: fixed;
    z-index: 9999;
    max-height: 160px;
    overflow-y: auto;
    margin: 0;
    padding: 4px 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    list-style: none;
}
.autocomplete-item {
    padding: 6px 10px;
    font-size: 0.8125rem;
    color: var(--gray-700);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
}
/* Inside sheet cells â€” use smaller font */
.sheet-cell .autocomplete-list {
    min-width: 140px;
}
.sheet-cell .autocomplete-item {
    font-size: 0.75rem;
    padding: 4px 8px;
}
/* Inside form inputs */
.form-group {
    position: relative;
}
.form-group .autocomplete-list {
    min-width: 180px;
}

/* â”€â”€ Inline Select (fuel/type dropdowns) â”€â”€ */
.cell-inline-select {
    width: 100%;
    height: 30px;
    padding: 0 20px 0 8px;
    border: 1px solid #6366f1;
    border-radius: 0;
    background: #fff;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 500;
    color: #111827;
    outline: none;
    box-shadow: inset 0 0 0 1px #6366f1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}
/* Inline text input autocomplete positioning */
.cell-editable {
    position: relative;
}
.cell-editable .autocomplete-list {
    top: 100%;
    left: 0;
    right: 0;
    min-width: 140px;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   DEPARTMENT SCAFFOLDING STYLES
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Department Header â”€â”€ */
.dept-header {
    margin-bottom: 1.5rem;
}
.dept-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.25rem 0;
}
.dept-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
}

/* â”€â”€ Department Grid Layout â”€â”€ */
.dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}
.dash-card-wide {
    grid-column: span 2;
}
.dash-card-fullheight {
    min-height: 500px;
}
.dash-card-fullheight .dash-card-body {
    flex: 1;
    display: flex;
}

@media (max-width: 768px) {
    .dept-grid {
        grid-template-columns: 1fr;
    }
    .dash-card-wide {
        grid-column: span 1;
    }
}

/* â”€â”€ Department Nav Cards (landing page quick-access cards) â”€â”€ */
.dept-nav-card {
    cursor: pointer;
    transition: box-shadow var(--dash-transition), transform var(--dash-transition), border-color var(--dash-transition);
}
.dept-nav-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary-400, #818cf8);
}
.dept-nav-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 1rem;
    min-height: 140px;
    gap: 0.5rem;
}
.dept-nav-card-body svg {
    color: var(--primary-500, #3b82f6);
    margin-bottom: 0.25rem;
}
.dept-nav-card-count {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}
.dept-nav-card-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* â”€â”€ Placeholder Content â”€â”€ */
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    min-height: 200px;
}
.placeholder-content svg {
    color: var(--gray-300);
    margin-bottom: 1rem;
}
.placeholder-content p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-500);
    margin: 0 0 0.5rem 0;
}
.placeholder-hint {
    font-size: 0.8125rem;
    color: var(--gray-400);
    max-width: 280px;
    line-height: 1.4;
}

/* â”€â”€ Expiration Alerts Card â”€â”€ */
.exp-alerts-card {
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.4,0,0.2,1);
    align-self: start;
}
.exp-alerts-card.exp-collapsed {
    grid-template-rows: auto 0fr;
}
.exp-body-wrap {
    overflow: hidden;
}
.exp-header-toggle {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
.exp-header-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.exp-header-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--gray-400);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), color 0.2s;
}
.exp-alerts-card:not(.exp-collapsed) .exp-header-chevron {
    transform: rotate(180deg);
    color: var(--primary, #6366f1);
}
.exp-header-toggle:hover .exp-header-chevron {
    color: var(--primary, #6366f1);
}
.exp-alerts-card.exp-collapsed .exp-tabs {
    display: none;
}
.exp-header-count {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 20px;
    background: rgba(239,68,68,0.1);
    color: #dc2626;
    margin-left: 0.35rem;
    vertical-align: middle;
}
.exp-header-count:empty {
    display: none;
}
.exp-alerts-card .dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.exp-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--gray-100, #f3f4f6);
    border-radius: 8px;
    padding: 3px;
}
.exp-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--dash-transition);
    white-space: nowrap;
}
.exp-tab:hover {
    color: var(--gray-700);
    background: rgba(255,255,255,0.5);
}
.exp-tab.active {
    background: #fff;
    color: var(--gray-800);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.exp-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--dash-radius-pill);
    font-size: 0.58rem;
    font-weight: 700;
    background: rgba(239,68,68,0.1);
    color: #dc2626;
    line-height: 1;
}
.exp-tab.active .exp-tab-count {
    background: rgba(239,68,68,0.12);
}
.exp-panel {
    display: none;
}
.exp-panel.active {
    display: block;
}
.exp-list {
    max-height: 280px;
    overflow-y: auto;
}
.exp-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
    font-size: 0.75rem;
    transition: background 0.1s;
}
.exp-row:last-child {
    border-bottom: none;
}
.exp-row:hover {
    background: var(--gray-50, #f9fafb);
}
.exp-row--expired {
    background: rgba(239,68,68,0.03);
}
.exp-row--expired:hover {
    background: rgba(239,68,68,0.06);
}
.exp-row-name {
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.exp-row-field {
    font-size: 0.68rem;
    color: var(--gray-500);
    white-space: nowrap;
}
.exp-row-date {
    font-size: 0.68rem;
    color: var(--gray-400);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.exp-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.exp-badge--expired {
    background: rgba(239,68,68,0.1);
    color: #dc2626;
}
.exp-badge--critical {
    background: rgba(245,158,11,0.1);
    color: #b45309;
}
.exp-badge--warning {
    background: rgba(99,102,241,0.08);
    color: #6366f1;
}
.exp-badge--missing {
    background: rgba(107,114,128,0.06);
    color: #9ca3af;
}
.exp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    color: var(--gray-400);
}
.exp-empty svg {
    color: #10b981;
}
.exp-empty span {
    font-size: 0.8rem;
    font-weight: 500;
}

@media (max-width: 480px) {
    .exp-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.25rem;
    }
    .exp-row-date { display: none; }
}

/* â”€â”€ Compliance Score Card â”€â”€ */
.comp-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--dash-radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 0fr;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, grid-template-rows 0.35s cubic-bezier(0.4,0,0.2,1);
    align-self: start;
}
.comp-card.open {
    grid-template-rows: auto 1fr;
}
.comp-card:hover {
    box-shadow: var(--dash-shadow-lg);
    border-color: rgba(99,102,241,0.15);
}
.comp-card-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    position: relative;
    cursor: pointer;
}
.comp-card-ring {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
}
.comp-card-ring svg { display: block; }
.comp-card-nav {
    cursor: pointer;
    border-radius: 50%;
    transition: box-shadow 0.2s, transform 0.2s;
}
.comp-card-nav:hover {
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    transform: scale(1.04);
}
.comp-score-arc {
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.4s ease;
}
.comp-card-score {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--gray-700);
    letter-spacing: -0.03em;
}
.comp-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}
.comp-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.comp-card-rating-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.comp-card-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
}
.comp-card-rating {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
}
.comp-card-sub {
    font-size: 0.72rem;
    color: var(--gray-400);
    line-height: 1.35;
}
.comp-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}
.comp-card-arrow {
    flex-shrink: 0;
    color: var(--gray-300);
    transition: color 0.2s, transform 0.2s;
}
.comp-card:hover .comp-card-arrow {
    color: var(--primary-500, #6366f1);
    transform: translateX(2px);
}
.comp-score-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.5rem;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.comp-score-chip--green { background: rgba(16,185,129,0.08); color: #059669; }
.comp-score-chip--yellow { background: rgba(245,158,11,0.08); color: #b45309; }
.comp-score-chip--red { background: rgba(239,68,68,0.08); color: #dc2626; }
.comp-score-chip--gray { background: rgba(107,114,128,0.06); color: #6b7280; }

/* Compliance card dropdown toggle */
.comp-card-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--gray-300);
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.4,0,0.2,1), color 0.2s ease;
    pointer-events: auto;
}
.comp-card-toggle:hover {
    opacity: 1;
    color: var(--gray-500);
}
.comp-card.open .comp-card-toggle {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--primary);
}

/* Compliance card unresolved notification */
.comp-card-notif {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 20px;
    background: #ef4444;
    color: #fff;
    font-size: 0.55rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(239,68,68,0.3);
    transition: opacity 0.2s, transform 0.2s;
}
.comp-card-notif:empty { display: none; }
.comp-card.open .comp-card-notif { opacity: 0; transform: scale(0.5); pointer-events: none; }

/* Compliance card dropdown panel */
.comp-card-dropdown {
    overflow: hidden;
    border-top: 0 solid transparent;
    transition: border-top 0.35s;
}
.comp-card.open .comp-card-dropdown {
    border-top: 1px solid rgba(0,0,0,0.05);
}
.comp-card-dropdown-inner {
    overflow: hidden;
}
.comp-card-dropdown-list {
    padding: 0.35rem 0;
    max-height: 320px;
    overflow-y: auto;
}
.comp-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.72rem;
    color: var(--gray-700);
    transition: background 0.15s;
    cursor: pointer;
    border-left: 2px solid transparent;
}
.comp-dropdown-item:hover {
    background: rgba(99,102,241,0.04);
    border-left-color: var(--primary, #6366f1);
}
.comp-dropdown-item:active {
    background: rgba(99,102,241,0.08);
}
.comp-dropdown-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.comp-dropdown-icon svg { width: 12px; height: 12px; }
.comp-dropdown-icon.pass { background: rgba(16,185,129,0.1); color: #059669; }
.comp-dropdown-icon.fail { background: rgba(239,68,68,0.1); color: #dc2626; }
.comp-dropdown-icon.warning { background: rgba(245,158,11,0.1); color: #b45309; }
.comp-dropdown-icon.oos { background: rgba(139,92,246,0.1); color: #7c3aed; }
.comp-dropdown-icon.citation { background: rgba(239,68,68,0.1); color: #dc2626; }
.comp-dropdown-detail {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}
.comp-dropdown-title {
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.comp-dropdown-sub {
    font-size: 0.62rem;
    color: var(--gray-400);
}
.comp-dropdown-badge {
    font-size: 0.58rem;
    font-weight: 700;
    padding: 0.12rem 0.4rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}
.comp-dropdown-badge.open { background: rgba(245,158,11,0.1); color: #b45309; }
.comp-dropdown-badge.resolved { background: rgba(16,185,129,0.1); color: #059669; }
.comp-dropdown-arrow {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--gray-300);
    transition: color 0.15s, transform 0.15s;
}
.comp-dropdown-item:hover .comp-dropdown-arrow {
    color: var(--primary, #6366f1);
    transform: translateX(2px);
}
.comp-dropdown-empty {
    padding: 1.25rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--gray-400);
}

/* Unified list standard (Task Manager baseline) */
.tm-list-standard .dash-card {
    overflow: hidden;
}
.tm-list-standard .dash-card-header,
.tm-list-standard .unit-topbar {
    min-height: 52px;
    padding: var(--dash-card-header-padding);
    border-bottom: 1px solid var(--dash-border-color);
    background: linear-gradient(180deg, rgba(248,250,252,0.6) 0%, rgba(241,245,249,0.3) 100%);
}
.tm-list-standard .dash-card-header h2,
.tm-list-standard .unit-table-title {
    color: var(--gray-800);
    font-size: 0.9375rem;
    font-weight: 700;
}
.tm-list-standard .dash-table-toolbar,
.tm-list-standard .unit-filterbar {
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--dash-border-color);
    background: #fff;
}
.tm-list-standard .dash-table-toolbar .filter-group label,
.tm-list-standard .unit-filterbar .filter-group label {
    color: #6b7280;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.tm-list-standard .dash-search,
.tm-list-standard .filter-select,
.tm-list-standard .filter-input,
.tm-list-standard .dash-sort,
.tm-list-standard .dash-filter {
    min-height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    box-shadow: none;
}
.tm-list-standard .dash-table-wrap,
.tm-list-standard .unit-table-wrapper {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
}
.tm-list-standard .dash-table,
.tm-list-standard .dash-table.unit-table {
    min-width: 0 !important;
    border-collapse: collapse;
}
.tm-list-standard .dash-table th,
.tm-list-standard .dash-table.unit-table th {
    height: 34px;
    padding: 7px 8px;
    border-right: 1px solid #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.tm-list-standard .dash-table td,
.tm-list-standard .dash-table.unit-table td {
    height: 34px;
    padding: 6px 8px;
    border-right: 1px solid #f8fafc;
    border-bottom: 1px solid #eef2f7;
    color: #334155;
    font-size: 0.78rem;
}
.tm-list-standard .dash-table tbody tr:hover td,
.tm-list-standard .dash-table.unit-table tbody tr:hover td {
    background: rgba(15, 23, 42, 0.03);
}
.tm-list-standard .dash-empty,
.tm-list-standard .empty-state {
    margin: 0;
    border: 1px dashed #dbe3ec;
    border-radius: 8px;
    background: #fbfdff;
}

@media (max-width: 480px) {
    .comp-card-inner { flex-direction: column; text-align: center; padding: 1.25rem; }
    .comp-card-info { align-items: center; }
    .comp-card-arrow { display: none; }
}

/* Special map placeholder */
.placeholder-content-map {
    min-height: 400px;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-radius: 8px;
    width: 100%;
}
.placeholder-content-map svg {
    color: var(--gray-300);
}

/* â”€â”€ Nav Group Colors (department accents) â”€â”€ */
.dash-nav-group-trigger[data-section="safety"] svg:first-child { color: #10b981; }
.dash-nav-group-trigger[data-section="maintenance"] svg:first-child { color: #f59e0b; }
.dash-nav-group-trigger[data-section="dispatch"] svg:first-child { color: #3b82f6; }
.dash-nav-group-trigger[data-section="tracking"] svg:first-child { color: #8b5cf6; }
.dash-nav-group-trigger[data-section="accounting"] svg:first-child { color: #06b6d4; }
.dash-nav-group-trigger[data-section="hiring"] svg:first-child { color: #ec4899; }
.dash-nav-group-trigger[data-section="claims"] svg:first-child { color: #ef4444; }
.dash-nav-group-trigger[data-section="afterhours"] svg:first-child { color: #6366f1; }
.dash-nav-group-trigger[data-section="operations"] svg:first-child { color: #14b8a6; }

/* Active state for nav groups */
.dash-nav-group-trigger.active[data-section="safety"],
.dash-nav-group .dash-nav-item.active[data-section^="safety"],
.dash-nav-group .dash-nav-item.active[data-section="drivers"],
.dash-nav-group .dash-nav-item.active[data-section="trucks"],
.dash-nav-group .dash-nav-item.active[data-section="trailers"],
.dash-nav-group .dash-nav-item.active[data-section="violations"] {
    background: rgba(16, 185, 129, 0.1);
}
.dash-nav-group-trigger.active[data-section="maintenance"],
.dash-nav-group .dash-nav-item.active[data-section^="maintenance"],
.dash-nav-group .dash-nav-item.active[data-section="work-orders"],
.dash-nav-group .dash-nav-item.active[data-section="pm-schedules"],
.dash-nav-group .dash-nav-item.active[data-section="parts-inventory"] {
    background: rgba(245, 158, 11, 0.1);
}
.dash-nav-group-trigger.active[data-section="dispatch"],
.dash-nav-group .dash-nav-item.active[data-section^="dispatch"],
.dash-nav-group .dash-nav-item.active[data-section="active-loads"],
.dash-nav-group .dash-nav-item.active[data-section="driver-assignments"] {
    background: rgba(59, 130, 246, 0.1);
}
.dash-nav-group-trigger.active[data-section="tracking"],
.dash-nav-group .dash-nav-item.active[data-section="live-map"],
.dash-nav-group .dash-nav-item.active[data-section="load-status"],
.dash-nav-group .dash-nav-item.active[data-section="eta-tracking"] {
    background: rgba(139, 92, 246, 0.1);
}
.dash-nav-group-trigger.active[data-section="accounting"],
.dash-nav-group .dash-nav-item.active[data-section="invoices"],
.dash-nav-group .dash-nav-item.active[data-section="settlements"],
.dash-nav-group .dash-nav-item.active[data-section="expenses"],
.dash-nav-group .dash-nav-item.active[data-section="payroll"] {
    background: rgba(6, 182, 212, 0.1);
}
.dash-nav-group-trigger.active[data-section="hiring"],
.dash-nav-group .dash-nav-item.active[data-section="applications"],
.dash-nav-group .dash-nav-item.active[data-section="hiring-pipeline"],
.dash-nav-group .dash-nav-item.active[data-section="onboarding"] {
    background: rgba(236, 72, 153, 0.1);
}
.dash-nav-group-trigger.active[data-section="claims"],
.dash-nav-group .dash-nav-item.active[data-section="accidents"],
.dash-nav-group .dash-nav-item.active[data-section="cargo-claims"],
.dash-nav-group .dash-nav-item.active[data-section="insurance"] {
    background: rgba(239, 68, 68, 0.1);
}
.dash-nav-group-trigger.active[data-section="afterhours"],
.dash-nav-group .dash-nav-item.active[data-section="on-call"],
.dash-nav-group .dash-nav-item.active[data-section="emergency-contacts"],
.dash-nav-group .dash-nav-item.active[data-section="driver-support"] {
    background: rgba(99, 102, 241, 0.1);
}
.dash-nav-group-trigger.active[data-section="operations"],
.dash-nav-group .dash-nav-item.active[data-section="cross-dept-alerts"],
.dash-nav-group .dash-nav-item.active[data-section="reports"] {
    background: rgba(20, 184, 166, 0.1);
}

/* â”€â”€ Driver Detail Panel (slide-out) â”€â”€ */
.detail-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.detail-backdrop:not(.hidden) { opacity: 1; }
.detail-backdrop.hidden { pointer-events: none; }

.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 94vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.10);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.detail-panel.hidden {
    pointer-events: none;
    visibility: hidden;
    transform: translateX(100%);
}
.detail-panel:not(.hidden) {
    transform: translateX(0);
    visibility: visible;
}

/* Driver profile dashboard page */
.driver-profile-page {
    width: 100%;
    min-width: 0;
    background: #f5f7fb;
}
.driver-profile-page .detail-panel-header {
    padding: 0.7rem 1rem;
    background: #fff;
    border: 1px solid #dde4ee;
    border-radius: 10px 10px 0 0;
}
.driver-profile-page .detail-panel-title h2 { font-size: 0.9rem; }
.driver-profile-page .detail-action-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
}
.driver-profile-page .detail-action-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #334155;
}
.driver-profile-page .detail-save-btn {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
}
.driver-profile-page .detail-save-btn:hover { background: #4338ca; color: #fff; }
.driver-profile-page .detail-panel-body {
    width: 100%;
    padding: 0.9rem 1rem 1.5rem;
    overflow: visible;
    background: #f5f7fb;
}
.driver-profile-page .dp-contact-strip,
.driver-profile-page .dp-summary-bar,
.driver-profile-page .dp-stats-bar,
.driver-profile-page .dp-quick-actions {
    background: #fff;
    border-left: 1px solid #dde4ee;
    border-right: 1px solid #dde4ee;
}
.driver-profile-page .dp-contact-strip {
    padding: 0.55rem 1rem;
    border-bottom: 1px solid #e7edf5;
    font-size: 0.72rem;
}
.driver-profile-page .dp-summary-bar {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e7edf5;
}
.driver-profile-page .dp-stats-bar {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e7edf5;
}
.driver-profile-page .dp-stat {
    border-color: #e5e7eb;
    border-radius: 6px;
    background: #f8fafc;
}
.driver-profile-page .dp-quick-actions {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e7edf5;
}
.driver-profile-page .dp-qaction {
    padding: 0.3rem 0.55rem;
    border-color: #e5e7eb;
    border-radius: 6px;
    background: #fff;
}
.driver-profile-page .dp-tab-bar {
    background: transparent;
    border: none;
    border-bottom: 1px solid #dde4ee;
    border-radius: 0;
    margin-top: 0;
    gap: 1.1rem;
    padding: 0 1.25rem;
}
.driver-profile-page .dp-tab-btn {
    padding: 0.65rem 0.05rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.driver-profile-page .dp-tab-btn:hover { background: rgba(0,0,0,.035); }
.driver-profile-page .detail-section {
    margin-bottom: 0.85rem;
    border: 1px solid #dde4ee;
    border-radius: 10px;
    background: #fff;
    padding: 0.65rem 0.75rem 0.75rem;
}
.driver-profile-page .dp-section-toggle {
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #e7edf5;
}
.driver-profile-page .dp-toggle-label {
    color: #64748b;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}
.driver-profile-page .dp-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    padding-top: 0.55rem;
}
.driver-profile-page .dp-field-card {
    padding: 0.55rem 0.65rem 0.6rem;
    border-color: #e7edf5;
    border-radius: 8px;
    background: #fff;
}
.driver-profile-page .dp-field-card h4 {
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #eef2f7;
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}
.driver-profile-page .detail-field { padding: 0.22rem 0; }
.driver-profile-page .detail-field-label {
    color: #9ca3af;
    font-size: 0.6rem;
}
.driver-profile-page .detail-field-input {
    padding: 0.32rem 0.45rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font-size: 0.78rem;
    font-weight: 400;
}
.driver-profile-page .detail-field:hover .detail-field-input {
    border-color: #d1d5db;
    background: #fff;
}
.driver-profile-page .detail-field-input:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(99,102,241,.15);
}
.profile-copy-field { position: relative; display: flex; align-items: center; }
.profile-copy-field .detail-field-input { padding-right: 2rem; width: 100%; }
.profile-copy-field-btn {
    position: absolute;
    right: 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
}
.profile-copy-field-btn:hover { color: #374151; }
.driver-profile-page .dp-compose {
    margin-top: 0.55rem;
    border-color: #e5e7eb;
    border-radius: 8px;
    background: #fff;
}
.driver-profile-page .dp-feed { padding-top: 0.55rem; }
.driver-profile-page .broker-kpi-card,
.driver-profile-page .broker-chart-card,
.driver-profile-page .broker-loads-section,
.driver-profile-page .broker-related-section {
    border-color: #dde4ee;
    border-radius: 10px;
    box-shadow: none;
}
.driver-profile-page .driver-profile-chart-grid {
    margin: 0.85rem 0;
}
@media (max-width: 980px) {
    .driver-profile-page .dp-card-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .driver-profile-page .detail-panel-header { border-radius: 0; }
    .driver-profile-page .dp-tab-bar { border-radius: 0; }
    .driver-profile-page .detail-panel-body { padding: 0.7rem; }
    .driver-profile-page .dp-card-grid { grid-template-columns: 1fr; }
}

.dp-tab-bar {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--dash-border-color);
    flex-shrink: 0;
    overflow-x: auto;
}
.dp-tab-btn {
    padding: 0.65rem 0.05rem;
    margin-bottom: -1px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-500, #6b7280);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--dash-transition);
}
.dp-tab-btn:hover { color: var(--gray-800, #1f2937); }
.dp-tab-btn.active {
    color: var(--primary, #4f46e5);
    border-bottom-color: var(--primary, #4f46e5);
}
.dp-tab-pane { display: none; }
.dp-tab-pane.active { display: block; }
.profile-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
    padding: 0.2rem;
}
.profile-dashboard-card {
    min-width: 0;
    padding: 0.8rem 0.9rem;
    border: 1px solid #e7edf5;
    border-radius: 8px;
    background: #fff;
}
.profile-dashboard-card span {
    display: block;
    margin-bottom: 0.35rem;
    color: #9ca3af;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.profile-dashboard-card strong {
    display: block;
    overflow: hidden;
    color: #374151;
    font-size: 0.82rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-task-manager {
    width: min(600px, 100%);
    margin: 0.25rem 0;
    padding: 0.75rem 0.85rem 0.6rem;
    border: 1px solid #e3eaf3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(31,41,55,0.05);
}
.profile-work-order-manager { margin-top: 0.75rem; }
.profile-task-manager-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}
.profile-task-manager-head h3 {
    margin: 0;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 700;
}
.profile-task-manager-count {
    margin-left: 0.35rem;
    color: #9ca3af;
    font-size: 0.7rem;
}
.profile-task-add-btn {
    border: 1px solid rgba(79,70,229,0.2);
    border-radius: 6px;
    background: #fff;
    color: var(--primary, #4f46e5);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.3rem 0.55rem;
    cursor: pointer;
}
.profile-task-add-btn:hover { background: rgba(79,70,229,0.05); border-color: rgba(79,70,229,0.35); }
.profile-task-filters {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 0.25rem;
}
.profile-task-filter {
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #9ca3af;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
}
.profile-task-filter:hover { color: #4b5563; }
.profile-task-filter.active { color: var(--primary, #4f46e5); border-bottom-color: var(--primary, #4f46e5); }
.profile-task-list { max-height: 220px; overflow-y: auto; }
.profile-task-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: transparent;
    padding: 0.42rem 0.2rem;
    text-align: left;
    cursor: pointer;
}
.profile-task-row:hover { background: #f8fafc; }
.profile-task-row-main { display: flex; flex-direction: column; gap: 0.18rem; min-width: 0; }
.profile-task-row-main strong { overflow: hidden; color: #374151; font-size: 0.78rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.profile-task-row-main span { color: #9ca3af; font-size: 0.66rem; }
.profile-task-row-meta { display: inline-flex; align-items: center; gap: 0.45rem; flex-shrink: 0; }
.profile-task-kind, .profile-task-status { font-size: 0.62rem; white-space: nowrap; }
.profile-task-kind { color: #64748b; }
.profile-task-kind.linked { color: #b45309; }
.profile-task-kind.direct { color: #1264a3; }
.profile-task-status { color: #9ca3af; }
.profile-task-empty { margin: 0; padding: 1.2rem 0.25rem; color: #9ca3af; font-size: 0.76rem; text-align: center; }
.tm-show-units {
    border: none;
    background: transparent;
    color: #1264a3;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
}
.tm-show-units:hover { text-decoration: underline; }
.tm-show-units span { margin-left: 0.2rem; color: #8a8f98; font-weight: 500; }
.tm-show-units-popup {
    position: fixed;
    z-index: 2147483647;
    min-width: 190px;
    max-width: 280px;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid rgba(29,28,29,0.1);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(29,28,29,0.16);
}
.tm-show-units-title {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid #f0f0f0;
    color: #6b7280;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
}
.tm-show-unit-link {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0.5rem;
    border-radius: 5px;
    color: #1264a3;
    font-size: 0.74rem;
    text-decoration: none;
}
.tm-show-unit-link:hover { background: #f0f9ff; }
.tm-show-unit-link span { color: #9ca3af; font-size: 0.64rem; }
@media (max-width: 900px) {
    .profile-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .profile-dashboard-grid { grid-template-columns: 1fr; }
}
.dp-tab-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--gray-400, #9ca3af);
    font-size: 0.85rem;
}

.dp-contact-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 1.1rem;
    padding: 0 1.5rem 0.75rem;
    font-size: 0.78rem;
    color: var(--gray-500, #6b7280);
}
.dp-contact-strip:empty { display: none; }
.dp-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.dp-contact-item svg { color: var(--gray-400, #9ca3af); flex-shrink: 0; }

.dp-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}
.dp-field-card {
    border: 1px solid var(--dash-border-color);
    border-radius: 8px;
    background: #fff;
    padding: 0.85rem 1rem 0.5rem;
    min-width: 0;
}
.dp-field-card h4 {
    margin: 0 0 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500, #6b7280);
}
.dp-field-card .detail-field { padding: 0.3rem 0; }
.dp-field-card--wide { grid-column: span 2; }
.dp-field-card--wide .dp-card-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}
@media (max-width: 980px) {
    .dp-card-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .dp-card-grid { grid-template-columns: 1fr; }
    .dp-field-card--wide { grid-column: span 1; }
}

.detail-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid var(--dash-border-color);
    flex-shrink: 0;
}

.detail-panel-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.detail-panel-title h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.detail-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    transition: all var(--dash-transition);
}
.detail-action-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--gray-600);
}

.detail-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem 2rem;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
    margin: 0 0 0.75rem;
}

.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1rem;
}

.detail-field {
    display: flex;
    flex-direction: column;
    padding: 0.35rem 0;
}
.detail-field.full-width {
    grid-column: 1 / -1;
}

.detail-field-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-400);
    margin-bottom: 0.2rem;
}
.detail-field-label .req {
    color: #ef4444;
    font-weight: 700;
}

.detail-field-input {
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--gray-700);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.3rem 0.45rem;
    outline: none;
    transition: all var(--dash-transition);
    width: 100%;
    box-sizing: border-box;
}
.detail-field-input::placeholder {
    color: var(--gray-300);
    font-weight: 400;
    font-style: italic;
}

.detail-field:hover .detail-field-input,
.detail-field-input:focus {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.015);
}
.detail-field-input:focus {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.03);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.08);
}

select.detail-field-input {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    padding-right: 1.4rem;
    cursor: pointer;
}

textarea.detail-field-input {
    resize: vertical;
    min-height: 42px;
}

.detail-endorsement-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.2rem 0;
}

.dp-endorse-chip {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
.dp-endorse-chip input { display: none; }
.dp-endorse-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 26px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--dash-radius-xs);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
    color: var(--gray-400);
    transition: all var(--dash-transition);
    padding: 0 4px;
}
.dp-endorse-chip:hover span {
    border-color: rgba(79, 70, 229, 0.2);
    background: rgba(79, 70, 229, 0.04);
}
.dp-endorse-chip input:checked + span {
    background: rgba(79, 70, 229, 0.1);
    border-color: rgba(79, 70, 229, 0.3);
    color: var(--primary);
}

.detail-save-btn {
    color: var(--primary) !important;
}
.detail-save-btn:hover {
    background: rgba(79, 70, 229, 0.08) !important;
    color: var(--primary) !important;
}

.detail-panel.is-create .detail-panel-header {
    border-bottom-color: rgba(79, 70, 229, 0.12);
}
.detail-panel.is-create .detail-panel-title h2 {
    color: var(--primary);
}

.detail-doc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

.detail-doc-slot {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--dash-radius-md);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.015);
    transition: border-color var(--dash-transition);
}
.detail-doc-slot:hover { border-color: rgba(0, 0, 0, 0.1); }

.detail-doc-slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.65rem;
    background: rgba(0, 0, 0, 0.025);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.detail-doc-slot-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gray-600);
}

.detail-doc-slot-status {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1px 6px;
    border-radius: 4px;
}

.detail-doc-slot-status.uploaded {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}
.detail-doc-slot-status.missing {
    color: #9ca3af;
    background: rgba(156, 163, 175, 0.1);
}

.detail-doc-slot-body {
    padding: 0.5rem 0.65rem;
    min-height: 54px;
    display: flex;
    align-items: center;
}

.detail-doc-upload-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.35rem;
    padding: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(79, 70, 229, 0.04);
    border: 1px dashed rgba(79, 70, 229, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--dash-transition);
}
.detail-doc-upload-prompt:hover {
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.35);
}
.detail-doc-upload-prompt input[type="file"] { display: none; }

.detail-doc-file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.detail-doc-file-info {
    flex: 1;
    min-width: 0;
}

.detail-doc-file-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-doc-file-meta {
    font-size: 0.65rem;
    color: var(--gray-400);
}

.detail-doc-file-actions {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
}

.detail-doc-file-actions a,
.detail-doc-file-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: var(--dash-radius-xs);
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    transition: all var(--dash-transition);
    text-decoration: none;
}
.detail-doc-file-actions a:hover,
.detail-doc-file-actions button:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--gray-600);
}
.detail-doc-file-actions .doc-slot-delete:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.detail-doc-thumb {
    width: 36px;
    height: 36px;
    border-radius: var(--dash-radius-xs);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

@media (max-width: 560px) {
    .detail-panel { width: 100vw; }
    .detail-doc-grid { grid-template-columns: 1fr; }
    .detail-info-grid { grid-template-columns: 1fr; }
}

#driversTable tbody tr { cursor: pointer; }
#driversTable tbody tr:hover { background: #f0f4ff; }

tr.detail-active {
    background: #f0f4ff !important;
    box-shadow: inset 3px 0 0 var(--primary);
}

.profile-nav-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: auto;
}

.profile-nav-controls.hidden { display: none; }

.profile-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--gray-500);
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
}

.profile-nav-btn:hover:not(:disabled) {
    background: rgba(29, 155, 209, 0.08);
    color: var(--primary);
}

.profile-nav-btn:disabled { cursor: default; opacity: 0.3; }

/* â”€â”€ Summary Bar â”€â”€ */
.dp-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 1.5rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.dp-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    padding: 0.6rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.dp-stats-bar:empty {
    display: none;
}
.dp-stat {
    text-align: center;
    padding: 0.35rem 0.25rem;
    border-radius: var(--dash-radius-sm);
    background: rgba(0, 0, 0, 0.015);
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.dp-stat-value {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.dp-stat-label {
    display: block;
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-400);
    margin-top: 0.1rem;
}
.dp-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border: 1px solid transparent;
}

/* â”€â”€ Import Dropdown â”€â”€ */
.import-dropdown {
    position: fixed;
    z-index: 10000;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--dash-radius-sm);
    box-shadow: var(--dash-shadow-lg);
    padding: 4px;
    min-width: 180px;
    animation: fadeInDropdown .12s ease;
}
@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.import-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    color: var(--text);
    font-size: .85rem;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.import-dropdown-item:hover {
    background: var(--bg);
}
.import-dropdown-item svg {
    flex-shrink: 0;
}
.dp-chip--green  { background: rgba(5,150,105,0.08);  color: #059669; border-color: rgba(5,150,105,0.15); }
.dp-chip--yellow { background: rgba(217,119,6,0.08);  color: #b45309; border-color: rgba(217,119,6,0.15); }
.dp-chip--red    { background: rgba(220,38,38,0.08);  color: #dc2626; border-color: rgba(220,38,38,0.15); }
.dp-chip--gray   { background: rgba(0,0,0,0.04);      color: var(--gray-500); border-color: rgba(0,0,0,0.06); }
.dp-chip--blue   { background: rgba(79,70,229,0.06);  color: var(--primary); border-color: rgba(79,70,229,0.12); }
.dp-chip-dot {
    width: 6px; height: 6px; border-radius: 50%;
}
.dp-chip--green .dp-chip-dot  { background: #059669; }
.dp-chip--yellow .dp-chip-dot { background: #d97706; }
.dp-chip--red .dp-chip-dot    { background: #dc2626; }
.dp-chip--gray .dp-chip-dot   { background: var(--gray-400); }
.dp-chip--blue .dp-chip-dot   { background: var(--primary); }

/* â”€â”€ Quick Actions â”€â”€ */
.dp-quick-actions {
    display: flex;
    gap: 0.35rem;
    padding: 0.65rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.dp-qaction {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--dash-radius-sm);
    background: rgba(0, 0, 0, 0.015);
    color: var(--gray-600);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--dash-transition);
    white-space: nowrap;
}
.dp-qaction:hover {
    background: rgba(79, 70, 229, 0.05);
    border-color: rgba(79, 70, 229, 0.2);
    color: var(--primary);
}
.dp-qaction--warn:hover {
    background: rgba(220, 38, 38, 0.05);
    border-color: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}
.dp-qaction--danger {
    border-color: rgba(220, 38, 38, 0.15);
    color: #b91c1c;
}
.dp-qaction--danger:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.3);
    color: #991b1b;
}
.dp-qaction--active {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
}
.dp-qaction--active:hover {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
}
.dp-qaction svg { flex-shrink: 0; }

/* DND badge in panel header */
.dnd-badge {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 8px;
    animation: dnd-pulse 2s infinite;
}
.dnd-badge.hidden { display: none; }
@keyframes dnd-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* DND tag in drivers table */
.dnd-tag {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
}
tr.row-dnd {
    background: rgba(220, 38, 38, 0.03) !important;
}
tr.row-dnd td:first-child {
    border-left: 3px solid #dc2626;
}

/* Samsara GPS badge in truck unit cell */
.samsara-loc-badge {
    display: inline-block;
    background: #6366f1;
    color: #fff;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
    text-transform: uppercase;
    cursor: default;
}

/* Samsara telematics strip inside truck detail panel */
.samsara-telematics-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 2px;
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.06);
    border-bottom: 1px solid rgba(99, 102, 241, 0.14);
    font-size: 0.72rem;
    color: var(--text, #1e293b);
}
.sam-strip-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    margin-right: 3px;
    flex-shrink: 0;
}
.sam-strip-dot.moving  { background: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.18); }
.sam-strip-dot.stopped { background: #94a3b8; }
.sam-strip-sep {
    margin: 0 5px;
    color: var(--text-muted, #cbd5e1);
}
.sam-strip-time { color: var(--text-muted, #94a3b8); }

/* ── Samsara Fleet Map Card (Company Workspace) ── */
.samsara-fleet-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}
.samsara-fleet-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: var(--card-header-bg, #f8fafc);
}
.samsara-fleet-card-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text, #1e293b);
}
.samsara-fleet-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.samsara-fleet-sync-time {
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
}
.samsara-fleet-sync-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text, #1e293b);
    background: transparent;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.samsara-fleet-sync-btn:hover:not(:disabled) {
    background: var(--sidebar-hover, #f1f5f9);
    border-color: #94a3b8;
}
.samsara-fleet-sync-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.samsara-fleet-sync-btn.syncing svg {
    animation: fleet-spin 0.9s linear infinite;
}
@keyframes fleet-spin {
    to { transform: rotate(360deg); }
}

.samsara-fleet-map-body {
    display: flex;
    height: 380px;
}
.samsara-fleet-map-container {
    flex: 1;
    position: relative;
    min-width: 0;
}
#overviewFleetMap {
    width: 100%;
    height: 100%;
}
.samsara-fleet-map-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(248, 250, 252, 0.9);
    z-index: 2;
    pointer-events: none;
}
.samsara-fleet-map-overlay-text {
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
}
.samsara-fleet-vehicle-list {
    width: 220px;
    border-left: 1px solid var(--border, #e2e8f0);
    overflow-y: auto;
    background: var(--card-bg, #fff);
    display: flex;
    flex-direction: column;
}
.samsara-fleet-vehicle-list-empty {
    padding: 20px 14px;
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    text-align: center;
}
.samsara-fleet-vehicle-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border, #f1f5f9);
    transition: background 0.12s;
}
.samsara-fleet-vehicle-item:hover {
    background: var(--sidebar-hover, #f8fafc);
}
.samsara-fleet-vehicle-item.no-gps {
    opacity: 0.55;
    cursor: default;
}
.samsara-fleet-vehicle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #475569;
    flex-shrink: 0;
    margin-top: 4px;
}
/* Truck states */
.samsara-fleet-vehicle-dot.off {
    background: #475569;
}
.samsara-fleet-vehicle-dot.idle {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
    animation: dot-pulse 2s ease-in-out infinite;
}
.samsara-fleet-vehicle-dot.moving {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}
.samsara-fleet-vehicle-dot.stopped {
    background: #475569;
}
/* Trailer states — square dot */
.samsara-fleet-vehicle-dot.trailer {
    border-radius: 2px;
    background: #475569;
}
.samsara-fleet-vehicle-dot.trailer.off {
    background: #475569;
}
.samsara-fleet-vehicle-dot.trailer.stopped {
    background: #94a3b8;
}
.samsara-fleet-vehicle-dot.trailer.moving {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}
@keyframes dot-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,0.18); }
    50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0.08); }
}
.samsara-fleet-vehicle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.samsara-fleet-vehicle-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.samsara-fleet-vehicle-loc {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Live Map Section */
.dash-card-body-map {
    padding: 0 !important;
    overflow: hidden;
    flex: 1;
    display: flex;
}
.samsara-live-map-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
    min-height: 500px;
}
#liveMapContainer {
    width: 100%;
    height: 100%;
    min-height: 500px;
}
.samsara-live-map-sidebar {
    width: 240px;
    border-left: 1px solid var(--border, #e2e8f0);
    display: flex;
    flex-direction: column;
    background: var(--card-bg, #fff);
    overflow: hidden;
}
.samsara-live-map-sidebar-header {
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: var(--card-header-bg, #f8fafc);
    flex-shrink: 0;
}
.samsara-live-map-sidebar .samsara-fleet-vehicle-list {
    flex: 1;
    width: 100%;
    border-left: none;
}

@media (max-width: 768px) {
    .samsara-fleet-map-body {
        flex-direction: column;
        height: auto;
    }
    .samsara-fleet-map-container {
        height: 280px;
    }
    .samsara-fleet-vehicle-list {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border, #e2e8f0);
        max-height: 200px;
    }
    .samsara-live-map-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border, #e2e8f0);
        max-height: 200px;
    }
    .dash-card-body-map {
        flex-direction: column;
    }
}

/* DND toggle switch */
.dnd-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
.dnd-toggle input { display: none; }
.dnd-toggle-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background: #d1d5db;
    border-radius: 11px;
    transition: background 0.25s;
}
.dnd-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.dnd-toggle input:checked + .dnd-toggle-slider {
    background: #dc2626;
}
.dnd-toggle input:checked + .dnd-toggle-slider::after {
    transform: translateX(18px);
}
.dnd-toggle-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    transition: color 0.2s;
}
.dnd-toggle input:checked ~ .dnd-toggle-label {
    color: #dc2626;
}

/* â”€â”€ Compose â”€â”€ */
.dp-compose {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.012);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.dp-compose:focus-within {
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.06);
}
.dp-compose-input {
    display: block;
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 0.75rem 0.85rem 0.35rem;
    font-family: inherit;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--gray-700);
    resize: none;
    min-height: 56px;
    max-height: 200px;
    box-sizing: border-box;
}
.dp-compose-input::placeholder { color: var(--gray-400); }
.dp-compose-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.dp-compose-selects {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}
.dp-compose-select {
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--gray-500);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--dash-radius-xs);
    padding: 0.2rem 0.35rem;
    background: rgba(0, 0, 0, 0.02);
    cursor: pointer;
    outline: none;
    max-width: 105px;
}
.dp-compose-select:focus { border-color: var(--primary); }
.dp-compose-post {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: var(--dash-radius-sm);
    padding: 0.32rem 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--dash-transition), opacity var(--dash-transition);
}
.dp-compose-post:hover:not(:disabled) { background: var(--primary-dark); }
.dp-compose-post:disabled { opacity: 0.25; cursor: default; }
.dp-compose-post.posting { pointer-events: none; opacity: 0.5; }
.dp-compose-post.posting svg { animation: dpSpin 0.6s linear infinite; }
@keyframes dpSpin { to { transform: rotate(360deg); } }
.dp-compose.posted { animation: dpPosted 0.5s ease; }
@keyframes dpPosted {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3); }
    50%  { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.04); }
    100% { box-shadow: none; }
}

/* â”€â”€ Collapsible Sections â”€â”€ */
.dp-section-collapsible { overflow: hidden; }
.dp-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}
.dp-section-toggle:hover .dp-toggle-label { color: var(--primary); }
.dp-toggle-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color var(--dash-transition);
}
.dp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 700;
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
}
.dp-badge:empty { display: none; }
.dp-toggle-chevron {
    color: var(--gray-400);
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dp-section-collapsible.collapsed .dp-toggle-chevron {
    transform: rotate(-90deg);
}
.dp-collapse-body {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    opacity: 1;
}
.dp-collapse-body > * { overflow: hidden; }
.dp-section-collapsible.collapsed .dp-collapse-body {
    grid-template-rows: 0fr;
    opacity: 0;
    pointer-events: none;
}

/* â”€â”€ Feed (Notes & Tasks) â”€â”€ */
.dp-feed {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-top: 0.6rem;
}
.dp-note {
    display: flex;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    background: rgba(0, 0, 0, 0.012);
    transition: border-color var(--dash-transition);
}
.dp-note:hover { border-color: rgba(0, 0, 0, 0.08); }
.dp-note-avi {
    width: 26px; height: 26px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff; font-size: 0.58rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.dp-note-body { flex: 1; min-width: 0; }
.dp-note-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.2rem;
}
.dp-note-tag {
    display: inline-flex;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
}
.dp-note-tag[data-type="incident"]    { background: rgba(220,38,38,0.08);  color: #dc2626; }
.dp-note-tag[data-type="safety"]      { background: rgba(234,88,12,0.08);  color: #ea580c; }
.dp-note-tag[data-type="maintenance"] { background: rgba(217,119,6,0.08);  color: #b45309; }
.dp-note-tag[data-type="training"]    { background: rgba(5,150,105,0.08);  color: #059669; }
.dp-note-tag[data-type="inspection"]  { background: rgba(37,99,235,0.08);  color: #2563eb; }
.dp-note-pri {
    font-size: 0.56rem; font-weight: 700; text-transform: uppercase;
}
.dp-note-pri[data-pri="high"]   { color: #ea580c; }
.dp-note-pri[data-pri="urgent"] { color: #dc2626; }
.dp-note-time {
    font-size: 0.6rem; color: var(--gray-400); margin-left: auto;
}
.dp-note-text {
    font-size: 0.78rem; color: var(--gray-700); line-height: 1.45;
    word-break: break-word;
}
.dp-note-author {
    font-size: 0.6rem; color: var(--gray-400); margin-top: 0.15rem;
}
.dp-note-del {
    border: none; background: none; color: var(--gray-300);
    font-size: 0.58rem; cursor: pointer; padding: 0.1rem 0.25rem;
    border-radius: 4px; transition: all var(--dash-transition); flex-shrink: 0;
    align-self: flex-start;
}
.dp-note-del:hover { background: rgba(220,38,38,0.08); color: #dc2626; }

/* Tasks */
.dp-task {
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    background: rgba(0, 0, 0, 0.012);
    transition: border-color var(--dash-transition);
}
.dp-task:hover { border-color: rgba(0, 0, 0, 0.08); }
.dp-task-top {
    display: flex; align-items: center; gap: 0.3rem; margin-bottom: 0.2rem;
}
.dp-task-type {
    display: inline-flex; padding: 0.1rem 0.35rem; border-radius: 4px;
    font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(79, 70, 229, 0.08); color: var(--primary);
}
.dp-task-pri {
    font-size: 0.56rem; font-weight: 700; text-transform: uppercase;
}
.dp-task-pri[data-pri="high"]   { color: #ea580c; }
.dp-task-pri[data-pri="urgent"] { color: #dc2626; }
.dp-task-overdue {
    font-size: 0.56rem; font-weight: 700; color: #dc2626;
    background: rgba(220,38,38,0.06); padding: 0.08rem 0.3rem;
    border-radius: 3px;
}
.dp-task-text {
    font-size: 0.78rem; color: var(--gray-700); line-height: 1.4;
    margin-bottom: 0.25rem; word-break: break-word;
}
.dp-task-bot {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.dp-task-date { font-size: 0.6rem; color: var(--gray-400); }
.dp-task-status {
    font-size: 0.6rem; font-weight: 700;
    padding: 0.08rem 0.35rem; border-radius: 4px;
}
.dp-task-status[data-status="Open"]        { background: rgba(79,70,229,0.08); color: var(--primary); }
.dp-task-status[data-status="In Progress"] { background: rgba(217,119,6,0.08); color: #b45309; }
.dp-task-status[data-status="Resolved"]    { background: rgba(5,150,105,0.08); color: #059669; }

/* Task card interactive controls */
.dp-task-status-select {
    font-size: 0.6rem; font-weight: 700;
    padding: 0.12rem 0.3rem; border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(0,0,0,0.02); color: var(--gray-700);
    cursor: pointer; outline: none;
    transition: border-color var(--dash-transition);
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 4px center;
    padding-right: 14px;
}
.dp-task-status-select:hover { border-color: var(--primary); }
.dp-task-status-select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,70,229,0.1); }
.dp-task-resolve {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%;
    border: 1.5px solid rgba(5,150,105,0.3); background: transparent;
    color: #059669; font-size: 0.6rem; font-weight: 700;
    cursor: pointer; transition: all var(--dash-transition); padding: 0; line-height: 1;
}
.dp-task-resolve:hover { background: rgba(5,150,105,0.1); border-color: #059669; }
.dp-task { cursor: default; }

/* Empty state */
.dp-empty {
    padding: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-400);
    font-style: italic;
}

/* â”€â”€ Compliance Grid â”€â”€ */
.dp-compliance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding-top: 0.5rem;
}
.dp-comp-item {
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    background: rgba(0, 0, 0, 0.012);
}
.dp-comp-item.comp-ok      { border-color: rgba(5,150,105,0.15);  background: rgba(5,150,105,0.03); }
.dp-comp-item.comp-warn    { border-color: rgba(217,119,6,0.2);   background: rgba(217,119,6,0.04); }
.dp-comp-item.comp-expired { border-color: rgba(220,38,38,0.2);   background: rgba(220,38,38,0.04); }
.dp-comp-item.comp-na      { border-color: rgba(0,0,0,0.04); }
.dp-comp-label {
    font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--gray-400); margin-bottom: 0.1rem;
}
.dp-comp-value {
    font-size: 0.78rem; font-weight: 600; color: var(--gray-800);
}
.dp-comp-item.comp-ok .dp-comp-value      { color: #059669; }
.dp-comp-item.comp-warn .dp-comp-value    { color: #b45309; }
.dp-comp-item.comp-expired .dp-comp-value { color: #dc2626; }
.dp-comp-item.comp-na .dp-comp-value      { color: var(--gray-400); }
.dp-comp-sub {
    font-size: 0.58rem; color: var(--gray-400); margin-top: 0.05rem;
}
.dp-merged-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0.75rem 0;
}

/* â”€â”€ Responsive â”€â”€ */
@media (max-width: 560px) {
    .dp-summary-bar { padding: 0 1rem 0.6rem; }
    .dp-quick-actions { padding: 0.5rem 1rem; flex-wrap: wrap; }
    .dp-compliance-grid { grid-template-columns: 1fr; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Spreadsheet Edit Mode  (Excel-inspired)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Toggle button */
.ss-toggle-btn {
    padding: 0.3rem !important;
    min-width: 30px;
}
.ss-toggle-btn.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(79,70,229,0.18);
}

/* Card expansion when spreadsheet is active */
.spreadsheet-active .dash-card {
    max-width: none;
}
.spreadsheet-active .dash-table-wrap {
    overflow-x: auto;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}
.spreadsheet-active .dash-table {
    table-layout: fixed;
    border-collapse: collapse;
}

/* â”€â”€ Save Bar â”€â”€ */
.ss-save-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.85rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(245,158,11,0.15);
}
.ss-save-count {
    color: #92400e;
    flex: 1;
    font-weight: 700;
}
.ss-save-btn {
    padding: 0.3rem 1rem;
    background: #059669;
    color: #fff;
    border: none;
    border-radius: var(--dash-radius-xs);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--dash-transition);
    box-shadow: 0 1px 2px rgba(5,150,105,0.2);
}
.ss-save-btn:hover { background: #047857; }
.ss-discard-btn {
    padding: 0.3rem 0.85rem;
    background: #fff;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: var(--dash-radius-xs);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--dash-transition);
}
.ss-discard-btn:hover { background: #fef2f2; border-color: #dc2626; }

/* â”€â”€ Spreadsheet Table Header â”€â”€ */
.ss-th {
    background: #e2e8f0 !important;
    color: #1e293b !important;
    font-size: 0.66rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.45rem 0.4rem !important;
    white-space: nowrap;
    text-align: left;
    border: 1px solid #cbd5e1 !important;
    border-top: none !important;
    position: sticky;
    top: 0;
    z-index: 2;
}
.ss-th-num {
    background: #d1d5db !important;
    color: #64748b !important;
    font-size: 0.6rem !important;
    font-weight: 700 !important;
    padding: 0.45rem 0.2rem !important;
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    text-align: center;
    border: 1px solid #cbd5e1 !important;
    border-top: none !important;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 3;
}

/* â”€â”€ Row Number Cell (frozen left) â”€â”€ */
.ss-num {
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    padding: 0 !important;
    background: #e9ecef;
    border: 1px solid #cbd5e1;
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    -webkit-user-select: none;
    user-select: none;
    position: sticky;
    left: 0;
    z-index: 1;
}

/* â”€â”€ Spreadsheet Cell â”€â”€ */
.ss-cell {
    padding: 0 !important;
    vertical-align: middle;
    border: 1px solid #e2e8f0;
    height: 30px;
}

/* â”€â”€ Spreadsheet Inputs â”€â”€ */
.ss-input, .ss-select {
    width: 100%;
    height: 100%;
    padding: 0.2rem 0.35rem;
    border: none;
    border-radius: 0;
    font-size: 0.73rem;
    font-family: 'Inter', -apple-system, sans-serif;
    background: transparent;
    color: #1e293b;
    transition: background 0.1s;
    box-sizing: border-box;
    outline: none;
}
.ss-input:hover, .ss-select:hover {
    background: #f8fafc;
}
.ss-input:focus, .ss-select:focus {
    background: #fff;
    box-shadow: inset 0 0 0 2px #6366f1;
    position: relative;
    z-index: 1;
}
.ss-select {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    padding-right: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
}
.ss-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
}
input[type="date"].ss-input {
    font-size: 0.7rem;
    padding-right: 2px;
}

/* â”€â”€ Dirty Cell Highlight â”€â”€ */
.ss-dirty {
    background: #fef9c3 !important;
    box-shadow: inset 0 0 0 1.5px #eab308 !important;
}
.ss-dirty:focus {
    box-shadow: inset 0 0 0 2px #3b82f6 !important;
}

/* â”€â”€ Expiry Highlights â”€â”€ */
.ss-expired {
    color: #dc2626 !important;
    background: rgba(220,38,38,0.06) !important;
    font-weight: 600;
}
.ss-expiring {
    color: #b45309 !important;
    background: rgba(245,158,11,0.08) !important;
    font-weight: 600;
}

/* â”€â”€ Spreadsheet Row â”€â”€ */
.ss-row {
    border-bottom: 1px solid #e2e8f0;
}
.ss-row:nth-child(even) .ss-cell {
    background: rgba(248,250,252,0.5);
}
.ss-row:nth-child(even) .ss-num {
    background: #dfe3e8;
}
.ss-row:hover .ss-cell {
    background: rgba(59,130,246,0.04);
}
.ss-row:hover .ss-num {
    background: #cbd5e1;
    color: #334155;
}

/* â”€â”€ Load Status Badges â”€â”€ */
.load-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.675rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.4;
}
.load-badge-booked {
    background: #dbeafe; color: #1e40af;
}
.load-badge-dispatched {
    background: #e0e7ff; color: #3730a3;
}
.load-badge-loaded {
    background: #fef3c7; color: #92400e;
}
.load-badge-transit {
    background: #cffafe; color: #155e75;
}
.load-badge-delivered {
    background: #d1fae5; color: #065f46;
}
.load-badge-invoiced {
    background: #ede9fe; color: #5b21b6;
}
.load-badge-paid {
    background: #a7f3d0; color: #064e3b;
}
.load-badge-canceled {
    background: #fee2e2; color: #991b1b;
}
.load-badge-issue {
    background: #fef3c7; color: #b45309;
}
.load-rpm {
    font-weight: 600;
    color: #059669;
}

/* â”€â”€ New row slide-in animation â”€â”€ */
.load-row-enter {
    opacity: 0;
    transform: translateY(-12px);
    background: #ecfdf5;
}
.load-row-enter td {
    transition: none;
}
#loadsTableBody tr {
    transition: opacity 0.4s ease, transform 0.4s ease, background 0.6s ease;
}

/* â”€â”€ Load Cell with Document Upload â”€â”€ */
.load-cell-with-doc {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}
.load-cell-with-doc > span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cell-with-doc {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: visible;
}
.cell-with-doc > span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cell-with-doc .entity-doc-btn {
    opacity: 0;
}
.cell-with-doc:hover .entity-doc-btn,
tr:hover .cell-with-doc .entity-doc-btn {
    opacity: 1;
}
.cell-with-doc .entity-doc-uploaded {
    opacity: 1;
}
.load-doc-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dash-transition);
    opacity: 0;
    z-index: 2;
}
.load-doc-btn svg {
    width: 13px;
    height: 13px;
}
tr:hover .load-doc-btn {
    opacity: 1;
}
.load-doc-btn:hover {
    color: #6366f1;
    border-color: #c7d2fe;
    background: #eef2ff;
}
.load-doc-btn.uploaded {
    opacity: 1;
    color: #059669;
}
.load-doc-btn.uploaded:hover {
    color: #047857;
    border-color: #a7f3d0;
    background: #ecfdf5;
}
.entity-doc-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dash-transition);
    opacity: 0;
    z-index: 2;
}
.entity-doc-btn svg {
    width: 13px;
    height: 13px;
}
tr:hover .entity-doc-btn {
    opacity: 1;
}
.entity-doc-btn:hover {
    color: #6366f1;
    border-color: transparent;
    background: transparent;
}
.entity-doc-btn.uploaded {
    opacity: 1;
}
.entity-doc-btn.uploaded svg {
    width: 10px;
    height: 10px;
}

/* â”€â”€ Uploaded Doc Indicator + Menu â”€â”€ */
.entity-doc-uploaded {
    position: absolute;
    right: 4px;
    top: 0;
    bottom: 0;
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    z-index: 2;
}
.entity-doc-check {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: transparent;
    color: #059669;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color var(--dash-transition), transform var(--dash-transition);
    flex-shrink: 0;
}
.entity-doc-check svg {
    width: 13px;
    height: 13px;
}
.entity-doc-check:hover,
.entity-doc-uploaded.open .entity-doc-check {
    color: #16a34a;
    transform: scale(1.15);
}
/* â”€â”€ Photo Thumbnail â”€â”€ */
.entity-doc-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 1.5px solid #e5e7eb;
    transition: border-color var(--dash-transition), box-shadow var(--dash-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.entity-doc-thumb:hover,
.entity-doc-uploaded.open .entity-doc-thumb {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.18);
}
.entity-doc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    image-rendering: -webkit-optimize-contrast;
}
.entity-doc-menu {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--dash-radius-sm);
    box-shadow: var(--dash-shadow-lg);
    padding: 4px 0;
    z-index: 200;
    flex-direction: column;
    min-width: 100px;
}
.entity-doc-uploaded.open .entity-doc-menu {
    display: flex;
}
.entity-doc-action {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    font-size: 12px;
    font-family: inherit;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s;
}
.entity-doc-action:hover {
    background: #f3f4f6;
}
.entity-doc-action svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* â”€â”€ Photo Lightbox â”€â”€ */
.photo-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.photo-lightbox.active {
    display: flex;
}
.photo-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    cursor: pointer;
}
.photo-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    background: #000;
    z-index: 1;
}
.photo-lightbox-content img {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}
.photo-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--dash-transition);
}
.photo-lightbox-close:hover {
    background: rgba(0,0,0,0.8);
}

.cell-muted {
    color: #6b7280;
    font-size: 0.7rem;
}

/* â”€â”€ Load Route Map â”€â”€ */
.load-rc-strip {
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.76);
}

.load-rc-strip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.load-rc-strip-label {
    margin: 0;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.load-rc-strip-status {
    margin: 0.12rem 0 0;
    font-size: 0.76rem;
    color: var(--gray-500);
    line-height: 1.3;
}

.load-rc-strip-status.is-loading {
    color: #0369a1;
}

.load-rc-strip-status.is-ready {
    color: #059669;
}

.load-rc-strip-status.is-error {
    color: #b91c1c;
}

.load-rc-dropzone {
    margin-top: 0.55rem;
    border: 1.5px dashed #c7d2fe;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8faff 0%, #f3f6ff 100%);
    padding: 0.6rem 0.75rem;
    min-height: 58px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    cursor: pointer;
    transition: border-color .16s, box-shadow .16s, transform .16s;
}

.load-rc-dropzone:hover,
.load-rc-dropzone:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.13);
    outline: none;
}

.load-rc-dropzone.drag-over {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.load-rc-dropzone.has-file {
    border-style: solid;
    border-color: #93c5fd;
    background: linear-gradient(180deg, #eff6ff 0%, #e9f2ff 100%);
}

.load-rc-drop-main {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e293b;
}

.load-rc-drop-sub {
    font-size: 0.7rem;
    color: #64748b;
}

.load-rc-strip-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: 0.6rem;
}

.load-rc-strip-summary span {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.35rem 0.45rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.9);
}

.load-rc-strip-summary strong {
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.load-rc-strip-summary em {
    font-style: normal;
    font-size: 0.77rem;
    font-weight: 600;
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.load-rc-change-summary {
    margin-top: 0.42rem;
    font-size: 0.72rem;
    color: #334155;
    background: rgba(248, 250, 252, 0.9);
    border: 1px dashed rgba(148, 163, 184, 0.5);
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
}

/* ═══════════════════════════════════════════════
   RC READER — full-screen redesign
   ═══════════════════════════════════════════════ */

/* overlay fills the entire viewport */
.rc-reader-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.rc-reader-overlay.hidden { display: none; }

.rc-reader-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: #f8fafc;
    overflow: hidden;
}

/* top bar */
.rc-reader-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.rc-reader-topbar-left  { display:flex; align-items:center; gap:0.65rem; min-width:0; }
.rc-reader-topbar-center{ display:flex; align-items:center; gap:0.65rem; flex:1; min-width:0; }
.rc-progress-wrap {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
    min-width: 80px;
    max-width: 340px;
}
.rc-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: #3b82f6;
    transition: width 0.35s ease, background 0.4s ease;
}
.rc-progress-bar.is-done { background: #10b981; }
.rc-progress-bar.is-error { background: #ef4444; }
.rc-reader-topbar-right { display:flex; align-items:center; gap:0.45rem; flex-shrink:0; }
.rc-reader-title  { font-size:0.875rem; font-weight:700; color:#111827; white-space:nowrap; }
.rc-reader-filename {
    font-size:0.72rem; color:#6b7280; white-space:nowrap;
    overflow:hidden; text-overflow:ellipsis; max-width:220px;
}
.rc-reader-status { font-size:0.72rem; font-weight:600; color:#6b7280; }
.rc-reader-close {
    background:none; border:none; font-size:1.4rem; line-height:1;
    color:#9ca3af; cursor:pointer; padding:0 0.25rem;
    transition:color 0.15s;
}
.rc-reader-close:hover { color:#374151; }

/* body: two-column split */
.rc-reader-body {
    display: grid;
    grid-template-columns: minmax(220px, 28%) minmax(660px, 1fr);
    flex: 1;
    min-height: 0;
    overflow: hidden;
    transition: grid-template-columns 0.22s ease;
}

#loadRcAiModal .rc-reader-shell.rc-has-file .rc-reader-body {
    grid-template-columns: minmax(340px, 40%) minmax(520px, 1fr);
}

/* LEFT — PDF viewer */
.rc-reader-left {
    display: flex;
    flex-direction: column;
    background: #edf2f8;
    border-right: 1px solid #d7dee8;
    overflow: hidden;
    position: relative;
    padding: 0.75rem;
}

/* drop zone (shown before file) */
.rc-reader-drop {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    color: #64748b;
    cursor: pointer;
    border: 1.5px dashed rgba(100, 116, 139, 0.4);
    border-radius: 12px;
    min-height: 140px;
    max-height: 170px;
    margin: 0;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
    transition: border-color 0.18s, background 0.18s;
}
.rc-reader-drop.drag-over {
    border-color: #6366f1;
    background: rgba(99,102,241,0.08);
}
.rc-reader-drop.has-file {
    border-color: #10b981;
    background: rgba(16,185,129,0.06);
}
.rc-reader-drop-label { font-size:0.86rem; font-weight:700; color:#1f2937; }
.rc-reader-drop-sub   { font-size:0.72rem; color:#64748b; }
.rc-reader-drop-btns  { display:flex; gap:0.5rem; flex-wrap:wrap; justify-content:center; margin-top:0.3rem; }

/* PDF canvas viewer */
.rc-pdf-viewer {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #1e293b;
}
.rc-pdf-viewer.hidden { display:none; }

.rc-pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.65rem;
    background: rgba(15,23,42,0.85);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.rc-pdf-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #e2e8f0;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s;
}
.rc-pdf-btn:hover { background: rgba(255,255,255,0.16); }
.rc-pdf-btn:disabled { opacity:0.35; cursor:default; }
.rc-pdf-btn-replace { color:#94a3b8; }
.rc-pdf-page-info { font-size:0.7rem; color:#94a3b8; padding:0 0.2rem; white-space:nowrap; }
.rc-pdf-sep { width:1px; height:16px; background:rgba(255,255,255,0.12); margin:0 0.15rem; }

.rc-pdf-canvas-wrap {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
    background: #334155;
}
.rc-pdf-canvas-wrap canvas {
    box-shadow: 0 4px 24px rgba(0,0,0,0.45);
    display: block;
    max-width: 100%;
}

.rc-reader-text-preview {
    flex: 1;
    overflow: auto;
    padding: 1rem;
    font-size: 0.73rem;
    line-height: 1.4;
    color: #cbd5e1;
    white-space: pre-wrap;
    background: #1e293b;
    margin: 0;
}
.rc-reader-text-preview.hidden { display:none; }

/* RIGHT — editable fields */
.rc-reader-right {
    background: #f8fafc;
    overflow-y: auto;
    padding: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#loadRcAiModal .rc-reader-right .rc-ai-kv-grid {
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    padding: 0.75rem;
}

#loadRcAiModal .rc-reader-right .rc-ai-stop-block {
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
    margin-top: 0;
}

#loadRcAiModal .rc-reader-right .rc-ai-stop-block h3 {
    margin: 0;
    padding: 0.55rem 0.7rem;
    background: #f4f7fb;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.66rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #475569;
}

/* keep kv-grid pointer-events always on inside reader */
.rc-reader-right .rc-ai-kv-grid input,
.rc-reader-right .rc-ai-kv-grid textarea {
    pointer-events: auto !important;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

@media (max-width: 900px) {
    .rc-reader-body { grid-template-columns: 1fr; grid-template-rows: 50vh 1fr; }
    .rc-reader-right { border-left: none; border-top: 1px solid #e5e7eb; }
    .rc-reader-left { border-right: none; padding: 0.65rem; }
    .rc-reader-drop { max-height: none; min-height: 120px; }
}

/* ── RC drag-drop zone (legacy, kept for old refs) ── */
.rc-ai-drop-zone {
    border: 2px dashed rgba(99,102,241,0.35);
    border-radius: 12px;
    background: rgba(238,242,255,0.45);
    padding: 1.5rem 1rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}
.rc-ai-drop-zone.drag-over {
    border-color: #6366f1;
    background: rgba(238,242,255,0.85);
}
.rc-ai-drop-zone svg {
    color: #6366f1;
    opacity: 0.75;
}
.rc-ai-drop-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #374151;
}
.rc-ai-drop-sub {
    font-size: 0.72rem;
    color: var(--gray-500);
    margin-bottom: 0.2rem;
}
.rc-ai-drop-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.2rem;
}
.rc-ai-drop-zone.has-file {
    border-color: #10b981;
    background: rgba(220,252,231,0.35);
}
.rc-ai-drop-zone.has-file svg {
    color: #10b981;
}

.modal-rc-ai {
    width: 94vw;
    max-width: 1320px;
    min-width: 900px;
    max-height: calc(100vh - 1.5rem);
}

#loadRcAiModal .modal-content.modal-rc-ai {
    display: flex;
    flex-direction: column;
}

#loadRcAiModal .modal-content.modal-rc-ai .modal-body {
    overflow-y: auto;
    max-height: calc(100vh - 8.5rem);
    -webkit-overflow-scrolling: touch;
}

.dash-layout ~ .modal:not(.modal-task-profile) .modal-content.modal-rc-ai {
    display: flex;
    flex-direction: column;
}

.dash-layout ~ .modal:not(.modal-task-profile) .modal-content.modal-rc-ai .modal-body {
    overflow-y: auto;
    max-height: calc(100vh - 8.5rem);
}

.rc-ai-toolbar {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.7rem;
    background: rgba(255, 255, 255, 0.82);
}

.rc-ai-status {
    margin: 0.45rem 0 0;
    font-size: 0.78rem;
    font-weight: 600;
}

.rc-ai-metrics {
    margin-top: 0.45rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.rc-ai-metric-badge {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 0.18rem 0.5rem;
    background: #f8fafc;
    color: var(--gray-600);
}

.rc-ai-metric-badge.ok {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: #047857;
}

.rc-ai-metric-badge.warn {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.26);
    color: #b45309;
}

.rc-ai-metric-badge.err {
    background: rgba(239, 68, 68, 0.13);
    border-color: rgba(239, 68, 68, 0.28);
    color: #b91c1c;
}

.rc-ai-workspace {
    display: grid;
    grid-template-columns: minmax(380px, 1.1fr) minmax(420px, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.rc-ai-preview-pane,
.rc-ai-detail-pane {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

.rc-ai-pane-head {
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-500);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.52rem 0.65rem;
    background: rgba(248, 250, 252, 0.92);
}

.rc-ai-preview-frame-wrap {
    height: 62vh;
    min-height: 480px;
    background: #eef2f7;
}

.rc-ai-preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: none;
}

.rc-ai-preview-frame.is-visible {
    display: block;
}

.rc-ai-text-preview {
    margin: 0;
    height: 100%;
    overflow: auto;
    padding: 0.7rem;
    font-size: 0.73rem;
    line-height: 1.35;
    color: #1f2937;
    white-space: pre-wrap;
}

.rc-ai-text-preview.is-hidden {
    display: none;
}

.rc-ai-detail-pane {
    max-height: 62vh;
    min-height: 480px;
    overflow: auto;
}

.rc-ai-kv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    padding: 0.6rem;
}

.rc-ai-kv-grid > div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.rc-ai-kv-grid > div.span-2 {
    grid-column: 1 / span 2;
}

.rc-ai-kv-grid label {
    font-size: 0.63rem;
    font-weight: 700;
    color: var(--gray-500);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rc-ai-kv-grid input,
.rc-ai-kv-grid textarea {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 7px;
    background: #fff;
    color: #1f2937;
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
}

#loadRcAiModal .rc-ai-kv-grid input,
#loadRcAiModal .rc-ai-kv-grid textarea {
    pointer-events: auto !important;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

.rc-ai-kv-grid textarea {
    resize: vertical;
}

.rc-ai-address-field {
    min-height: 3.25rem;
    line-height: 1.35;
}

.rc-ai-stop-block {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.rc-ai-stop-block h3 {
    margin: 0;
    padding: 0.55rem 0.65rem 0.15rem;
    font-size: 0.8rem;
    color: var(--gray-700);
}

.rc-ai-review-banner {
    margin-top: 0.6rem;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(255, 251, 235, 0.95);
    border-radius: 10px;
    padding: 0.6rem 0.72rem;
}

.rc-ai-review-banner strong {
    display: block;
    font-size: 0.75rem;
    color: #92400e;
    margin-bottom: 0.2rem;
}

.rc-ai-review-banner p {
    margin: 0;
    font-size: 0.72rem;
    color: #92400e;
}

.rc-ai-review-banner ul {
    margin: 0.42rem 0 0;
    padding-left: 1rem;
    display: grid;
    gap: 0.15rem;
}

.rc-ai-review-banner li {
    font-size: 0.72rem;
    color: #78350f;
}

.rc-ai-low-confidence {
    border-color: rgba(245, 158, 11, 0.65) !important;
    background: rgba(255, 251, 235, 0.95) !important;
}

.rc-ai-debug-panel {
    margin-top: 0.55rem;
    border: 1px solid rgba(100, 116, 139, 0.35);
    background: rgba(248, 250, 252, 0.94);
    border-radius: 10px;
    padding: 0.58rem 0.7rem;
}

.rc-ai-debug-panel strong {
    display: block;
    font-size: 0.74rem;
    color: #334155;
    margin-bottom: 0.3rem;
}

.rc-ai-debug-pre {
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.69rem;
    line-height: 1.35;
    color: #334155;
    max-height: 180px;
    overflow: auto;
}

.load-route-map {
    width: 100%;
    height: 220px;
    border-radius: var(--dash-radius-md);
    margin: 0.25rem 0 0.5rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.load-route-info {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
}
.load-route-info span {
    background: #f3f4f6;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

/* Unified sheet route map */
/* â”€â”€ Route Card (positioning in usheet-body section) â”€â”€ */
.usheet-route-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.5rem;
    background: linear-gradient(135deg, #f8f7ff 0%, #eef2ff 100%);
    border-bottom: 1px solid #e5e7eb;
}
.usheet-route-load-num {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #6366f1;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255,255,255,0.8), 0 -1px 0 rgba(99,102,241,0.08);
    background: linear-gradient(180deg, #e0e7ff 0%, #c7d2fe 100%);
    padding: 0.2rem 0.75rem;
    border-radius: 4px;
    border: 1px solid #c7d2fe;
    box-shadow: inset 0 1px 2px rgba(99,102,241,0.12), 0 1px 0 rgba(255,255,255,0.6);
}
.usheet-route-nav {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6366f1;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dash-transition);
    line-height: 1;
}
.usheet-route-nav:hover:not(:disabled) {
    background: #eef2ff;
    border-color: #6366f1;
}
.usheet-route-nav:disabled {
    opacity: 0.3;
    cursor: default;
}
.usheet-route-map {
    width: 100%;
    height: 100%;
    min-height: 150px;
}
.usheet-route-info {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0.35rem 0.5rem;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--gray-600);
    background: #fafafa;
    border-top: 1px solid #f3f4f6;
}
.usheet-route-info span {
    white-space: nowrap;
}
.usheet-route-arrow {
    color: #6366f1;
    font-size: 0.75rem;
}
.usheet-route-pill {
    background: #fff;
    padding: 0.12rem 0.5rem;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.usheet-route-rpm {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #6366f1;
}
.usheet-route-error {
    color: #ef4444;
    font-weight: 600;
}

/* â”€â”€ Dispatch Overview â”€â”€ */
.dispatch-overview {
    margin-bottom: 0.75rem;
}
.dispatch-stat-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.dispatch-stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--dash-radius-md);
    padding: 0.55rem 0.7rem;
    text-align: center;
    transition: border-color var(--dash-transition);
}
.dispatch-stat-card:hover {
    border-color: #c7d2fe;
}
.dispatch-stat-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.dispatch-stat-label {
    display: block;
    font-size: 0.55rem;
    color: var(--gray-400);
    margin-top: 0.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.45px;
}

/* â”€â”€ Period overview + Pulse â”€â”€ */
/* Period overview */
.disp-pulse-row {
    margin-bottom: 0.65rem;
}
.disp-period-tables {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.disp-period-table {
    width: auto;
    flex: 1 1 340px;
    max-width: 460px;
    table-layout: fixed;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--dash-radius-md);
    overflow: hidden;
}
.disp-period-table th {
    font-size: 0.48rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    padding: 0.18rem 0.4rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: var(--gray-50, #f9fafb);
}
.disp-period-table th:first-child {
    text-align: left;
    width: 66px;
}
.disp-period-table td {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--gray-700);
    padding: 0.16rem 0.4rem;
    text-align: right;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.disp-period-table tr:last-child td { border-bottom: none; }
.disp-period-table tr:hover td {
    color: var(--gray-900);
    background: var(--gray-50, #f9fafb);
}
.disp-period-row-clickable {
    cursor: pointer;
}
.disp-period-row-clickable:hover td {
    color: var(--primary, #4f46e5);
}
.disp-period-row-clickable:focus-visible td {
    outline: none;
}
.disp-period-row-clickable:focus-visible {
    box-shadow: inset 0 0 0 1.5px var(--primary, #4f46e5);
}
.disp-period-label {
    text-align: left !important;
    font-size: 0.54rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-400) !important;
}

@media (max-width: 760px) {
    .disp-period-tables { flex-direction: column; }
    .disp-period-table { max-width: none; }
}

.dispatch-breakdown {
    background: #ffffff;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--dash-radius-lg);
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.dispatch-breakdown-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    padding: 0 0.5rem;
}
.dispatch-tab {
    padding: 0.5rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-400);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color var(--dash-transition), border-color var(--dash-transition);
    font-family: inherit;
}
.dispatch-tab:hover {
    color: var(--gray-600);
}
.dispatch-tab.active {
    color: var(--primary, #4f46e5);
    border-bottom-color: var(--primary, #4f46e5);
}
.dispatch-breakdown-body {
    overflow-x: auto;
}
.dispatch-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.dispatch-breakdown-table th {
    background: #f9fafb;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    padding: 0.45rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}
.dispatch-breakdown-table td {
    padding: 0.4rem 0.65rem;
    border-bottom: 1px solid #f8f9fa;
    color: var(--gray-700);
}
.dispatch-breakdown-table tr:hover td {
    background: #f0f4ff;
}
.dispatch-breakdown-table td:first-child {
    font-weight: 600;
}
@media (max-width: 900px) {
    .dispatch-stat-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   DISPATCH LANDING PAGE
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Section dividers */
.disp-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 0.75rem;
}
.disp-section-header-first {
    margin-top: 0;
}
.disp-section-header h3 {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-400);
    margin: 0;
    white-space: nowrap;
}
.disp-section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color, #e5e7eb);
}

/* Charts â€” 4 col grid */
.an-charts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}
.an-chart-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--dash-radius-lg);
    padding: 0.75rem 0.75rem 0.6rem;
}
.an-chart-wrap {
    position: relative;
    height: 180px;
}
.an-card-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: #6b7280;
    margin: 0 0 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.an-charts-3 {
    grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) {
    .an-charts-3 { grid-template-columns: 1fr; }
}

/* Leaderboards */
.an-boards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-bottom: 1rem;
}
.an-board-card {
    background: #ffffff;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--dash-radius-lg);
    padding: 0.85rem;
}
.an-board-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.an-board-tabs {
    display: flex;
    gap: 0.25rem;
}
.an-tab {
    padding: 0.25rem 0.55rem;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all var(--dash-transition);
}
.an-tab:hover { background: var(--gray-50, #f9fafb); color: var(--primary, #4f46e5); border-color: #c7d2fe; }
.an-tab.active { background: var(--primary, #4f46e5); color: #fff; border-color: var(--primary, #4f46e5); }

/* Leaderboard rows */
.an-lb-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.an-lb-row:last-child { border-bottom: none; }
.an-lb-top { background: var(--gray-50, #f9fafb); border-radius: 8px; padding: 0.55rem 0.5rem; margin: 0 -0.5rem; }
.an-lb-rank {
    width: 28px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #9ca3af;
    flex-shrink: 0;
}
.an-lb-top .an-lb-rank { font-size: 1.1rem; }
.an-lb-info { flex: 1; min-width: 0; }
.an-lb-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-900, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.an-lb-name-link {
    display: block;
    width: 100%;
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.an-lb-name-link:hover { color: var(--primary, #4f46e5); }
.an-lb-sub {
    font-size: 0.6rem;
    color: #9ca3af;
    margin-top: 0.1rem;
}
.an-lb-bar {
    height: 3px;
    background: #f3f4f6;
    border-radius: 2px;
    margin-top: 0.3rem;
    overflow: hidden;
}
.an-lb-fill {
    height: 100%;
    background: var(--primary, #4f46e5);
    border-radius: 2px;
    transition: width 0.4s ease;
}
.an-lb-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary, #4f46e5);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Teams */
.an-teams-section {
    background: #ffffff;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--dash-radius-lg);
    padding: 1rem;
}
.an-teams-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}
.an-teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}
.an-team-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.85rem;
    background: #fff;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.an-team-card:hover { border-color: #c7d2fe; }
.an-team-first {
    border-left: 3px solid var(--primary, #4f46e5);
    background: var(--gray-50, #f9fafb);
}
.an-team-rank {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-300, #d1d5db);
}
.an-team-first .an-team-rank { color: var(--primary, #4f46e5); font-size: 1.05rem; }
.an-team-header {
    margin-bottom: 0.6rem;
}
.an-team-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-900, #111827);
    margin: 0;
}
.an-team-leader {
    font-size: 0.6rem;
    color: #6b7280;
    font-weight: 600;
}
.an-team-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.65rem;
    padding: 0.5rem 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
}
.an-team-stat {
    text-align: center;
}
.an-team-stat strong {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gray-900, #111827);
}
.an-team-stat span {
    font-size: 0.52rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}
.an-team-members {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.an-team-member {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    padding: 0.2rem 0;
}
.an-team-member-name {
    font-weight: 600;
    color: #374151;
}
.an-leader-badge {
    display: inline-block;
    background: var(--primary, #4f46e5);
    color: #fff;
    font-size: 0.5rem;
    font-weight: 700;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 0.2rem;
}
.an-team-member-stat {
    font-weight: 700;
    color: #6b7280;
}

/* Modal */
.an-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.an-modal {
    background: #fff;
    border-radius: var(--dash-radius-lg);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--dash-shadow-xl);
}
.disp-period-modal {
    max-width: min(720px, 94vw);
}
.an-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}
.an-modal-head h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-900, #111827);
    margin: 0;
}
.an-modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    line-height: 1;
}
.an-modal-body {
    padding: 1rem 1.25rem;
}
.an-team-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}
.an-team-form input,
.an-team-form select {
    flex: 1;
    min-width: 120px;
}
.an-team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.an-team-row-info strong {
    font-size: 0.78rem;
    color: var(--gray-900, #111827);
}
.an-team-row-leader {
    font-size: 0.6rem;
    color: #6b7280;
    margin-left: 0.5rem;
}
.an-team-row-count {
    font-size: 0.6rem;
    color: #9ca3af;
    margin-left: 0.5rem;
}
.an-team-row-actions {
    display: flex;
    gap: 0.35rem;
}
.an-assign-section {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e5e7eb;
}
.an-assign-section h4 {
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 0.5rem;
}
.an-dispatcher-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.an-disp-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #374151;
    padding: 0.3rem 0.6rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--dash-transition);
}
.an-disp-label:hover { border-color: #c7d2fe; background: #f0f4ff; }
.an-disp-label input:checked + .an-disp-label,
.an-disp-label:has(input:checked) {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4f46e5;
}
.an-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 0.75rem;
    padding: 1.5rem;
}

/* Responsive */
@media (max-width: 1100px) {
    .an-charts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .an-charts { grid-template-columns: 1fr; }
    .an-boards { grid-template-columns: 1fr; }
    .an-teams-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .an-charts { grid-template-columns: 1fr; }
}
/* Load modal wider */
.modal-lg {
    max-width: 720px;
}

@media (max-width: 768px) {
    .modal-lg {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
    }

    #loadModal .modal-content.modal-lg {
        max-height: calc(100vh - 1rem);
    }

    #loadModal .modal-body {
        max-height: calc(100vh - 6.75rem);
    }

    #loadModal {
        padding: 0.5rem;
    }

    .modal-rc-ai {
        min-width: 0;
    }

    .rc-ai-workspace {
        grid-template-columns: 1fr;
    }

    .rc-ai-preview-frame-wrap,
    .rc-ai-detail-pane {
        min-height: 320px;
        max-height: none;
        height: 44vh;
    }

    .rc-ai-kv-grid {
        grid-template-columns: 1fr;
    }

    .rc-ai-kv-grid > div.span-2 {
        grid-column: auto;
    }

    .load-rc-strip-header {
        align-items: flex-start;
    }

    .load-rc-strip-summary {
        grid-template-columns: 1fr;
    }
}
/* Readonly spreadsheet cells */
.ss-readonly {
    background: #f1f5f9 !important;
    color: #64748b;
    font-style: italic;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   UNIFIED SPREADSHEET POPUP
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.usheet-modal {
    width: 96vw;
    max-width: 1320px;
    min-width: 760px;
    min-height: 220px;
    height: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    resize: both;
    border-radius: 12px;
    overflow: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
}

/* â”€â”€ Header â”€â”€ */
.usheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
    position: relative;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.usheet-header h2 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    letter-spacing: -0.01em;
}

.usheet-header-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.usheet-row-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #6366f1;
    background: #eef2ff;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.01em;
}

.usheet-btn-cols,
.usheet-btn-add,
.usheet-btn-import {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: all var(--dash-transition);
}

.usheet-btn-cols:hover,
.usheet-btn-add:hover,
.usheet-btn-import:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.usheet-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    font-size: 1.25rem;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--dash-transition);
    line-height: 1;
}

.usheet-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* â”€â”€ Column Picker Dropdown â”€â”€ */
.usheet-col-dropdown {
    position: fixed;
    z-index: 10000;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--dash-radius-md);
    box-shadow: var(--dash-shadow-lg);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 170px;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.usheet-col-dropdown::-webkit-scrollbar {
    width: 5px;
}

.usheet-col-dropdown::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

/* Mini card */
.usheet-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 0.6875rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background var(--dash-transition), color var(--dash-transition);
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
    line-height: 1.2;
    width: 100%;
    text-align: left;
}

.usheet-card::before {
    content: '';
    display: block;
    width: 13px;
    height: 13px;
    border-radius: 3px;
    border: 1.5px solid #d1d5db;
    flex-shrink: 0;
    background: transparent;
    transition: background var(--dash-transition), border-color var(--dash-transition);
}

.usheet-card:hover {
    background: #f9fafb;
    color: #374151;
}

.usheet-card:hover::before {
    border-color: #9ca3af;
}

/* Active card */
.usheet-card.active {
    background: transparent;
    color: #1f2937;
    font-weight: 600;
}

.usheet-card.active::before {
    background: #4f46e5;
    border-color: #4f46e5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='2'%3E%3Cpolyline points='2,6 5,9 10,3'/%3E%3C/svg%3E");
    background-size: 10px;
    background-position: center;
    background-repeat: no-repeat;
}

.usheet-card.active:hover {
    background: #f9fafb;
}

/* Locked card */
.usheet-card.locked {
    color: #d1d5db;
    cursor: default;
    opacity: 1;
}

.usheet-card.locked::before {
    border-color: #e5e7eb;
    background: #f9fafb;
}

/* Vanish animation */
@keyframes usheet-vanish {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scaleY(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.usheet-card-vanish {
    animation: usheet-vanish 0.25s ease;
    pointer-events: none;
}

/* â”€â”€ Body / Table â”€â”€ */
.usheet-body {
    flex: 0 1 auto;
    min-height: 0;
    max-height: min(56vh, 520px);
    position: relative;
    overflow: hidden;
}

.usheet-wrap {
    position: relative;
    overflow: auto;
    max-height: inherit;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.12) transparent;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s;
    transform: translateX(0);
    z-index: 1;
}

.usheet-wrap::-webkit-scrollbar { width: 7px; height: 7px; }
.usheet-wrap::-webkit-scrollbar-track { background: transparent; }
.usheet-wrap::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }
.usheet-wrap::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); }

/* Route card â€” same space, starts off-screen right */
.usheet-route-card {
    position: absolute;
    inset: 0;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: #fafbff;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s;
    opacity: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.usheet-route-card .usheet-route-map {
    flex: 1;
    height: auto;
    min-height: 200px;
}
.usheet-route-card .usheet-route-info {
    flex-shrink: 0;
}

/* Flipped state â€” table slides out left, map slides in from right */
.usheet-body.flipped .usheet-wrap {
    transform: translateX(-40%);
    opacity: 0;
    pointer-events: none;
}
.usheet-body.flipped .usheet-route-card {
    transform: translateX(0);
    opacity: 1;
}

/* Flip button â€” edge tab */
.usheet-flip-btn {
    display: none;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 28px;
    height: 52px;
    border: 1px solid #e5e7eb;
    border-right: none;
    border-radius: 8px 0 0 8px;
    background: rgba(255,255,255,0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #6366f1;
    cursor: pointer;
    box-shadow: -2px 0 8px rgba(99,102,241,0.08);
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.usheet-flip-btn:hover {
    background: #eef2ff;
    box-shadow: -3px 0 12px rgba(99,102,241,0.15);
    width: 32px;
}
.usheet-flip-btn.visible {
    display: flex;
}
.usheet-flip-btn svg {
    transition: transform 0.3s;
}
.usheet-body.flipped .usheet-flip-btn {
    left: 0;
    right: auto;
    border-radius: 0 8px 8px 0;
    border: 1px solid #e5e7eb;
    border-left: none;
    box-shadow: 2px 0 8px rgba(99,102,241,0.08);
}
.usheet-body.flipped .usheet-flip-btn:hover {
    box-shadow: 3px 0 12px rgba(99,102,241,0.15);
}
.usheet-body.flipped .usheet-flip-btn svg {
    transform: rotate(180deg);
}

.usheet-table-inner {
    width: 100%;
    min-width: max-content;
}

.usheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

/* â”€â”€ Header â”€â”€ */
.usheet-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.usheet-table thead th {
    background: #f9fafb;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    padding: 7px 8px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #f3f4f6;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.usheet-table thead th:last-child {
    border-right: none;
}

.usheet-num-col {
    width: 36px;
    text-align: center !important;
}

.usheet-action-col {
    width: 64px;
    text-align: center !important;
}

/* â”€â”€ Rows â”€â”€ */
.usheet-row {
    transition: background 0.1s;
}

.usheet-row:nth-child(even) {
    background: #fafbfc;
}

.usheet-row:hover {
    background: #f0f4ff;
}

.usheet-row.usheet-dirty {
    background: #fffbeb;
}

.usheet-row.usheet-dirty:hover {
    background: #fef3c7;
}

.usheet-row.usheet-saved {
    background: #ecfdf5 !important;
    transition: background var(--dash-transition);
}

.usheet-row.usheet-row-out {
    opacity: 0;
    transform: translateX(40px);
    max-height: 0;
    overflow: hidden;
    padding: 0;
    border: none;
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease 0.1s;
}

/* Row num */
.usheet-num {
    text-align: center;
    font-size: 0.625rem;
    font-weight: 600;
    color: #9ca3af;
    padding: 0 4px;
    border-right: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    -webkit-user-select: none;
    user-select: none;
}

.usheet-row:hover .usheet-num {
    color: #6366f1;
}

/* â”€â”€ Cells â”€â”€ */
.usheet-cell {
    padding: 0;
    border-bottom: 1px solid #f3f4f6;
    border-right: 1px solid #f3f4f6;
    position: relative;
}

.usheet-cell:last-of-type {
    border-right: none;
}

.usheet-cell input,
.usheet-cell select {
    width: 100%;
    height: 30px;
    padding: 0 8px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 0;
    outline: none;
    background: transparent;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 500;
    color: #111827;
    transition: border-color var(--dash-transition), background var(--dash-transition), box-shadow var(--dash-transition);
    box-sizing: border-box;
}

.usheet-cell input::placeholder {
    color: #c6cbd2;
    font-weight: 400;
    font-style: normal;
    font-size: 0.75rem;
}

/* Empty select / date â€” match placeholder look */
.usheet-cell select.usheet-empty {
    color: #c6cbd2;
    font-weight: 400;
}

.usheet-cell input[type="date"].usheet-empty {
    color: #c6cbd2;
    font-weight: 400;
}

.usheet-cell input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    font-size: 0.75rem;
    font-weight: 400;
}

.usheet-cell input[type="date"].usheet-empty::-webkit-datetime-edit {
    color: #c6cbd2;
}

/* Hover state â€” subtle cue that cell is editable */
.usheet-cell:hover input,
.usheet-cell:hover select {
    border-color: #c7d2fe;
    background: #fafbff;
}

/* Focus state â€” clear edit mode */
.usheet-cell input:focus,
.usheet-cell select:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: inset 0 0 0 1px #6366f1;
    z-index: 2;
    position: relative;
}

/* Computed (read-only) cell */
.usheet-computed {
    background: #f9fafb;
}
.usheet-computed span {
    display: block;
    padding: 0.25rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6366f1;
    text-align: center;
    white-space: nowrap;
}
.usheet-computed span[data-key="loadNumber"] {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #4f46e5;
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: 3px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.7);
    box-shadow: inset 0 1px 2px rgba(99,102,241,0.1);
    margin: 2px;
    padding: 0.2rem 0.35rem;
}

.usheet-cell select {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    padding-right: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

/* Date input - match text input appearance */
.usheet-cell input[type="date"] {
    padding-right: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #111827;
    letter-spacing: 0;
}

.usheet-cell input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    width: 14px;
    cursor: pointer;
}

.usheet-cell:hover input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.5;
}

.usheet-cell input[type="date"]:focus::-webkit-calendar-picker-indicator {
    opacity: 0.7;
}

.usheet-cell-attach input[type="date"]::-webkit-calendar-picker-indicator {
    display: none !important;
}
.usheet-cell-attach input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
}

.usheet-cell-attach .usheet-input-with-attach {
    position: relative;
}

.usheet-cell-attach input,
.usheet-cell-attach select {
    padding-right: 28px;
}

.usheet-attach-btn {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--dash-transition), opacity var(--dash-transition);
    opacity: 0.35;
}

.usheet-attach-btn:hover {
    color: #6366f1;
    opacity: 1;
}

.usheet-attach-btn.has-file {
    color: #059669;
    opacity: 1;
}

.usheet-attach-btn.has-preview {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    border: 1.5px solid #e5e7eb;
    padding: 0;
    background: #fff;
}
.usheet-attach-btn.has-preview:hover {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.18);
}
.usheet-attach-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    image-rendering: -webkit-optimize-contrast;
}

.usheet-attach-menu {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--dash-radius-sm);
    box-shadow: var(--dash-shadow-lg);
    padding: 4px 0;
    display: flex;
    flex-direction: column;
    min-width: 100px;
}

/* â”€â”€ Row Actions â”€â”€ */
.usheet-actions {
    padding: 0 4px;
    border-bottom: 1px solid #f3f4f6;
    text-align: center;
    white-space: nowrap;
}

.usheet-row-save,
.usheet-row-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--dash-radius-xs);
    transition: all var(--dash-transition);
    opacity: 0;
    color: #9ca3af;
}

.usheet-row:hover .usheet-row-save,
.usheet-row:hover .usheet-row-delete {
    opacity: 1;
}

.usheet-row-save:hover {
    color: #059669;
    background: #ecfdf5;
}

.usheet-row-delete:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* Show save button always on dirty rows */
.usheet-dirty .usheet-row-save {
    opacity: 1;
    color: #059669;
}

/* â”€â”€ Footer â”€â”€ */
.usheet-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
    gap: 1rem;
}

.usheet-footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.usheet-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    color: #9ca3af;
}

.usheet-dirty-count {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #d97706;
}

.usheet-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* â”€â”€ Bulk Edit button â”€â”€ */
.bulk-btn-edit {
    background: #eef2ff !important;
    color: #4f46e5 !important;
    border-color: #c7d2fe !important;
}

.bulk-btn-edit:hover {
    background: #e0e7ff !important;
}

/* â”€â”€ Responsive â”€â”€ */
@media (max-width: 768px) {
    .usheet-modal {
        width: 100vw;
        min-width: 0;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        resize: none;
    }
    .usheet-body {
        max-height: min(62vh, 520px);
    }
    .usheet-hint {
        display: none;
    }
}

/* ==========================================
   BULK DOCUMENT CENTER
   ========================================== */
.bulk-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.25rem 0 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}
.bulk-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.bulk-filter-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-400);
    font-weight: 600;
}
.bulk-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.bulk-chip {
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--dash-transition);
}
.bulk-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.bulk-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.bulk-search {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.72rem;
    background: var(--card-bg);
    color: var(--text-primary);
    min-width: 170px;
    outline: none;
    transition: border-color var(--dash-transition);
}
.bulk-search:focus {
    border-color: var(--primary);
}
.bulk-select-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
    font-size: 0.68rem;
    color: var(--text-secondary);
}
.bulk-select-all {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-weight: 500;
}
.bulk-selected-count {
    font-weight: 600;
    color: var(--primary);
}

/* Custom checkbox */
.bulk-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}
.bulk-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.bulk-check-box {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--gray-300);
    border-radius: 4px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dash-transition);
}
.bulk-check-box svg {
    width: 10px;
    height: 10px;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--dash-transition);
    color: #fff;
    stroke-width: 3;
}
.bulk-check input:checked + .bulk-check-box {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.25);
}
.bulk-check input:checked + .bulk-check-box svg {
    opacity: 1;
    transform: scale(1);
}
.bulk-check:hover .bulk-check-box {
    border-color: var(--primary);
}
.bulk-check input:indeterminate + .bulk-check-box {
    background: var(--primary);
    border-color: var(--primary);
}
.bulk-check input:indeterminate + .bulk-check-box svg {
    opacity: 1;
    transform: scale(1);
}

.bulk-results {
    min-height: 120px;
}
.bulk-results .placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    gap: 0.5rem;
    color: var(--gray-400);
}
.bulk-results .placeholder-content p {
    font-size: 0.78rem;
    margin: 0;
}
.bulk-results .placeholder-hint {
    font-size: 0.68rem;
    color: var(--gray-400);
    opacity: 0.7;
}

/* Table-style list for bulk docs */
.bulk-table {
    width: 100%;
    border-collapse: collapse;
}
.bulk-table thead th {
    text-align: left;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.bulk-table thead th:first-child {
    width: 32px;
    padding-left: 0.35rem;
}
.bulk-table tbody tr {
    transition: background var(--dash-transition);
    cursor: pointer;
}
.bulk-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.03);
}
.bulk-table tbody tr.selected {
    background: rgba(79, 70, 229, 0.05);
}
.bulk-table td {
    padding: 0.4rem 0.5rem;
    font-size: 0.72rem;
    color: var(--gray-700);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    vertical-align: middle;
}
.bulk-table td:first-child {
    width: 32px;
    padding-left: 0.35rem;
}
.bulk-td-entity {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bulk-td-type {
    width: 90px;
}
.bulk-td-type span {
    display: inline-block;
    padding: 0.12rem 0.4rem;
    border-radius: 100px;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
}
.bulk-td-name {
    color: var(--text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bulk-td-date {
    font-size: 0.65rem;
    color: var(--gray-400);
    white-space: nowrap;
    width: 90px;
}
.bulk-td-thumb {
    width: 32px;
}
.bulk-td-thumb img {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
}
.bulk-td-thumb svg {
    width: 18px;
    height: 18px;
    color: var(--gray-300);
}
.bulk-td-actions {
    width: 28px;
    text-align: center;
}
.bulk-td-actions a {
    color: var(--gray-400);
    transition: color var(--dash-transition);
    display: inline-flex;
}
.bulk-td-actions a:hover {
    color: var(--primary);
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.spin-icon {
    animation: spin 0.8s linear infinite;
}
@media (max-width: 600px) {
    .bulk-filters {
        flex-direction: column;
    }
    .bulk-search {
        min-width: 100%;
    }
    .bulk-td-date,
    .bulk-td-thumb {
        display: none;
    }
}
@media (max-width: 600px) {
    .bulk-filters {
        flex-direction: column;
    }
    .bulk-grid {
        grid-template-columns: 1fr;
    }
    .bulk-search {
        min-width: 100%;
    }
}

/* â”€â”€ Toast Notifications (bottom-right) â”€â”€ */
.dash-toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--dash-radius-md);
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.35;
    min-width: 220px;
    max-width: 340px;
    position: relative;
    overflow: hidden;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: var(--dash-shadow-lg);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.dash-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.dash-toast.hide {
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.dash-toast-success {
    background: rgba(220, 252, 231, 0.95);
    border: 1px solid rgba(134, 239, 172, 0.5);
    color: #15803d;
}

.dash-toast-error {
    background: rgba(254, 226, 226, 0.95);
    border: 1px solid rgba(252, 165, 165, 0.5);
    color: #dc2626;
}

.dash-toast-upload {
    background: rgba(239, 246, 255, 0.95);
    border: 1px solid rgba(147, 197, 253, 0.5);
    color: #1d4ed8;
}

.dash-toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.dash-toast-spinner svg {
    animation: toastSpin 1s linear infinite;
}

@keyframes toastSpin {
    to { transform: rotate(360deg); }
}

.dash-toast-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-toast-text strong {
    font-weight: 700;
}

.dash-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.15rem;
    opacity: 0.4;
    transition: opacity var(--dash-transition);
    color: inherit;
    font-family: inherit;
}

.dash-toast-close:hover {
    opacity: 0.8;
}

.dash-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 0 0 10px 10px;
}

.dash-toast-success .dash-toast-progress {
    background: #16a34a;
    animation: toastCountdown 3.5s linear forwards;
}

.dash-toast-error .dash-toast-progress {
    background: #dc2626;
    animation: toastCountdown 3.5s linear forwards;
}

.dash-toast-progress-loading {
    background: #3b82f6;
    animation: toastLoading 1.5s ease-in-out infinite !important;
}

@keyframes toastCountdown {
    from { width: 100%; }
    to { width: 0%; }
}

@keyframes toastLoading {
    0% { width: 0%; left: 0; }
    50% { width: 60%; left: 20%; }
    100% { width: 0%; left: 100%; }
}

/* ===============================================
   TASK MANAGER (embedded in dashboard)
   =============================================== */

/* -- Card shell --------------------------------- */
#section-task-manager .tm-card {
    padding: 0;
    border-radius: var(--dash-radius);
    overflow: visible;
}

/* -- Top bar: title + New Task button ----------- */
#section-task-manager .tm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--dash-border-color);
}
#section-task-manager .tm-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}
#section-task-manager .tm-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    height: 30px;
    padding: 0 0.75rem;
    border-radius: 7px;
}

/* -- Filter/toolbar bar ------------------------- */
#section-task-manager .tm-filterbar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.65rem 1.25rem;
    border-bottom: 1px solid var(--dash-border-color);
    background: var(--gray-50, #f9fafb);
}

#section-task-manager .tm-filter-sep {
    width: 1px;
    height: 26px;
    background: var(--dash-border-color);
    align-self: flex-end;
    margin: 0 0.15rem;
}

#section-task-manager .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

#section-task-manager .filter-group label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#section-task-manager .filter-select,
#section-task-manager .filter-input {
    height: 28px;
    padding: 0 0.6rem;
    font-size: 0.79rem;
    border: 1px solid rgba(0,0,0,0.09);
    border-radius: 7px;
    background: #fff;
    color: var(--gray-800);
    font-family: inherit;
    transition: border-color var(--dash-transition), box-shadow var(--dash-transition);
}

#section-task-manager .filter-select:focus,
#section-task-manager .filter-input:focus {
    outline: none;
    border-color: rgba(29,155,209,0.55);
    box-shadow: 0 0 0 3px rgba(29,155,209,0.13);
}

#section-task-manager .filter-group.search {
    flex: 1;
    min-width: 180px;
}
#section-task-manager .filter-group.search .filter-input {
    width: 100%;
}

#section-task-manager .tm-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: auto;
    align-self: flex-end;
}

#section-task-manager .tm-resolved-btn {
    align-self: center;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    border: none;
    background: transparent;
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
    transition: background var(--dash-transition), color var(--dash-transition);
}
#section-task-manager .tm-resolved-btn:hover {
    background: rgba(99,102,241,0.08);
    color: var(--primary);
}
#section-task-manager .tm-resolved-btn.tm-resolved-btn-active {
    background: rgba(99,102,241,0.12);
    color: var(--primary);
}

#section-task-manager #tmRefreshBtn.is-loading {
    opacity: 0.86;
    cursor: wait;
    pointer-events: none;
}

#section-task-manager #tmRefreshBtn.is-loading svg {
    animation: spin 0.8s linear infinite;
}

/* -- Column resize handle ----------------------- */
/* ── Column resize handle ──────────────────────────────────── */
.tm-col-resize-handle {
    position: absolute;
    right: -3px;         /* straddle the border */
    top: 0;
    bottom: 0;
    width: 8px;          /* wider hit target */
    cursor: col-resize;
    z-index: 10;
    user-select: none;
    display: flex;
    align-items: stretch;
    justify-content: center;
}
.tm-col-resize-handle::after {
    content: '';
    width: 2px;
    border-radius: 2px;
    background: transparent;
    transition: background 0.15s, opacity 0.15s;
    opacity: 0;
}
.tm-col-resize-handle:hover::after {
    background: rgba(29,155,209,0.55);
    opacity: 1;
}
/* Full-height blue line during active drag */
.tm-col-resize-handle.tm-col-resize-active::after {
    background: #1d9bd1;
    opacity: 1;
}
/* Suppress width transition during drag */
#section-task-manager .task-table th.tm-col-resizing {
    transition: none !important;
}
/* Full-height drag overlay line (appended to wrapper during drag) */
.tm-resize-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(29,155,209,0.75);
    pointer-events: none;
    z-index: 100;
    transform: translateX(-50%);
    box-shadow: 0 0 0 1px rgba(29,155,209,0.12);
}
/* Ensure th is positioned so handle works */
#section-task-manager .task-table th {
    position: relative;
}

/* -- View Toggle -------------------------------- */
#section-task-manager .task-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(0,0,0,0.05);
    padding: 3px;
    border-radius: 8px;
    align-self: flex-end;
}

#section-task-manager .toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.22rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background var(--dash-transition), color var(--dash-transition), box-shadow var(--dash-transition);
}
#section-task-manager .toggle-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--gray-700);
}
#section-task-manager .toggle-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* -- View Containers ---------------------------- */
#section-task-manager .task-view-container {
    display: none;
    overflow: visible;
}
#section-task-manager .task-view-container.active {
    display: block;
}
#section-task-manager .task-view-kanban {
    padding: 1rem;
}
#section-task-manager .task-view-table {
    padding: 0;
    overflow: visible;
}
/* Wrapper: sticky header + horizontal scroll */
#section-task-manager .task-table-wrapper {
    background: #fff;
    border: 1px solid var(--dash-border-color);
    border-radius: var(--dash-radius-md);
    overflow: auto;
    max-height: calc(100vh - 260px);
    position: relative;
}

/* Table shell */
#section-task-manager .task-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
    table-layout: fixed;
}

/* Sticky header */
#section-task-manager .task-table thead {
    position: sticky;
    top: 0;
    z-index: 4;
}

#section-task-manager .task-table th {
    height: 32px;
    padding: 0 10px;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fafbfc;
    border-bottom: 2px solid rgba(0,0,0,0.07);
    border-right: 1px solid rgba(0,0,0,0.05);
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
    vertical-align: middle;
}

#section-task-manager .task-table th:last-child { border-right: none; }

#section-task-manager .task-table .th-task     { padding-left: 14px; }
#section-task-manager .task-table .th-assigned  {}
#section-task-manager .task-table .th-status    {}
#section-task-manager .task-table .th-due-date  {}
#section-task-manager .task-table .th-priority  {}

#section-task-manager .task-table th.th-sortable { cursor: pointer; transition: background 0.14s; }
#section-task-manager .task-table th.th-sortable:hover { background: rgba(99,102,241,0.05); color: var(--gray-600); }
#section-task-manager .task-table th.th-sort-asc::after  { content: ' \2191'; color: var(--primary,#4f46e5); font-weight: 700; }
#section-task-manager .task-table th.th-sort-desc::after { content: ' \2193'; color: var(--primary,#4f46e5); font-weight: 700; }

/* ── Cells ─────────────────────────────────────── */
#section-task-manager .task-table td {
    height: 36px; padding: 0 10px; font-size: 0.8rem; color: var(--gray-700);
    border-right: 1px solid rgba(0,0,0,0.04);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.12s; position: relative;
}
#section-task-manager .task-table td:last-child { border-right: none; }

/* Row states */
#section-task-manager .task-table tbody tr:hover td { background: rgba(0,0,0,0.018); }
#section-task-manager .task-table tbody tr.row-selected td { background: rgba(99,102,241,0.06) !important; }
#section-task-manager .task-table tbody tr.row-overdue td { background: rgba(220,38,38,0.015); }
#section-task-manager .task-table tbody tr.row-overdue:hover td { background: rgba(220,38,38,0.035); }
/* Row editing highlight */
#section-task-manager .task-table tbody tr:has(td.editing) td { background: rgba(79,70,229,0.022); }
/* Status accent stripe */
#section-task-manager .task-table tbody tr td:first-child { border-left: 3px solid transparent; }
#section-task-manager .task-table tbody tr.row-overdue td:first-child { border-left-color: #ef4444; }
/* Checkbox column */
#section-task-manager .task-table .col-checkbox {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    text-align: center;
    padding: 0;
    border-right: none;
}
/* Open-detail column — hidden until row hover */
#section-task-manager .task-table .col-open {
    width: 28px;
    min-width: 28px;
    max-width: 28px;
    text-align: center;
    padding: 0;
    border-right: 1px solid rgba(29,28,29,0.06);
}
/* Round resolve checkbox */
.tm-resolve-cb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid rgba(29,28,29,0.22);
    background: transparent;
    cursor: pointer;
    transition: border-color 0.13s, background 0.13s, box-shadow 0.13s;
    padding: 0;
    vertical-align: middle;
    flex-shrink: 0;
}
.tm-resolve-cb .tm-resolve-check { opacity: 0; color: #fff; transition: opacity 0.12s; }
.tm-resolve-cb:hover {
    border-color: #10b981;
    background: rgba(16,185,129,0.1);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}
.tm-resolve-cb:hover .tm-resolve-check { opacity: 0.5; color: #10b981; }
.tm-resolve-cb-done {
    background: #10b981;
    border-color: #10b981;
}
.tm-resolve-cb-done .tm-resolve-check { opacity: 1; }
.tm-resolve-cb-done:hover {
    background: rgba(16,185,129,0.75);
    border-color: rgba(16,185,129,0.75);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}
/* Open-detail icon */
.tm-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: rgba(29,28,29,0.22);
    padding: 0;
    border-radius: 4px;
    transition: color 0.1s, background 0.1s;
    visibility: hidden;
}
.task-row:hover .tm-open-btn { visibility: visible; }
.tm-open-btn:hover { color: #1264a3; background: rgba(29,155,209,0.09); }

/* Doc-status badge — flat icon matching entity-doc-check style */
.dsb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    vertical-align: middle;
    margin-left: auto;
    transition: color 0.12s, transform 0.12s;
}
.dsb svg { width: 13px; height: 13px; }
.dsb-ok  { color: #059669; }
.dsb-err { color: #dc2626; }
.dsb:hover { transform: scale(1.15); }
.dsb-ok:hover  { color: #16a34a; }
.dsb-err:hover { color: #b91c1c; }

.cell-dsb {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
}

/* Doc-status popup dropdown */
.dsb-popup {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    min-width: 160px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.dsb-pop-item {
    display: block;
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #1f2937;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: none;
    text-align: left;
    transition: background 0.1s;
}
.dsb-pop-item:hover { background: #f3f4f6; }

/* Unit table profile-open icon (same behavior as Task Manager open button) */
.unit-open-btn {
    flex-shrink: 0;
}

.dash-table tbody tr:hover .unit-open-btn,
.cell-with-doc:hover .unit-open-btn {
    visibility: visible;
}

/* Fleet table: circle-select + open-profile arrow in first column */
.fleet-cb-th {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    padding: 0 4px !important;
}
.fleet-cb-cell {
    width: 52px;
    min-width: 52px;
    padding: 0 4px !important;
    white-space: nowrap;
    vertical-align: middle;
}
.fleet-sel-all-cb {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #10b981;
    display: block;
    margin: 0 auto;
}
/* Show open-profile arrow when the row is hovered */
tr:hover .fleet-open-btn { visibility: visible; }
/* ── Editable cell affordance (shared by ALL editable tds) ── */
#section-task-manager .task-table td.tm-editable { cursor: pointer; transition: background 0.1s; }
#section-task-manager .task-table td.tm-editable:not(.editing):hover {
    background: rgba(29,155,209,0.08) !important;
    border-radius: 4px;
}
/* Active editing ring — superseded below (kept borderless for the same cascade) */
#section-task-manager .task-table td.editing {
    overflow: visible; white-space: normal;
    background: rgba(29,155,209,0.05) !important;
    border-radius: 5px;
    box-shadow: none;
    padding: 2px 4px; z-index: 1;
}
/* ── Task name cell ── */
#section-task-manager .task-table .td-task {
    font-weight: 400; color: var(--gray-800);
    max-width: 360px; overflow: hidden; text-overflow: ellipsis;
}

/* Status pill — Linear-style: dot + label, colored bg tint (shared with unit tables) */
.tm-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.2rem 0.6rem 0.2rem 0.45rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.12s, box-shadow 0.12s;
    border: none;
    background: color-mix(in srgb, var(--sc, #6b7280) 12%, transparent);
    color: color-mix(in srgb, var(--sc, #6b7280) 80%, #1d1c1d);
}
.tm-status-pill::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sc, #6b7280);
    flex-shrink: 0;
}
.tm-status-pill:hover { filter: brightness(0.9); }

/* Task Manager only: plain text status, no colored pill/dot */
#section-task-manager .tm-status-pill {
    padding: 0;
    border-radius: 0;
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: normal;
    background: transparent;
    color: #1d1c1d;
}
#section-task-manager .tm-status-pill::before { display: none; }
#section-task-manager .tm-status-pill:hover { filter: none; text-decoration: underline; }

/* Status picker panel */
.tm-sp-panel {
    position: fixed;
    z-index: 10010;
    width: 180px;
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(29,28,29,0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(29,28,29,0.15), 0 2px 8px rgba(29,28,29,0.07);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-5px) scale(0.98);
    transition: opacity 0.13s ease, transform 0.13s ease;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}
.tm-sp-panel.tm-sp-open { opacity: 1; transform: translateY(0) scale(1); }
.tm-sp-panel.tm-sp-panel-wide { width: 240px; }

.tm-sp-list { padding: 5px; }
.tm-sp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: none;
    background: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #1d1c1d;
    text-align: left;
    transition: background 0.08s;
}
.tm-sp-item:hover { background: rgba(29,28,29,0.05); }
.tm-sp-item-active { background: rgba(29,155,209,0.08); font-weight: 500; }
.tm-sp-item-active:hover { background: rgba(29,155,209,0.13); }
.tm-sp-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tm-sp-label { flex: 1; }
.tm-sp-check { color: #1264a3; display: flex; align-items: center; flex-shrink: 0; }

.tm-sp-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 0.75rem;
    color: #8a8f98;
    cursor: pointer;
    border-top: 1px solid rgba(29,28,29,0.07);
    transition: background 0.08s, color 0.08s;
}
.tm-sp-footer:hover { background: rgba(29,28,29,0.04); color: #1d1c1d; }

/* Manage view */
.tm-sp-manage-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px 7px;
    border-bottom: 1px solid rgba(29,28,29,0.07);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1d1c1d;
}
.tm-sp-back {
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #8a8f98;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.08s, color 0.08s;
}
.tm-sp-back:hover { background: rgba(29,28,29,0.07); color: #1d1c1d; }
.tm-sp-manage-list { padding: 5px; max-height: 280px; overflow-y: auto; scrollbar-width: thin; }
.tm-sp-edit-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 2px;
    position: relative;
}
.tm-sp-drag-handle {
    cursor: grab;
    color: rgba(29,28,29,0.25);
    display: flex;
    align-items: center;
    padding: 0 2px;
    flex-shrink: 0;
}
.tm-sp-drag-handle:active { cursor: grabbing; }
.tm-sp-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 0 0 1px rgba(29,28,29,0.15);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.1s;
}
.tm-sp-swatch:hover { transform: scale(1.18); }
.tm-sp-name-input {
    flex: 1;
    border: none;
    border-bottom: 1px solid transparent;
    outline: none;
    font-size: 0.8125rem;
    color: #1d1c1d;
    background: transparent;
    font-family: inherit;
    padding: 2px 0;
    min-width: 0;
    transition: border-color 0.1s;
}
.tm-sp-name-input:focus { border-bottom-color: rgba(29,155,209,0.55); }
.tm-sp-delete {
    border: none;
    background: none;
    cursor: pointer;
    color: rgba(29,28,29,0.25);
    padding: 3px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.1s, background 0.1s;
}
.tm-sp-delete:hover:not(:disabled) { color: #ef4444; background: rgba(239,68,68,0.08); }
.tm-sp-delete:disabled { opacity: 0.3; cursor: default; }
.tm-sp-color-grid {
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    background: #fff;
    border: 1px solid rgba(29,28,29,0.1);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(29,28,29,0.13);
    padding: 8px;
    width: 200px;
}
.tm-sp-color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.1s;
}
.tm-sp-color-dot:hover { transform: scale(1.2); }
.tm-sp-color-dot-active { border-color: #fff; box-shadow: 0 0 0 2px #1264a3; }
.tm-sp-color-native {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
    overflow: hidden;
}
.tm-sp-add-status {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 7px 12px;
    border: none;
    border-top: 1px solid rgba(29,28,29,0.07);
    background: none;
    cursor: pointer;
    font-size: 0.78rem;
    color: #8a8f98;
    transition: background 0.08s, color 0.08s;
    text-align: left;
}
.tm-sp-add-status:hover { background: rgba(29,155,209,0.06); color: #1264a3; }

/* ── Entity picker popup (new-task row) ── */
.tm-ent-trigger,
.tm-asn-trigger {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(29,28,29,0.38);
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.1s, background 0.1s;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tm-ent-trigger:hover,
.tm-asn-trigger:hover {
    color: #1264a3;
    background: rgba(29,155,209,0.07);
}
.tm-ent-trigger.tm-ent-selected,
.tm-asn-trigger.tm-asn-trigger-set {
    color: #1d1c1d;
    background: transparent;
    font-weight: 500;
}
.tm-asn-trigger.tm-asn-trigger-set:hover {
    color: #1264a3;
    background: rgba(29,155,209,0.07);
}

/* Panel — matches .tm-people-panel exactly */
.tm-ent-panel {
    position: fixed;
    z-index: 10015;
    width: 232px;
    background: rgba(255,255,255,0.97);
    border: 1px solid rgba(29,28,29,0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(29,28,29,0.14), 0 2px 8px rgba(29,28,29,0.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.14s ease, transform 0.14s ease;
}
.tm-ent-panel.tm-ent-open { opacity: 1; transform: translateY(0) scale(1); }

/* Step 1: type selector */
.tm-ent-heading {
    padding: 9px 12px 7px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(29,28,29,0.38);
    border-bottom: 1px solid rgba(29,28,29,0.07);
}
.tm-ent-type-list { display: flex; flex-direction: column; padding: 5px 0; }
.tm-ent-type-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #1d1c1d;
    text-align: left;
    transition: background 0.08s;
    width: 100%;
    font-family: inherit;
}
.tm-ent-type-btn:hover { background: rgba(29,155,209,0.06); }
.tm-ent-type-btn.active { background: rgba(29,155,209,0.09); font-weight: 500; }
.tm-ent-type-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(29,28,29,0.2);
}
.tm-ent-type-btn.active .tm-ent-type-dot { background: #1264a3; }

/* Step 2 — header + search + list */
.tm-ent-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px 8px;
    border-bottom: 1px solid rgba(29,28,29,0.07);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1d1c1d;
    flex-shrink: 0;
}
.tm-ent-back {
    border: none;
    background: none;
    cursor: pointer;
    color: rgba(29,28,29,0.4);
    display: flex;
    align-items: center;
    padding: 3px 4px;
    border-radius: 5px;
    transition: background 0.08s, color 0.08s;
    flex-shrink: 0;
}
.tm-ent-back:hover { background: rgba(29,28,29,0.07); color: #1d1c1d; }

/* Search — identical to .tm-pp-search-wrap / .tm-pp-search */
.tm-ent-search-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px 8px;
    border-bottom: 1px solid rgba(29,28,29,0.07);
    flex-shrink: 0;
}
.tm-ent-search-icon { flex-shrink: 0; opacity: 0.4; }
.tm-ent-search {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.8125rem;
    color: #1d1c1d;
    background: transparent;
    font-family: inherit;
    min-width: 0;
    caret-color: #1264a3;
}
.tm-ent-search::placeholder { color: #b0b3b8; }

.tm-ent-entity-list {
    overflow-y: auto;
    max-height: 220px;
    padding: 5px 0;
    scrollbar-width: thin;
}
.tm-ent-entity-list::-webkit-scrollbar { width: 5px; }
.tm-ent-entity-list::-webkit-scrollbar-thumb { background: rgba(29,28,29,0.15); border-radius: 3px; }

.tm-ent-entity-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #1d1c1d;
    text-align: left;
    width: 100%;
    font-family: inherit;
    transition: background 0.08s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tm-ent-entity-row:hover { background: rgba(29,155,209,0.06); }
.tm-ent-entity-row.active { background: rgba(29,155,209,0.09); font-weight: 500; }

.tm-ent-loading, .tm-ent-empty {
    padding: 12px;
    font-size: 0.8125rem;
    color: rgba(29,28,29,0.38);
    text-align: center;
}

/* ── Mini pickers (priority / type / assignee) ── */
.tm-mini-picker {
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    padding: 4px;
    min-width: 140px;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    animation: tmPickerIn 0.14s cubic-bezier(0.2,0,0.2,1);
}
.tm-mini-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--gray-700,#374151);
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
}
.tm-mini-picker-item:hover { background: rgba(99,102,241,0.06); }
.tm-mini-picker-item.active { background: rgba(99,102,241,0.1); color: var(--primary,#4f46e5); font-weight: 600; }

/* Priority dots — 0-5 numeric scale, click to set */
.tm-priority-dots { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.tm-pdot {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    background: rgba(29,28,29,0.12);
    transition: background 0.1s, transform 0.08s;
    cursor: pointer;
}
.tm-pdot-on { background: #f59e0b; }
.tm-pdot:hover { transform: scale(1.3); background: #fbbf24 !important; }

/* Assignee avatar group */
.tm-avatar-group { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }
.tm-assigned-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100px;
    overflow: hidden;
}
.tm-assigned-name {
    font-size: 0.8rem;
    font-weight: 400;
    color: #1d1c1d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tm-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.78rem;   /* emoji size */
    background: var(--av-bg, #6366f1);
    border: 2px solid #fff;
    margin-right: 0;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.14);
    transition: transform 0.12s;
    cursor: default;
    overflow: hidden;
}
.tm-avatar:last-child { margin-right: 0; }
.tm-avatar:hover { transform: translateY(-2px) scale(1.12); z-index: 1; position: relative; }
.tm-avatar-emoji { line-height: 1; }
.tm-avatar-photo { object-fit: cover; background: var(--gray-100,#f3f4f6); font-size: 0.55rem; font-weight: 700; color: #fff; }
.tm-avatar-overflow { background: rgba(29,28,29,0.08); color: #1d1c1d; font-size: 0.6rem; font-weight: 600; }
.tm-avatar-md {
    width: 32px;
    height: 32px;
    font-size: 1.05rem;  /* emoji size in picker */
    border: none;
    margin-right: 0;
    box-shadow: none;
    flex-shrink: 0;
}

/* ── People picker panel (new design) ───────────────────── */
.tm-people-panel {
    width: 232px;
    background: rgba(255,255,255,0.97);
    border: 1px solid rgba(29,28,29,0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(29,28,29,0.14), 0 2px 8px rgba(29,28,29,0.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.14s ease, transform 0.14s ease;
}
.tm-people-panel.tm-pp-open {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.tm-pp-search-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px 8px;
    border-bottom: 1px solid rgba(29,28,29,0.07);
    flex-shrink: 0;
}
.tm-pp-search-icon { flex-shrink: 0; opacity: 0.55; }
.tm-pp-search {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.8125rem;
    color: #1d1c1d;
    background: transparent;
    font-family: inherit;
    min-width: 0;
    caret-color: #1264a3;
}
.tm-pp-search::placeholder { color: #b0b3b8; }
.tm-pp-list {
    overflow-y: auto;
    max-height: 260px;
    padding: 5px 0;
}
.tm-pp-list::-webkit-scrollbar { width: 5px; }
.tm-pp-list::-webkit-scrollbar-thumb { background: rgba(29,28,29,0.15); border-radius: 3px; }
.tm-pp-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.08s;
    position: relative;
}
.tm-pp-row:hover { background: rgba(29,155,209,0.06); }
.tm-pp-row-sel { background: rgba(29,155,209,0.09); }
.tm-pp-row-sel:hover { background: rgba(29,155,209,0.13); }
.tm-pp-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}
.tm-pp-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #1d1c1d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tm-pp-email {
    font-size: 0.7rem;
    color: #8a8f98;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tm-pp-check {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: transparent;
    background: transparent;
    border: 1.5px solid rgba(29,28,29,0.18);
    transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.tm-pp-row-sel .tm-pp-check {
    background: #1264a3;
    border-color: #1264a3;
    color: #fff;
}
.tm-pp-clear {
    padding: 7px 12px;
    font-size: 0.75rem;
    color: #8a8f98;
    cursor: pointer;
    border-top: 1px solid rgba(29,28,29,0.07);
    transition: background 0.08s, color 0.08s;
    flex-shrink: 0;
}
.tm-pp-clear:hover { background: rgba(239,68,68,0.06); color: #ef4444; }

/* Shared email-style "To:" chip + type-ahead picker (assign / people fields) */
.tm-pp-typeahead {
    display: flex;
    flex-direction: column;
}
.tm-pp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 9px 12px 0;
}
.tm-pp-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px 3px 9px;
    border-radius: 999px;
    background: rgba(18,100,163,0.09);
    color: #1264a3;
    font-size: 0.76rem;
    font-weight: 500;
    max-width: 100%;
}
.tm-pp-chip-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}
.tm-pp-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.08s;
}
.tm-pp-chip-remove:hover { background: rgba(18,100,163,0.18); }
.tm-pp-suggestions {
    display: none;
    overflow-y: auto;
    max-height: 220px;
    border-top: 1px solid rgba(29,28,29,0.07);
    padding: 4px 0;
}
.tm-pp-suggestions.tm-pp-suggestions-open { display: block; }
.tm-pp-suggestion {
    padding: 6px 12px;
    font-size: 0.8125rem;
    color: #1d1c1d;
    cursor: pointer;
    transition: background 0.08s;
}
.tm-pp-suggestion:hover,
.tm-pp-suggestion-active { background: rgba(29,155,209,0.09); }
.tm-pp-suggestion-empty {
    padding: 8px 12px;
    font-size: 0.76rem;
    color: #8a8f98;
}

#section-task-manager .task-table .fleet-inline-input {
    width: 100%;
    height: 30px;
    padding: 0 8px;
    border: 1px solid rgba(29,28,29,0.14);
    border-radius: 6px;
    background: #fff;
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--gray-800, #1f2937);
    outline: none;
    box-sizing: border-box;
    box-shadow: none;
    transition: border-color 0.15s;
}
#section-task-manager .task-table .fleet-inline-input:focus {
    border-color: rgba(29,155,209,0.55);
}
#section-task-manager .task-table select.fleet-inline-input { height: 30px; cursor: pointer; }
#section-task-manager .task-table .tm-date-mask-input { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
#section-task-manager .task-table td.editing .fleet-inline-input.tm-date-mask-input {
    border: none;
    background: transparent;
    padding: 0;
}
#section-task-manager .task-table .fleet-inline-input.tm-date-mask-input:focus {
    border: none;
}

/* Give cells initial widths; horizontal scroll when columns overflow */
#section-task-manager .task-table { min-width: unset; }
/* Checkbox (resolve + open) — fixed, not resizable */
#section-task-manager .task-table .col-checkbox,
#section-task-manager .task-table th.col-checkbox { width: 46px !important; min-width: 46px !important; max-width: 46px !important; }
/* Task name — stable width prevents short labels from creating a large blank area. */
#section-task-manager .task-table .td-task,
#section-task-manager .task-table .th-task { width: 280px; }
/* Assignee — first + last name or «Assign» button */
#section-task-manager .task-table .td-assigned,
#section-task-manager .task-table .th-assigned { width: 150px; }
/* Due date — «May 11, 2026» is ~90px at 0.8rem */
#section-task-manager .task-table .td-due-date,
#section-task-manager .task-table .th-due-date { width: 110px; }
/* Priority — «High» / «Medium» / «Low» pill */
#section-task-manager .task-table .td-priority,
#section-task-manager .task-table .th-priority { width: 100px; }
/* Status — longest label ~«In Progress» */
#section-task-manager .task-table .td-status,
#section-task-manager .task-table .th-status { width: 130px; }
/* Entity — truck/driver/trailer name */
#section-task-manager .task-table .td-entity,
#section-task-manager .task-table .th-entity { width: 107px; }
/* Type — «Task» / «Issue» etc. */
#section-task-manager .task-table .td-type,
#section-task-manager .task-table .th-type { width: 100px; }
/* Created date — same as due date */
#section-task-manager .task-table .td-created,
#section-task-manager .task-table .th-created { width: 110px; }
#section-task-manager .task-table .td-created-by,
#section-task-manager .task-table .th-created-by { width: 150px; }
#section-task-manager .task-table .td-created-by { white-space: nowrap; overflow: visible; }
.tm-created-by-value { vertical-align: middle; }
.tm-row-actions { display: inline-flex; align-items: center; gap: 0; float: right; margin-left: 4px; vertical-align: middle; }

.tm-task-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: #87919d;
    cursor: pointer;
    opacity: 1;
    visibility: visible;
    transition: color 0.12s, background 0.12s;
}
.tm-task-action svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tm-task-action:hover { color: #1264a3; background: rgba(29,155,209,0.08); }
.tm-archive-btn:hover { color: #dc2626; background: rgba(220,38,38,0.08); }
/* + New Task row */
#section-task-manager .task-table .task-row-add td { color: var(--gray-400); font-size: 0.78rem; font-weight: 500; cursor: pointer; height: 32px; border-bottom: none; }
#section-task-manager .task-table .task-row-add:hover td { background: rgba(99,102,241,0.04); color: var(--primary,#4f46e5); }
#section-task-manager .task-table .task-row-add .td-new-task { padding-left: 14px; }
#section-task-manager .task-table .task-row-ghost td { height: 34px; background: transparent; border-bottom: 1px solid var(--gray-100, #f3f4f6); }
#section-task-manager .task-table .task-row-ghost:hover td { background: rgba(99,102,241,0.025); }

/* Task Manager follows the standard dashboard list presentation. */
#section-task-manager .load-style-task-card { overflow: hidden !important; }
#section-task-manager .load-style-task-card .tm-topbar {
    min-height: 52px;
    padding: var(--dash-card-header-padding);
    background: linear-gradient(180deg, rgba(248,250,252,0.6) 0%, rgba(241,245,249,0.3) 100%);
    cursor: default;
}
.tm-section-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 54px;
    padding: 0 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}
.tm-section-tab-list { display: flex; align-self: stretch; gap: 1.25rem; }
.tm-section-tab {
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #9ca3af;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0 0.05rem;
    cursor: pointer;
}
.tm-section-tab:hover { color: #4b5563; }
.tm-section-tab.active { color: var(--primary, #4f46e5); border-bottom-color: var(--primary, #4f46e5); }
.tm-section-tabs #addTaskBtn { min-height: 30px; border-radius: 6px; }
.tm-overview {
    padding: 1rem 1.25rem 1.35rem;
    background: #f8fafc;
}
.tm-overview[hidden] { display: none; }
.tm-overview-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.tm-overview-intro h2 { margin: 0; color: #111827; font-size: 0.95rem; line-height: 1.35; }
.tm-overview-intro p, .tm-analytics-heading p { margin: 0.15rem 0 0; color: #6b7280; font-size: 0.72rem; }
.tm-overview-period { color: #64748b; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; }
.tm-overview-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #fff;
    overflow: hidden;
}
.tm-overview-kpi { min-width: 0; padding: 0.75rem 0.85rem; border-right: 1px solid #e2e8f0; }
.tm-overview-kpi:last-child { border-right: 0; }
.tm-overview-kpi span, .tm-overview-kpi small { display: block; color: #64748b; font-size: 0.66rem; }
.tm-overview-kpi span { font-weight: 700; text-transform: uppercase; }
.tm-overview-kpi strong { display: block; margin: 0.15rem 0 0.1rem; color: #0f172a; font-size: 1.25rem; line-height: 1.2; }
.tm-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.tm-analytics-panel { min-width: 0; padding: 0.85rem; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; }
.tm-analytics-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.65rem; }
.tm-analytics-heading h3 { margin: 0; color: #1f2937; font-size: 0.8rem; }
.tm-chart-wrap { height: 190px; }
.tm-ranking-list { display: grid; gap: 0.55rem; }
.tm-ranking-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 0.55rem; }
.tm-ranking-position { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #f1f5f9; color: #64748b; font-size: 0.62rem; font-weight: 700; }
.tm-ranking-person { min-width: 0; }
.tm-ranking-person strong { display: block; overflow: hidden; color: #334155; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.tm-ranking-track { display: block; height: 3px; margin-top: 0.22rem; border-radius: 2px; background: #e2e8f0; overflow: hidden; }
.tm-ranking-track i { display: block; height: 100%; border-radius: inherit; background: #2563eb; }
.tm-ranking-row b { color: #475569; font-size: 0.7rem; }
.tm-analytics-empty { margin: 0; padding: 1rem 0; color: #94a3b8; font-size: 0.72rem; text-align: center; }
.tm-benchmark-summary { min-height: 150px; display: grid; align-content: center; gap: 0.75rem; }
.tm-benchmark-summary p { margin: 0; color: #64748b; font-size: 0.72rem; line-height: 1.5; text-align: center; }
.tm-benchmark-score { text-align: center; }
.tm-benchmark-score strong, .tm-benchmark-comparison strong { display: block; color: #0f172a; font-size: 1.55rem; }
.tm-benchmark-score span, .tm-benchmark-comparison span { color: #64748b; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; }
.tm-benchmark-comparison { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); text-align: center; }
.tm-benchmark-comparison > div + div { border-left: 1px solid #e2e8f0; }
.tm-benchmark-summary .is-positive { color: #15803d; font-weight: 700; }
.tm-benchmark-summary .is-negative { color: #b91c1c; font-weight: 700; }
@media (max-width: 900px) {
    .tm-overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tm-overview-kpi { border-bottom: 1px solid #e2e8f0; }
    .tm-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .tm-section-tabs { padding: 0 0.75rem; }
    .tm-overview { padding: 0.85rem 0.75rem 1rem; }
    .tm-overview-kpis { grid-template-columns: 1fr; }
    .tm-overview-kpi { border-right: 0; }
}
#section-task-manager .load-style-task-card .tm-title { font-size: 0.9375rem; color: var(--gray-800); }
#section-task-manager .load-style-task-card .tm-filterbar {
    align-items: center;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--dash-border-color);
    background: #fff;
}
#section-task-manager .load-style-task-card .task-view-toggle,
#section-task-manager .load-style-task-card .tm-filter-sep { display: none; }
#section-task-manager .load-style-task-card .filter-group label {
    color: #6b7280;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
#section-task-manager .load-style-task-card .filter-select,
#section-task-manager .load-style-task-card .filter-input {
    min-height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    box-shadow: none;
}
#section-task-manager .load-style-task-card .tm-filterbar { gap: 0.45rem; }
#section-task-manager .load-style-task-card .filter-group.search {
    order: 1;
    flex: 0 0 220px;
    min-width: 220px;
}
#section-task-manager .load-style-task-card .filter-group:has(#statusFilter) { order: 2; }
#section-task-manager .load-style-task-card .filter-group:has(#assigneeFilter) { order: 3; }
#section-task-manager .load-style-task-card .filter-group:has(#entityTypeFilter) { order: 4; }
#section-task-manager .load-style-task-card .filter-group:has(#statusFilter) .filter-select { width: 76px; }
#section-task-manager .load-style-task-card .filter-group:has(#assigneeFilter) .filter-select { width: 108px; }
#section-task-manager .load-style-task-card .filter-group:has(#entityTypeFilter) .filter-select { width: 76px; }
#section-task-manager .load-style-task-card .tm-toolbar-actions { order: 5; margin-left: auto; }
#section-task-manager .load-style-task-card .task-table-wrapper {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
}
#section-task-manager .load-style-task-card .task-table {
    min-width: 0 !important;
    border-collapse: collapse;
}
#section-task-manager .load-style-task-card .task-table th {
    height: 34px;
    padding: 7px 8px;
    border-right: 1px solid #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
#section-task-manager .load-style-task-card .task-table td {
    height: var(--dash-row-height);
    border-right: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#section-task-manager .load-style-task-card .task-table td.col-checkbox {
    display: table-cell;
    overflow: hidden !important;
    padding: 0 6px !important;
    text-align: center;
    vertical-align: middle;
}
#section-task-manager .load-style-task-card .task-table td.td-created-by { overflow: visible; }
#section-task-manager .load-style-task-card .task-table tbody tr:hover td { background: #f8fafc; }
#section-task-manager .load-style-task-card .task-table tbody tr.row-overdue td { background: #fff7f7; }

/* Empty state */
#section-task-manager .empty-state { padding: 3rem 1.5rem; border-top: 1px solid var(--dash-border-color); }

/* Kanban (unchanged) */
#section-task-manager .kanban-board { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.875rem; }
#section-task-manager .kanban-column { background: rgba(248,250,252,0.6); border: 1px solid var(--dash-border-color); border-radius: var(--dash-radius-md); max-height: none; }
#section-task-manager .kanban-column-header { padding: 0.625rem 0.875rem; background: rgba(255,255,255,0.5); border-bottom: 1px solid var(--dash-border-color); border-left-width: 3px; }
#section-task-manager .kanban-column-header h3 { font-size: 0.8125rem; color: var(--gray-700); }
#section-task-manager .kanban-column-cards { gap: 0.5rem; padding: 0.625rem; }
#section-task-manager .task-card { background: rgba(255,255,255,0.88); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: var(--dash-radius-sm); box-shadow: var(--dash-shadow-xs); border-left-width: 2px; padding: 0.75rem; }
#section-task-manager .task-card:hover { box-shadow: var(--dash-shadow-md); transform: translateY(-1px); }

/* Task Form & Resolution Modals */
.modal-task-form,
.modal-resolution { display: none !important; position: fixed; top: 0; left: 0; right: 0; bottom: 0; align-items: center; justify-content: center; padding: 1rem; z-index: 9999; background: rgba(0,0,0,0.22); }
.modal-task-form.open, .modal-resolution.open { display: flex !important; }
.tm-form-card { background: #fff; border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04); width: 560px; max-width: 95vw; min-width: 320px; overflow: hidden; animation: tmModalIn 0.22s cubic-bezier(0.4,0,0.2,1); display: flex; flex-direction: column; }
.tm-task-progress { height: 2px; overflow: hidden; background: transparent; opacity: 0; }
.tm-task-progress span { display: block; width: 35%; height: 100%; background: #4f46e5; transform: translateX(-120%); }
.tm-form-card.tm-task-saving .tm-task-progress { opacity: 1; }
.tm-form-card.tm-task-saving .tm-task-progress span { animation: tmTaskProgress 1.1s ease-in-out infinite; }
@keyframes tmTaskProgress { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
.tm-form-body { padding: 1.25rem 1.25rem 0.5rem; overflow-y: auto; max-height: calc(90vh - 120px); }
.tm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; }
.tm-form-full { grid-column: 1 / -1; }
.modal-resolution .modal-content { background: rgba(255,255,255,0.97); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,0.7); box-shadow: var(--dash-shadow-xl); border-radius: var(--dash-radius-lg); max-width: 480px; animation: tmModalIn 0.22s cubic-bezier(0.4,0,0.2,1); }
@keyframes tmModalIn { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-task-form .modal-header, .modal-resolution .modal-header { padding: 1.125rem 1.25rem; border-bottom: 1px solid var(--dash-border-color); }
.modal-task-form .modal-header h2, .modal-resolution .modal-header h2 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--gray-800); margin: 0; }
.modal-task-form .modal-close, .modal-resolution .modal-close { width: 28px; height: 28px; border-radius: var(--dash-radius-xs); }
.task-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tm-profile-form-card { width: min(1120px, 96vw); height: min(680px, 92vh); }
.tm-form-profile-body { flex: 1; }
.tm-form-profile-body .tpm-left { display: flex; flex-direction: column; }
.tm-task-title-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    padding: 0 0 0.35rem;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    min-height: 2.1rem;
    white-space: nowrap;
    overflow: hidden;
}
.tm-task-title-input:focus { border-bottom-color: #d1d5db; box-shadow: none; }
.tm-task-title-input:empty::before,
.tpm-desc-input:empty::before,
.tpm-comment-input:empty::before,
.tpm-reply-input:empty::before {
    color: #9ca3af;
    content: attr(data-placeholder);
    pointer-events: none;
}
.tm-task-title-input + .tpm-section-label { margin-top: 0.45rem; }
#taskDescription,
#tpmTaskDescription {
    flex: 0 0 120px;
    height: 120px;
    min-height: 120px !important;
    max-height: 220px;
}
.tm-form-section-gap { margin-top: 0; }
.tm-form-assignee-panel + #taskAssignees + .tpm-section-label,
#taskAssignees + .tpm-section-label { margin-top: 0; }
.tm-form-assignee-panel {
    flex: 0 0 auto;
    height: auto;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: #fff;
    padding: 0.45rem;
}
.tm-form-assignee-panel .form-assignee-trigger {
    width: 100%;
    border: none;
    background: #f9fafb;
    cursor: text;
    text-align: left;
}
.tm-form-attach-box {
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #f9fafb;
    padding: 0.6rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    transition: border-color 0.15s, background 0.15s;
}
.tm-form-attach-box.tm-form-attach-dragover { border-color: #3b82f6; background: #eff6ff; }
.tm-form-attach-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 0.5rem; }
.tm-form-attach-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    min-height: 96px;
    border: 1.5px dashed #d1d5db;
    border-radius: 7px;
    background: transparent;
    color: #6b7280;
    text-align: center;
    padding: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.tm-form-attach-list:has(.tm-form-attach-item) .tm-form-attach-add {
    width: auto;
    min-height: 84px;
    flex: 0 0 96px;
    padding: 0.5rem;
}
.tm-form-attach-add:hover { border-color: #3b82f6; background: #eff6ff; }
.tm-form-attach-label { font-size: 0.78rem; font-weight: 600; color: #4b5563; }
.tm-form-attach-hint { font-size: 0.68rem; color: #9ca3af; }
.tm-form-attach-list:has(.tm-form-attach-item) .tm-form-attach-hint { display: none; }
.tm-form-attach-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 96px;
    min-height: 84px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #fff;
    padding: 0.5rem 0.4rem;
    cursor: pointer;
    text-align: center;
}
.tm-form-attach-item:hover { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.12); }
.tm-form-attach-icon { font-size: 1.3rem; line-height: 1; }
.tm-form-attach-name {
    width: 100%;
    font-size: 0.66rem;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tm-form-attach-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #6b7280;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tm-form-attach-remove:hover { color: #dc2626; }
.tm-asset-row { align-items: flex-start; }
.tm-link-assets-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    padding-top: 0.28rem;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.tm-link-assets-toggle input[type="checkbox"] { margin: 0; cursor: pointer; }
.tm-link-assets-toggle:hover { color: #374151; }
.tm-info-tip-float {
    position: fixed;
    transform: translate(-50%, -100%);
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 5px 9px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 2147483647;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.tpm-detail-group { padding: 0.3rem 0; border-bottom: 1px solid #f0f0f0; }
.tpm-detail-group:last-child { border-bottom: none; }
.tm-linked-assets-group { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tm-linked-tabs {
    display: flex;
    gap: 0.2rem;
    padding: 0.3rem 0.5rem 0.5rem;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
.tm-linked-tab {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.tm-linked-tab:hover { color: #4b5563; background: #f3f4f6; }
.tm-linked-tab.active { color: #1264a3; background: rgba(29,155,209,0.1); }
.tm-linked-tab-count { margin-left: 0.2rem; opacity: 0.7; font-weight: 500; }
.tm-linked-assets-list {
    flex: 1;
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.15rem 0.6rem 0.4rem;
    display: flex;
    flex-direction: column;
}
.tm-linked-assets-empty { margin: 0.5rem 0.2rem; color: #9ca3af; font-size: 0.76rem; }
.tm-linked-asset-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.36rem 0.1rem;
    border-bottom: 1px solid #f5f5f5;
}
.tm-linked-asset-row:last-child { border-bottom: none; }
.tm-linked-asset-link {
    border: none;
    background: transparent;
    color: #1264a3;
    font: inherit;
    font-size: 0.78rem;
    padding: 0;
    cursor: pointer;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tm-linked-asset-link:hover { text-decoration: underline; }
.tm-linked-asset-link.tm-linked-asset-primary { font-weight: 700; color: #0d4f73; }
.tm-linked-asset-name-plain {
    color: #1f2937;
    font-size: 0.78rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tm-linked-remove-btn {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    flex-shrink: 0;
    padding: 0 0.15rem;
}
.tm-linked-remove-btn:hover { color: #dc2626; }
.tm-asset-picker { flex: 1; min-width: 0; }
.tm-asset-trigger {
    width: 100%;
    min-height: 32px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #111827;
    font: inherit;
    font-size: 0.8rem;
    padding: 0.22rem 0.4rem;
    text-align: left;
    cursor: text;
}
.tm-asset-trigger:hover, .tm-asset-trigger:focus { border-color: #3b82f6; background: #fff; outline: none; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.tm-asset-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.tm-asset-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 100%;
    padding: 0.18rem 0.38rem;
    border-radius: 999px;
    background: rgba(29,155,209,0.09);
    color: #1264a3;
    font-size: 0.72rem;
    font-weight: 600;
}
.tm-asset-tag button { border: none; background: transparent; color: inherit; cursor: pointer; padding: 0; line-height: 1; }
.tm-asset-dropdown {
    position: fixed;
    z-index: 2147483647;
    background: #fff;
    border: 1px solid rgba(29,28,29,0.1);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(29,28,29,0.16);
    overflow: hidden;
}
.tm-asset-options { max-height: 260px; overflow-y: auto; padding: 0.25rem 0; }
.tm-asset-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    border: none;
    background: #fff;
    padding: 0.38rem 0.7rem;
    text-align: left;
    cursor: pointer;
}
.tm-asset-option:hover,
.tm-asset-option-active { background: rgba(29,155,209,0.08); }
.tm-asset-option strong { color: #1d1c1d; font-size: 0.75rem; font-weight: 400; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-asset-option span { color: #8a8f98; font-size: 0.66rem; font-weight: 400; flex-shrink: 0; }
.tm-asset-quickall { border-bottom: 1px solid #f0f0f0; }
.tm-asset-quickall strong { color: #1264a3; font-weight: 600; }
.tm-asset-empty { padding: 0.85rem; color: #8a8f98; font-size: 0.72rem; text-align: center; }
.tm-form-detail-rows .tpm-dr-label { width: 96px; min-width: 96px; }
.tm-form-detail-rows {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.tm-form-detail-rows .tm-form-assignee-panel {
    flex: 1;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
}
.tm-form-detail-rows .form-assignee-trigger {
    height: auto;
    min-height: 32px;
    padding: 0.22rem 0.4rem;
    line-height: normal;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    font-size: 0.8rem;
}
.tm-form-detail-rows .form-assignee-trigger:hover,
.tm-form-detail-rows .form-assignee-trigger:focus {
    border-color: #3b82f6;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.tm-form-footer { justify-content: flex-end; }
.tm-form-footer .usheet-hint { margin-right: auto; color: #9ca3af; font-size: 0.76rem; }
.resolution-form { padding: 1.125rem 1.25rem 1.25rem; gap: 0.75rem; display: flex; flex-direction: column; }
.task-form .form-field, .resolution-form .form-field { margin-bottom: 0; gap: 0.2rem; }
.task-form .form-field label, .resolution-form .form-field label { font-size: 0.6875rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.4px; transition: color var(--dash-transition); }
.task-form .form-field:focus-within label, .resolution-form .form-field:focus-within label { color: var(--primary); }
.task-form .form-select, .task-form .form-input, .task-form .form-textarea, .resolution-form .form-textarea { padding: 0.5rem 0.625rem; font-size: 0.8125rem; border: 1px solid rgba(0,0,0,0.10); border-radius: var(--dash-radius-sm); background: rgba(248,250,252,0.8); color: var(--gray-800); font-family: inherit; transition: border-color var(--dash-transition), box-shadow var(--dash-transition), background var(--dash-transition); }
.task-form .form-select:hover, .task-form .form-input:hover, .task-form .form-textarea:hover, .resolution-form .form-textarea:hover { border-color: #c7d2fe; background: #fafbff; }
.task-form .form-select:focus, .task-form .form-input:focus, .task-form .form-textarea:focus, .resolution-form .form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--dash-focus-ring); background: #fff; }
.task-form .form-textarea, .resolution-form .form-textarea { min-height: 80px; resize: vertical; }
.task-form .form-actions, .resolution-form .form-actions { margin-top: 0.125rem; padding-top: 0.125rem; gap: 0.5rem; }
.form-assignee-trigger { height: 34px; padding: 0 0.625rem; line-height: 34px; border-radius: var(--dash-radius-sm); font-size: 0.8125rem; border: 1px solid rgba(0,0,0,0.10); background: rgba(248,250,252,0.8); transition: border-color var(--dash-transition), background var(--dash-transition); }
.form-assignee-trigger:hover { border-color: #c7d2fe; background: #fafbff; }

/* Task Detail Drawer */
.drawer-task-detail { position: fixed; top: 0; right: 0; width: 480px; max-width: 94vw; height: 100vh; z-index: 9999; display: flex; flex-direction: column; background: rgba(255,255,255,0.97); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border-left: 1px solid rgba(0,0,0,0.08); box-shadow: -16px 0 48px rgba(0,0,0,0.10); transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); animation: none; }
.drawer-task-detail.open { transform: translateX(0); }
.drawer-task-detail .drawer-content { display: flex; flex-direction: column; height: 100%; }
.drawer-task-detail .drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 1.125rem 1.5rem; border-bottom: 1px solid var(--dash-border-color); flex-shrink: 0; }
.drawer-task-detail .drawer-header h2 { font-size: 1.0625rem; font-weight: 700; color: var(--gray-800); margin: 0; }
.drawer-task-detail .drawer-close { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--gray-400); cursor: pointer; border-radius: var(--dash-radius-xs); transition: all var(--dash-transition); }
.drawer-task-detail .drawer-close:hover { background: rgba(0,0,0,0.06); color: var(--gray-700); }
.drawer-task-detail .drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; }

/* Inline controls */
#section-task-manager .inline-status { font-size: 0.7rem; font-weight: 600; padding: 0.2rem 1rem 0.2rem 0.45rem; border-radius: var(--dash-radius-xs); }
#section-task-manager .btn-comments-toggle { font-size: 0.7rem; padding: 0.2rem 0.45rem; border-radius: var(--dash-radius-xs); border-color: var(--dash-border-color); }
#section-task-manager .days-badge { font-size: 0.68rem; padding: 0.15rem 0.4rem; }
#section-task-manager .assignee-dropdown { z-index: 10000; }

/* Checkbox — overrides (resolve buttons handled by .tm-resolve-cb block above) */
#section-task-manager .task-table th.col-checkbox,
#section-task-manager .task-table td.col-checkbox,
.task-manager-layout .task-table th.col-checkbox,
.task-manager-layout .task-table td.col-checkbox { width: 46px !important; min-width: 46px !important; max-width: 46px !important; text-align: center; padding: 0 6px !important; }

/* Priority badges (legacy for kanban) */
.priority-badge { display: inline-flex; align-items: center; padding: 0.2rem 0.55rem; font-size: 0.65rem; font-weight: 700; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.priority-high { background: rgba(220,38,38,0.1); color: #dc2626; }
.priority-medium { background: rgba(217,119,6,0.1); color: #d97706; }
.priority-low { background: rgba(34,197,94,0.1); color: #16a34a; }
.priority-none { color: var(--gray-400,#9ca3af); font-size: 0.85rem; }

/* Row selected */
#section-task-manager .task-table tr.row-selected,
.task-manager-layout .task-table tr.row-selected { background: rgba(79,70,229,0.04) !important; }

/* Responsive */
@media (max-width: 768px) {
    #section-task-manager .task-manager-filters { flex-direction: column; align-items: stretch; }
    #section-task-manager .filter-group, #section-task-manager .filter-group.search { width: 100%; }
    #section-task-manager .filter-select, #section-task-manager .filter-input { width: 100%; }
    .drawer-task-detail { width: 100%; max-width: 100%; }
    #section-task-manager .task-table-wrapper { max-height: 60vh; }
}

/* Legacy scopes for .task-manager-layout */
.task-manager-layout .task-table th.th-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.task-manager-layout .task-table th.th-sortable:hover { background: rgba(79,70,229,0.05); }
.task-manager-layout .task-table th.th-sort-asc::after  { content: ' \2191'; font-size: 0.65rem; color: var(--primary,#4f46e5); font-weight: 700; }
.task-manager-layout .task-table th.th-sort-desc::after { content: ' \2193'; font-size: 0.65rem; color: var(--primary,#4f46e5); font-weight: 700; }
.task-manager-layout .task-table th.col-checkbox,
.task-manager-layout .task-table td.col-checkbox { width: 46px; min-width: 46px; max-width: 46px; text-align: center; padding: 0 6px; }
.task-manager-layout .task-table tr.row-selected { background: rgba(79,70,229,0.04) !important; }

Fullscreen Overview Fleet Map ─────────────────────────────────── */
#section-overview.active {
    display: flex;
    flex: 1;
    padding: 0 !important;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.overview-map-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.overview-map-bg #overviewFleetMap {
    width: 100%;
    height: 100%;
}
.overview-map-bg .samsara-fleet-map-overlay {
    position: absolute;
    inset: 0;
    background: rgba(248, 250, 252, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 2;
    pointer-events: none;
}

/* Topbar floating above the map */
.overview-map-topbar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 30;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    pointer-events: none;
}

.overview-map-chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
    pointer-events: all;
}
/* Re-scope overview-card inside the map topbar so it floats cleanly */
.overview-map-chips .overview-card {
    pointer-events: all;
    box-shadow: 0 2px 12px rgba(0,0,0,0.14);
}
.overview-map-chips .overview-dropdown-panel {
    min-width: 220px;
    max-height: 280px;
}
.overview-map-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: all;
    flex-shrink: 0;
}
.samsara-fleet-sync-time {
    font-size: 0.7rem;
    color: rgba(30,41,59,0.65);
    background: rgba(255,255,255,0.75);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 20px;
    padding: 0.2rem 0.65rem;
    white-space: nowrap;
}
.overview-map-ctrl-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.3rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.75);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: var(--text, #1e293b);
    cursor: pointer;
    transition: background var(--dash-transition), box-shadow var(--dash-transition);
    box-shadow: 0 1px 6px rgba(0,0,0,0.10);
}
.overview-map-ctrl-btn:hover {
    background: rgba(255,255,255,0.92);
    box-shadow: 0 2px 10px rgba(0,0,0,0.14);
}
.overview-map-ctrl-btn.active {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.4);
    color: #6366f1;
}

/* Floating right sidebar */
.overview-map-sidebar {
    position: absolute;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: 280px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.82);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    overflow: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.overview-map-sidebar.collapsed {
    transform: translateX(calc(100% + 16px));
    opacity: 0;
    pointer-events: none;
}
.overview-map-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text, #1e293b);
    border-bottom: 1px solid rgba(226,232,240,0.6);
    flex-shrink: 0;
}
.overview-map-sidebar-header span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.overview-sidebar-collapse-btn,
.overview-sidebar-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid rgba(226,232,240,0.7);
    background: rgba(255,255,255,0.7);
    color: var(--text, #1e293b);
    cursor: pointer;
    transition: background var(--dash-transition);
}
.overview-sidebar-collapse-btn:hover,
.overview-sidebar-expand-btn:hover {
    background: rgba(255,255,255,0.95);
}
.overview-sidebar-expand-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 11;
    display: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}
.overview-map-sidebar .samsara-fleet-vehicle-list {
    flex: 1;
    width: 100%;
    border: none;
    background: transparent;
    overflow-y: auto;
}

/* Floating draggable task panels on overview map */
.overview-task-float {
    position: fixed;
    z-index: 60;
    width: 260px;
    min-width: 200px;
    max-width: 320px;
    background: rgba(255,255,255,0.72);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--dash-radius-md);
    box-shadow: var(--dash-shadow-xs);
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    /* override base company-task-widget sizing */
    min-width: 200px !important;
    flex: none !important;
    max-width: 320px !important;
    /* No left/top transition by default — rebalance must be instant */
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.overview-task-float:hover {
    box-shadow: var(--dash-shadow-md);
    border-color: rgba(255,255,255,0.95);
}
/* Added to a card only during intentional moves (drag snap, expand restore) */
.overview-task-float.float-animating {
    transition: left 0.26s cubic-bezier(0.2, 0, 0.2, 1),
                top  0.26s cubic-bezier(0.2, 0, 0.2, 1),
                box-shadow 0.18s ease,
                border-color 0.18s ease;
}
/* Elevate the last-interacted card so it paints on top of siblings */
.overview-task-float.float-top {
    z-index: 65;
}
.overview-task-float-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.55rem;
    cursor: grab;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background: rgba(255,255,255,0.5);
    position: relative;
    overflow: hidden;
}
.overview-task-float-header:active {
    cursor: grabbing;
}
.overview-task-float-drag {
    color: var(--gray-300);
    flex-shrink: 0;
    line-height: 0;
    padding-right: 2px;
}
.overview-task-float-drag:hover {
    color: var(--gray-500);
}
.overview-task-float .company-task-widget-title {
    flex: 1;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    pointer-events: none;
}
.overview-task-float .company-task-widget-meta {
    pointer-events: none;
}
.overview-task-float .company-task-widget-body {
    /* Animated open/close — override the base display:none collapse */
    display: block !important;
    overflow: hidden;
    max-height: 290px;
    opacity: 1;
    transition: max-height 0.26s ease-out, opacity 0.2s ease, padding 0.26s ease;
}
.overview-task-float.collapsed .company-task-widget-body {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top: none !important;
}
.overview-task-float.collapsed .overview-task-float-header,
.overview-task-float.collapsed .company-task-float-header {
    border-bottom: none;
}
/* Live badge inside fleet widget header */
.overview-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #16a34a;
    background: rgba(22,163,74,0.10);
    border-radius: 20px;
    padding: 2px 6px 2px 5px;
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 0.2px;
}
.overview-live-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16a34a;
    animation: live-pulse 1.8s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.75); }
}
/* Unit float cards (trucks / trailers / drivers) */
#trucksWidget, #trailersWidget, #driversWidget {
    width: 240px;
    max-width: 280px !important;
}

.float-unit-body {
    max-height: 260px;
    overflow-y: auto;
    padding: 0.2rem 0;
}

.float-unit-empty {
    font-size: 0.72rem;
    color: var(--gray-400);
    padding: 0.6rem 0.75rem;
    text-align: center;
}

.float-unit-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.7rem;
    cursor: pointer;
    transition: background var(--dash-transition);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.float-unit-item:last-child { border-bottom: none; }
.float-unit-item:hover { background: rgba(0,0,0,0.04); }

.float-unit-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--gray-300);
}
.float-unit-dot.moving  { background: #16a34a; animation: live-pulse 1.8s ease-in-out infinite; }
.float-unit-dot.idle    { background: #86efac; }
.float-unit-dot.stopped { background: #fbbf24; }
.float-unit-dot.off     { background: var(--gray-300); }

.float-unit-name {
    flex: 1;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.float-unit-sub {
    font-size: 0.65rem;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

.float-unit-gps {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #16a34a;
    background: rgba(22,163,74,0.1);
    border-radius: 10px;
    padding: 1px 5px;
    flex-shrink: 0;
}

/* Magnetic snap: brief scale pop when two cards lock together */
@keyframes mag-snap {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.012); }
    100% { transform: scale(1); }
}
.mag-snapping { animation: mag-snap 0.22s ease-out; }

/* Live badge in trucks card header */
#trucksWidget .overview-live-badge { font-size: 0.58rem; }


/* Samsara telematics strip inside truck detail panel */
.samsara-telematics-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: rgba(99,102,241,0.07);
    border-radius: 8px;
    margin: 6px 0 2px;
    font-size: 0.72rem;
    color: #4338ca;
}
.samsara-telematics-strip svg {
    flex-shrink: 0;
    opacity: 0.75;
}

/* Responsive */
@media (max-width: 900px) {
    .overview-map-topbar {
        right: 12px;
        flex-wrap: wrap;
    }
}
@media (max-width: 640px) {
    .overview-map-topbar {
        top: 8px;
        left: 8px;
        right: 8px;
    }
    .overview-map-chips {
        gap: 0.25rem;
    }
    .overview-map-sidebar {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 45%;
        border-radius: 16px 16px 0 0;
    }
    .overview-sidebar-expand-btn {
        bottom: 12px;
        top: auto;
        right: 12px;
    }
}


/* ============================================================
   TASK MANAGER — SLACK-MODERN OVERHAUL  (v=222)
   Goals: airy, low-noise table; horizontal-only dividers;
   frameless inline editing; soft hover; clean new-task row.
   ============================================================ */

/* Wrapper: softer shadow instead of hard border */
#section-task-manager .task-table-wrapper {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.06);
    border-radius: 0;
    box-shadow: none;
    background: #fff;
}

/* Sticky header: minimal, no vertical dividers */
#section-task-manager .task-table thead { z-index: 4; }
#section-task-manager .task-table th {
    height: 38px;
    padding: 0 14px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #8a8f98;
    text-transform: none;
    letter-spacing: 0.02em;
    background: #fff;
    border-bottom: 1px solid rgba(29,28,29,0.13);
    border-right: none;
    box-shadow: 0 1px 0 rgba(29,28,29,0.04);
}
#section-task-manager .task-table th.th-sortable:hover {
    background: rgba(29,28,29,0.04);
    color: #1d1c1d;
}

/* Cells: only horizontal divider, generous padding */
#section-task-manager .task-table td {
    height: 44px;
    padding: 0 14px;
    font-size: 0.8125rem;
    color: #1d1c1d;
    border-right: none;
    border-bottom: 1px solid rgba(29,28,29,0.06);
    transition: background 0.08s ease;
}

/* Row hover — subtle Slack-style highlight */
#section-task-manager .task-table tbody tr:hover td {
    background: rgba(29,28,29,0.035);
}
#section-task-manager .task-table tbody tr.row-selected td {
    background: rgba(29,155,209,0.07) !important;
}

/* Remove the heavy editing ring from cells */
#section-task-manager .task-table td.editing {
    background: rgba(29,155,209,0.05) !important;
    box-shadow: none;
    border-radius: 0;
    padding: 0 14px;
    overflow: visible;
    white-space: normal;
}

/* Editable affordance — no outline ring, just soft fill */
#section-task-manager .task-table td.tm-editable {
    cursor: text;
}
#section-task-manager .task-table td.tm-editable:not(.editing):hover {
    background: rgba(29,155,209,0.06) !important;
    outline: none;
    border-radius: 0;
}

/* Task-name cell — frameless, Slack-style edit */
#section-task-manager .task-table .td-task {
    font-weight: 400;
    color: #1d1c1d;
    letter-spacing: -0.005em;
    padding-left: 16px !important;
}
#section-task-manager .task-table .th-task { padding-left: 16px !important; }
#section-task-manager .task-table .td-task.tm-editable:not(.editing):hover {
    background: rgba(29,155,209,0.05) !important;
    cursor: text;
}
#section-task-manager .task-table .fleet-inline-input.tm-name-input,
#section-task-manager .task-table .task-row-new .tm-new-name-input {
    width: 100%;
    height: auto;
    padding: 0;
    margin: 0;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    border-radius: 0;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 400;
    color: #1d1c1d;
    letter-spacing: -0.005em;
    line-height: 1.4;
    caret-color: #1264a3;
}
#section-task-manager .task-table .fleet-inline-input.tm-name-input:focus,
#section-task-manager .task-table .task-row-new .tm-new-name-input:focus {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}
#section-task-manager .task-table .task-row-new .tm-new-name-input::placeholder,
#section-task-manager .task-table .fleet-inline-input.tm-name-input::placeholder {
    color: #b0b3b8;
    font-weight: 400;
}

/* addInlineRow — see canonical v=231 block at end of file */

/* Inline editing inputs (hover-edit) for non-task fields — flat, no glow ring */
#section-task-manager .task-table td.editing .fleet-inline-input:not(.tm-name-input) {
    border: 1px solid rgba(29,28,29,0.14);
    background: #fff;
    box-shadow: none;
    border-radius: 6px;
    height: 30px;
    padding: 0 8px;
    font-size: 0.8125rem;
    color: #1d1c1d;
}
#section-task-manager .task-table td.editing .fleet-inline-input.tm-date-mask-input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    border-radius: 0;
    padding: 0;
}

/* (status pill + picker now defined at top of file — v=237) */

/* Avatar polish */
.tm-avatar {
    width: 24px;
    height: 24px;
    font-size: 0.6rem;
    border: 2px solid #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* Checkbox column, lighter divider */
#section-task-manager .task-table .col-checkbox {
    border-right: none;
}

/* Status accent stripe — only show on overdue, not always */
#section-task-manager .task-table tbody tr td:first-child {
    border-left: 3px solid transparent;
}
#section-task-manager .task-table tbody tr.row-overdue td:first-child {
    border-left-color: #e01e5a;
}

/* Filterbar: lighter, blends into table */
#section-task-manager .tm-filterbar {
    background: #fff;
    border-bottom: 1px solid rgba(29,28,29,0.08);
    padding: 0.55rem 1rem;
    gap: 0.5rem;
}
#section-task-manager .filter-select,
#section-task-manager .filter-input {
    height: 30px;
    border: 1px solid rgba(29,28,29,0.12);
    border-radius: 6px;
    font-size: 0.8125rem;
    background: #fff;
}
#section-task-manager .filter-select:focus,
#section-task-manager .filter-input:focus {
    border-color: rgba(29,155,209,0.55);
    box-shadow: 0 0 0 3px rgba(29,155,209,0.13);
}

/* Topbar: cleaner */
#section-task-manager .tm-topbar {
    padding: 0.85rem 1.1rem 0.7rem;
    border-bottom: 1px solid rgba(29,28,29,0.08);
}
#section-task-manager .tm-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* View toggle — softer */
#section-task-manager .task-view-toggle {
    background: rgba(29,28,29,0.06);
    border-radius: 7px;
    padding: 2px;
}
#section-task-manager .toggle-btn.active {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 0 1px rgba(29,28,29,0.06);
    color: #1d1c1d;
}

/* (status picker now defined at top — v=237) */
/* === Table sizing fix (v=223) — bigger viewport, no clipping === */
#section-task-manager .task-view-table { padding: 0; }
#section-task-manager .task-view-container.active { display: block; height: auto; min-height: 0; }
#section-task-manager.active { display: block; height: auto; min-height: 0; }
#section-task-manager .tm-topbar,
#section-task-manager .tm-filterbar { flex-shrink: 0; }

/* Wrapper takes all remaining height; allow native popups (date/select) to escape */
#section-task-manager .task-table-wrapper {
    flex: 0 0 auto;
    min-height: auto;
    max-height: none;
    overflow: auto;
}

/* addInlineRow — see canonical v=231 block at end of file */
/* === Floating overview cards: ensure content scrolls when overflowing (v=225) === */
.overview-task-float:not(.collapsed) .company-task-widget-body {
    overflow-y: auto !important;
    overflow-x: hidden;
    max-height: min(60vh, 420px) !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.overview-task-float .company-task-list {
    max-height: none !important;
    overflow: visible !important;
}
.overview-task-float .float-unit-body {
    max-height: none !important;
    overflow: visible !important;
}
/* Slim, unobtrusive scrollbar inside floats */
.overview-task-float:not(.collapsed) .company-task-widget-body::-webkit-scrollbar { width: 6px; }
.overview-task-float:not(.collapsed) .company-task-widget-body::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.18); border-radius: 3px;
}
.overview-task-float:not(.collapsed) .company-task-widget-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.32);
}
/* === Task table columns: hide / drag-reorder (v=227) === */
#section-task-manager .task-table th.col-hidden,
#section-task-manager .task-table td.col-hidden { display: none !important; }

#section-task-manager .task-table th[draggable="true"] { cursor: grab; user-select: none; }
#section-task-manager .task-table th[draggable="true"]:active { cursor: grabbing; }
#section-task-manager .task-table th.th-dragging { opacity: 0.45; }
#section-task-manager .task-table th.th-drop-before { box-shadow: inset 3px 0 0 0 #1264a3; }
#section-task-manager .task-table th.th-drop-after  { box-shadow: inset -3px 0 0 0 #1264a3; }
#section-task-manager .task-table th[data-col-key] { position: relative; }

/* Context menu items */
.tm-col-ctx-menu button:focus { outline: none; }

/* === addInlineRow: matches data rows exactly (v=232) === */
#section-task-manager .task-table .task-row-new {
    background: transparent !important;
}
#section-task-manager .task-table .task-row-new td {
    height: 44px !important;
    padding: 0 14px !important;
    font-size: 0.8125rem !important;
    color: #1d1c1d !important;
    background: transparent !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(29,28,29,0.06) !important;
    vertical-align: middle !important;
    overflow: visible !important;
    white-space: nowrap;
}
#section-task-manager .task-table .task-row-new:hover td {
    background: rgba(29,28,29,0.035) !important;
}
/* Inputs + selects: invisible by default, inherit cell typography */
#section-task-manager .task-table .task-row-new .fleet-inline-input,
#section-task-manager .task-table .task-row-new .fleet-inline-sel {
    width: 100% !important;
    height: 28px !important;
    padding: 0 6px !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0.8125rem !important;
    font-family: inherit !important;
    font-weight: 400 !important;
    color: #1d1c1d !important;
    outline: none !important;
    box-sizing: border-box;
    transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
/* Cell hover: soft Slack tint */
#section-task-manager .task-table .task-row-new td:hover .fleet-inline-input,
#section-task-manager .task-table .task-row-new td:hover .fleet-inline-sel {
    background: rgba(29,155,209,0.06) !important;
}
/* Focus: flat border only, no glow ring */
#section-task-manager .task-table .task-row-new .fleet-inline-input:focus,
#section-task-manager .task-table .task-row-new .fleet-inline-sel:focus {
    background: #fff !important;
    border-color: rgba(29,155,209,0.45) !important;
    box-shadow: none !important;
    outline: none !important;
}
/* Placeholders */
#section-task-manager .task-table .task-row-new .fleet-inline-input::placeholder {
    color: #b0b3b8 !important;
    font-weight: 400;
}
/* Task-name input: always frameless, flows like cell text */
#section-task-manager .task-table .task-row-new .tm-new-name-input,
#section-task-manager .task-table .task-row-new td:hover .tm-new-name-input,
#section-task-manager .task-table .task-row-new .tm-new-name-input:focus {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    height: auto !important;
    width: 100% !important;
    letter-spacing: -0.005em;
    caret-color: #1264a3;
}
#section-task-manager .task-table .task-row-new .tm-new-name-input::placeholder {
    color: #b0b3b8 !important;
}
/* Entity cell: allow overflow for popup */
#section-task-manager .task-table .task-row-new .td-entity-new {
    overflow: visible !important;
    padding: 0 14px !important;
}

/* Insertion animation — applied when a task is freshly added (inline or
   from a driver/truck/trailer profile) */
@keyframes tmRowEnter {
    0%   { opacity: 0; transform: translateY(-4px); background-color: rgba(29,155,209,0.10); }
    60%  { opacity: 1; transform: translateY(0);    background-color: rgba(29,155,209,0.06); }
    100% { opacity: 1; transform: translateY(0);    background-color: transparent; }
}
#section-task-manager .task-table tr.tm-row-enter {
    animation: tmRowEnter 480ms ease-out;
}
#section-task-manager .task-table tr.tm-row-enter > td {
    animation: tmRowEnter 480ms ease-out;
}

/* ══════════════════════════════════════════════════════
   UNIT TABLES (Trucks / Trailers / Drivers) — TM-style
   v273
   ══════════════════════════════════════════════════════ */

/* Card shell - no extra padding, no inner body wrapper */
.unit-card-shell {
    padding: 0;
    border-radius: var(--dash-radius);
    overflow: visible;
}

/* ── Top bar ──────────────────────────────────── */
.unit-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--dash-border-color);
}
.unit-table-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}
.unit-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Department scope toggle ─────────────────── */
.dashboard-scope-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.34rem 0.7rem;
    border: 1px solid var(--dash-border-color);
    background: #fff;
    color: var(--gray-700);
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.dashboard-scope-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.dashboard-scope-toggle.is-group {
    background: rgba(29, 155, 209, 0.09);
    border-color: rgba(29, 155, 209, 0.28);
    color: var(--primary);
}
.dashboard-scope-toggle-label {
    font-weight: 700;
}
.dashboard-scope-toggle-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dashboard-scope-toggle.is-group .dashboard-scope-toggle-badge {
    background: rgba(29, 155, 209, 0.16);
}

/* ── Profile settings modal ─────────────────── */
.profile-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.profile-settings-modal.hidden {
    display: none;
}
.profile-settings-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
}
.profile-settings-modal-card {
    position: relative;
    width: min(100%, 480px);
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--dash-border-color);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}
.profile-settings-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--dash-border-color);
}
.profile-settings-modal-header h3 {
    margin: 0 0 0.2rem;
    font-size: 1rem;
    color: var(--gray-900);
}
.profile-settings-modal-header p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--gray-500);
}
.profile-settings-modal-close {
    border: 0;
    background: transparent;
    color: var(--gray-500);
    font-size: 1.2rem;
    cursor: pointer;
}
.profile-settings-modal-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 1.1rem 1.1rem;
}
.profile-settings-field {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    font-size: 0.8rem;
    color: var(--gray-700);
}
.profile-settings-field input,
.profile-settings-field select {
    width: 100%;
    height: 38px;
    padding: 0 0.7rem;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 8px;
    font-size: 0.84rem;
    color: var(--gray-800);
}
.profile-settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.2rem;
}

/* ── Filter bar ─────────────────────────────────  */
.unit-filterbar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.65rem 1.25rem;
    border-bottom: 1px solid var(--dash-border-color);
    background: var(--gray-50, #f9fafb);
}
.unit-filterbar .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}
.unit-filterbar .filter-group label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.unit-filterbar .filter-group.search {
    flex: 1;
    min-width: 180px;
}
.unit-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.unit-search-wrap svg {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}
.unit-filterbar .filter-input {
    height: 28px;
    padding: 0 0.6rem 0 1.75rem;
    font-size: 0.79rem;
    border: 1px solid rgba(0,0,0,0.09);
    border-radius: 7px;
    background: #fff;
    color: var(--gray-800);
    font-family: inherit;
    width: 100%;
    transition: border-color var(--dash-transition), box-shadow var(--dash-transition);
}
.unit-filterbar .filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--dash-focus-ring);
}
.unit-filterbar .filter-select {
    height: 28px;
    padding: 0 1.5rem 0 0.6rem;
    font-size: 0.79rem;
    border: 1px solid rgba(0,0,0,0.09);
    border-radius: 7px;
    background: #fff;
    color: var(--gray-800);
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 10px 6px;
    transition: border-color var(--dash-transition), box-shadow var(--dash-transition);
}
.unit-filterbar .filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--dash-focus-ring);
}
.unit-filter-sep {
    width: 1px;
    height: 26px;
    background: var(--dash-border-color);
    align-self: flex-end;
    margin: 0 0.15rem;
}

/* ── Table wrapper: sticky header + vertical scroll ── */
.unit-table-wrapper {
    background: #fff;
    border-top: none;
    overflow: auto;
    max-height: calc(100vh - 240px);
    position: relative;
}
.unit-table-wrapper::-webkit-scrollbar { width: 6px; height: 6px; }
.unit-table-wrapper::-webkit-scrollbar-track { background: transparent; }
.unit-table-wrapper::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
.unit-table-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); }

/* ── Unit table overrides (on top of .dash-table) ── */
.dash-table.unit-table {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    width: 100%;
}

/* Sticky header */
.dash-table.unit-table thead {
    position: sticky;
    top: 0;
    z-index: 4;
}

.dash-table.unit-table th {
    height: 32px;
    padding: 0 10px;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fafbfc;
    border-bottom: 2px solid rgba(0,0,0,0.07);
    border-right: 1px solid rgba(0,0,0,0.05);
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
    vertical-align: middle;
    position: relative;
}
.dash-table.unit-table th:last-child { border-right: none; }

/* Sortable th */
.dash-table.unit-table th.ut-sortable {
    cursor: pointer;
    transition: background 0.13s;
}
.dash-table.unit-table th.ut-sortable:hover {
    background: rgba(99,102,241,0.05);
    color: var(--gray-600);
}
.dash-table.unit-table th.ut-sort-asc::after  { content: ' \2191'; color: var(--primary, #4f46e5); font-weight: 700; }
.dash-table.unit-table th.ut-sort-desc::after { content: ' \2193'; color: var(--primary, #4f46e5); font-weight: 700; }

/* Cells */
.dash-table.unit-table td {
    height: var(--unit-row-height, 36px);
    padding: 0 10px;
    font-size: 0.8rem;
    color: var(--gray-700);
    border-right: 1px solid rgba(0,0,0,0.04);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.12s;
    position: relative;
}
.dash-table.unit-table td:last-child { border-right: none; }

/* Row states - remove even/odd striping, use hover only */
.dash-table.unit-table tbody tr:nth-child(even) { background: transparent; }
.dash-table.unit-table tbody tr:hover td { background: rgba(0,0,0,0.018); }
.dash-table.unit-table tbody tr.row-selected td { background: rgba(99,102,241,0.06) !important; }

/* Left accent stripe on first cell */
.dash-table.unit-table tbody tr td:first-child { border-left: 3px solid transparent; }
.dash-table.unit-table tbody tr.row-validation-error td:first-child { border-left-color: #ef4444; }
.dash-table.unit-table tbody tr.row-validation-warning td:first-child { border-left-color: #f59e0b; }

/* Required document issues use a full-row tint, not a status edge stripe. */
.dash-table.unit-table tbody tr[data-status] td:first-child { border-left-color: transparent; }
.dash-table.unit-table tbody tr.row-required-docs-error td { background: rgba(220, 38, 38, 0.055); }
.dash-table.unit-table tbody tr.row-required-docs-error:hover td { background: rgba(220, 38, 38, 0.085); }

/* Density classes */
.unit-table-wrapper.ut-density-compact .dash-table.unit-table td,
.unit-table-wrapper.ut-density-compact .dash-table.unit-table { --unit-row-height: 28px; }
.unit-table-wrapper.ut-density-comfortable .dash-table.unit-table td,
.unit-table-wrapper.ut-density-comfortable .dash-table.unit-table { --unit-row-height: 48px; }

/* ── Unit table — inline editable cells ── */
.dash-table.unit-table th.col-checkbox,
.dash-table.unit-table td.col-checkbox {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    padding: 0 4px !important;
    text-align: center;
    vertical-align: middle;
}
.dash-table.unit-table td.cell-editable {
    padding: 0;
    cursor: text;
    position: relative;
}
.dash-table.unit-table td.cell-editable > .cell {
    padding: 0 10px;
    height: var(--unit-row-height, 36px);
    display: flex;
    align-items: center;
    border-radius: 5px;
    border: 1.5px solid transparent;
    transition: border-color 0.12s, background 0.12s;
}
.dash-table.unit-table td.cell-editable:hover > .cell {
    border-color: #c7d2fe;
    background: #f5f6ff;
}
.dash-table.unit-table tbody tr:hover td.cell-editable > .cell {
    border-color: #e0e7ff;
}
.dash-table.unit-table td.cell-editable .cell-input {
    position: absolute;
    inset: 2px 2px;
    height: calc(var(--unit-row-height, 36px) - 4px);
    border-radius: 5px;
    padding: 0 8px;
    font-size: 0.8125rem;
}
.dash-table.unit-table td.cell-editable .cell-inline-select {
    position: absolute;
    inset: 2px 2px;
    height: calc(var(--unit-row-height, 36px) - 4px);
    border-radius: 5px;
    padding: 0 6px;
    font-size: 0.8125rem;
}
/* Edit pencil hint on hover */
.dash-table.unit-table td.cell-editable::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    opacity: 0;
    transition: opacity 0.12s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
}
.dash-table.unit-table td.cell-editable:hover::after { opacity: 0.5; }

/* ── Unit status pill (reuses tm-status-pill colors) ── */
/* Status color vars per status value */
.unit-sp[data-status="active"]      { --sc: #10b981; }
.unit-sp[data-status="inactive"]    { --sc: #6b7280; }
.unit-sp[data-status="maintenance"] { --sc: #f59e0b; }
.unit-sp[data-status="inshop"]      { --sc: #3b82f6; }
.unit-sp[data-status="reserved"]    { --sc: #8b5cf6; }
.unit-sp[data-status="sold"]        { --sc: #9ca3af; }
.unit-sp[data-status="home-time"]   { --sc: #06b6d4; }
.unit-sp[data-status="training"]    { --sc: #f59e0b; }
.unit-sp[data-status="pending"]     { --sc: #f97316; }
.unit-sp[data-status="suspended"]   { --sc: #dc2626; }
.unit-sp[data-status="terminated"]  { --sc: #7f1d1d; }

/* ── Samsara Telematics tile grid (truck/trailer profile panel) ── */
.tp-telematics-section {
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(79, 70, 229, 0.18);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, rgba(255, 255, 255, 0.8) 48%, rgba(14, 116, 144, 0.08) 100%);
}
.tp-telematics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin-bottom: 9px;
}
.tp-telem-tile {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    padding: 9px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 2px 8px rgba(31, 41, 55, 0.06);
}
.tp-telem-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}
.tp-telem-value {
    font-size: 0.94rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}
.tp-telem-sub {
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 1px;
}
/* Fuel bar inside tile */
.tp-telem-fuel-bar-wrap {
    height: 6px;
    background: rgba(15, 23, 42, 0.12);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}
.tp-telem-fuel-bar {
    height: 100%;
    border-radius: 3px;
    background: #22c55e;
    width: 0%;
    transition: width 0.4s ease, background 0.3s;
}
/* Footer row */
.tp-telem-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px solid rgba(79, 70, 229, 0.12);
}
.tp-telem-sync-time {
    font-size: 0.67rem;
    font-weight: 600;
    color: #4f46e5;
    letter-spacing: 0.02em;
}
/* Fault / safety event lists */
.tp-telem-faults { margin-top: 8px; }
.tp-telem-faults-header {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500, #6b7280);
    margin-bottom: 5px;
}
.tp-telem-faults-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tp-telem-faults-list li {
    font-size: 0.75rem;
    color: var(--gray-600, #4b5563);
    padding: 4px 8px;
    background: rgba(0,0,0,0.02);
    border-radius: 5px;
    border-left: 2px solid #f59e0b;
}

.tp-safety-section {
    border-color: var(--dash-border-color);
    background: #fff;
}

.tp-safety-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tp-safety-score[data-rating="good"] { color: #15803d; }
.tp-safety-score[data-rating="warning"] { color: #b45309; }
.tp-safety-score[data-rating="risk"] { color: #b91c1c; }
.tp-safety-score[data-rating="unknown"] { color: var(--gray-500); }

.tp-safety-event-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 34px;
    padding: 6px 8px;
    border-left-color: #dc2626;
    border-radius: 3px;
}

.tp-safety-event-name {
    min-width: 0;
    color: var(--gray-800);
    font-weight: 600;
    text-transform: capitalize;
}

.tp-safety-event-meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    color: var(--gray-500);
    white-space: nowrap;
}

.tp-safety-speed {
    color: #b91c1c;
    font-weight: 700;
}

.tp-safety-driver,
.tp-telem-fault-time {
    color: var(--gray-500);
}

.tp-safety-empty {
    margin: 0;
    padding: 1rem 0.5rem;
    color: var(--gray-500);
    font-size: 0.78rem;
    text-align: center;
}

html[data-theme="dark"] .tp-safety-section,
html[data-theme="dark"] .tp-safety-section .tp-telem-tile {
    background: #171c22;
    border-color: #2a333d;
    box-shadow: none;
}

html[data-theme="dark"] .tp-safety-section .tp-telem-label,
html[data-theme="dark"] .tp-safety-section .tp-telem-sub,
html[data-theme="dark"] .tp-safety-event-meta,
html[data-theme="dark"] .tp-safety-empty {
    color: #87939f;
}

html[data-theme="dark"] .tp-safety-section .tp-telem-value,
html[data-theme="dark"] .tp-safety-event-name {
    color: #edf1f4;
}

html[data-theme="dark"] .tp-safety-score[data-rating="good"] { color: #4ade80; }
html[data-theme="dark"] .tp-safety-score[data-rating="warning"] { color: #fbbf24; }
html[data-theme="dark"] .tp-safety-score[data-rating="risk"] { color: #f87171; }
html[data-theme="dark"] .tp-safety-score[data-rating="unknown"] { color: #87939f; }

html[data-theme="dark"] .tp-safety-event-list li {
    background: #12171c;
}

@media (max-width: 900px) {
    .tp-telematics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .tp-telematics-section {
        padding: 0.65rem;
    }
    .tp-telematics-grid {
        grid-template-columns: 1fr;
        gap: 7px;
    }
    .tp-safety-event-list li {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }
    .tp-safety-event-meta {
        flex-wrap: wrap;
        justify-content: flex-start;
        white-space: normal;
    }
}

/* Task Manager scroll fix (v=288) */
#section-task-manager.active {
    height: auto;
    min-height: 0;
}

#section-task-manager .task-view-container.active {
    display: block;
    height: auto;
}

#section-task-manager .task-view-table {
    overflow-x: auto;
    overflow-y: visible;
}

#section-task-manager .task-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
    -webkit-overflow-scrolling: touch;
}

#section-task-manager .task-table {
    min-width: 0;
}

/* Task Manager first cell icon visibility fix (v=289) */
#section-task-manager .task-table th.col-checkbox,
#section-task-manager .task-table td.col-checkbox,
.task-manager-layout .task-table th.col-checkbox,
.task-manager-layout .task-table td.col-checkbox {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    padding: 0 !important;
}

#section-task-manager .task-table td.col-checkbox,
.task-manager-layout .task-table td.col-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
    overflow: visible !important;
    text-overflow: clip !important;
}
#section-task-manager .task-table td.td-entity,
#section-task-manager .task-table th.th-entity { padding-left: 6px; }

#section-task-manager .task-table .tm-open-btn,
.task-manager-layout .task-table .tm-open-btn {
    visibility: visible;
    opacity: 0.75;
}

#section-task-manager .task-table .tm-open-btn:hover,
.task-manager-layout .task-table .tm-open-btn:hover {
    opacity: 1;
}

/* Unit tables Task Manager parity (v=290) */
.unit-topbar {
    padding: 0.85rem 1.1rem 0.7rem;
    border-bottom: 1px solid rgba(29, 28, 29, 0.08);
    background: #fff;
}

.unit-table-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1d1c1d;
}

.unit-filterbar {
    background: #fff;
    border-bottom: 1px solid rgba(29, 28, 29, 0.08);
    padding: 0.55rem 1rem;
    gap: 0.5rem;
}

.unit-filterbar .filter-group label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #8a8f98;
    letter-spacing: 0.01em;
}

.unit-table-wrapper {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    max-height: none;
}

.dash-table.unit-table {
    min-width: 1240px;
}

.dash-table.unit-table thead {
    z-index: 4;
}

.dash-table.unit-table th {
    height: 19px;
    padding: 0 14px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #8a8f98;
    text-transform: none;
    letter-spacing: 0.02em;
    background: #fff;
    border-bottom: 1px solid rgba(29, 28, 29, 0.13);
    border-right: none;
    box-shadow: 0 1px 0 rgba(29, 28, 29, 0.04);
}

.dash-table.unit-table th.ut-sortable:hover {
    background: rgba(29, 28, 29, 0.04);
    color: #1d1c1d;
}

.dash-table.unit-table td {
    height: var(--unit-row-height, 22px);
    padding: 0 14px;
    font-size: 0.8125rem;
    color: #1d1c1d;
    border-right: none;
    border-bottom: 1px solid rgba(29, 28, 29, 0.06);
}

.dash-table.unit-table tbody tr:hover td {
    background: rgba(29, 28, 29, 0.035);
}

.dash-table.unit-table tbody tr.row-selected td {
    background: rgba(29, 155, 209, 0.07) !important;
}

.dash-table.unit-table td.cell-editable > .cell {
    border-radius: 0;
    border: 1.5px solid transparent;
    background: transparent;
    height: var(--unit-row-height, 22px);
    padding: 0 14px;
}

.dash-table.unit-table td.cell-editable:hover > .cell,
.dash-table.unit-table tbody tr:hover td.cell-editable > .cell {
    border-color: transparent;
    background: rgba(29, 155, 209, 0.06);
}

.dash-table.unit-table td.cell-editable .cell-input,
.dash-table.unit-table td.cell-editable .cell-inline-select {
    inset: 3px 6px;
    height: calc(var(--unit-row-height, 22px) - 6px);
    border-radius: 6px;
    font-size: 0.8125rem;
}

.dash-table.unit-table td.cell-editable::after {
    display: none;
}

.dash-table.unit-table .cell,
.dash-table.unit-table .cell strong,
.dash-table.unit-table .text-muted {
    font-size: 0.8125rem;
    line-height: 1.35;
}

.dash-table.unit-table .cell strong {
    color: #1d1c1d;
    font-weight: 600;
}

.dash-table.unit-table .text-muted {
    color: #8a8f98;
}

.unit-table-wrapper.ut-density-compact .dash-table.unit-table td,
.unit-table-wrapper.ut-density-compact .dash-table.unit-table {
    --unit-row-height: 15px;
}

.unit-table-wrapper.ut-density-comfortable .dash-table.unit-table td,
.unit-table-wrapper.ut-density-comfortable .dash-table.unit-table {
    --unit-row-height: 21px;
}

.unit-sp.tm-status-pill {
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
}

/* Unit table width behavior (v=291): size to content, then side-scroll */
.unit-table-wrapper {
    overflow-x: auto !important;
    overflow-y: visible;
}

.dash-table.unit-table {
    width: max-content !important;
    min-width: max-content !important;
    table-layout: auto !important;
}

.dash-table.unit-table th,
.dash-table.unit-table td {
    white-space: nowrap;
    min-width: 110px;
}

.dash-table.unit-table th.col-checkbox,
.dash-table.unit-table td.col-checkbox {
    min-width: 52px;
}

.dash-table.unit-table th.col-validation,
.dash-table.unit-table td.col-validation {
    min-width: 28px;
}

.dash-table.unit-table .cell {
    overflow: visible;
    text-overflow: clip;
}

/* Let list pages scroll horizontally instead of squeezing card content */
#section-trucks.active,
#section-trailers.active,
#section-drivers.active {
    overflow-x: auto;
}

#section-trucks .unit-card-shell,
#section-trailers .unit-card-shell,
#section-drivers .unit-card-shell {
    min-width: max-content;
}

/* Remove inline percentage width constraints from header cells on these tables */
#trucksTable th[style],
#trailersTable th[style],
#driversTable th[style] {
    width: auto !important;
}

/* Content-width card/table sizing: keep scrolling, avoid full-page stretch */
#section-task-manager.active,
#section-trucks.active,
#section-trailers.active,
#section-drivers.active {
    overflow-x: auto;
}

#section-trucks .unit-card-shell,
#section-trailers .unit-card-shell,
#section-drivers .unit-card-shell {
    width: 100%;
    min-width: 0;
    max-width: none;
}

#section-trucks .unit-table-wrapper,
#section-trailers .unit-table-wrapper,
#section-drivers .unit-table-wrapper {
    width: 100%;
    min-width: 0;
    max-width: none;
}

#section-trucks .dash-table.unit-table,
#section-trailers .dash-table.unit-table,
#section-drivers .dash-table.unit-table {
    width: 100%;
}

#section-trucks .dash-table.unit-table,
#section-trailers .dash-table.unit-table,
#section-drivers .dash-table.unit-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

#section-trucks .unit-table-wrapper,
#section-trailers .unit-table-wrapper,
#section-drivers .unit-table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
}

/* Task Manager-style fleet list surface */
#section-trucks .unit-card-shell,
#section-trailers .unit-card-shell,
#section-drivers .unit-card-shell {
    width: 100%;
    min-width: 0;
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

#section-trucks .unit-topbar,
#section-trailers .unit-topbar,
#section-drivers .unit-topbar {
    min-height: 46px;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid rgba(29, 28, 29, 0.08);
    background: #fff;
}

#section-trucks .unit-topbar-actions,
#section-trailers .unit-topbar-actions,
#section-drivers .unit-topbar-actions {
    margin-left: auto;
}

#section-trucks .unit-filterbar,
#section-trailers .unit-filterbar,
#section-drivers .unit-filterbar {
    min-height: 52px;
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid rgba(29, 28, 29, 0.08);
    background: #fff;
}

#section-trucks .unit-filterbar .filter-group.search,
#section-trailers .unit-filterbar .filter-group.search,
#section-drivers .unit-filterbar .filter-group.search {
    flex: 0 0 220px;
    min-width: 220px;
}

.fleet-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: auto;
}

.fleet-toolbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--gray-500);
    box-shadow: none;
}

.fleet-toolbar-icon:hover {
    border: 0;
    background: rgba(29, 155, 209, 0.08);
    color: var(--primary);
    box-shadow: none;
}

.fleet-toolbar-icon svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#section-trucks .unit-table-wrapper,
#section-trailers .unit-table-wrapper,
#section-drivers .unit-table-wrapper {
    border: 0;
    border-radius: 0;
    background: #fff;
    max-height: calc(100vh - 225px);
}

#section-trucks .dash-table.unit-table th,
#section-trailers .dash-table.unit-table th,
#section-drivers .dash-table.unit-table th {
    height: 32px;
    padding: 0 10px;
    font-size: 0.625rem;
    color: #8a8f98;
    background: #fff;
    border-bottom: 1px solid rgba(29, 28, 29, 0.13);
    box-shadow: 0 1px 0 rgba(29, 28, 29, 0.04);
}

#section-trucks .dash-table.unit-table td,
#section-trailers .dash-table.unit-table td,
#section-drivers .dash-table.unit-table td {
    height: 36px;
    padding: 0 10px;
    font-size: 0.8rem;
    color: #1d1c1d;
    border-bottom: 1px solid rgba(29, 28, 29, 0.06);
    transition: background 0.08s ease;
}

#section-trucks .dash-table.unit-table tbody tr:hover td,
#section-trailers .dash-table.unit-table tbody tr:hover td,
#section-drivers .dash-table.unit-table tbody tr:hover td {
    background: rgba(29, 28, 29, 0.035);
}

#section-trucks .dash-table.unit-table th:last-child,
#section-trucks .dash-table.unit-table td:last-child,
#section-trailers .dash-table.unit-table th:last-child,
#section-trailers .dash-table.unit-table td:last-child,
#section-drivers .dash-table.unit-table th:last-child,
#section-drivers .dash-table.unit-table td:last-child {
    border-left: 0;
}

#section-trucks .bulk-bar,
#section-trailers .bulk-bar,
#section-drivers .bulk-bar {
    border: 0;
    border-bottom: 1px solid rgba(29, 28, 29, 0.08);
    border-radius: 0;
    padding: 0.4rem 0.85rem;
    background: #fff;
}

@media (max-width: 768px) {
    #section-trucks .unit-filterbar .filter-group.search,
    #section-trailers .unit-filterbar .filter-group.search,
    #section-drivers .unit-filterbar .filter-group.search {
        flex: 1 1 100%;
        min-width: 100%;
    }
}

#section-trucks .dash-table.unit-table th:last-child,
#section-trucks .dash-table.unit-table td:last-child,
#section-trailers .dash-table.unit-table th:last-child,
#section-trailers .dash-table.unit-table td:last-child,
#section-drivers .dash-table.unit-table th:last-child,
#section-drivers .dash-table.unit-table td:last-child {
    width: 108px !important;
    min-width: 108px !important;
    max-width: 108px !important;
    padding: 0 8px !important;
    border-left: 0 !important;
    border-right: 0 !important;
    overflow: visible;
}

#section-trucks .dash-table.unit-table th:nth-last-child(2),
#section-trucks .dash-table.unit-table td:nth-last-child(2),
#section-trailers .dash-table.unit-table th:nth-last-child(2),
#section-trailers .dash-table.unit-table td:nth-last-child(2),
#section-drivers .dash-table.unit-table th:nth-last-child(2),
#section-drivers .dash-table.unit-table td:nth-last-child(2) {
    border-right: 0 !important;
}

#section-trucks .fleet-row-actions .cell,
#section-trailers .fleet-row-actions .cell,
#section-drivers .fleet-row-actions .cell {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    padding: 0;
}

#section-trucks .fleet-row-actions .fleet-action-btn,
#section-trailers .fleet-row-actions .fleet-action-btn,
#section-drivers .fleet-row-actions .fleet-action-btn {
    width: 28px;
    height: 28px;
    opacity: 1;
    visibility: visible;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #7a8491;
    box-shadow: none;
}

#section-trucks .fleet-row-actions .fleet-action-btn svg,
#section-trailers .fleet-row-actions .fleet-action-btn svg,
#section-drivers .fleet-row-actions .fleet-action-btn svg {
    width: 15px;
    height: 15px;
}

#section-trucks .fleet-row-actions .fleet-action-open,
#section-trailers .fleet-row-actions .fleet-action-open,
#section-drivers .fleet-row-actions .fleet-action-open {
    color: #176b95;
    background: #edf7fb;
}

#section-trucks .fleet-row-actions .fleet-action-btn:hover,
#section-trailers .fleet-row-actions .fleet-action-btn:hover,
#section-drivers .fleet-row-actions .fleet-action-btn:hover {
    color: #176b95;
    background: #e8f3f8;
}

#section-trucks .fleet-row-actions .btn-delete:hover,
#section-trailers .fleet-row-actions .btn-delete:hover,
#section-drivers .fleet-row-actions .btn-delete:hover {
    color: #c62f3e;
    background: #fff0f1;
}

#section-trucks .fleet-row-actions .fleet-action-btn:focus-visible,
#section-trailers .fleet-row-actions .fleet-action-btn:focus-visible,
#section-drivers .fleet-row-actions .fleet-action-btn:focus-visible {
    outline: 2px solid #1d9bd1;
    outline-offset: 1px;
}

#section-trucks .fleet-toolbar-actions .fleet-toolbar-icon,
#section-trailers .fleet-toolbar-actions .fleet-toolbar-icon,
#section-drivers .fleet-toolbar-actions .fleet-toolbar-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    padding: 0;
    border: 0 !important;
    border-radius: 6px;
    background: transparent !important;
    color: #697481;
    box-shadow: none !important;
}

#section-trucks .fleet-toolbar-actions .fleet-toolbar-icon:hover,
#section-trailers .fleet-toolbar-actions .fleet-toolbar-icon:hover,
#section-drivers .fleet-toolbar-actions .fleet-toolbar-icon:hover {
    color: #176b95;
    background: #edf7fb !important;
}

#section-trucks .fleet-toolbar-actions .fleet-toolbar-icon:focus,
#section-trailers .fleet-toolbar-actions .fleet-toolbar-icon:focus,
#section-drivers .fleet-toolbar-actions .fleet-toolbar-icon:focus {
    outline: 0;
    box-shadow: none !important;
}

#section-trucks .fleet-toolbar-actions .fleet-toolbar-icon:focus-visible,
#section-trailers .fleet-toolbar-actions .fleet-toolbar-icon:focus-visible,
#section-drivers .fleet-toolbar-actions .fleet-toolbar-icon:focus-visible {
    outline: 2px solid #1d9bd1;
    outline-offset: 1px;
}

#section-task-manager .task-table-wrapper {
    width: 100%;
    min-width: 0;
    max-width: none;
}

#section-task-manager .task-table th,
#section-task-manager .task-table td {
    white-space: nowrap;
}

/* ── Task profile popup ──────────────────────────────────────────────────── */
.modal-task-profile {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(0,0,0,0.22);
    padding: 1rem;
    align-items: center;
    justify-content: center;
}
.modal-task-profile.hidden { display: none !important; }
.modal-task-profile.open   { display: flex; }

/* Override global styles.css .modal-content constraints */
.modal-task-profile .modal-content {
    max-width: none !important;
    width: min(1300px, 96vw) !important;
    max-height: none !important;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
}
.modal-task-profile .tm-task-profile-form-card {
    background: #fff;
    contain: layout paint style;
}
.tm-task-profile-form-card .tpm-profile-tabs {
    display: flex;
    gap: 1.1rem;
    padding: 0 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}
.tm-task-profile-form-card .tpm-profile-tab {
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #9ca3af;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.62rem 0.05rem;
    cursor: pointer;
    text-transform: uppercase;
}
.tm-task-profile-form-card .tpm-profile-tab.active { color: #2563eb; border-bottom-color: #2563eb; }
.tpm-profile-history-pane { flex: 1; min-height: 0; overflow-y: auto; padding: 1.25rem 1.5rem; }
.tpm-profile-history-list { max-width: 760px; }
#tpmProfileAttachBox {
    flex: 0 0 240px;
    min-height: 240px;
    max-height: 240px;
}
#tpmProfileAttachList {
    width: 100%;
    min-height: 100%;
}
#tpmProfileAttachList .tm-form-attach-add:only-child {
    min-height: 100%;
}
.tpm-profile-comments-label { margin-top: 0.75rem !important; }
.tpm-profile-comments {
    display: flex;
    flex: 1;
    min-height: 140px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #fff;
}
.tpm-profile-comments-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    contain: layout paint style;
}
.tpm-profile-comments .tpm-comment-row {
    padding: 0.45rem 0.55rem;
    background: #f8fafc;
}
.tpm-thread {
    border-bottom: 1px solid #eef0f3;
    content-visibility: auto;
    contain-intrinsic-size: auto 38px;
}
.tpm-thread:last-child { border-bottom: 0; }
.tpm-thread-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
    min-height: 38px;
    padding: 0.38rem 0.55rem;
    border: 0;
    background: #fff;
    color: #1f2937;
    text-align: left;
    cursor: pointer;
}
.tpm-thread-summary:hover { background: #f8fafc; }
.tpm-thread-main { min-width: 0; }
.tpm-thread-text {
    display: block;
    overflow: hidden;
    color: #1f2937;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tpm-thread-meta { color: #8a8f98; font-size: 0.64rem; }
.tpm-thread-count { color: #6b7280; font-size: 0.66rem; white-space: nowrap; }
.tpm-thread-body { display: none; padding: 0 0.55rem 0.55rem; background: #fafbfc; }
.tpm-thread.is-open .tpm-thread-body { display: block; }
.tpm-thread-full { margin: 0; padding: 0.5rem 0; color: #374151; font-size: 0.76rem; line-height: 1.4; }
.tpm-reply {
    padding: 0.4rem 0.5rem;
    border-left: 2px solid #dbe3ec;
    background: #fff;
}
.tpm-reply + .tpm-reply { margin-top: 0.3rem; }
.tpm-reply p { margin: 0; color: #374151; font-size: 0.73rem; line-height: 1.35; }
.tpm-reply span { color: #9ca3af; font-size: 0.62rem; }
.tpm-reply-form { display: flex; gap: 0.35rem; margin-top: 0.5rem; }
.tpm-reply-input {
    flex: 1;
    min-width: 0;
    height: 28px;
    padding: 0 0.5rem;
    border: 1px solid #d7dce2;
    border-radius: 5px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    font-size: 0.72rem;
}
.tpm-reply-input:focus { outline: none; border-color: #2563eb; }
.tpm-reply-send,
.tpm-thread-delete {
    height: 28px;
    padding: 0 0.55rem;
    border: 1px solid #d7dce2;
    border-radius: 5px;
    background: #fff;
    color: #374151;
    font-size: 0.68rem;
    cursor: pointer;
}
.tpm-reply-send { border-color: #2563eb; background: #2563eb; color: #fff; }
.tpm-thread-delete { margin-top: 0.45rem; color: #b42318; }

/* Card shell */
.tpm-card {
    display: flex;
    flex-direction: column;
    width: min(1300px, 96vw);
    height: min(880px, 94vh);
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.12);
    box-shadow: 0 32px 80px rgba(0,0,0,0.26);
    overflow: hidden;
}

/* Both task workflows use the exact same modal shell. */
.modal-task-form .tm-profile-form-card,
.modal-task-profile .tm-profile-form-card {
    width: min(1300px, 96vw) !important;
    height: min(880px, 94vh) !important;
    max-width: 96vw !important;
    max-height: 94vh !important;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 10px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.26);
}

/* Header */
.tpm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.1rem;
    height: 48px;
    min-height: 48px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}
.tpm-header-id {
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.02em;
}
.tpm-header-actions {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.tpm-hdr-btn {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}
.tpm-hdr-btn:hover { background: #f3f4f6; color: #374151; }
.tpm-close {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}
.tpm-close:hover { background: #f3f4f6; color: #111827; }

/* Body: two-column */
.tpm-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}
.tm-task-profile-form-card .tpm-body[hidden],
.tm-task-profile-form-card .tpm-profile-history-pane[hidden] {
    display: none !important;
}

/* Left panel */
.tpm-left {
    padding: 1.4rem 1.6rem;
    overflow-y: auto;
    border-right: 1px solid #e5e7eb;
    background: #fff;
    contain: layout paint style;
}
.tpm-task-title {
    margin: 0 0 1.4rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}
.tpm-section-label {
    margin: 0 0 0.45rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: none;
}
.tpm-desc-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: 0.6rem 0.75rem;
    font: inherit;
    font-size: 0.84rem;
    color: #1f2937;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow-y: auto;
    white-space: pre-wrap;
}
.tpm-desc-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.18);
}
.tpm-post-row {
    display: flex;
    justify-content: flex-end;
    margin: 0.4rem 0 1.2rem;
}
.tpm-post-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.36rem 0.9rem;
    cursor: pointer;
    transition: background 0.12s;
}
.tpm-post-btn:hover { background: #1d4ed8; }

/* Drop zone */
.tpm-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border: 1.5px dashed #d1d5db;
    border-radius: 8px;
    padding: 1.2rem;
    text-align: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 0.78rem;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 0.5rem;
}
.tpm-dropzone:hover { border-color: #3b82f6; background: #eff6ff; }
.tpm-browse-link { color: #2563eb; font-weight: 600; text-decoration: underline; cursor: pointer; }
.tpm-dropzone-hint { font-size: 0.7rem; color: #9ca3af; margin: 0; }
.tpm-caption-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.36rem 0.6rem;
    font: inherit;
    font-size: 0.78rem;
    color: #374151;
    box-sizing: border-box;
    margin-bottom: 0.6rem;
}
.tpm-caption-input:focus { outline: none; border-color: #3b82f6; }

.tpm-entity-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.2rem; }
.tpm-entity-label { font-size: 0.82rem; font-weight: 600; color: #1f2937; }

/* Right panel */
.tpm-right {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    contain: layout paint style;
}
.tpm-details-heading {
    margin: 0;
    padding: 0.9rem 1rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.tpm-detail-rows {
    padding: 0.4rem 0;
    flex-shrink: 0;
}
.tpm-dr {
    display: flex;
    align-items: center;
    padding: 0.38rem 1rem;
    gap: 0.6rem;
    border-bottom: 1px solid #f9fafb;
    min-height: 36px;
}
.tpm-dr:hover { background: #f9fafb; }
.tpm-dr-label {
    width: 80px;
    min-width: 80px;
    font-size: 0.74rem;
    color: #6b7280;
    font-weight: 500;
}
.tpm-dr-field {
    flex: 1;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    font: inherit;
    font-size: 0.8rem;
    color: #111827;
    padding: 0.22rem 0.4rem;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.tpm-dr-field:hover, .tpm-dr-field:focus {
    border-color: #d1d5db;
    background: #fff;
    outline: none;
}
.tpm-dr-field:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }

.tm-profile-form-card .tpm-dr-field,
.tm-profile-form-card .form-select,
.tm-profile-form-card .form-input {
    min-height: 32px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    font-size: 0.8rem;
    padding: 0.22rem 0.4rem;
    outline: none;
    box-shadow: none;
}
.tm-profile-form-card .tpm-dr-field:hover,
.tm-profile-form-card .tpm-dr-field:focus,
.tm-profile-form-card .form-select:hover,
.tm-profile-form-card .form-select:focus,
.tm-profile-form-card .form-input:hover,
.tm-profile-form-card .form-input:focus {
    border-color: transparent;
    background: transparent;
    outline: none;
    box-shadow: none;
}
.tpm-details-heading { display: flex; align-items: center; justify-content: space-between; }
.tpm-recurring-toggle { display: inline-flex; align-items: center; cursor: pointer; color: #9ca3af; }
.tpm-recurring-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.tpm-recurring-symbol { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; font-size: 1.1rem; line-height: 1; border-radius: 5px; }
.tpm-recurring-toggle:hover .tpm-recurring-symbol,
.tpm-recurring-toggle input:checked + .tpm-recurring-symbol { color: #4f46e5; background: rgba(79,70,229,0.08); }
.tpm-priority-dots { display: inline-flex; align-items: center; gap: 0.28rem; }
.tpm-priority-dots button { width: 9px; height: 9px; padding: 0; border: 1px solid #cbd5e1; border-radius: 50%; background: #fff; cursor: pointer; }
.tpm-priority-dots button:hover { border-color: #4f46e5; transform: scale(1.15); }
.tpm-priority-dots button.is-active { border-color: #4f46e5; background: #4f46e5; box-shadow: 0 0 0 2px rgba(79,70,229,0.12); }
.tpm-priority-value { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tpm-recurring-days-row { display: none; }
.tpm-recurring-days-row.is-visible { display: flex; }
.tpm-recurring-days-field { display: flex; align-items: center; gap: 0.35rem; flex: 1; color: #9ca3af; font-size: 0.74rem; }
.tpm-recurring-days-field .tpm-dr-field { width: 70px; flex: 0 0 70px; }

/* Tabs */
.tpm-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
    padding: 0 0.75rem;
    flex-shrink: 0;
    margin-top: auto;
}
.tpm-tab {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    padding: 0.55rem 0.6rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tpm-tab.active { color: #2563eb; border-bottom-color: #2563eb; }

/* Panes */
.tpm-pane { display: none; flex: 1; overflow-y: auto; }
.tpm-pane.active { display: flex; flex-direction: column; }

/* Comment input row */
.tpm-comment-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.tpm-user-dot {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: #e03e3e;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tpm-comment-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    font: inherit;
    font-size: 0.8rem;
    color: #111827;
    padding: 0.38rem 0.6rem;
    transition: border-color 0.12s, background 0.12s;
    min-height: 30px;
    overflow: hidden;
    white-space: nowrap;
}
.tpm-comment-input:focus { outline: none; border-color: #3b82f6; background: #fff; }
.tpm-comment-send {
    border: none;
    background: #2563eb;
    color: #fff;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.tpm-comment-send:hover { background: #1d4ed8; }

/* Shared list */
.tpm-list { overflow: hidden; }
.tpm-item {
    padding: 0.58rem 0.8rem;
    border-bottom: 1px solid #f3f4f6;
}
.tpm-item:last-child { border-bottom: none; }
.tpm-item-head {
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
    align-items: flex-start;
}
.tpm-item-title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.4;
}
.tpm-item-meta {
    margin: 0.15rem 0 0;
    font-size: 0.68rem;
    color: #9ca3af;
}
.tpm-item-actions {
    display: inline-flex;
    gap: 0.25rem;
    flex-shrink: 0;
}
.tpm-item-actions button, .tpm-item-actions a {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    border-radius: 5px;
    font-size: 0.67rem;
    padding: 0.14rem 0.34rem;
    text-decoration: none;
    cursor: pointer;
}
.tpm-item-actions button:hover, .tpm-item-actions a:hover { background: #f3f4f6; }
.tpm-empty {
    padding: 1rem 0.8rem;
    font-size: 0.76rem;
    color: #9ca3af;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer */
.tpm-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 860px) {
    .modal-task-form,
    .modal-task-profile { padding: 0; }
    .modal-task-form .modal-content,
    .modal-task-profile .modal-content { width: 100vw !important; }
    .tpm-card { width: 100vw; height: 100dvh; border-radius: 0; }
    .tpm-body { grid-template-columns: 1fr; }
    .tpm-right { border-left: none; border-top: 1px solid #e5e7eb; max-height: 50vh; }
}

/* ══════════════════════════════════════
   LOAD FORM (lf-*) — sectioned modal
   ══════════════════════════════════════ */
.lf-modal {
    width: 96vw;
    max-width: 1100px;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lf-modal.lf-modal-rc-docked {
    width: 98vw;
    max-width: 1600px;
}

.lf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 1.1rem;
    border-bottom: 1px solid rgba(0,0,0,.07);
    flex-shrink: 0;
}
.lf-header h2 { font-size: .9rem; font-weight: 700; margin: 0; }
.lf-header-actions { display: flex; align-items: center; gap: .45rem; }

.lf-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.lf-rc-pane {
    width: 0;
    min-width: 0;
    display: none;
    flex-direction: column;
    border-right: 1px solid rgba(0,0,0,.08);
    background: #eef3f9;
}

.lf-body.lf-rc-docked .lf-rc-pane {
    display: flex;
    width: min(44vw, 640px);
    min-width: 340px;
}

.lf-rc-pane.hidden {
    display: none !important;
}

.lf-rc-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    background: #fff;
    border-bottom: 1px solid #dbe3ee;
}

.lf-rc-pane-title-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.lf-rc-pane-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
}

.lf-rc-pane-file {
    font-size: 0.68rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}

.lf-rc-pane-close {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 0.2rem;
    cursor: pointer;
}

.lf-rc-pane-close:hover {
    color: #334155;
}

.lf-rc-pane-progress-wrap {
    padding: 0.45rem 0.7rem;
    border-bottom: 1px solid #dbe3ee;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lf-rc-pane-progress-track {
    height: 5px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.lf-rc-pane-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: #3b82f6;
    transition: width 0.25s ease, background 0.25s ease;
}

.lf-rc-pane-progress-bar.is-done {
    background: #10b981;
}

.lf-rc-pane-progress-bar.is-error {
    background: #ef4444;
}

.lf-rc-pane-status {
    font-size: 0.68rem;
    color: #64748b;
    min-height: 1em;
}

.lf-rc-pane-mount {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.lf-rc-pane-mount .rc-reader-left {
    height: 100%;
    border-right: none;
    border-radius: 0;
    padding: 0.65rem;
}

/* sticky left nav */
.lf-nav {
    width: 130px;
    flex-shrink: 0;
    border-right: 1px solid rgba(0,0,0,.07);
    background: #f8fafc;
    overflow-y: auto;
    padding: .6rem 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.lf-nav-item {
    display: block;
    padding: .42rem .75rem;
    font-size: .72rem;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all .15s;
}
.lf-nav-item:hover { color: #374151; background: rgba(0,0,0,.04); }
.lf-nav-item.active { color: #4f46e5; border-left-color: #4f46e5; background: rgba(79,70,229,.05); }

/* scrollable form panel */
.lf-form {
    flex: 1;
    overflow-y: auto;
    padding: .9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #f5f7fb;
}

/* section card */
.lf-section {
    margin-bottom: .85rem;
    scroll-margin-top: .5rem;
    border: 1px solid #dde4ee;
    border-radius: 10px;
    background: #ffffff;
    padding: .65rem .75rem .75rem;
}

.lf-section.is-active {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
.lf-section-head {
    font-size: .64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    margin-bottom: .55rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid #e7edf5;
}

/* grid layouts */
.lf-grid { display: grid; gap: .45rem; }
.lf-g1  { grid-template-columns: 1fr; }
.lf-g2  { grid-template-columns: 1fr 1fr; }
.lf-g3  { grid-template-columns: repeat(3,1fr); }
.lf-g4  { grid-template-columns: repeat(4,1fr); }
.lf-span2 { grid-column: span 2; }

/* individual field */
.lf-field {
    display: flex;
    flex-direction: column;
    gap: .18rem;
}
.lf-field label, .lf-muted-lbl {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #9ca3af;
}
.lf-field input,
.lf-field select,
.lf-field textarea {
    font-size: .78rem;
    padding: .32rem .45rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s;
}
.lf-field input:focus,
.lf-field select:focus,
.lf-field textarea:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(99,102,241,.15);
}
.lf-field textarea { resize: vertical; }
.lf-check { justify-content: center; }
.lf-check label { display: flex; align-items: center; gap: .35rem; font-size: .75rem; text-transform: none; color: #374151; letter-spacing: 0; font-weight: 500; cursor: pointer; }

/* computed display (RPM, total) */
.lf-computed {
    font-size: .82rem;
    font-weight: 700;
    color: #4f46e5;
    padding: .32rem .45rem;
    background: #f0f4ff;
    border-radius: 6px;
    min-height: 30px;
    display: flex;
    align-items: center;
}
.lf-total { background: #ecfdf5; color: #065f46; }

.lf-inline-note {
    min-height: 34px;
    display: flex;
    align-items: center;
    padding: .38rem .48rem;
    border: 1px dashed #d6deea;
    border-radius: 6px;
    background: #f8fafc;
    color: #64748b;
    font-size: .74rem;
    line-height: 1.35;
}

.lf-warning-box {
    margin-top: .55rem;
    padding: .55rem .65rem;
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fff8e6;
    color: #92400e;
    font-size: .74rem;
    line-height: 1.4;
}

.lf-warning-box.hidden {
    display: none;
}

/* stop cards */
.lf-stop-card {
    display: flex;
    align-items: flex-start;
    margin-bottom: .6rem;
    background: #fbfdff;
    border: 1px solid #dfe7f2;
    border-radius: 8px;
    padding: .6rem .7rem;
    position: relative;
}
.lf-stop-badge {
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .05em;
    padding: .22rem .4rem;
    border-radius: 5px;
    flex-shrink: 0;
    margin-top: 1px;
}
.lf-pu  { background: #dbeafe; color: #1d4ed8; }
.lf-del { background: #dcfce7; color: #15803d; }
.lf-stop-body { flex: 1; min-width: 0; }

.lf-stop-corner-label {
    position: absolute;
    top: .42rem;
    right: .65rem;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: #1f2937;
}

.lf-stop-sections {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding-top: .35rem;
}

.lf-stop-subsection {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0.58rem 0.2rem 0.5rem;
}

.lf-stop-subsection + .lf-stop-subsection {
    border-top: 1px dashed #cfd8e3;
}

.lf-stop-subhead {
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: .42rem;
}

.lf-stop-subsection .lf-grid {
    padding-top: 0;
}

.lf-stop-subsection-time .lf-stop-subhead {
    color: #4b5563;
}

.lf-stop-subsection-time .lf-field input,
.lf-stop-subsection-time .lf-field select {
    background: #fbfdff;
}

.lf-stopoff-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.lf-stop-card-stopoff {
    border-color: #d9e2f4;
    background: #f8fbff;
}

.lf-stop-remove {
    margin-left: auto;
    border: none;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.22rem 0.45rem;
    cursor: pointer;
}

.lf-stop-remove:hover {
    background: rgba(239, 68, 68, 0.16);
}

.lf-add-stop-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .72rem;
    font-weight: 600;
    color: #6366f1;
    background: none;
    border: 1px dashed #c7d2fe;
    border-radius: 6px;
    padding: .35rem .65rem;
    cursor: pointer;
    transition: all .15s;
    margin-top: .15rem;
}
.lf-add-stop-btn:hover { background: #f0f4ff; border-color: #6366f1; }

/* documents list */
.lf-doc-list { display: flex; flex-direction: column; gap: .35rem; }
.lf-doc-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .42rem .55rem;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #f3f4f6;
}
.lf-doc-lbl { font-size: .72rem; font-weight: 700; color: #374151; width: 110px; flex-shrink: 0; }
.lf-doc-status { font-size: .72rem; color: #9ca3af; flex: 1; }
.lf-doc-status.attached { color: #059669; font-weight: 600; }
.lf-doc-attach {
    font-size: .68rem;
    font-weight: 600;
    color: #6366f1;
    cursor: pointer;
    padding: .18rem .5rem;
    border: 1px solid #c7d2fe;
    border-radius: 5px;
    transition: all .15s;
}
.lf-doc-attach:hover { background: #f0f4ff; }

/* Broker profile analytics modal */
.broker-profile-modal {
    max-width: min(1100px, 96vw);
    max-height: 88vh !important;
    overflow-y: auto !important;
}
.broker-profile-modal::-webkit-scrollbar { width: 7px; }
.broker-profile-modal::-webkit-scrollbar-track { background: transparent; }
.broker-profile-modal::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.14); border-radius: 4px; }

.broker-profile-body {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.broker-profile-meta {
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 600;
}

.broker-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.broker-kpi-card {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    background: #f9fafb;
    padding: 0.4rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.broker-kpi-label {
    font-size: 0.65rem;
    color: #6b7280;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.broker-kpi-card strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}

.broker-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.broker-chart-card {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    background: #ffffff;
    padding: 0.75rem 0.8rem;
}

.broker-chart-card h3 {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.broker-chart-canvas-wrap {
    position: relative;
    height: 110px;
}

.broker-chart-canvas-wrap-wide {
    height: 120px;
}

.broker-chart-wide {
    grid-column: 1 / -1;
}

@media (max-width: 980px) {
    .broker-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .broker-chart-grid { grid-template-columns: 1fr; }
}

.broker-related-section {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    background: #ffffff;
    padding: 0.75rem 0.8rem;
}

.broker-related-grid-wrap {
    max-height: 280px;
    overflow-y: auto;
}
.broker-related-grid-wrap::-webkit-scrollbar { width: 6px; }
.broker-related-grid-wrap::-webkit-scrollbar-track { background: transparent; }
.broker-related-grid-wrap::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }

.broker-related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
}

@media (max-width: 980px) {
    .broker-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .broker-related-grid { grid-template-columns: 1fr; }
}

.broker-related-card {
    padding: 0;
}

.broker-related-title {
    margin: 0 0 0.3rem;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--gray-500, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.broker-related-list {
    display: flex;
    flex-direction: column;
}

.broker-related-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.4rem;
    font-size: 0.72rem;
    padding: 0.32rem 0;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
}
.broker-related-list .broker-related-row:last-child {
    border-bottom: none;
}

.broker-related-name,
.broker-related-name-link {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--gray-800, #1f2937);
    font-weight: 500;
}

.broker-related-name-link {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}
.broker-related-name-link:hover { color: var(--primary, #4f46e5); text-decoration: underline; text-underline-offset: 2px; }

.broker-related-sub {
    flex-shrink: 0;
    font-size: 0.62rem;
    color: var(--gray-400, #9ca3af);
}

.broker-related-value {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--gray-600, #4b5563);
}

.broker-related-empty {
    margin: 0;
    font-size: 0.68rem;
    color: var(--gray-400, #9ca3af);
}
 .broker-loads-section {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    background: #ffffff;
    padding: 0.75rem 0.8rem;
}

.broker-loads-title {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.broker-loads-table-wrap {
    max-height: 328px;
    overflow-y: auto;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
}
.broker-loads-table-wrap::-webkit-scrollbar { width: 6px; }
.broker-loads-table-wrap::-webkit-scrollbar-track { background: transparent; }
.broker-loads-table-wrap::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }

.broker-loads-table {
    width: 100%;
    border-collapse: collapse;
}

.broker-loads-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    height: 28px;
    padding: 0 10px;
    font-size: 0.625rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #fafbfc;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    text-align: left;
    white-space: nowrap;
}

.broker-loads-table tbody tr {
    height: 30px;
    cursor: pointer;
    transition: background 0.12s;
}

.broker-loads-table tbody tr:hover {
    background: #f3f4f6;
}

.broker-loads-table tbody tr + tr td {
    border-top: 1px solid #f1f2f4;
}

.broker-loads-table td {
    padding: 0 10px;
    font-size: 0.78rem;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0;
}

.broker-loads-empty {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
}

/* responsive */
@media (max-width: 860px) {
    .lf-nav { display: none; }
    .lf-g4 { grid-template-columns: 1fr 1fr; }
    .lf-g3 { grid-template-columns: 1fr 1fr; }
    .lf-body.lf-rc-docked {
        flex-direction: column;
    }
    .lf-body.lf-rc-docked .lf-rc-pane {
        width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,.08);
        min-height: 280px;
        max-height: 46vh;
    }
    .lf-modal.lf-modal-rc-docked {
        width: 100vw;
        max-width: 100vw;
    }
}
@media (max-width: 560px) {
    .lf-g4, .lf-g3, .lf-g2 { grid-template-columns: 1fr; }
    .lf-span2 { grid-column: auto; }
    .lf-stop-subsection .lf-span2 { grid-column: auto; }
    .lf-stop-corner-label { font-size: .68rem; }
}

/* ── scroll spy: highlight active nav item ── */
.lf-nav-item.lf-nav-active { color: #4f46e5; border-left-color: #4f46e5; background: rgba(79,70,229,.05); }

/* Modal-specific autocomplete list positioning in Add Load fields */
.lf-field {
    position: relative;
}

.lf-field .autocomplete-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 0;
    z-index: 12000;
}

/* Native night mode */
html[data-theme="dark"] .dash-layout.ready,
html[data-theme="dark"] .dash-main {
    background: #101419;
    color: #d8dee5;
}

html[data-theme="dark"] .dash-sidebar {
    background: rgba(20, 25, 31, 0.96);
    border-right-color: #29313a;
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .dash-sidebar-header,
html[data-theme="dark"] .dash-sidebar-footer {
    border-color: #29313a;
}

html[data-theme="dark"] .dash-logo,
html[data-theme="dark"] .dash-page-title,
html[data-theme="dark"] .dash-user-name {
    color: #f1f4f6;
}

html[data-theme="dark"] .dash-nav-item {
    color: #9ba7b3;
}

html[data-theme="dark"] .dash-nav-item:hover {
    color: #dce3e9;
    background: rgba(255, 255, 255, 0.055);
}

html[data-theme="dark"] .dash-nav-item.active {
    color: #70c7e9;
    background: rgba(82, 184, 226, 0.12);
}

html[data-theme="dark"] .dash-topbar {
    background: rgba(16, 20, 25, 0.88);
    border-bottom-color: #29313a;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .topbar-engraved-btn {
    color: #7f8b97;
}

html[data-theme="dark"] .topbar-engraved-btn:hover {
    color: #cbd3da;
    background: rgba(255, 255, 255, 0.055);
}

html[data-theme="dark"] .dash-card {
    background: #171c22;
    border-color: #29313a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

html[data-theme="dark"] .dash-card-header {
    background: #1a2027;
    border-color: #2a333d;
}

html[data-theme="dark"] .dash-layout .btn-secondary {
    color: #c7d0d8;
    background: #20272f;
    border-color: #35404b;
}

html[data-theme="dark"] .dash-layout .btn-secondary:hover {
    color: #74caeb;
    background: #27313a;
    border-color: #46778b;
}

html[data-theme="dark"] .dash-layout .btn-primary {
    color: #07151c;
    background: #63c3e8;
    border-color: #63c3e8;
    box-shadow: none;
}

html[data-theme="dark"] .dash-layout .btn-primary:hover {
    color: #07151c;
    background: #7bcceb;
    border-color: #7bcceb;
    box-shadow: 0 4px 14px rgba(82, 184, 226, 0.2);
}

html[data-theme="dark"] #section-task-manager .tm-card,
html[data-theme="dark"] #section-task-manager .tm-topbar,
html[data-theme="dark"] #section-task-manager .tm-filterbar,
html[data-theme="dark"] #section-task-manager .tm-section-tabs,
html[data-theme="dark"] #section-task-manager .task-table-wrapper,
html[data-theme="dark"] #section-task-manager .load-style-task-card .task-table-wrapper {
    background: #171c22;
    border-color: #2a333d;
}

html[data-theme="dark"] #section-task-manager .tm-section-tab {
    color: #87939f;
}

html[data-theme="dark"] #section-task-manager .tm-section-tab:hover {
    color: #cbd3da;
}

html[data-theme="dark"] #section-task-manager .tm-section-tab.active {
    color: #72c9ea;
    border-bottom-color: #52b8e2;
}

html[data-theme="dark"] #section-task-manager .tm-title {
    color: #edf1f4;
}

html[data-theme="dark"] #section-task-manager .filter-group label {
    color: #7f8b97;
}

html[data-theme="dark"] #section-task-manager .filter-select,
html[data-theme="dark"] #section-task-manager .filter-input,
html[data-theme="dark"] #section-task-manager .load-style-task-card .filter-select,
html[data-theme="dark"] #section-task-manager .load-style-task-card .filter-input {
    color: #dce2e7;
    background: #12171c;
    border-color: #343e48;
}

html[data-theme="dark"] #section-task-manager .filter-input::placeholder {
    color: #697581;
}

html[data-theme="dark"] #section-task-manager .filter-select:hover,
html[data-theme="dark"] #section-task-manager .filter-input:hover {
    border-color: #4a5865;
}

html[data-theme="dark"] #section-task-manager .filter-select:focus,
html[data-theme="dark"] #section-task-manager .filter-input:focus {
    border-color: #52b8e2;
    box-shadow: 0 0 0 3px rgba(82, 184, 226, 0.14);
}

html[data-theme="dark"] #section-task-manager .task-view-toggle {
    background: #11161b;
    box-shadow: inset 0 0 0 1px #2a333d;
}

html[data-theme="dark"] #section-task-manager .toggle-btn {
    color: #8e9aa6;
}

html[data-theme="dark"] #section-task-manager .toggle-btn:hover {
    color: #dce2e7;
    background: #252d35;
}

html[data-theme="dark"] #section-task-manager .toggle-btn.active {
    color: #72c9ea;
    background: #29323b;
    box-shadow: none;
}

html[data-theme="dark"] #section-task-manager .task-table th,
html[data-theme="dark"] #section-task-manager .load-style-task-card .task-table th {
    color: #85919d;
    background: #151a20;
    border-bottom-color: #313a44;
    border-right-color: transparent;
    box-shadow: none;
}

html[data-theme="dark"] #section-task-manager .task-table th.th-sortable:hover {
    color: #cbd3da;
    background: #1d242b;
}

html[data-theme="dark"] #section-task-manager .task-table td,
html[data-theme="dark"] #section-task-manager .load-style-task-card .task-table td,
html[data-theme="dark"] #section-task-manager .task-table .td-task,
html[data-theme="dark"] #section-task-manager .tm-status-pill,
html[data-theme="dark"] .tm-assigned-name {
    color: #cbd3da;
    border-bottom-color: #252d35;
    border-right-color: transparent;
}

html[data-theme="dark"] #section-task-manager .task-table tbody tr:hover td,
html[data-theme="dark"] #section-task-manager .load-style-task-card .task-table tbody tr:hover td {
    background: #20272e;
}

html[data-theme="dark"] #section-task-manager .task-table tbody tr,
html[data-theme="dark"] #section-task-manager .task-table tbody tr:nth-child(even) {
    background: transparent;
}

html[data-theme="dark"] #section-task-manager .task-table tbody tr.row-selected td {
    background: rgba(82, 184, 226, 0.11) !important;
}

html[data-theme="dark"] #section-task-manager .task-table tbody tr.row-overdue td,
html[data-theme="dark"] #section-task-manager .load-style-task-card .task-table tbody tr.row-overdue td {
    background: rgba(225, 74, 97, 0.07);
}

html[data-theme="dark"] #section-task-manager .task-table td.tm-editable:not(.editing):hover,
html[data-theme="dark"] #section-task-manager .task-table .td-task.tm-editable:not(.editing):hover,
html[data-theme="dark"] #section-task-manager .task-table td.editing {
    background: rgba(82, 184, 226, 0.1) !important;
}

html[data-theme="dark"] #section-task-manager .task-table td.editing .fleet-inline-input:not(.tm-name-input) {
    color: #e4e9ed;
    background: #11161b;
    border-color: #465360;
}

html[data-theme="dark"] #section-task-manager .task-table .fleet-inline-input.tm-name-input,
html[data-theme="dark"] #section-task-manager .task-table .task-row-new .tm-new-name-input {
    color: #e4e9ed;
    caret-color: #63c3e8;
}

html[data-theme="dark"] #section-task-manager .task-table .task-row-new .tm-new-name-input::placeholder,
html[data-theme="dark"] #section-task-manager .task-table .fleet-inline-input.tm-name-input::placeholder {
    color: #687480;
}

html[data-theme="dark"] .tm-resolve-cb {
    border-color: #53606d;
}

html[data-theme="dark"] .tm-open-btn {
    color: #687581;
}

html[data-theme="dark"] .tm-open-btn:hover {
    color: #72c9ea;
    background: rgba(82, 184, 226, 0.12);
}

html[data-theme="dark"] .tm-pdot {
    background: #3a444e;
}

html[data-theme="dark"] .tm-pdot-on {
    background: #e6a23c;
}

html[data-theme="dark"] .tm-sp-panel,
html[data-theme="dark"] .tm-ent-panel,
html[data-theme="dark"] .tm-mini-picker,
html[data-theme="dark"] .tm-people-panel,
html[data-theme="dark"] .tm-sp-color-grid {
    color: #d7dee5;
    background: rgba(27, 33, 40, 0.98);
    border-color: #3a4550;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

html[data-theme="dark"] .tm-sp-item,
html[data-theme="dark"] .tm-ent-type-btn,
html[data-theme="dark"] .tm-ent-entity-row,
html[data-theme="dark"] .tm-sp-manage-header,
html[data-theme="dark"] .tm-ent-header,
html[data-theme="dark"] .tm-sp-name-input,
html[data-theme="dark"] .tm-ent-search,
html[data-theme="dark"] .tm-mini-picker-item {
    color: #d7dee5;
}

html[data-theme="dark"] .tm-sp-item:hover,
html[data-theme="dark"] .tm-ent-type-btn:hover,
html[data-theme="dark"] .tm-ent-entity-row:hover,
html[data-theme="dark"] .tm-mini-picker-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .tm-sp-item-active,
html[data-theme="dark"] .tm-ent-type-btn.active,
html[data-theme="dark"] .tm-ent-entity-row.active,
html[data-theme="dark"] .tm-mini-picker-item.active {
    color: #78cceb;
    background: rgba(82, 184, 226, 0.13);
}

html[data-theme="dark"] #section-task-manager .kanban-column {
    background: #13181e;
    border-color: #2c3540;
}

html[data-theme="dark"] #section-task-manager .kanban-column-header,
html[data-theme="dark"] #section-task-manager .task-card {
    background: #1b2128;
    border-color: #303a44;
}

html[data-theme="dark"] .modal-task-form,
html[data-theme="dark"] .modal-task-profile,
html[data-theme="dark"] .modal-resolution {
    background: rgba(4, 7, 10, 0.72);
}

html[data-theme="dark"] .tm-form-card,
html[data-theme="dark"] .tm-task-profile-form-card,
html[data-theme="dark"] .modal-resolution .modal-content,
html[data-theme="dark"] .tpm-profile-comments,
html[data-theme="dark"] .tpm-thread-summary,
html[data-theme="dark"] .tpm-reply,
html[data-theme="dark"] .tpm-footer {
    color: #d7dee5;
    background: #1a2027;
    border-color: #303a44;
}

html[data-theme="dark"] .tpm-right,
html[data-theme="dark"] .tpm-profile-tabs,
html[data-theme="dark"] .tpm-detail-group,
html[data-theme="dark"] .tpm-item,
html[data-theme="dark"] .tpm-thread {
    border-color: #303a44;
}

html[data-theme="dark"] .tpm-task-title,
html[data-theme="dark"] .tpm-item-title,
html[data-theme="dark"] .tpm-thread-text,
html[data-theme="dark"] .tpm-details-heading {
    color: #edf1f4;
}

html[data-theme="dark"] .tpm-desc-input,
html[data-theme="dark"] .tpm-comment-input,
html[data-theme="dark"] .tpm-dr-field,
html[data-theme="dark"] .tm-asset-trigger,
html[data-theme="dark"] .form-assignee-trigger {
    color: #d7dee5;
    background: #12171c;
    border-color: #3a4550;
}

html[data-theme="dark"] .tpm-desc-input::placeholder,
html[data-theme="dark"] .tpm-comment-input::placeholder,
html[data-theme="dark"] .tm-asset-trigger::placeholder,
html[data-theme="dark"] .form-assignee-trigger::placeholder {
    color: #687480;
}

html[data-theme="dark"] .tpm-thread-body,
html[data-theme="dark"] .tpm-comment-row {
    background: #151a20;
}

html[data-theme="dark"] #section-task-manager .tm-toolbar-actions .tm-resolved-btn {
    color: #aab5bf;
    opacity: 1;
    visibility: visible;
}

html[data-theme="dark"] #section-task-manager .tm-toolbar-actions .tm-resolved-btn:hover,
html[data-theme="dark"] #section-task-manager .tm-toolbar-actions .tm-resolved-btn.tm-resolved-btn-active {
    color: #7bd0ef;
    background: rgba(82, 184, 226, 0.13);
}

html[data-theme="dark"] #section-task-manager .tm-row-actions .tm-task-action {
    color: #a5b0ba;
    opacity: 1;
    visibility: visible;
}

html[data-theme="dark"] #section-task-manager .tm-row-actions .tm-task-action:hover {
    color: #d9e0e6;
    background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] #section-task-manager .tm-row-actions .tm-archive-btn:hover {
    color: #ef8996;
    background: rgba(225, 74, 97, 0.11);
}

.profile-nav-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html[data-theme="dark"] .profile-nav-btn {
    color: #a5b0ba;
}

html[data-theme="dark"] #profileArchiveTruckBtn:hover {
    color: #ef8996;
    background: rgba(225, 74, 97, 0.11);
}

html[data-theme="dark"] .fleet-row-actions .fleet-action-btn {
    color: #b5c0ca !important;
    background: rgba(255, 255, 255, 0.045) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

html[data-theme="dark"] .fleet-row-actions .fleet-action-open {
    color: #7bd0ef !important;
    background: rgba(82, 184, 226, 0.14) !important;
}

html[data-theme="dark"] .fleet-row-actions .btn-delete {
    color: #ef8996 !important;
    background: rgba(225, 74, 97, 0.1) !important;
}

html[data-theme="dark"] .modal-task-form .tm-profile-form-card,
html[data-theme="dark"] .modal-task-profile .tm-profile-form-card {
    color: #d7dee5;
    background: #171c22;
    border-color: #35404b;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .modal-task-form .tpm-header,
html[data-theme="dark"] .modal-task-profile .tpm-header {
    color: #d7dee5;
    background: #1b2128;
    border-bottom-color: #35404b;
}

html[data-theme="dark"] .tpm-header-id {
    color: #e8edf1;
}

html[data-theme="dark"] .tpm-hdr-btn,
html[data-theme="dark"] .tpm-close {
    color: #a5b0ba;
}

html[data-theme="dark"] .tpm-hdr-btn:hover,
html[data-theme="dark"] .tpm-close:hover {
    color: #eef2f5;
    background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .modal-task-form .tpm-left,
html[data-theme="dark"] .modal-task-profile .tpm-left {
    color: #d7dee5;
    background: #171c22;
    border-right-color: #303a44;
}

html[data-theme="dark"] .modal-task-form .tpm-right,
html[data-theme="dark"] .modal-task-profile .tpm-right {
    color: #d7dee5;
    background: #1a2027;
}

html[data-theme="dark"] .tpm-task-title,
html[data-theme="dark"] .tm-task-title-input,
html[data-theme="dark"] #taskText {
    color: #f0f3f5;
    background: #171c22 !important;
    border-bottom-color: #303a44;
}

html[data-theme="dark"] .modal-task-form #taskText:focus,
html[data-theme="dark"] .modal-task-form #taskText:focus-visible,
html[data-theme="dark"] .modal-task-profile #tpmTaskName:focus,
html[data-theme="dark"] .modal-task-profile #tpmTaskName:focus-visible {
    color: #f0f3f5 !important;
    background: #171c22 !important;
    border-color: transparent transparent #46525e !important;
    outline: none !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .modal-task-form #taskDescription,
html[data-theme="dark"] .modal-task-form #taskDescription:focus,
html[data-theme="dark"] .modal-task-form #taskDescription:focus-visible,
html[data-theme="dark"] .modal-task-profile #tpmTaskDescription,
html[data-theme="dark"] .modal-task-profile #tpmTaskDescription:focus,
html[data-theme="dark"] .modal-task-profile #tpmTaskDescription:focus-visible {
    color: #d7dee5 !important;
    background: #12171c !important;
    border-color: #46525e !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(82, 184, 226, 0.12) !important;
}

html[data-theme="dark"] .modal-task-form #taskText:-webkit-autofill,
html[data-theme="dark"] .modal-task-form #taskDescription:-webkit-autofill {
    -webkit-text-fill-color: #f0f3f5;
    -webkit-box-shadow: 0 0 0 1000px #171c22 inset !important;
}

html[data-theme="dark"] .tm-task-title-input::placeholder,
html[data-theme="dark"] .tm-task-title-input:empty::before {
    color: #75818d;
}

html[data-theme="dark"] .tpm-section-label,
html[data-theme="dark"] .tpm-dr-label,
html[data-theme="dark"] .tm-form-attach-hint,
html[data-theme="dark"] .tm-linked-assets-empty {
    color: #929eaa;
}

html[data-theme="dark"] .tpm-details-heading {
    color: #aeb8c2;
    background: #1d242b;
    border-bottom-color: #303a44;
}

html[data-theme="dark"] .tpm-detail-group,
html[data-theme="dark"] .tpm-dr,
html[data-theme="dark"] .tm-linked-tabs,
html[data-theme="dark"] .tm-linked-asset-row {
    border-color: #303a44;
}

html[data-theme="dark"] .tpm-dr:hover {
    background: rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .tpm-dr-field:hover,
html[data-theme="dark"] .tpm-dr-field:focus,
html[data-theme="dark"] .tm-profile-form-card .tpm-dr-field:hover,
html[data-theme="dark"] .tm-profile-form-card .tpm-dr-field:focus {
    color: #edf1f4;
    background: #11161b;
    border-color: #4a5865;
}

html[data-theme="dark"] .tm-form-assignee-panel {
    background: #12171c;
    border-color: #3a4550;
}

html[data-theme="dark"] .tm-form-assignee-panel .form-assignee-trigger {
    color: #d7dee5;
    background: transparent;
}

html[data-theme="dark"] .tm-form-attach-box {
    color: #cbd3da;
    background: #12171c;
    border-color: #303a44;
}

html[data-theme="dark"] .tm-form-attach-add {
    color: #9eabb6;
    background: #151b21;
    border-color: #46525e;
}

html[data-theme="dark"] .tm-form-attach-add:hover,
html[data-theme="dark"] .tm-form-attach-box.tm-form-attach-dragover {
    color: #79cceb;
    background: rgba(82, 184, 226, 0.08);
    border-color: #52b8e2;
}

html[data-theme="dark"] .tm-form-attach-label {
    color: #c8d1d9;
}

html[data-theme="dark"] .tm-form-attach-item {
    color: #d7dee5;
    background: #1c232a;
    border-color: #35404b;
}

html[data-theme="dark"] .tm-form-attach-name {
    color: #cbd3da;
}

html[data-theme="dark"] .tm-form-attach-remove {
    color: #aab5bf;
    background: #29323b;
}

html[data-theme="dark"] .tm-linked-tabs {
    background: #171d23;
}

html[data-theme="dark"] .tm-linked-tab {
    color: #8f9ba7;
}

html[data-theme="dark"] .tm-linked-tab:hover {
    color: #d7dee5;
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .tm-linked-tab.active {
    color: #7bd0ef;
    background: rgba(82, 184, 226, 0.13);
}

html[data-theme="dark"] .modal-task-form .tpm-footer,
html[data-theme="dark"] .modal-task-profile .tpm-footer {
    background: #1b2128;
    border-top-color: #35404b;
}

html[data-theme="dark"] .modal-task-form .tpm-footer .btn-secondary,
html[data-theme="dark"] .modal-task-profile .tpm-footer .btn-secondary {
    color: #c7d0d8;
    background: #262e37;
    border-color: #3b4651;
}

html[data-theme="dark"] .modal-task-form .tpm-footer .btn-primary,
html[data-theme="dark"] .modal-task-profile .tpm-footer .btn-primary {
    color: #07151c;
    background: #63c3e8;
    border-color: #63c3e8;
}

html[data-theme="dark"] * {
    scrollbar-color: #3a4550 transparent;
}
