/* ==========================================================
   Car Wash Management — application theme
   Loaded after Bootstrap 5.3. Put site-specific tweaks in
   custom.css rather than editing this file.
   ========================================================== */

/* ---------- Tokens ---------- */

:root {
    --ink:        #13232E;   /* sidebar, headings */
    --ink-2:      #1E3543;
    --surface:    #EEF3F4;   /* page background */
    --card:       #FFFFFF;
    --line:       #DCE4E7;
    --line-soft:  #E9EEF0;
    --text:       #1E2A31;
    --muted:      #61747F;

    --rinse:      #0E7C86;   /* primary */
    --rinse-600:  #0A6169;
    --rinse-50:   #E2F1F2;
    --rinse-400:  #2A8B94;
    --rinse-rgb:  14, 124, 134;
    --on-rinse:   #FFFFFF;

    --suds:       #E39A22;   /* money owed / attention */
    --suds-50:    #FCF1DE;
    --suds-700:   #8A5A0B;

    --ok:         #2B8456;
    --ok-50:      #E3F3EA;
    --bad:        #B93C2A;
    --bad-50:     #FAE8E4;
    --info:       #2B67AE;
    --info-50:    #E5EEF8;

    --plate:      #F5CD2F;
    --chart-expense: #D0701E;

    --radius:     12px;
    --radius-sm:  8px;
    --sidebar-w:  248px;

    --font-ui:    'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-num:   'Barlow Semi Condensed', 'Figtree', sans-serif;

    /* Bootstrap hooks */
    --bs-body-font-family: var(--font-ui);
    --bs-body-font-size:   0.875rem;
    --bs-body-color:       var(--text);
    --bs-body-bg:          var(--surface);
    --bs-border-color:     var(--line);
    --bs-primary:          var(--rinse);
    --bs-primary-rgb:      14, 124, 134;
    --bs-link-color:       var(--rinse);
    --bs-link-color-rgb:   14, 124, 134;
    --bs-link-hover-color: var(--rinse-600);
    --bs-secondary-color:  var(--muted);
    --bs-border-radius:    var(--radius-sm);
}

/* ---------- Base ---------- */

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
}

a { text-decoration: none; }

h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 650; letter-spacing: -0.01em; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

.text-muted, .text-secondary { color: var(--muted) !important; }

.num, .text-end, td.text-end, th.text-end { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--rinse); outline-offset: 2px; }

/* ---------- Shell ---------- */

.app-shell { min-height: 100vh; }

.app-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-w);
}

.app-content {
    flex: 1;
    width: 100%;
    max-width: 1440px;
    padding: 1.5rem 2rem 2.5rem;
}

.app-footer {
    padding: 1rem 2rem 1.5rem;
    color: var(--muted);
    font-size: 0.75rem;
}

/* ---------- Sidebar ---------- */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--ink);
    color: rgba(255, 255, 255, 0.72);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1.25rem 1.25rem 1rem;
    color: #fff;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--rinse);
    color: var(--on-rinse);
    font-size: 1.05rem;
    flex: none;
    overflow: hidden;
}
.brand-mark.has-logo { background: #fff; padding: 3px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-text { min-width: 0; }
.brand-name, .brand-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-num); font-size: 1.25rem; font-weight: 700; letter-spacing: 0.01em; }
.brand-sub  { font-size: 0.75rem; color: rgba(255,255,255,.55); }

.sidebar-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.25rem 1rem 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--rinse);
    color: var(--on-rinse);
    font-weight: 600;
    transition: background-color .15s;
}
.sidebar-cta:hover { background: var(--rinse-400); color: var(--on-rinse); }

.sidebar-nav { flex: 1; padding: 0.25rem 0.75rem 1rem; }

.sidebar-group {
    margin: 1.1rem 0.6rem 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.42);
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 1px 0;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.74);
    font-weight: 500;
    transition: background-color .15s, color .15s;
}

.sidebar-link i { font-size: 1rem; width: 1.1rem; text-align: center; opacity: .85; }

.sidebar-link:hover { background: var(--ink-2); color: #fff; }

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}
.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--plate);
}
.sidebar-link.active i { opacity: 1; color: var(--plate); }

.sidebar-foot { padding: 0.75rem; border-top: 1px solid rgba(255,255,255,.08); }

.sidebar-backdrop { display: none; }

/* ---------- Top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 60px;
    padding: 0 2rem;
    background: rgba(238, 243, 244, 0.88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.topbar-toggle {
    display: none;
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    color: var(--ink);
    padding: 0.25rem;
}

.topbar-date { color: var(--muted); display: flex; align-items: center; gap: 0.5rem; }

.topbar-user { margin-left: auto; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
}
.user-chip:hover, .user-chip[aria-expanded="true"] { background: var(--card); border-color: var(--line); }

.avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.avatar-sm { display: inline-grid; width: 26px; height: 26px; font-size: 0.65rem; vertical-align: middle; }

.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.user-name { font-weight: 600; }
.user-role { font-size: 0.75rem; color: var(--muted); }

/* ---------- Page heading ---------- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title-main {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink);
}

.page-subtitle { margin: 0.25rem 0 0; color: var(--muted); }

.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.breadcrumb { margin-bottom: 0.35rem; font-size: 0.8rem; --bs-breadcrumb-divider-color: var(--muted); }
.breadcrumb-item a { color: var(--muted); }
.breadcrumb-item a:hover { color: var(--rinse); }
.breadcrumb-item.active { color: var(--muted); }

/* Older pages print their own title inside the first card — keep it tidy */
.page-title { font-size: 1rem; font-weight: 650; margin: 0; }

/* ---------- Cards ---------- */

.card {
    --bs-card-border-color: var(--line);
    --bs-card-border-radius: var(--radius);
    --bs-card-inner-border-radius: calc(var(--radius) - 1px);
    --bs-card-cap-bg: transparent;
    --bs-card-spacer-y: 1.25rem;
    --bs-card-spacer-x: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: none;
}

.card.shadow, .card.shadow-sm { box-shadow: none !important; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--line-soft);
    font-weight: 650;
    color: var(--ink);
}
.card-header h5, .card-header h6 { margin: 0; font-size: 0.95rem; }
.card-header.bg-light { background: transparent !important; }

.card-footer { background: transparent; border-top: 1px solid var(--line-soft); }

/* Older KPI cards built with .card.bg-* become calm cards with a colour rule */
.card.bg-primary, .card.bg-success, .card.bg-danger,
.card.bg-warning, .card.bg-info, .card.bg-secondary, .card.bg-dark {
    background: var(--card) !important;
    color: var(--text) !important;
    border-left-width: 4px;
}
.card.bg-primary   { border-left-color: var(--rinse); }
.card.bg-success   { border-left-color: var(--ok); }
.card.bg-danger    { border-left-color: var(--bad); }
.card.bg-warning   { border-left-color: var(--suds); }
.card.bg-info      { border-left-color: var(--info); }
.card.bg-secondary, .card.bg-dark { border-left-color: var(--ink); }

