/* ═══════════════════════════════════════════════════════════════════════
   ZinzaCrm — MS Access-style UI
   Colour palette matches Access 2016/2019:
     Title bar   : #2b579a  (Access blue)
     Ribbon bg   : #f0f0f0  (light grey)
     Ribbon tabs : #e8e8e8 / active #f0f0f0
     Band        : #f0f0f0
     Doc tabs    : #d6d6d6 / active #ffffff
     Content bg  : #ffffff
     Status bar  : #e5e5e5
     Table header: #dce8f5  (light blue tint)
     Table hover : #dce8f5
     Btn hover   : #dce8f5 / border #7cb3e0
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Reset / base ──────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    color: #1a1a1a;
    background: #fff;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════════════════
   TITLE BAR
   ═══════════════════════════════════════════════════════════════════════ */
.ac-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 12px;
    background: #2b579a;
    color: #ffffff;
    flex-shrink: 0;
    user-select: none;
}

.ac-titlebar-logo {
    font-size: 16px;
}

.ac-titlebar-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.ac-titlebar-spacer { flex: 1; }

.ac-titlebar-user {
    font-size: 12px;
    opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════════════════════
   RIBBON
   ═══════════════════════════════════════════════════════════════════════ */
.ac-ribbon {
    background: #f0f0f0;
    border-bottom: 1px solid #c0c0c0;
    flex-shrink: 0;
    user-select: none;
}

/* Ribbon tab label row */
.ac-ribbon-tabs {
    display: flex;
    align-items: flex-end;
    padding: 0 4px;
    background: #e8e8e8;
    border-bottom: 1px solid #c8c8c8;
}

.ac-ribbon-tab {
    padding: 5px 16px 4px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    cursor: pointer;
    position: relative;
    bottom: -1px;
    transition: background 0.1s;
}

.ac-ribbon-tab:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.ac-ribbon-tab.active {
    background: #f0f0f0;
    border-color: #c8c8c8;
    border-bottom-color: #f0f0f0;   /* merges with band */
    color: #1a1a1a;
    font-weight: 600;
}


/* Ribbon band — the icon button area */
.ac-ribbon-band {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 4px 8px;
    min-height: 76px;
    background: #f0f0f0;
}

/* A group of related buttons with a title label at the bottom */
.ac-ribbon-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 6px;
    border-right: 1px solid #d0d0d0;
}

.ac-ribbon-group:last-child {
    border-right: none;
}

.ac-ribbon-group-buttons {
    display: flex;
    align-items: flex-start;
    gap: 2px;
    flex: 1;
    padding-bottom: 2px;
}

.ac-ribbon-group-title {
    font-size: 10px;
    color: #666;
    text-align: center;
    padding: 2px 0 0;
    border-top: 1px solid #d8d8d8;
    letter-spacing: 0.2px;
}

/* Vertical separator between groups */
.ac-ribbon-separator {
    width: 1px;
    background: #d0d0d0;
    margin: 6px 4px;
}

/* Individual ribbon button */
.ac-ribbon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    padding: 4px 8px;
    min-width: 50px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    color: #222;
    transition: background 0.12s, border-color 0.12s;
}

.ac-ribbon-btn:hover:not(:disabled) {
    background: #dce8f5;
    border-color: #7cb3e0;
}

.ac-ribbon-btn:active:not(:disabled) {
    background: #c5d9ef;
    border-color: #5a9fd4;
}

.ac-ribbon-btn:disabled {
    color: #aaa;
    cursor: default;
}

.ac-ribbon-btn-icon {
    font-size: 22px;
    line-height: 1;
}

.ac-ribbon-btn-label {
    font-size: 10.5px;
    text-align: center;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    max-width: 56px;
}

/* ═══════════════════════════════════════════════════════════════════════
   DOCUMENT TAB STRIP  —  "Tabbed Documents" like Access
   ═══════════════════════════════════════════════════════════════════════ */
.ac-doctabs {
    display: flex;
    align-items: flex-end;
    background: #d6d6d6;
    border-bottom: 1px solid #b0b0b0;
    padding: 0 4px;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    user-select: none;
}

.ac-doctab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    min-width: 100px;
    max-width: 200px;
    background: #c8c8c8;
    border: 1px solid #b0b0b0;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    cursor: pointer;
    font-size: 12px;
    color: #333;
    position: relative;
    bottom: -1px;
    transition: background 0.1s;
    flex-shrink: 0;
}

