/* ============================================
   CUSTOMERS
   ============================================ */

/* ─── CUSTOMERS ─────────────────────────────────── */
#customers-view { display: none; }
.cust-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.cust-card {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px;
    cursor: pointer; transition: all var(--transition);
}
.cust-card:hover { background: var(--bg-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.cust-card-name { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.cust-card-phone { font-size: 13px; color: var(--text-2); font-family: var(--font-mono); }
.cust-card-stats {
    display: flex; gap: 16px; margin-top: 12px; padding-top: 10px;
    border-top: 1px solid var(--border);
}
.cust-card-stat { font-size: 12px; color: var(--text-2); }
.cust-card-stat strong { color: var(--text-0); font-family: var(--font-mono); }

.cust-detail-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.cust-detail-back {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    font-size: 14px; color: var(--text-2); border: none; background: none;
    font-family: var(--font-body); transition: color var(--transition);
}
.cust-detail-back:hover { color: var(--text-0); }
.cust-detail-info {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px;
}
.cust-info-card {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.cust-info-card h3 {
    font-family: var(--font-mono); font-size: 13px; font-weight: 700;
    color: var(--text-2); text-transform: uppercase; letter-spacing: 0.8px;
    margin-bottom: 14px;
}
.cust-info-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.cust-info-row .label { color: var(--text-2); }
.cust-info-row .value { font-weight: 600; }

.veh-card {
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px;
    margin-bottom: 8px; display: flex; align-items: center;
    justify-content: space-between; cursor: pointer;
    transition: background var(--transition);
}
.veh-card:hover { background: var(--bg-3); }
.veh-card-info { display: flex; flex-direction: column; gap: 2px; }
.veh-card-desc { font-weight: 600; font-size: 14px; }
.veh-card-plate { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }


/* ═══ v3.18 — Customers redesign ═══════════════════════════ */
.muted { color: var(--text-2); }
.mono { font-family: var(--font-mono); }

.cust-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cust-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cust-chips .chip { padding: 6px 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-1);
                    color: var(--text-1); font: 600 12.5px var(--font-body); cursor: pointer; }
.cust-chips .chip span { color: var(--text-2); font-family: var(--font-mono); font-weight: 500; margin-left: 3px; }
.cust-chips .chip.on { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
.cust-chips .chip.on span { color: var(--accent); }
.cust-summary { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 10px; }
.cust-summary b { color: var(--text-0); font-family: var(--font-mono); }
.cust-sort { width: auto; padding: 5px 10px; font-size: 12.5px; }
.cust-empty { text-align: center; color: var(--text-2); padding: 48px 20px; background: var(--bg-1);
              border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; line-height: 1.6; }
.cust-empty b { color: var(--text-0); }

/* avatar: initials in a neutral circle */
.avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
          background: var(--bg-3); color: var(--text-1); font: 700 12.5px var(--font-body); letter-spacing: .3px; }
.avatar.lg { width: 42px; height: 42px; font-size: 14px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; background: var(--accent-glow); color: var(--accent); }

/* car maker logo over an initials fallback */
.brand-badge { position: relative; width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
               background: var(--bg-3); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.brand-badge b { font: 700 10.5px var(--font-body); color: var(--text-1); letter-spacing: .3px; }
.brand-badge img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; opacity: 0; }
.brand-badge.has-logo { background: #f4f5f7; }          /* logos are drawn for light backgrounds */
.brand-badge.has-logo img { opacity: 1; }
.brand-badge.has-logo b { visibility: hidden; }
.brand-badge.none { font-size: 15px; filter: grayscale(1); opacity: .6; }
.brand-badge.sm { width: 22px; height: 22px; border-radius: 6px; }
.brand-badge.sm b { font-size: 8px; }
.brand-badge.lg { width: 44px; height: 44px; border-radius: 10px; }
.brand-badge.lg b { font-size: 13px; }

/* Norwegian number plate: white plate, blue EU band */
.plate-no { display: inline-flex; align-items: stretch; height: 20px; border: 1.5px solid #1b1d22; border-radius: 4px;
            background: #fff; color: #111; font: 700 11.5px var(--font-mono); letter-spacing: .6px; overflow: hidden;
            white-space: nowrap; line-height: 17px; width: max-content; }
.plate-no i { font-style: normal; background: #1f4db8; color: #fff; font-size: 8.5px; padding: 0 3px; display: flex; align-items: flex-end;
              padding-bottom: 1px; letter-spacing: 0; margin-right: 5px; }
.plate-no { padding-right: 5px; }

.car-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.car-cell.sm { gap: 7px; }
.car-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.car-txt > span:not(.plate-no) { font-size: 13px; font-weight: 600; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-txt em { font-style: normal; font-size: 11px; color: var(--text-2); font-weight: 600; background: var(--bg-3); padding: 0 5px; border-radius: 8px; }

/* ── the table ── */
.cust-table-wrap { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
.cust-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cust-table thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-2); text-align: left; padding: 10px 14px;
                       font: 700 11px var(--font-body); text-transform: uppercase; letter-spacing: .8px; color: var(--text-2);
                       border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
.cust-table th.sortable { cursor: pointer; }
.cust-table th.sortable:hover, .cust-table th.sorted { color: var(--text-0); }
.cust-table th i { font-style: normal; font-size: 9px; margin-left: 5px; color: var(--accent); }
.cust-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cust-table tbody tr { cursor: pointer; transition: background .12s; }
.cust-table tbody tr:hover { background: var(--bg-2); }
.cust-table tbody tr:last-child td { border-bottom: none; }
.cust-table th:nth-child(1) { width: 24%; } .cust-table th:nth-child(2) { width: 22%; }
.cust-table .num { text-align: right; font-family: var(--font-mono); white-space: nowrap; width: 90px; }
.cust-table th.num { text-align: right; }
.cust-table .num.strong { font-weight: 700; color: var(--text-0); }
.cust-table a { color: var(--text-0); text-decoration: none; }
.cust-table a:hover { color: var(--accent); text-decoration: underline; }
.who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.who > div { display: flex; flex-direction: column; min-width: 0; }
.who b { font-weight: 700; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small, .two small { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.two { display: flex; flex-direction: column; min-width: 0; }
.two span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-1); }
.c-last { white-space: nowrap; }
.next-pill { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 700; color: var(--accent);
             background: var(--accent-glow); padding: 1px 7px; border-radius: 9px; white-space: nowrap; }
@media (max-width: 1250px) { .cust-table .c-addr { display: none; } }
@media (max-width: 980px)  { .cust-table .c-phone, .cust-table .c-last { display: none; } }

/* ── cards ── */
.cust-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.cust-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.cust-card:hover { transform: none; border-color: var(--border-light); }
.cc-top { display: flex; align-items: center; gap: 12px; }
.cc-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cc-name b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-name small { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-car { min-height: 32px; }
.cc-contact { font-size: 13px; }
.cc-contact a { color: var(--text-1); text-decoration: none; }
.cc-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); padding-top: 10px; }
.cc-stats div { display: flex; flex-direction: column; }
.cc-stats b { font: 700 14px var(--font-mono); color: var(--text-0); }
.cc-stats span { font-size: 11px; color: var(--text-2); }

/* ── detail ── */
.cd-hero { display: flex; gap: 18px; align-items: flex-start; background: var(--bg-1); border: 1px solid var(--border);
           border-radius: var(--radius); padding: 20px; margin-bottom: 14px; }
.cd-id { flex: 1; min-width: 0; }
.cd-id h2 { font-size: 22px; font-weight: 700; margin-bottom: 2px; }
.cd-sub { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.cd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-act { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border);
          background: var(--bg-2); color: var(--text-0); font-size: 13px; text-decoration: none; max-width: 100%;
          white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-act:hover { border-color: var(--accent); color: var(--accent); }
.cd-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.cd-stats > div { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
                  display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cd-stats span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-2); }
.cd-stats b { font: 700 17px var(--font-mono); color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-stats b em { font: 500 11px var(--font-body); color: var(--text-2); font-style: normal; }
.cd-stats small { font-size: 11.5px; color: var(--text-2); }
.cd-stats .hl { border-color: var(--accent); }
.cd-stats .hl b { color: var(--accent); }
.cd-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 14px; }
.cd-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cd-card-head h3 { margin: 0 !important; }
.cd-card-head h3 span { font-family: var(--font-mono); background: var(--bg-3); color: var(--text-2); padding: 1px 7px;
                        border-radius: 9px; font-size: 11px; margin-left: 6px; letter-spacing: 0; }
.cd-notes { font-size: 14px; color: var(--text-1); white-space: pre-line; line-height: 1.55; }
.cd-quote { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 7px 0;
            border-bottom: 1px solid var(--border); font-size: 13px; }
.cd-quote:last-child { border-bottom: none; }
.cd-quote small { color: var(--text-2); font-size: 11.5px; }
.cd-q-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-1); }
.q-st { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 2px 7px; border-radius: 8px;
        background: var(--bg-3); color: var(--text-1); }
.q-st.st-accepted { background: var(--green-dim); color: var(--green); }
.q-st.st-sent { background: var(--accent-glow); color: var(--accent); }
.q-st.st-declined { background: var(--red-dim); color: var(--red); }
.veh-card { gap: 12px; justify-content: flex-start; }
.veh-card-info { flex: 1; min-width: 0; }
.veh-card-desc em { font-style: normal; color: var(--text-2); font-weight: 500; font-size: 12.5px; }
.veh-card-sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.veh-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.veh-card-right small { font-size: 11px; color: var(--text-2); }
.cd-hist tr.future td { color: var(--accent); }
.cd-hist .car-cell > span:not(.plate-no):not(.brand-badge) { font-size: 13px; }
@media (max-width: 1100px) { .cd-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cd-grid { grid-template-columns: 1fr; } }

.cd-more-wrap .extra { display: none; }
.cd-more-wrap.all .extra { display: flex; }
.cd-more-wrap.all tr.extra { display: table-row; }
.cd-more { width: 100%; margin-top: 8px; padding: 9px; border: 1px dashed var(--border-light); border-radius: var(--radius-sm);
           background: none; color: var(--text-1); font: 600 13px var(--font-body); cursor: pointer; }
.cd-more:hover { color: var(--accent); border-color: var(--accent); }
.cust-summary { padding-right: 2px; }