.card[class*="bg-"] h2, .card[class*="bg-"] h3, .card[class*="bg-"] h4 {
    font-family: var(--font-num);
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--ink);
    margin-bottom: 0.1rem;
}
.card[class*="bg-"] h6 { color: var(--muted); font-weight: 500; }
.card.text-white, .card .text-white { color: var(--text) !important; }

/* ---------- KPI strip ---------- */

.kpi-strip {
    display: grid;
    grid-template-columns: repeat(var(--kpi-cols, 4), minmax(0, 1fr));
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.kpi {
    position: relative;
    padding: 1.1rem 1.25rem 1.2rem;
    min-width: 0;
}
.kpi + .kpi { border-left: 1px solid var(--line-soft); }

.kpi-label { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); font-weight: 500; }
.kpi-label i { font-size: 0.95rem; }

.kpi-value {
    margin-top: 0.35rem;
    font-family: var(--font-num);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kpi-value small { font-family: var(--font-ui); font-size: 0.8rem; font-weight: 500; color: var(--muted); margin-left: 0.2rem; }

.kpi-note { margin-top: 0.35rem; font-size: 0.8rem; color: var(--muted); }

.kpi.is-positive .kpi-value { color: var(--ok); }
.kpi.is-negative .kpi-value { color: var(--bad); }
.kpi.is-owed     .kpi-value { color: var(--suds-700); }

.kpi-strip.kpi-stack { grid-template-columns: 1fr; }
.kpi-stack .kpi + .kpi { border-left: 0; border-top: 1px solid var(--line-soft); }

.detail-list dd.count { font-family: var(--font-num); font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.detail-list dt { display: flex; align-items: center; }

a.kpi { color: inherit; transition: background-color .15s; }
a.kpi:hover { background: #F7FAFA; }

/* ---------- Section heading inside content ---------- */

.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.75rem 0 0.75rem;
}
.section-title h2 { margin: 0; font-size: 1rem; font-weight: 650; }
.section-title a { font-weight: 600; }

/* ---------- Number plate (signature element) ---------- */

.plate {
    display: inline-block;
    padding: 0.05rem 0.5rem 0.1rem;
    border: 1.5px solid #111;
    border-radius: 5px;
    background: var(--plate);
    color: #111;
    font-family: var(--font-num);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.35;
    letter-spacing: 0.06em;
    white-space: nowrap;
    box-shadow: inset 0 0 0 1.5px var(--plate), inset 0 0 0 2.5px rgba(0,0,0,.18);
}
.plate-lg { font-size: 1.6rem; padding: 0.1rem 0.8rem; border-width: 2px; border-radius: 7px; }

/* ---------- Pills (status) ---------- */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    background: var(--line-soft);
    color: var(--muted);
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok    { background: var(--ok-50);    color: var(--ok); }
.pill-bad   { background: var(--bad-50);   color: var(--bad); }
.pill-warn  { background: var(--suds-50);  color: var(--suds-700); }
.pill-info  { background: var(--info-50);  color: var(--info); }
.pill-brand { background: var(--rinse-50); color: var(--rinse-600); }
.pill-muted { background: var(--line-soft); color: var(--muted); }

/* Bootstrap badges used across older pages get the same treatment */
.badge {
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: lowercase;
}
.badge::first-letter { text-transform: uppercase; }
.badge.bg-success   { background: var(--ok-50)   !important; color: var(--ok); }
.badge.bg-danger    { background: var(--bad-50)  !important; color: var(--bad); }
.badge.bg-warning   { background: var(--suds-50) !important; color: var(--suds-700); }
.badge.bg-info      { background: var(--info-50) !important; color: var(--info); }
.badge.bg-primary   { background: var(--rinse-50) !important; color: var(--rinse-600); }
.badge.bg-secondary { background: var(--line-soft) !important; color: var(--muted); }
.badge.bg-dark      { background: var(--ink) !important; color: #fff; }

/* ---------- Buttons ---------- */

.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-font-size: 0.875rem;
    --bs-btn-padding-x: 0.95rem;
    --bs-btn-padding-y: 0.5rem;
    --bs-btn-border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.btn-sm {
    --bs-btn-font-size: 0.8rem;
    --bs-btn-padding-x: 0.65rem;
    --bs-btn-padding-y: 0.3rem;
    --bs-btn-border-radius: 7px;
}

.btn-primary {
    --bs-btn-color: var(--on-rinse);      --bs-btn-hover-color: var(--on-rinse);
    --bs-btn-active-color: var(--on-rinse); --bs-btn-disabled-color: var(--on-rinse);
    --bs-btn-bg: var(--rinse);            --bs-btn-border-color: var(--rinse);
    --bs-btn-hover-bg: var(--rinse-600);  --bs-btn-hover-border-color: var(--rinse-600);
    --bs-btn-active-bg: var(--rinse-600); --bs-btn-active-border-color: var(--rinse-600);
    --bs-btn-disabled-bg: var(--rinse);   --bs-btn-disabled-border-color: var(--rinse);
}

.btn-success {
    --bs-btn-bg: var(--ok);               --bs-btn-border-color: var(--ok);
    --bs-btn-hover-bg: #226B45;           --bs-btn-hover-border-color: #226B45;
    --bs-btn-active-bg: #226B45;          --bs-btn-active-border-color: #226B45;
    --bs-btn-disabled-bg: var(--ok);      --bs-btn-disabled-border-color: var(--ok);
}

.btn-danger {
    --bs-btn-bg: var(--bad);              --bs-btn-border-color: var(--bad);
    --bs-btn-hover-bg: #9A3122;           --bs-btn-hover-border-color: #9A3122;
}

.btn-dark {
    --bs-btn-bg: var(--ink);              --bs-btn-border-color: var(--ink);
    --bs-btn-hover-bg: var(--ink-2);      --bs-btn-hover-border-color: var(--ink-2);
}

/* "View" / "Edit" buttons in tables become quiet */
.btn-info {
    --bs-btn-color: var(--rinse-600);     --bs-btn-bg: var(--rinse-50);   --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--on-rinse); --bs-btn-hover-bg: var(--rinse); --bs-btn-hover-border-color: var(--rinse);
    --bs-btn-active-color: var(--on-rinse); --bs-btn-active-bg: var(--rinse-600);
}
.btn-warning {
    --bs-btn-color: var(--suds-700);      --bs-btn-bg: var(--suds-50);    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: #fff;           --bs-btn-hover-bg: var(--suds); --bs-btn-hover-border-color: var(--suds);
    --bs-btn-active-color: #fff;          --bs-btn-active-bg: var(--suds);
}
.btn-secondary, .btn-light {
    --bs-btn-color: var(--text);          --bs-btn-bg: var(--card);       --bs-btn-border-color: var(--line);
    --bs-btn-hover-color: var(--ink);     --bs-btn-hover-bg: var(--surface); --bs-btn-hover-border-color: #C9D4D8;
    --bs-btn-active-color: var(--ink);    --bs-btn-active-bg: var(--line-soft);
}
.btn-outline-primary {
    --bs-btn-color: var(--rinse);         --bs-btn-border-color: var(--rinse);
    --bs-btn-hover-bg: var(--rinse);      --bs-btn-hover-border-color: var(--rinse);
}

.btn.is-busy { opacity: .7; pointer-events: none; }

td .btn + .btn { margin-left: 0.25rem; }

/* ---------- Forms ---------- */

label, .form-label {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink);
}

.form-control, .form-select {
    padding: 0.55rem 0.8rem;
    font-size: 0.875rem;
    border: 1px solid #CFDADE;
    border-radius: var(--radius-sm);
    background-color: #fff;
    color: var(--text);
}
.form-control:focus, .form-select:focus {
    border-color: var(--rinse);
    box-shadow: 0 0 0 3px rgba(var(--rinse-rgb), 0.15);
}
.form-control[readonly], .form-control.bg-light {
    background-color: var(--surface) !important;
    color: var(--ink);
    font-weight: 600;
}
.form-check-input:checked { background-color: var(--rinse); border-color: var(--rinse); }
.form-check-input:focus  { border-color: var(--rinse); box-shadow: 0 0 0 3px rgba(var(--rinse-rgb), .15); }
.form-check-label { font-weight: 500; color: var(--text); }

.form-text, small.text-muted { font-size: 0.78rem; }

textarea.form-control { min-height: 84px; }

.input-group > .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Groups of related fields inside a form */
.form-section { padding: 1.25rem 0; border-top: 1px solid var(--line-soft); }
.form-section:first-child { padding-top: 0; border-top: 0; }
.form-section-title { margin: 0 0 0.9rem; font-size: 0.95rem; font-weight: 650; color: var(--ink); }
.form-section-title small { display: block; margin-top: 0.15rem; font-weight: 400; color: var(--muted); }

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1.25rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--line-soft);
}