.ac-doctab:hover { background: #e0e0e0; }

.ac-doctab.active {
    background: #ffffff;
    border-color: #b0b0b0;
    border-bottom-color: #ffffff;
    color: #1a1a1a;
    font-weight: 600;
    z-index: 1;
}

.ac-doctab-icon  { font-size: 13px; flex-shrink: 0; }

.ac-doctab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-doctab-close {
    font-size: 10px;
    line-height: 1;
    padding: 1px 3px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    color: #666;
    flex-shrink: 0;
    transition: background 0.1s, color 0.1s;
}

.ac-doctab-close:hover {
    background: #e07070;
    border-color: #c05050;
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════════════════════════════════════════ */
.ac-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 12px 16px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════════════════
   STATUS BAR
   ═══════════════════════════════════════════════════════════════════════ */
.ac-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 22px;
    padding: 0 8px;
    background: #e5e5e5;
    border-top: 1px solid #c0c0c0;
    font-size: 11px;
    color: #444;
    flex-shrink: 0;
    user-select: none;
}

.ac-statusbar-right { color: #888; }

/* ═══════════════════════════════════════════════════════════════════════
   PAGE SCAFFOLD
   Wraps every page's content with a title and a scrollable body.
   ═══════════════════════════════════════════════════════════════════════ */
.page-scaffold {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.page-scaffold-header {
    flex-shrink: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 10px;
}

.page-scaffold-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: #2b579a;
    margin: 0;
}

.page-scaffold-header p {
    font-size: 12px;
    color: #666;
    margin: 2px 0 0;
}

.page-scaffold-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════════════════
   FORM FIELDS
   ═══════════════════════════════════════════════════════════════════════ */
.field {
    width: 100%;
    border: 1px solid #b8cfe0;
    border-radius: 3px;
    background: #ffffff;
    padding: 4px 8px;
    font-size: 12.5px;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.12s, box-shadow 0.12s;
    font-family: inherit;
}

.field:focus {
    border-color: #5a9fd4;
    box-shadow: 0 0 0 2px rgba(90, 159, 212, 0.25);
}

/* ═══════════════════════════════════════════════════════════════════════
   WORKSPACE SHELL  —  sidebar + main content split
   ═══════════════════════════════════════════════════════════════════════ */
.ws-shell {
    display: flex;
    height: 100%;
    min-height: 0;
    gap: 0;
}

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.ps-sidebar {
    display: flex;
    flex-direction: column;
    width: 260px;
    min-width: 200px;
    max-width: 300px;
    flex-shrink: 0;
    min-height: 0;
    background: #f5f9ff;
    border-right: 1px solid #c8ddf0;
    padding: 10px;
    gap: 0;
    overflow: hidden;
}

.ps-filter-label {
    display: grid;
    gap: 3px;
    font-size: 12px;
    color: #444;
    margin-bottom: 8px;
}

.ps-filter-label span { font-weight: 600; }

.ps-card-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #c8ddf0;
    border-radius: 3px;
    background: #ffffff;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
}

.ps-card {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    border-radius: 2px;
    padding: 6px 10px;
    background: transparent;
    color: #1a1a1a;
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
    flex-shrink: 0;
}

.ps-card:hover {
    background: #dce8f5;
    border-color: #7cb3e0;
}

.ps-card--active {
    background: #dce8f5;
    border-color: #5a9fd4;
    font-weight: 500;
}

.ps-card--active:hover { background: #d0e4f5; }

.ps-card-ref {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #2b579a;
}

.ps-card-name {
    font-weight: 500;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}

.ps-card-meta {
    font-size: 11px;
    color: #666;
    margin-top: 1px;
}

.ps-empty {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: #999;
}

.ps-empty--dashed {
    border: 1px dashed #c8ddf0;
    border-radius: 3px;
    background: #f5f9ff;
    padding: 20px 12px;
}

.ps-count {
    flex-shrink: 0;
    padding: 5px 0 0;
    font-size: 11px;
    color: #888;
    text-align: center;
    user-select: none;
}

.ps-api-error {
    color: #cc0000;
    padding: 6px;
    font-size: 12px;
}

/* ── Right-hand content column ──────────────────────────────────────── */
.ws-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 0 0 10px;
    overflow: hidden;
}

.ws-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12.5px;
}

/* ═══════════════════════════════════════════════════════════════════════
   PROJECT DETAILS FORM
   ═══════════════════════════════════════════════════════════════════════ */

/*  Layout: 3 field columns (each label+input inline) + 1 Notes column.
    3 rows of fields; Notes spans all 3 rows in column 4.              */
.pf-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr) 1.4fr;
    grid-template-rows: auto auto auto;
    gap: 5px 12px;
    border: 1px solid #c8ddf0;
    border-radius: 4px;
    background: #f5f9ff;
    padding: 8px 12px;
    flex-shrink: 0;
}

/* Label + input inline */
.pf-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #444;
    min-width: 0;
}

.pf-field span {
    font-size: 11px;
    font-weight: 600;
    color: #2b579a;
    white-space: nowrap;
    flex-shrink: 0;
    /* Wide enough for "Installation Date" — the longest label */
    width: 108px;
}

.pf-field span::after { content: ":"; }

.pf-field .field {
    padding: 3px 6px;
    font-size: 12px;
    border-radius: 2px;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
}

/* Notes: column 4, spans all 3 rows, label above textarea */
.pf-field--notes {
    grid-column: 4;
    grid-row: 1 / 4;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
}

.pf-field--notes span {
    width: auto;
}

.pf-field--notes .field {
    flex: 1;
    resize: none;
    min-height: 80px;
}

/* Inline feedback bar shown above the form after Save / Delete */
.pf-feedback {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 2px;
    border: 1px solid;
}

.pf-feedback--ok  { background: #e6f4ea; color: #1a6b30; border-color: #a8d5b0; }
.pf-feedback--err { background: #fdecea; color: #9b1c1c; border-color: #f5b7b7; }

.pf-textarea {
    resize: vertical;
    min-height: 44px;
    max-height: 80px;
}

/* ═══════════════════════════════════════════════════════════════════════
   LINES SEARCH BAR  —  above the lines table
   ═══════════════════════════════════════════════════════════════════════ */
.lt-searchbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 4px 0;
}

.lt-searchbar .field {
    flex: 1;
    max-width: 280px;
    padding: 3px 8px;
    font-size: 12px;
}

/* Compact variant used when the search sits inside the pagination bar */
.lp-line-search {
    width: 160px;
    padding: 2px 7px !important;
    font-size: 12px;
}

.lt-search-clear {
    background: transparent;
    border: 1px solid #c0c0c0;
    border-radius: 2px;
    padding: 2px 7px;
    font-size: 11px;
    cursor: pointer;
    color: #666;
    line-height: 1.5;
    transition: background 0.1s;
}

.lt-search-clear:hover { background: #fde; color: #a00; }

.lt-search-count {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════
   LINES TABLE  —  Access datasheet style
   ═══════════════════════════════════════════════════════════════════════ */
.lt-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #c8ddf0;
    border-radius: 2px;
    scrollbar-width: thin;
}

.lt-table {
    min-width: 640px;
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

/* Sticky header — stays visible when scrolling down through many lines */
.lt-th--sticky {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #dce8f5;
    color: #1a3a5c;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid #b8cfe0;
    border-right: 1px solid #c8ddf0;
    white-space: nowrap;
}

.lt-th--sticky:last-child { border-right: none; }

.lt-th--center { text-align: center; }
.lt-th--right  { text-align: right;  }

.lt-row {
    border-bottom: 1px solid #e8f0f8;
    cursor: pointer;
    transition: background 0.08s;
}

/* Default alternating rows */
.lt-row--even { background: #ffffff; }
.lt-row--odd  { background: #f5f9ff; }

.lt-row--even:hover,
.lt-row--odd:hover  { background: #dce8f5; }

/* ── Colour-coded status rows ────────────────────────────────────────── */

/* Installed — soft green */
.lt-row--installed            { background: #e8f5e9; }
.lt-row--installed:hover      { background: #d4edda; }

/* In manufacture — soft amber */
.lt-row--inmfg                { background: #fff8e1; }
.lt-row--inmfg:hover          { background: #fff0c0; }

/* Measured only — soft blue (same tint as normal Access hover, just always on) */
.lt-row--measured             { background: #e8f0fc; }
.lt-row--measured:hover       { background: #d8e8f8; }

/* Selected — always wins via specificity */
.lt-row--selected             { background: #c5d9ef !important; }
.lt-row--selected:hover       { background: #b8d0e8 !important; }

.lt-td {
    padding: 4px 12px;
    color: #1a1a1a;
    border-right: 1px solid #e8f0f8;
}

.lt-td:last-child  { border-right: none; }
.lt-td--center     { text-align: center; }
.lt-td--right      { text-align: right;  }

.lt-state {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 12px;
}

/* ── Colour legend ────────────────────────────────────────────────────── */
.lt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    padding: 4px 2px 0;
    font-size: 11px;
}

.lt-legend-item {
    padding: 2px 8px;
    border-radius: 2px;
    border: 1px solid transparent;
    font-weight: 500;
}

.lt-legend--installed { background: #e8f5e9; border-color: #a5d6a7; color: #2e7d32; }
.lt-legend--inmfg     { background: #fff8e1; border-color: #ffe082; color: #7a5800; }
.lt-legend--measured  { background: #e8f0fc; border-color: #90b8e8; color: #1a3a6c; }
.lt-legend--none      { background: #f5f5f5; border-color: #d0d0d0; color: #555; }

/* ═══════════════════════════════════════════════════════════════════════
   PAGINATION BAR
   ═══════════════════════════════════════════════════════════════════════ */
.lp-bar {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #c8ddf0;
    border-radius: 2px;
    background: #f0f6ff;
    padding: 5px 10px;
    font-size: 12px;
    color: #444;
}

.lp-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lp-size-label { font-weight: 600; color: #2b579a; white-space: nowrap; }

.lp-size-select { width: auto; padding: 2px 6px; }

.lp-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lp-btns {
    display: flex;
    align-items: center;
    gap: 3px;
}

.lp-btn {
    border: 1px solid #b8cfe0;
    background: #ffffff;
    border-radius: 2px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    color: #2b579a;
    cursor: pointer;
    transition: background 0.1s;
}

.lp-btn:hover:not(:disabled) { background: #dce8f5; }

.lp-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.lp-page-label {
    min-width: 80px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #555;
}

/* ═══════════════════════════════════════════════════════════════════════
   DATA TABLE  —  generic datasheet (used by Statuses, Payment Terms, etc.)
   ═══════════════════════════════════════════════════════════════════════ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    background: #fff;
}

.data-table thead th {
    background: #dce8f5;
    border: 1px solid #b8cfe0;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    white-space: nowrap;
    color: #1a3a5c;
}

.data-table tbody tr { border-bottom: 1px solid #e8f0f8; transition: background 0.08s; }
.data-table tbody tr:nth-child(even) { background: #f5f9ff; }
.data-table tbody tr:hover { background: #dce8f5; cursor: pointer; }
.data-table tbody tr.selected { background: #c5d9ef; }

.data-table tbody td {
    border-right: 1px solid #e8f0f8;
    padding: 4px 10px;
    color: #1a1a1a;
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════════════
   DATA GRID COMPONENT
   ═══════════════════════════════════════════════════════════════════════ */
.dg-wrapper {
    overflow-y: auto;
    overflow-x: auto;
    flex: 1;
    min-height: 0;
}

.dg-table thead th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.dg-table thead th:hover { background: #c5d9ef; }

.dg-sort-arrow {
    font-size: 9px;
    margin-left: 4px;
    color: #2b579a;
}

.dg-status-bar {
    flex-shrink: 0;
    padding: 2px 10px;
    font-size: 11px;
    color: #666;
    background: #f0f6ff;
    border-top: 1px solid #c8ddf0;
    user-select: none;
}

.dg-state-msg {
    padding: 20px;
    color: #888;
    font-size: 12px;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════
   SPLIT PANEL LAYOUT
   ═══════════════════════════════════════════════════════════════════════ */
.split-layout {
    display: flex;
    height: 100%;
    min-height: 0;
}

.split-list {
    display: flex;
    flex-direction: column;
    width: 28%;
    min-width: 220px;
    max-width: 320px;
    min-height: 0;
    flex-shrink: 0;
}

.split-divider {
    width: 1px;
    background: #c8ddf0;
    flex-shrink: 0;
    margin: 0 8px;
}

.split-detail {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 0 4px;
}

.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 0 8px;
    flex-shrink: 0;
    border-bottom: 1px solid #c8ddf0;
}
.filter-bar input,
.filter-bar select { width: 100%; }

.filter-bar input { flex: 1; }

.detail-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 12px;
}

.detail-section { margin-bottom: 16px; }

.detail-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #2b579a;
    border-bottom: 1px solid #dce8f5;
    padding-bottom: 3px;
    margin-bottom: 10px;
}

.detail-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
}

.detail-form .full-width { grid-column: 1 / -1; }

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #2b579a;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-value {
    font-size: 12.5px;
    color: #1a1a1a;
    min-height: 1.4em;
    word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════════════════
   LINE EDIT PANEL  —  appears below the lines table when a row is
   selected or Add Line is clicked
   ═══════════════════════════════════════════════════════════════════════ */
.le-panel {
    flex-shrink: 0;
    border: 1px solid #b8cfe0;
    border-radius: 3px;
    background: #f5f9ff;
    overflow: hidden;
}

/* Header bar: title on left, action buttons on right */
.le-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: #2b579a;
    color: #fff;
    font-size: 12px;
    flex-wrap: wrap;
}

.le-panel-title {
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

.le-panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Action buttons inside the panel header */
.le-btn {
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 500;
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.4);
    cursor: pointer;
    background: rgba(255,255,255,0.15);
    color: #fff;
    transition: background 0.1s;
    white-space: nowrap;
}

.le-btn:hover:not(:disabled) { background: rgba(255,255,255,0.28); }
.le-btn:disabled              { opacity: 0.5; cursor: default; }

.le-btn--save   { background: #1a7a3a; border-color: #14602d; }
.le-btn--save:hover:not(:disabled) { background: #1d8f44; }

.le-btn--delete { background: #a03020; border-color: #7a2418; }
.le-btn--delete:hover { background: #c03828; }

.le-btn--cancel { background: transparent; }

/* Inline feedback inside the panel header */
.le-feedback {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 2px;
    white-space: nowrap;
}

.le-feedback--ok  { background: #1a7a3a; }
.le-feedback--err { background: #a03020; }

/* Compact form table inside the panel */
.le-form {
    width: 100%;
    padding: 6px 12px;
}

.le-form table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;   /* 4 equal columns — inputs align vertically */
}

.le-form td {
    padding: 3px 8px 3px 0;
    vertical-align: middle;
}

/* Last cell in each row gets no right padding */
.le-form td:last-child { padding-right: 0; }

/* Label + input inline on the same line */
.le-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #444;
}

.le-field span {
    font-size: 11px;
    font-weight: 600;
    color: #2b579a;
    white-space: nowrap;
    /* Fixed width — wide enough for the longest label so all inputs
       start at the same horizontal position within their column.
       If you add a longer label, increase this number to match. */
    width: 128px;
    flex-shrink: 0;
}

.le-field span::after { content: ":"; }

.le-field .field {
    padding: 3px 6px;
    font-size: 12px;
    border-radius: 2px;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
}

/* Checkboxes row — label already inline via .le-check */
.le-checks { gap: 6px; }

.le-check-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    flex: 1;
}

.le-check {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
}

.le-check input[type="checkbox"] {
    width: 13px;
    height: 13px;
    cursor: pointer;
    accent-color: #2b579a;
}

/* Add Line button variant */
.lp-btn--add {
    background: #2b579a;
    color: #fff;
    border-color: #1e4080;
    font-weight: 600;
    white-space: nowrap;
}

.lp-btn--add:hover { background: #1e4080; }

/* ═══════════════════════════════════════════════════════════════════════
   SUBTABS  —  Lines / Snags / Visits
   Classic browser-tab pattern: tabs sit on top of a bordered content box.
════════════════════════════════════════════════════════════════════════ */

.pt-tabbar {
    display: flex;
    gap: 0;
    padding: 12px 12px 0;
    border-bottom: 1px solid #c8d4e0;
}

.pt-tab {
    padding: 7px 20px;
    font-size: 0.82rem;
    font-weight: 500;
    background: #f0f3f7;
    border: 1px solid #c8d4e0;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    color: #666;
    margin-right: 3px;
    position: relative;
    bottom: -1px;
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
}

.pt-tab:hover {
    background: #e2e8f0;
    color: #2b579a;
}

.pt-tab--active {
    background: #fff;
    color: #2b579a;
    font-weight: 600;
    border-color: #c8d4e0;
    border-bottom-color: #fff;
    z-index: 1;
}

.pt-body {
    border: 1px solid #c8d4e0;
    border-top: none;
    background: #fff;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sch-team-bar {
    display: flex;
    gap: 2rem;
    padding: 6px 12px;
    background: #f0f4f8;
    border-bottom: 1px solid #c8d4e0;
    font-size: 0.82rem;
    color: #444;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   CONFIRMATION DIALOG  —  delete line confirmation overlay
   Pure Blazor — no JavaScript. The backdrop click cancels the dialog.
   ═══════════════════════════════════════════════════════════════════════ */
.ac-confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.ac-confirm-dialog {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    padding: 28px 32px;
    min-width: 280px;
    max-width: 380px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ac-confirm-icon  { font-size: 36px; }

.ac-confirm-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.ac-confirm-msg {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.ac-confirm-btns {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.ac-confirm-btn {
    padding: 6px 20px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #c0c0c0;
    background: #f5f5f5;
    color: #333;
    transition: background 0.1s;
}

.ac-confirm-btn:hover { background: #e8e8e8; }

.ac-confirm-btn--danger {
    background: #c0392b;
    border-color: #962d22;
    color: #fff;
}

.ac-confirm-btn--danger:hover { background: #a93226; }

/* ═══════════════════════════════════════════════════════════════════════
   BLAZOR ERROR UI
   ═══════════════════════════════════════════════════════════════════════ */
#blazor-error-ui {
    background: #ffcc00;
    bottom: 22px;               /* sits above the status bar */
    box-shadow: 0 -2px 4px rgba(0,0,0,.2);
    display: none;
    left: 0;
    padding: 8px 16px;
    position: fixed;
    right: 0;
    z-index: 1000;
    font-size: 13px;
}

#blazor-error-ui .reload {
    color: #0050aa;
    font-weight: 600;
    margin-left: 8px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════
   CUSTOMER DETAIL  —  Zoho-inspired card layout
   ═══════════════════════════════════════════════════════════════════════ */

/* Scrollable container for the entire detail area */
.cu-detail {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-bottom: 12px;
}

/* ── Header summary card ─────────────────────────────────────────────── */
.cu-header {
    background: linear-gradient(135deg, #2b579a 0%, #1a3a70 100%);
    border-radius: 6px;
    padding: 14px 18px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex-shrink: 0;
}

.cu-header-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cu-header-icon { font-size: 20px; }

.cu-header-name {
    font-size: 15px;
    font-weight: 700;
    flex: 1;
}

.cu-header-code {
    font-size: 11.5px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 2px 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.cu-header-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.22);
    border: 1px solid rgba(255,255,255,0.3);
}

.cu-header-meta {
    font-size: 12px;
    opacity: 0.88;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.cu-header-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Two-column section grid ─────────────────────────────────────────── */
.cu-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex-shrink: 0;
}

/* ── Section card ────────────────────────────────────────────────────── */
.cu-section {
    background: #fff;
    border: 1px solid #d0dce8;
    border-radius: 6px;
    overflow: hidden;
}

/* Full-width section (Notes, Contacts) */
.cu-section--wide {
    grid-column: 1 / -1;
}

.cu-section-title {
    background: #f0f4f8;
    border-bottom: 1px solid #d0dce8;
    padding: 6px 14px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #2b579a;
}

.cu-section-body {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

/* ── Field row inside a section ──────────────────────────────────────── */
.cu-field {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
}

/* Align label to top when control is a textarea */
.cu-field--top { align-items: flex-start; }
.cu-field--top .cu-field-label { padding-top: 5px; }

.cu-field-label {
    width: 90px;
    flex-shrink: 0;
    font-size: 11.5px;
    font-weight: 600;
    color: #555;
    text-align: right;
    white-space: nowrap;
}

.cu-field-label::after { content: ":"; }

.cu-field .field {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    padding: 4px 8px;
    border: 1px solid #c8d4e0;
    border-radius: 3px;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.1s;
}

.cu-field .field:focus {
    outline: none;
    border-color: #2b579a;
    box-shadow: 0 0 0 2px rgba(43,87,154,0.12);
}

.cu-field textarea.field {
    resize: vertical;
    min-height: 56px;
    font-family: inherit;
    line-height: 1.5;
}

/* Inline checkbox label */
.cu-check-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #333;
    cursor: pointer;
}

.cu-check-inline input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #2b579a;
}

/* ── Notes section ───────────────────────────────────────────────────── */
.cu-notes-body {
    padding: 10px 14px;
}

.cu-notes-body textarea.field {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    font-size: 12.5px;
    padding: 6px 8px;
    border: 1px solid #c8d4e0;
    border-radius: 3px;
    font-family: inherit;
    line-height: 1.5;
    color: #1a1a1a;
}

.cu-notes-body textarea.field:focus {
    outline: none;
    border-color: #2b579a;
    box-shadow: 0 0 0 2px rgba(43,87,154,0.12);
}

/* ── Contacts section header ─────────────────────────────────────────── */
.cu-contacts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: #f0f4f8;
    border-bottom: 1px solid #d0dce8;
    gap: 10px;
    flex-wrap: wrap;
}

.cu-contacts-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #2b579a;
}

.cu-contacts-add {
    font-size: 12px;
    padding: 4px 12px;
    background: #2b579a;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.1s;
}

.cu-contacts-add:hover { background: #1e4080; }

/* ── Contact inline editor ───────────────────────────────────────────── */
.cu-contact-editor {
    border-bottom: 1px solid #d0dce8;
    background: #f8fbff;
}

.cu-contact-editor-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    background: #2b579a;
    color: #fff;
    flex-wrap: wrap;
}

.cu-contact-editor-title {
    font-weight: 600;
    flex: 1;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cu-contact-editor-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cu-contact-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px 16px;
    padding: 10px 14px;
}

/* ── Contacts table wrapper ──────────────────────────────────────────── */
.cu-contacts-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 240px;
}

/* ═══════════════════════════════════════════════════════════════════════
   PROJECT SCHEDULE  —  weekly resource calendar
   Rows = installers, columns = days (Mon–Sun or Mon–Fri)
   ═══════════════════════════════════════════════════════════════════════ */

/* Outer shell — full height, flex column */
.sched-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 0;
}

/* ── Toolbar ──────────────────────────────────────────────────────────── */
.sched-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 6px 10px;
    background: #f0f4f8;
    border: 1px solid #c8ddf0;
    border-radius: 4px;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.sched-nav {
    display: flex;
    align-items: center;
    gap: 3px;
}

.sched-nav-btn {
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #b8cfe0;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    color: #2b579a;
    cursor: pointer;
    transition: background 0.1s;
    white-space: nowrap;
}

.sched-nav-btn:hover { background: #dce8f5; }

.sched-nav-btn--today {
    background: #2b579a;
    color: #fff;
    border-color: #1e4080;
}

.sched-nav-btn--today:hover { background: #1e4080; }

.sched-week-label {
    font-size: 13px;
    font-weight: 700;
    color: #1a3a6c;
    white-space: nowrap;
    flex: 1;
    text-align: center;
}

.sched-toolbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.sched-filter-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: #2b579a;
    white-space: nowrap;
}

.sched-filter-input {
    width: 140px;
    padding: 3px 7px !important;
    font-size: 12px;
}

.sched-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #444;
    cursor: pointer;
    white-space: nowrap;
}

.sched-toggle input[type="checkbox"] {
    cursor: pointer;
    accent-color: #2b579a;
}

/* ── State message ────────────────────────────────────────────────────── */
.sched-state {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #888;
    font-size: 13px;
    padding: 40px;
}

/* ── Grid wrapper — scrollable ────────────────────────────────────────── */
.sched-grid-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
    border: 1px solid #c8ddf0;
    border-radius: 4px;
}

/* ── Schedule table ───────────────────────────────────────────────────── */
.sched-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 700px;
    table-layout: fixed;
    font-size: 12px;
}

/* ── Column header row ────────────────────────────────────────────────── */
.sched-th-installer {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 4;
    width: 160px;
    min-width: 160px;
    background: #2b579a;
    color: #fff;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-right: 2px solid #1a3a6c;
    border-bottom: 2px solid #1a3a6c;
    text-align: left;
}

.sched-th-day {
    position: sticky;
    top: 0;
    z-index: 3;
    min-width: 130px;
    background: #dce8f5;
    text-align: center;
    padding: 4px 6px;
    border-right: 1px solid #c8ddf0;
    border-bottom: 2px solid #b8cfe0;
    vertical-align: middle;
}

.sched-th--today {
    background: #fff3cd;
    border-bottom-color: #e6a800;
}

.sched-th--weekend {
    background: #efefef;
}

.sched-day-name {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #555;
}

.sched-day-num {
    font-size: 17px;
    font-weight: 700;
    color: #1a3a6c;
    line-height: 1.2;
}

.sched-day-num--today {
    display: inline-block;
    background: #2b579a;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    line-height: 28px;
    text-align: center;
    font-size: 14px;
}

/* ── Data rows ────────────────────────────────────────────────────────── */
.sched-row { border-bottom: 1px solid #e8f0f8; }

.sched-row:last-child { border-bottom: none; }

/* Installer name cell — sticky left */
.sched-td-installer {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 160px;
    min-width: 160px;
    background: #f8faff;
    padding: 8px 10px;
    border-right: 2px solid #c8ddf0;
    vertical-align: top;
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.sched-installer-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
}

.sched-installer-name {
    font-size: 12px;
    font-weight: 600;
    color: #1a3a6c;
    line-height: 1.4;
    word-break: break-word;
}

.sched-installer-name--unassigned {
    color: #999;
    font-style: italic;
    font-weight: 400;
}

/* Day cells */
.sched-td-day {
    vertical-align: top;
    padding: 5px 5px;
    min-height: 60px;
    border-right: 1px solid #e8f0f8;
    min-width: 130px;
}

.sched-td--today   { background: #fffef0; }
.sched-td--weekend { background: #f5f5f5; }

/* ── Job card inside a cell ───────────────────────────────────────────── */
.sched-job {
    background: #fff;
    border: 1px solid #d0dce8;
    border-radius: 4px;
    padding: 5px 7px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: box-shadow 0.12s, transform 0.08s;
    overflow: hidden;
}

.sched-job:last-child { margin-bottom: 0; }

.sched-job:hover {
    box-shadow: 0 2px 8px rgba(43,87,154,0.18);
    transform: translateY(-1px);
}

.sched-job-ref {
    font-size: 10px;
    font-weight: 700;
    color: #2b579a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1px;
}

.sched-job-name {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sched-job-scope {
    font-size: 10.5px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sched-type-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.sched-type-badge--visit {
    background: #e3f2fd;
    color: #1565c0;
}

.sched-type-badge--snag {
    background: #fce4ec;
    color: #b71c1c;
}

/* ── Invoice badges ───────────────────────────────────────────────────── */
.inv-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.inv-badge--pending   { background: #f1f5f9; color: #64748b; }
.inv-badge--requested { background: #fef3c7; color: #92400e; }
.inv-badge--paid      { background: #dcfce7; color: #166534; }

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

.lt-muted { color: #94a3b8; font-size: 12px; }

/* ── Legend ───────────────────────────────────────────────────────────── */
.sched-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 10px;
    border-top: 1px solid #e8f0f8;
    background: #fafcff;
    font-size: 11.5px;
    flex-shrink: 0;
}

.sched-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #444;
}

.sched-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Sub-contractor claims ────────────────────────────────────────────── */
.sc-table { font-size: 12px; }
.sc-col-name    { min-width: 140px; }
.sc-col-qty     { width: 50px; }
.sc-col-rate    { width: 80px; }
.sc-col-total   { width: 80px; }
.sc-col-claim   { width: 120px; }
.sc-col-claimed { width: 120px; }
.sc-col-remaining { width: 120px; }
.sc-sub-hd { font-size: 10px; font-weight: 500; color: #64748b; }

.sc-td-claimed   { background: #fef9c3; }
.sc-td-empty     { color: #cbd5e1; }
.sc-td-total     { background: #dbeafe; font-weight: 600; }
.sc-td-remaining { background: #dcfce7; font-weight: 600; }
.sc-row--over td { background: #fee2e2 !important; color: #991b1b; }

.sc-rate-val {
    cursor: pointer;
    color: #0284c7;
    text-decoration: underline dotted;
}
.sc-rate-input {
    width: 72px;
    padding: 2px 4px;
    font-size: 11px;
}
.sc-pct-input {
    width: 58px;
    padding: 2px 4px;
    text-align: center;
}
.sc-pct--over {
    border-color: #dc2626;
    background: #fee2e2;
}

/* ── Claim dialog shell ───────────────────────────────────────────────── */
.sc-claim-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
    max-width: 860px;
    width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.sc-dlg-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-radius: 12px 12px 0 0;
}
.sc-dlg-title  { font-size: 17px; font-weight: 700; color: #0f172a; }
.sc-dlg-subtitle { font-size: 12px; color: #64748b; margin-top: 2px; }
.sc-dlg-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}
.sc-dlg-close:hover { background: #f1f5f9; color: #475569; }

.sc-dlg-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    padding: 0 24px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sc-dlg-badge {
    font-size: 10px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    border-radius: 999px;
    padding: 1px 7px;
    text-transform: none;
    letter-spacing: 0;
}

.sc-claim-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    padding: 12px 24px 0;
}

/* ── Line search ──────────────────────────────────────────────────────── */
.sc-line-search-wrap {
    position: relative;
    margin: 10px 24px 6px;
}
.sc-search-icon {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    pointer-events: none;
}
.sc-line-search {
    width: 100%;
    padding: 7px 32px 7px 30px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
    background: #f8fafc;
    transition: border-color .15s;
}
.sc-line-search:focus {
    outline: none;
    border-color: #0284c7;
    background: #fff;
}
.sc-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 2px 4px;
}
.sc-search-clear:hover { color: #475569; }

/* ── Lines table container ────────────────────────────────────────────── */
.sc-claim-lines-wrap {
    margin: 0 24px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
}
.sc-row--active td { background: #f0f9ff !important; }

/* ── Pagination ───────────────────────────────────────────────────────── */
.sc-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 24px;
}
.sc-page-btn {
    padding: 4px 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    color: #374151;
    transition: background .12s;
}
.sc-page-btn:hover:not(:disabled) { background: #f1f5f9; }
.sc-page-btn:disabled { opacity: .4; cursor: default; }
.sc-page-info { font-size: 12px; color: #64748b; }

/* ── Claim total bar ──────────────────────────────────────────────────── */
.sc-claim-total-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 24px 0;
    padding: 10px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: 13px;
    color: #0369a1;
}
.sc-claim-total-val {
    font-size: 15px;
    font-weight: 700;
    color: #0c4a6e;
}

/* ── Dialog action buttons ────────────────────────────────────────────── */
.sc-dlg-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px 20px;
    border-top: 1px solid #e2e8f0;
    margin-top: 14px;
    position: sticky;
    bottom: 0;
    background: #fff;
    border-radius: 0 0 12px 12px;
}
.sc-btn-save {
    padding: 8px 22px;
    background: #0284c7;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s;
}
.sc-btn-save:hover { background: #0369a1; }
.sc-btn-cancel {
    padding: 8px 18px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background .12s;
}
.sc-btn-cancel:hover { background: #e2e8f0; }

.sc-td-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════════════
   GLOBAL MOBILE OVERRIDES  (≤ 768px)
   ═══════════════════════════════════════════════════════════════════════ */
@@media (max-width: 768px) {

    /* Any table that hasn't been individually wrapped gets a scroll container */
    .lt-wrap, .dg-wrapper, .inv-table-wrap, .cu-contacts-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Split layouts stack vertically on mobile */
    .split-layout {
        flex-direction: column;
    }
    .split-list {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid #c8ddf0;
        max-height: 240px;
    }
    .split-divider { display: none; }
    .split-detail  { padding: 0; }

    /* Workspace shell stacks too */
    .ws-shell { flex-direction: column; }
    .ps-sidebar {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid #c8ddf0;
        max-height: 200px;
    }
    .ws-main { padding: 0; }

    /* Customer detail sections: single column */
    .cu-sections { grid-template-columns: 1fr; }
    .cu-section--wide { grid-column: 1; }

    /* Contact fields: single column */
    .cu-contact-fields { grid-template-columns: 1fr; }

    /* Form grids: single column */
    .pf-form { grid-template-columns: 1fr; }
    .pf-field--notes { grid-column: 1; grid-row: auto; }
    .detail-form { grid-template-columns: 1fr; }
    .sc-claim-form { grid-template-columns: 1fr; }

    /* Pagination bar wraps nicely */
    .lp-bar { flex-direction: column; align-items: flex-start; gap: 6px; }
    .lp-right { width: 100%; justify-content: space-between; }

    /* Ribbon: hide labels and shrink buttons */
    .ac-ribbon-band { min-height: auto; flex-wrap: wrap; }
    .ac-ribbon-btn  { min-width: 40px; padding: 4px 5px; }
    .ac-ribbon-btn-label { display: none; }
    .ac-ribbon-group-title { display: none; }

    /* Content area padding */
    .ac-content { padding: 8px; }

    /* Dialog panels fit the screen */
    .sc-claim-panel { width: 96vw; max-width: 96vw; }
    .ac-confirm-dialog { padding: 20px 16px; min-width: 0; width: 88vw; }
}