/* Old forms separate sections with <hr> */
.card-body hr { border-color: var(--line); opacity: 1; margin: 1.25rem 0; }

/* Checkbox lists (team members, extra services) */
.check-list .form-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}
.check-list .form-check + .form-check { margin-top: 0.4rem; }
.check-list .form-check-input { margin: 0; float: none; }
.check-list .form-check:has(.form-check-input:checked) { border-color: var(--rinse); background: var(--rinse-50); }

/* ---------- Tables ---------- */

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: #F7FAFA;
    --bs-table-hover-bg: #F3F8F8;
    --bs-table-border-color: var(--line-soft);
    margin-bottom: 0;
    font-size: 0.875rem;
    color: var(--text);
}

.table > thead th,
.table > tfoot th {
    padding: 0.65rem 0.85rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.table > tfoot th { color: var(--ink); background: var(--surface); border-top: 1px solid var(--line); }

.table > tbody td { padding: 0.7rem 0.85rem; vertical-align: middle; }

/* Drop the boxy grid look from .table-bordered */
.table-bordered > :not(caption) > * > * { border-width: 0 0 1px 0; }
.table-bordered > :not(caption) > * { border-width: 0; }

/* Key/value detail tables (th in body rows) */
.table > tbody th {
    padding: 0.6rem 0.85rem;
    width: 38%;
    color: var(--muted);
    font-weight: 500;
    background: transparent;
}
.table-sm > tbody th, .table-sm > tbody td { padding: 0.45rem 0.5rem; }

.table-success, .table-success > th, .table-success > td {
    --bs-table-bg: var(--ok-50);
    --bs-table-color: var(--ink);
    font-weight: 700;
}

/* Tables sitting flush inside a card */
.card > .table-responsive > .table > thead th:first-child,
.card > .table-responsive > .table > tbody td:first-child { padding-left: 1.25rem; }
.card > .table-responsive > .table > thead th:last-child,
.card > .table-responsive > .table > tbody td:last-child { padding-right: 1.25rem; }

.table-link { color: var(--ink); font-weight: 600; }
.table-link:hover { color: var(--rinse); }

.empty-state {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--muted);
}
.empty-state i { display: block; font-size: 1.75rem; margin-bottom: 0.5rem; color: #A9B8BF; }

/* ---------- DataTables ---------- */

div.dataTables_wrapper div.dataTables_filter input {
    width: 240px;
    margin-left: 0;
    padding-left: 2rem;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%2361747F' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 0.7rem center;
}
div.dataTables_wrapper div.dataTables_length select { width: auto; display: inline-block; padding-right: 2rem; }
div.dataTables_wrapper div.dataTables_info { padding-top: 0.9rem; color: var(--muted); font-size: 0.8rem; }
div.dataTables_wrapper div.dataTables_paginate { padding-top: 0.6rem; }
div.dataTables_wrapper > .row:first-child { margin-bottom: 0.75rem; align-items: center; }

.page-link { color: var(--text); border-color: var(--line); }
.page-item.active .page-link { background: var(--rinse); border-color: var(--rinse); color: var(--on-rinse); }
.page-link:focus { box-shadow: 0 0 0 3px rgba(var(--rinse-rgb), .15); }

table.dataTable thead > tr > th.sorting::before,
table.dataTable thead > tr > th.sorting::after,
table.dataTable thead > tr > th.sorting_asc::before,
table.dataTable thead > tr > th.sorting_desc::after { opacity: .25; }

/* ---------- Alerts ---------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    border-radius: var(--radius-sm);
    border-width: 1px;
    font-weight: 500;
}
.alert > i { font-size: 1.05rem; line-height: 1.3; }
.alert-success { background: var(--ok-50);    border-color: #BFE3CF; color: #1D5E3C; }
.alert-danger  { background: var(--bad-50);   border-color: #F0C7BF; color: #84281B; }
.alert-warning { background: var(--suds-50);  border-color: #F3D9A8; color: var(--suds-700); }
.alert-info    { background: var(--info-50);  border-color: #C4D7EE; color: #1F4E86; }
.alert-light   { background: var(--surface);  border-color: var(--line); color: var(--text); }

/* ---------- Detail lists ---------- */

.detail-list { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.55rem 1.25rem; }
.detail-list dt { color: var(--muted); font-weight: 500; }
.detail-list dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px dashed var(--line);
}
.total-row .amount { font-family: var(--font-num); font-size: 1.6rem; font-weight: 700; color: var(--ink); }

/* Summary panel that follows the form on wide screens */
@media (min-width: 992px) { .sticky-summary { position: sticky; top: 76px; } }

/* ---------- Workflow stepper (wash job) ---------- */

.stepper { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.stepper li {
    flex: 1;
    position: relative;
    padding-top: 1.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}
.stepper li::before {
    content: '';
    position: absolute;
    top: 0.35rem;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--line);
}
.stepper li::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--line);
}
.stepper li.done::before, .stepper li.done::after { background: var(--rinse); border-color: var(--rinse); }
.stepper li.current { color: var(--ink); }
.stepper li.current::after { border-color: var(--rinse); background: #fff; box-shadow: 0 0 0 4px var(--rinse-50); }
.stepper li.done { color: var(--ink); }

/* ---------- Timeline (status history) ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; }
.timeline li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0.45rem;
    bottom: -0.2rem;
    width: 2px;
    background: var(--line);
}
.timeline li:last-child::before { display: none; }
.timeline li::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0.3rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--rinse);
}
.timeline .when { font-size: 0.78rem; color: var(--muted); }

/* ---------- Report hub ---------- */

.report-tile {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    height: 100%;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    transition: border-color .15s, background-color .15s;
}
.report-tile:hover { border-color: var(--rinse); background: #FAFDFD; color: var(--text); }
.report-tile .tile-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--rinse-50);
    color: var(--rinse-600);
    font-size: 1.2rem;
}
.report-tile .tile-name { font-weight: 650; color: var(--ink); }
.report-tile .tile-desc { font-size: 0.8rem; color: var(--muted); }

/* ---------- Period filter ---------- */

.period-filter { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.period-range { font-size: 0.78rem; color: var(--muted); }

.list-toolbar { display: flex; margin: -0.5rem 0 1rem; }
.list-toolbar .period-filter { flex-direction: row; align-items: center; gap: 0.75rem; }

.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
}
.segmented > a,
.segmented .dropdown > button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}
.segmented > a:hover,
.segmented .dropdown > button:hover { color: var(--ink); background: var(--surface); }
.segmented > a.active,
.segmented .dropdown > button.active { background: var(--rinse); color: var(--on-rinse); }
.period-menu { min-width: 280px; }
.period-menu .dropdown-item.active { background: var(--rinse-50); color: var(--rinse-600); font-weight: 600; }

/* ---------- Change badges ---------- */

.delta { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.delta-good { color: var(--ok); }
.delta-bad  { color: var(--bad); }

.kpi-strip.kpi-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-6 .kpi-value { font-size: 1.75rem; }
@media (min-width: 992px) and (max-width: 1399.98px) {
    .kpi-strip.kpi-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kpi-6 .kpi:nth-child(4) { border-left: 0; }
    .kpi-6 .kpi:nth-child(n+4) { border-top: 1px solid var(--line-soft); }
}

/* ---------- Dashboard charts & leaderboards ---------- */

.chart-box { position: relative; height: 280px; }
.chart-legend { display: flex; gap: 1rem; font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.45rem; flex: none; }
.chart-legend .legend-swatch { margin-right: 0; }

.mini-title { margin: 0 0 0.6rem; font-size: 0.82rem; font-weight: 600; color: var(--muted); }

.hbar { flex: 1; height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.hbar > span { display: block; height: 100%; border-radius: 4px; background: var(--rinse); }
.hbar-expense > span { background: var(--chart-expense); }

.leaderboard td.bar-cell { width: 38%; }
.bar-cell { white-space: nowrap; }
.bar-cell .hbar { display: inline-block; width: calc(100% - 4.5rem); vertical-align: middle; }
.hbar-value { display: inline-block; width: 4.2rem; padding-left: 0.5rem; font-weight: 600; font-variant-numeric: tabular-nums; vertical-align: middle; }

.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.bar-list-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.3rem; }

.split-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line-soft); }
.split-bar > span { display: block; height: 100%; }
.split-0 { background: var(--rinse); }
.split-1 { background: var(--chart-expense); }
.split-2 { background: #6B5BB5; }
.split-3 { background: #3E8E5A; }
.split-4 { background: #9AA9B0; }

.owed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--line-soft);
    color: var(--text);
}
.owed-row:hover { color: var(--text); }
.owed-row:hover .owed-amount { color: var(--rinse-600); }
.owed-amount { font-family: var(--font-num); font-size: 1.45rem; font-weight: 700; color: var(--suds-700); white-space: nowrap; }

@media (max-width: 991.98px) {
    .kpi-strip.kpi-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .period-filter, .list-toolbar .period-filter { flex-direction: column; align-items: stretch; width: 100%; }
    .segmented { width: 100%; }
    .segmented > a, .segmented .dropdown { flex: 1; }
    .segmented > a, .segmented .dropdown > button { justify-content: center; width: 100%; padding: 0.4rem 0.4rem; }
    .period-range { text-align: right; }
    .chart-box { height: 220px; }
}

/* ---------- Wash job lookup ---------- */

.lookup { position: relative; }
.lookup-input { position: relative; }
.lookup-input > .bi-search { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.lookup-input .form-control { padding: 0.75rem 2.5rem 0.75rem 2.4rem; font-size: 1rem; }
.lookup-input .spinner-border { position: absolute; right: 0.9rem; top: 50%; margin-top: -0.5rem; }

.lookup-list {
    position: absolute;
    z-index: 1050;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 380px;
    overflow-y: auto;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(19, 35, 46, 0.12);
}
.lookup-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.lookup-item .plate { flex: none; min-width: 6.5rem; text-align: center; }
.lookup-item.active, .lookup-item:hover { background: var(--rinse-50); }
.lookup-text { min-width: 0; }
.lookup-group { padding: 0.6rem 0.65rem 0.25rem; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.lookup-new { border-top: 1px dashed var(--line); margin-top: 0.25rem; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.lookup-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 6.5rem;
    height: 30px;
    border: 1.5px dashed var(--rinse);
    border-radius: 6px;
    color: var(--rinse);
}
.lookup-item .avatar-sm { width: 6.5rem; border-radius: 6px; height: 30px; }

.lookup-picked {
    padding: 0.85rem 1rem;
    border: 1px solid #BFE3CF;
    border-radius: var(--radius-sm);
    background: var(--ok-50);
}

/* ---------- Payments page ---------- */

.stat-card {
    position: relative;
    display: block;
    height: 100%;
    padding: 1.1rem 1.25rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
}
a.stat-card:hover { border-color: var(--rinse); color: var(--text); }
.stat-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--rinse-50);
    color: var(--rinse-600);
    font-size: 1.05rem;
}
.stat-label { color: var(--muted); font-weight: 500; padding-right: 3rem; }
.stat-value { margin-top: 0.35rem; font-family: var(--font-num); font-size: 1.9rem; font-weight: 700; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-value small { font-family: var(--font-ui); font-size: 0.78rem; font-weight: 500; color: var(--muted); margin-left: 0.25rem; }
.stat-note { margin-top: 0.4rem; font-size: 0.8rem; color: var(--muted); }
.stat-owed .stat-icon  { background: var(--suds-50); color: var(--suds-700); }
.stat-owed .stat-value { color: var(--suds-700); }
.stat-alert { border-color: #F0C7BF; background: #FFFBFA; }
.stat-alert .stat-icon  { background: var(--bad-50); color: var(--bad); }
.stat-alert .stat-value { color: var(--bad); }

.method-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
.method-card {
    position: relative;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.8rem 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    overflow: hidden;
}
.method-card:hover { border-color: var(--rinse); color: var(--text); }
.method-card.active { border-color: var(--rinse); box-shadow: inset 0 0 0 1px var(--rinse); background: #FAFDFD; }
.method-card-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 1rem; }
.method-card.active .method-card-icon { background: var(--rinse); color: var(--on-rinse); }
.method-card-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.method-card-label { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.method-card-value { font-family: var(--font-num); font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.method-card-note { font-size: 0.72rem; color: var(--muted); }
.method-card-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line-soft); }
.method-card-bar > span { display: block; height: 100%; background: var(--rinse); }

.page-tabs { gap: 0.25rem; border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow-x: auto; }
.page-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 0.9rem;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}
.page-tabs a:hover { color: var(--ink); }
.page-tabs a.active { color: var(--ink); border-bottom-color: var(--rinse); }
.tab-count { padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--line-soft); color: var(--muted); font-size: 0.72rem; }
.tab-count.is-alert { background: var(--bad); color: #fff; }

.chip {
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
}
.chip:hover { border-color: var(--rinse); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.filter-bar .form-label { margin-bottom: 0.2rem; color: var(--muted); font-weight: 500; }
.filter-bar .form-select { min-width: 160px; }

tr.is-cancelled td { color: var(--muted); }
tr.is-cancelled td.text-end { text-decoration: line-through; }

.nav-badge {
    margin-left: auto;
    min-width: 20px;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: var(--bad);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
}

.request-list { display: grid; gap: 0.75rem; }
.request {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    border-radius: var(--radius-sm);
}
.request.pending  { border-left-color: var(--suds); background: #FFFDF8; }
.request.approved { border-left-color: var(--bad); }
.request.rejected { border-left-color: #B6C3C9; }
.request-main { flex: 1 1 380px; min-width: 0; }
.request-reason { padding: 0.5rem 0.7rem; border-radius: var(--radius-sm); background: var(--surface); }
.request-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.cancel-summary { padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); background: var(--surface); }

/* Split payment lines */
.pay-line {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1.2fr 1.2fr auto;
    gap: 0.75rem;
    align-items: end;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #FBFCFC;
}
.pay-line + .pay-line { margin-top: 0.6rem; }
.pay-line .form-label { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.pay-line.is-cash { grid-template-columns: 1.1fr 1fr 2.4fr auto; }
.pay-line-remove { height: 38px; width: 38px; padding: 0; grid-column: -2 / -1; justify-self: end; }
.pay-result { padding: 0.65rem 0.8rem; border-radius: var(--radius-sm); font-size: 0.85rem; }
.pay-result.is-ok   { background: var(--ok-50); color: #1D5E3C; }
.pay-result.is-part { background: var(--suds-50); color: var(--suds-700); }
.pay-result.is-over, .pay-result.is-warn { background: var(--bad-50); color: #84281B; }

/* Receipt */
.receipt {
    max-width: 640px;
    padding: 1.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}
.receipt-head { display: flex; align-items: center; gap: 0.9rem; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 2px solid var(--ink); }
.receipt-logo { width: 48px; height: 48px; object-fit: contain; }
.receipt-business { font-family: var(--font-num); font-size: 1.4rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.receipt-no { margin-left: auto; text-align: right; }
.receipt-meta { margin-bottom: 1rem; }
.receipt-lines { margin-top: 0.5rem; }
.receipt-foot { margin-top: 1.25rem; padding-top: 0.9rem; border-top: 1px dashed var(--line); font-size: 0.8rem; color: var(--muted); text-align: center; }

@media (max-width: 1199.98px) { .method-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
    .method-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pay-line, .pay-line.is-cash { grid-template-columns: 1fr 1fr; }
    .pay-line-remove { grid-column: 2; }
    .receipt { padding: 1.1rem; }
}
@media print {
    .receipt { border: 0; max-width: none; padding: 0; }
    .page-head { display: none; }
}

/* ---------- Cash-up ---------- */

.cashup-table td { vertical-align: middle; }
.cashup-table .form-control { max-width: 170px; margin-left: auto; }
.cashup-table .input-group { flex-wrap: nowrap; }
.cashup-table .input-group .form-control { max-width: 140px; }
.cashup-table tr.is-quiet td { opacity: 0.6; }
.cashup-table tr.is-quiet:focus-within td { opacity: 1; }
.cashup-float td { background: var(--surface); }
.denom-row td { border-bottom: 0; }
.denoms { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; padding: 0.75rem 1.25rem 1rem; background: #FBFCFC; border-bottom: 1px solid var(--line-soft); }
.denom { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; font-weight: 500; }
.denom-face { min-width: 3.4rem; padding: 0.15rem 0.4rem; border-radius: 4px; background: var(--ok-50); color: #1D5E3C; font-family: var(--font-num); font-weight: 700; text-align: right; }
.denom .form-control { width: 64px; }
.denom-total { margin-left: auto; }

.diff { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 700; white-space: nowrap; }
.diff-ok    { color: var(--ok); }
.diff-short { color: var(--bad); }
.diff-over  { color: var(--suds-700); }
.stat-value .diff { font-family: var(--font-num); font-size: 1.5rem; }

.cashup-payments { max-height: 420px; overflow-y: auto; }
.cashup-payment { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 1.25rem; border-top: 1px solid var(--line-soft); color: var(--text); }
.cashup-payment:first-child { border-top: 0; }
.cashup-payment:hover { background: var(--surface); color: var(--text); }
.cashup-payment.is-cancelled { color: var(--muted); text-decoration: line-through; }

/* ---------- Accounts & loyalty ---------- */

.account-note { display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 0.75rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); background: var(--info-50); color: #1F4E86; }
.account-note.is-warn { background: var(--suds-50); color: var(--suds-700); }

.loyalty-card { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; margin-top: 0.75rem; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.loyalty-card.is-earned { border-color: #BFE3CF; background: var(--ok-50); }
.loyalty-dots { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }
.loyalty-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #C7D3D8; background: #fff; }
.loyalty-dots span.on { background: var(--rinse); border-color: var(--rinse); }
.loyalty-dots span.gift { border-radius: 4px; border-color: var(--ok); }
.loyalty-dots span.gift.on { background: var(--ok); }

.invoice .receipt-no .fs-5 { font-family: var(--font-num); }
.receipt.invoice, .receipt.statement { max-width: 860px; }

/* ---------- Wash board ---------- */

.board-wrap { --b-bg: var(--surface); --b-col: #E6EDEF; --b-card: #fff; --b-text: var(--text); --b-muted: var(--muted); --b-line: var(--line); }
.board-wrap:fullscreen { padding: 1.25rem; background: var(--b-bg); overflow: auto; }

.board-bar { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; margin-bottom: 1rem; }
.board-stats { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; color: var(--b-muted, var(--muted)); }
.board-stats b { color: var(--b-text, var(--ink)); font-family: var(--font-num); font-size: 1.15rem; margin-right: 0.15rem; }
.board-alert { font-size: 0.85rem; color: var(--suds-700); }
.board-offline { padding: 0.4rem 0.75rem; border-radius: var(--radius-sm); background: var(--bad-50); color: var(--bad); font-weight: 600; }

.board-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.bcol { border-radius: var(--radius); background: var(--b-col); min-height: 320px; }
.bcol > header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.85rem 1rem; font-weight: 700; color: var(--b-text); border-bottom: 3px solid transparent;
}
.bcol > header i { margin-right: 0.4rem; }
.bcol-waiting > header { border-bottom-color: #9AA9B0; }
.bcol-washing > header { border-bottom-color: var(--rinse); }
.bcol-ready   > header { border-bottom-color: var(--ok); }
.bcount { min-width: 2rem; padding: 0.05rem 0.55rem; border-radius: 999px; background: var(--b-card); font-family: var(--font-num); font-size: 1.1rem; text-align: center; color: var(--b-text); }
.bcol-body { display: grid; gap: 0.65rem; padding: 0.75rem; }
.bempty { padding: 2rem 0.5rem; text-align: center; color: var(--b-muted); }

.bcard {
    position: relative;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--b-line);
    border-left: 4px solid #9AA9B0;
    border-radius: var(--radius-sm);
    background: var(--b-card);
    color: var(--b-text);
}
.bcol-washing .bcard { border-left-color: var(--rinse); }
.bcol-ready   .bcard { border-left-color: var(--ok); }
.bcard.is-late { border-left-color: var(--suds); }
.bcard.is-over { border-left-color: var(--bad); }
.bcard.is-new  { animation: bcard-in 1.6s ease-out; }
@keyframes bcard-in { 0% { box-shadow: 0 0 0 4px var(--plate); } 100% { box-shadow: 0 0 0 0 transparent; } }

.bcard-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.bplate { font-size: 1.25rem; padding: 0.1rem 0.6rem; }
a.bplate:hover { color: #111; filter: brightness(1.05); }
.bcard-pkg { font-size: 0.78rem; font-weight: 600; color: var(--b-muted); text-align: right; }
.bcard-car { margin-top: 0.5rem; font-weight: 600; }
.bcard-cust { font-weight: 400; color: var(--b-muted); }
.bcard-team { margin-top: 0.2rem; font-size: 0.82rem; color: var(--b-muted); }
.bcard-team.is-empty { color: var(--suds-700); }
.bcard-time { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.6rem; font-size: 0.85rem; color: var(--b-muted); }
.btimer b { font-family: var(--font-num); font-size: 1.1rem; color: var(--b-text); font-variant-numeric: tabular-nums; }
.bcard.is-over .btimer b, .bcard.is-late .btimer b { color: var(--bad); }
.bbar { height: 6px; margin-top: 0.5rem; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.bbar > span { display: block; height: 100%; background: var(--rinse); border-radius: 3px; transition: width 1s linear; }
.bcard.is-over .bbar > span { background: var(--bad); }
.bcard-actions { display: flex; gap: 0.4rem; margin-top: 0.7rem; }
.bcard-actions:empty { display: none; }

/* TV screen */
body.tv { background: #0F1C24; color: #E8EEF0; min-height: 100vh; }
.tv-head { display: flex; align-items: center; gap: 2rem; padding: 1.1rem 1.75rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.tv-head .board-stats { color: rgba(255,255,255,.6); font-size: 1.05rem; }
.tv-head .board-stats b { color: #fff; font-size: 1.5rem; }
.tv-clock { margin-left: auto; font-family: var(--font-num); font-size: 2.4rem; font-weight: 700; color: #fff; }
.board-dark { --b-bg: #0F1C24; --b-col: #162833; --b-card: #1D3340; --b-text: #F1F5F6; --b-muted: rgba(241,245,246,.62); --b-line: rgba(255,255,255,.06); padding: 1.25rem 1.75rem; }
.board-dark .bcol > header { font-size: 1.3rem; }
.board-dark .bplate { font-size: 1.9rem; }
.board-dark .bcard-car { font-size: 1.15rem; }
.board-dark .btimer b { font-size: 1.5rem; }
.board-dark .bbar { background: rgba(255,255,255,.1); height: 8px; }
.board-dark .bcount { font-size: 1.4rem; }
.board-dark .pill-ok  { background: rgba(43,132,86,.25); color: #7FD3A4; }
.board-dark .pill-bad { background: rgba(185,60,42,.25); color: #F2A194; }
.tv-invalid { max-width: 34rem; margin: 18vh auto 0; text-align: center; color: rgba(255,255,255,.75); }
.tv-invalid i { font-size: 3rem; color: var(--plate); }
.tv-invalid h1 { color: #fff; font-size: 1.8rem; margin: 1rem 0 0.5rem; }

@media (max-width: 991.98px) {
    .board-cols { grid-template-columns: 1fr; }
    .tv-head { flex-wrap: wrap; gap: 0.75rem 1.5rem; }
}

/* ---------- Text messages ---------- */

.placeholder-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.placeholder-chips .chip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.75rem; font-weight: 500; padding: 0.2rem 0.55rem; }
.sms-event { padding: 1rem 0; border-top: 1px solid var(--line-soft); }
.sms-event:first-of-type { border-top: 0; padding-top: 0.25rem; }
.sms-preview { display: flex; gap: 0.5rem; align-items: baseline; margin: 0.45rem 0 0.25rem; padding: 0.55rem 0.75rem; border-radius: 12px 12px 12px 3px; background: var(--rinse-50); color: var(--ink); }
.form-switch .form-check-input { width: 2.4em; }
.form-switch .form-check-label { margin-left: 0.45rem; }
.channel-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.channel-pick .chip { cursor: pointer; margin: 0; font-size: 0.75rem; padding: 0.2rem 0.65rem; }
.btn-check:checked + .chip { background: var(--ink); border-color: var(--ink); color: #fff; }
.wa-box { margin-top: 0.6rem; padding: 0.75rem; border: 1px solid #CFE9DA; border-radius: var(--radius-sm); background: #F6FBF8; }
.wa-body { display: block; margin-top: 0.25rem; padding: 0.4rem 0.55rem; border-radius: 6px; background: #fff; color: var(--ink); white-space: normal; }

/* ---------- Payment method picker ---------- */

.method-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.method-option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.55rem 0.9rem;
    border: 1px solid #CFDADE;
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.method-option i { font-size: 1.05rem; color: var(--muted); }
.method-option:hover { border-color: var(--rinse); }
.btn-check:checked + .method-option { border-color: var(--rinse); background: var(--rinse-50); color: var(--rinse-600); box-shadow: inset 0 0 0 1px var(--rinse); }
.btn-check:checked + .method-option i { color: var(--rinse); }
.btn-check:focus-visible + .method-option { outline: 2px solid var(--rinse); outline-offset: 2px; }

/* ---------- System settings ---------- */

.logo-drop {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    padding: 8px;
    border: 1px dashed #C3CFD4;
    border-radius: var(--radius);
    background: #fff repeating-conic-gradient(#F1F4F5 0 25%, #fff 0 50%) 0 0 / 14px 14px;
    color: #A9B8BF;
    font-size: 1.75rem;
}
.logo-drop img { max-width: 100%; max-height: 100%; object-fit: contain; }

.swatches { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.swatch {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--c);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
    cursor: pointer;
}
.swatch.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }

.input-group > .form-control-color { flex: 0 0 56px; width: 56px; padding: 0.3rem; }

.preview {
    display: grid;
    grid-template-columns: 170px 1fr;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 220px;
}
.preview-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.9rem 0.75rem;
    background: var(--ink);
}
.preview-sidebar .sidebar-brand { margin-bottom: 0.4rem; }
.preview-sidebar .brand-name { font-size: 1rem; }
.preview-sidebar .brand-mark { width: 30px; height: 30px; font-size: .9rem; border-radius: 8px; }
.preview-cta {
    padding: 0.4rem 0.5rem;
    border-radius: 7px;
    background: var(--rinse);
    color: var(--on-rinse);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
}
.preview-link { padding: 0.35rem 0.5rem; border-radius: 7px; color: rgba(255,255,255,.72); font-size: 0.78rem; }
.preview-link i { margin-right: 0.35rem; }
.preview-link.is-active { background: rgba(255,255,255,.09); color: #fff; }
.preview-link.is-active i { color: var(--plate); }
.preview-main { padding: 0.9rem; background: var(--surface); }
.preview-main a { color: var(--rinse); }
.preview-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
    padding: 0.35rem 0.6rem;
    border-radius: 8px 8px 0 0;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 0.75rem;
}
.preview-favicon { display: grid; place-items: center; width: 16px; height: 16px; flex: none; color: var(--rinse); font-size: .8rem; }
.preview-favicon img { width: 16px; height: 16px; object-fit: contain; }
.preview-btn {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 7px;
    background: var(--rinse);
    color: var(--on-rinse);
    font-size: 0.8rem;
    font-weight: 600;
}
.preview .pill-brand { display: inline-flex; background: var(--rinse-50); color: var(--rinse-600); }

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

/* ---------- Modals & dropdowns ---------- */

.modal-content { border: 0; border-radius: var(--radius); }
.modal-header { border-bottom: 1px solid var(--line-soft); }
.modal-header h5 { margin: 0; }
.modal-footer { border-top: 1px solid var(--line-soft); }

.dropdown-menu { border-color: var(--line); border-radius: var(--radius-sm); font-size: 0.875rem; box-shadow: 0 8px 24px rgba(19,35,46,.08); }
.dropdown-item:active { background: var(--rinse); }

/* ---------- Login ---------- */

body.auth { background: var(--ink); min-height: 100vh; }

.auth-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 480px);
    min-height: 100vh;
}

.auth-side {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 3rem;
    color: rgba(255,255,255,.8);
    overflow: hidden;
}

.auth-side .sidebar-brand { padding: 0; }

.auth-pitch { max-width: 30rem; }
.auth-pitch h1 {
    color: #fff;
    font-family: var(--font-num);
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}
.auth-pitch p { font-size: 1rem; color: rgba(255,255,255,.65); max-width: 26rem; }

.auth-plates { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; }
.auth-plates .plate { font-size: 1.15rem; opacity: .95; }
.auth-plates .plate:nth-child(2) { transform: rotate(-2deg); }
.auth-plates .plate:nth-child(3) { transform: rotate(1.5deg); }

.auth-foot { font-size: 0.78rem; color: rgba(255,255,255,.4); }

.auth-panel {
    display: flex;
    align-items: center;
    padding: 2.5rem;
    background: var(--surface);
}

.auth-form { width: 100%; max-width: 360px; margin: 0 auto; }
.auth-form h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.35rem; }
.auth-form .lead { font-size: 0.9rem; color: var(--muted); margin-bottom: 1.75rem; }
.auth-form .form-control { padding: 0.7rem 0.9rem; }
.auth-form .btn { padding: 0.7rem; font-size: 0.95rem; }

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {

    .app-main { margin-left: 0; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    body.sidebar-open .sidebar { transform: none; }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(19, 35, 46, 0.45);
    }

    .topbar { padding: 0 1rem; }
    .topbar-toggle { display: inline-flex; }
    .app-content { padding: 1.25rem 1rem 2rem; }
    .app-footer { padding: 1rem; }

    .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi-strip:not(.kpi-stack) .kpi:nth-child(odd) { border-left: 0; }
    .kpi-strip:not(.kpi-stack) .kpi:nth-child(n+3) { border-top: 1px solid var(--line-soft); }

    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { padding: 2rem 1.5rem 1.5rem; }
    .auth-pitch h1 { font-size: 2rem; }
    .auth-plates, .auth-foot { display: none; }
    .auth-panel { padding: 2rem 1.5rem 3rem; border-radius: 18px 18px 0 0; }
}

@media (max-width: 575.98px) {
    .topbar-date { display: none; }
    .user-meta { display: none; }
    .page-title-main { font-size: 1.35rem; }
    .kpi { padding: 0.9rem 1rem; }
    .kpi-value { font-size: 1.45rem; white-space: normal; overflow-wrap: anywhere; }
    .kpi-value small { display: block; margin: 0.2rem 0 0; }
    div.dataTables_wrapper div.dataTables_filter input { width: 100%; }
    .stepper li { font-size: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Print ---------- */

@media print {
    .sidebar, .sidebar-backdrop, .topbar, .app-footer, .page-actions,
    .btn, .dataTables_filter, .dataTables_length, .dataTables_paginate,
    .no-print { display: none !important; }

    .app-main { margin: 0; }
    .app-content { padding: 0; max-width: none; }
    body { background: #fff; }
    .card { border-color: #ccc; break-inside: avoid; }
    .plate { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Discounts ---------- */
.discount-pending {
    padding: 0.75rem 0.9rem;
    border: 1px solid #F3D9A8;
    border-left: 4px solid var(--suds);
    border-radius: var(--radius-sm);
    background: #FFFDF8;
}
.discount-pending > div > .bi { color: var(--suds-700); font-size: 1.1rem; line-height: 1.3; }
.request.disc-approved  { border-left-color: var(--ok, #2E8B57); }
.request.withdrawn      { border-left-color: #B6C3C9; }
.disc-summary { border-top: 1px dashed var(--line, #DDE5E8); margin-top: 0.75rem; padding-top: 0.75rem; }
.disc-summary .btn-link { padding: 0; font-size: 0.875rem; text-decoration: none; }

/* ---------- Stock ---------- */
.stock-bar { position: relative; margin-top: 0.35rem; overflow: visible; }
.stock-bar > span { background: var(--ok); }
.stock-bar.stock-low > span { background: var(--suds); }
.stock-bar.stock-out > span { background: var(--bad); }
.stock-bar > i {
    position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px;
    background: var(--ink, #14232B); opacity: 0.45; border-radius: 1px;
}
a.alert { color: inherit; }
a.alert:hover { filter: brightness(0.98); }

/* ---------- Activity ---------- */
.activity-feed { list-style: none; margin: 0; padding: 0; }
.activity-day {
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
    padding: 1rem 0 0.4rem; border-bottom: 1px solid var(--line-soft);
}
.activity-day:first-child { padding-top: 0; }
.activity-item {
    display: grid; grid-template-columns: 3rem 2.25rem 1fr; gap: 0.75rem; align-items: start;
    padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--line-soft);
}
.activity-item.is-sensitive { background: #FFFCF5; box-shadow: inset 3px 0 0 var(--suds); }
.activity-item.is-failed { background: #FDF6F4; box-shadow: inset 3px 0 0 var(--bad); }
.activity-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.875rem; padding-top: 0.45rem; }
.activity-avatar {
    width: 2.25rem; height: 2.25rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--rinse) 14%, white); color: var(--rinse); font-weight: 700; font-size: 0.8rem; flex: none;
}
.activity-avatar.sm { width: 2rem; height: 2rem; font-size: 0.72rem; }
.activity-body { min-width: 0; }
.activity-text { font-weight: 500; overflow-wrap: anywhere; }
.activity-text a { color: var(--ink); text-decoration: none; }
.activity-text a:hover { color: var(--rinse); text-decoration: underline; }
.activity-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }
.activity-meta a { color: inherit; text-decoration: none; }
.activity-meta a:hover { color: var(--rinse); }
.activity-details summary { cursor: pointer; font-size: 0.8rem; color: var(--rinse); margin-top: 0.3rem; width: max-content; }
.activity-kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.15rem 0.9rem; margin: 0.25rem 0 0; font-size: 0.8rem; }
.activity-kv dt { color: var(--muted); font-weight: 500; }
.activity-kv dd { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.76rem; }
.activity-people { list-style: none; margin: 0; padding: 0.25rem 0; }
.activity-people a { display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 1rem; color: inherit; text-decoration: none; }
.activity-people a:hover, .activity-people li.active a { background: var(--surface, #F4F7F8); }
.activity-people .hbar { display: block; height: 4px; }
.min-w-0 { min-width: 0; }
@media (max-width: 575.98px) {
    .activity-item { grid-template-columns: 2.25rem 1fr; }
    .activity-time { grid-column: 1 / -1; padding: 0; font-size: 0.75rem; }
}

/* ---------- Package pricing grid ---------- */
.price-grid th[scope="row"] { white-space: nowrap; vertical-align: middle; font-weight: 600; }
.price-grid thead th { white-space: nowrap; }
.price-cell { min-width: 9.5rem; }
.price-cell .comm { font-size: 0.8rem; color: var(--muted); }
.price-cell.is-missing .form-control:first-child { border-color: #F3B7A9; background: #FDF6F4; }
.price-cell.is-changed .form-control { border-color: var(--rinse); box-shadow: 0 0 0 2px color-mix(in srgb, var(--rinse) 15%, transparent); }
.price-grid tr.is-focus th { color: var(--rinse); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain > li + li { border-top: 1px solid var(--line-soft); }
.list-plain > li > a:hover { background: var(--surface); }
.scroll-panel { max-height: 420px; overflow-y: auto; }
.avatar-photo { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.employee-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--line-soft); }
.avatar-xl { display: inline-grid; place-items: center; width: 120px; height: 120px; font-size: 2.2rem; }
.signature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 3rem; font-size: 0.8rem; color: var(--muted); }
.signature-row span { display: block; border-top: 1px solid var(--ink); margin-bottom: 0.3rem; opacity: 0.5; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.6rem; }
.team-option { display: flex; align-items: center; gap: 0.65rem; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--card); }
.team-option input { margin: 0; }
.team-option.is-on { border-color: var(--rinse); background: color-mix(in srgb, var(--rinse) 7%, white); }

/* ---------- Reports ---------- */
.print-only { display: none; }
.report-chart { position: relative; }
.report-print-head { margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--ink); }
@media print {
    .print-only { display: block !important; }
    .report-chart { height: 200px !important; }
    .stat-card { box-shadow: none !important; }
}

/* ---------- Profit & loss statement ---------- */
.pl-table td, .pl-table th { padding: 0.45rem 0.5rem; }
.pl-table .pl-head td { font-weight: 700; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; color: var(--muted); padding-top: 1rem; border-bottom: 0; }
.pl-table .pl-sub td { font-weight: 600; border-top: 1px solid var(--line); }
.pl-table tfoot .pl-total td { font-family: var(--font-num); font-size: 1.25rem; font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
.report-chart { position: relative; }
@media print {
    .report-chart canvas { max-width: 100% !important; height: auto !important; }
    .stat-card { break-inside: avoid; }
}

/* ---------- Next step panel ---------- */
.next-step {
    display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: flex-start;
    padding: 0.9rem 1rem; border: 1px solid #F3D9A8; border-left: 4px solid var(--suds);
    border-radius: var(--radius-sm, 8px); background: #FFFDF8;
}
.next-step-icon { font-size: 1.25rem; color: var(--suds-700, #8A5A0B); line-height: 1.2; }
