:root {
    --bg: #f6f5f2;
    --surface: #ffffff;
    --ink: #16140f;
    --ink-2: #57534a;
    --ink-3: #8f8a7e;
    --line: #ebe8e1;
    --line-2: #f2f0eb;
    --brand: #2366ed;
    --brand-2: #0e43ae;
    --brand-glow: rgba(36, 73, 180, 0.35);
    --brand-bg: #fff4e8;
    --ok: #15803d;
    --ok-bg: #e8f6ec;
    --warn: #a16207;
    --warn-bg: #fdf4dc;
    --bad: #b91c1c;
    --bad-bg: #fdecec;
    --neutral: #57534a;
    --neutral-bg: #f1efea;
    --radius: 18px;
    --brand-ink: #0e43ae;
    --info: #1d4ed8;
    --info-bg: #e8effd;
    --tabbar-height: 64px;
}
* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
}
body {
    font-family:
        "Plus Jakarta Sans",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
button,
input {
    font: inherit;
    color: inherit;
}
button {
    cursor: pointer;
}
a {
    color: inherit;
}

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Top bar ---------- */
.topbar {
    padding: 22px 0;
}
.topbar .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.topbar img {
    height: 32px;
    display: block;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}
.who {
    color: var(--ink-3);
    font-size: 13px;
}
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-weight: 600;
    font-size: 13px;
    color: var(--ink-2);
    transition:
        border-color 0.15s,
        color 0.15s;
}
.btn-ghost:hover {
    border-color: #d8d4ca;
    color: var(--ink);
}

/* ---------- Headings ---------- */
.page-head {
    margin: 8px 0 24px;
}
.page-head h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 4px;
}
.page-head p {
    margin: 0;
    color: var(--ink-2);
}

/* ---------- Stats ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.stat-lbl {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
}
.stat-lbl i {
    font-size: 15px;
}
.stat-val {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}
.stat-sub {
    color: var(--ink-3);
    font-size: 12px;
    margin-top: 2px;
}

/* ---------- Panels ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 18px;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 0;
}
.panel-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
}
.panel-count {
    color: var(--ink-3);
    font-size: 13px;
    font-weight: 600;
}

/* ---------- Create form ---------- */
.create {
    padding: 16px 22px 22px;
}
.create-grid {
    display: grid;
    grid-template-columns: 1fr 210px 200px auto;
    gap: 12px;
    align-items: end;
}
.label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.label-row > label:first-child {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-2);
    margin: 0 0 6px 2px;
}
.check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    margin-bottom: 6px;
    user-select: none;
}
.check input {
    width: 15px;
    height: 15px;
    accent-color: var(--brand);
    margin: 0;
    cursor: pointer;
}

.plate {
    position: relative;
    display: flex;
}
.plate-eu {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: #003399;
    color: #fff;
    border-radius: 12px 0 0 12px;
    display: grid;
    place-items: end center;
    padding-bottom: 7px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.plate .input {
    padding-left: 42px;
    background: #f7c600;
    border-color: #e5b700;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #111;
}
.plate .input::placeholder {
    color: rgba(17, 17, 17, 0.35);
}
.plate .input:focus {
    background: #f7c600;
    border-color: #111;
}
.plate.is-off .plate-eu {
    background: #c9c5bb;
}
.plate.is-off .input {
    background: #f1efea;
    border-color: var(--line);
    color: var(--ink-3);
    cursor: not-allowed;
}
.plate.is-off .input::placeholder {
    color: #cfcabf;
}

.textarea {
    height: auto;
    padding: 10px 14px;
    resize: vertical;
    min-height: 64px;
    line-height: 1.5;
}
.create-notes {
    margin-top: 12px;
}
.create-notes summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    list-style: none;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 2px;
}
.create-notes summary::-webkit-details-marker {
    display: none;
}
.create-notes summary:hover {
    color: var(--brand-ink);
}
.create-notes[open] summary {
    margin-bottom: 8px;
}
.field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-2);
    margin: 0 0 6px 2px;
}
.input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fcfbf9;
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s,
        background 0.15s;
}
.input:focus {
    border-color: var(--brand);
    background: #fff;
}
.input-money {
    position: relative;
}
.input-money span {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-3);
    font-weight: 700;
}
.input-money .input {
    padding-left: 32px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.hint {
    color: var(--ink-3);
    font-size: 12px;
    margin: 6px 0 0 2px;
}
.btn-brand {
    height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;

    transition:
        background 0.15s,
        transform 0.1s;
}
.btn-brand:hover {
    background: #0e43ae;
}
.btn-brand:active {
    transform: translateY(1px);
}

.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 14px;
}
.alert-bad {
    background: var(--bad-bg);
    color: var(--bad);
}

.created {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--brand-bg);
    border: 1px solid #ffdcb8;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.created-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--ok-bg);
    color: var(--ok);
    display: grid;
    place-items: center;
    font-size: 18px;
}
.created-text {
    flex: 1;
    min-width: 180px;
}
.created-title {
    font-weight: 700;
}
.created-link {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
    color: var(--brand-ink);
    word-break: break-all;
}
.created-actions {
    display: flex;
    gap: 8px;
}

/* ---------- Payments list ---------- */
.list {
    margin-top: 12px;
}
.payment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px 112px 108px 100px 124px 152px;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-top: 1px solid var(--line-2);
}
.payment-row-head {
    padding-top: 10px;
    padding-bottom: 10px;
    border-top: 0;
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.payment-row:not(.payment-row-head):hover {
    background: #fcfbf9;
}
.payment-row.is-new {
    background: var(--brand-bg);
}
.payment-row:last-child {
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.c-desc {
    font-weight: 700;
    min-width: 0;
}
.desc-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.note-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    margin-top: 6px;
    padding: 3px 8px;
    border: 0;
    border-radius: 7px;
    background: #fff8d6;
    color: #7a5b00;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
}
.note-preview span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.note-preview i {
    font-size: 11px;
    flex-shrink: 0;
}
.note-preview:hover {
    background: #fff1b3;
}
.icon-btn.has-note {
    color: #b08400;
}

.note-edit {
    grid-column: 1 / -1;
    background: #fffcef;
    border: 1px solid #f3e6b5;
    border-radius: 14px;
    padding: 14px;
}
.note-edit[hidden] {
    display: none;
}
.note-lbl {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #7a5b00;
    margin: 0 0 8px 2px;
}
.note-edit .textarea {
    background: #fff;
}
.note-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}
.btn-sm {
    height: 38px;
    padding: 0 16px;
    font-size: 13px;
}
.c-desc small {
    display: block;
    font-weight: 500;
    color: var(--ink-3);
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.c-amount {
    text-align: right;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.c-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.when-day {
    font-weight: 600;
}
.when-time {
    color: var(--ink-3);
    font-size: 12px;
}
.none {
    color: #cfcabf;
}
.meta-lbl {
    display: none;
}

.method {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
}
.method-dot {
    width: 22px;
    height: 16px;
    border-radius: 4px;
    display: grid;
    place-items: center;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
}
.method-dot.ideal {
    background: #cc0066;
}
.method-dot.bancontact {
    background: #1e3764;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.pill.ok {
    color: var(--ok);
    background: var(--ok-bg);
}
.pill.warn {
    color: var(--warn);
    background: var(--warn-bg);
}
.pill.bad {
    color: var(--bad);
    background: var(--bad-bg);
}
.pill.neutral {
    color: var(--neutral);
    background: var(--neutral-bg);
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink-2);
    text-decoration: none;
    font-size: 15px;
    position: relative;
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s;
}
.icon-btn:hover {
    background: var(--line-2);
    border-color: var(--line);
    color: var(--ink);
}
.icon-btn.danger:hover {
    background: var(--bad-bg);
    border-color: #f6cfcf;
    color: var(--bad);
}
.icon-btn.done {
    color: var(--ok);
}
.icon-btn[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
}
.icon-btn.solid {
    background: #fff;
    border-color: #ffdcb8;
    color: var(--brand-ink);
}
.icon-btn.solid:hover {
    border-color: var(--brand);
}
.c-actions form {
    margin: 0;
}

.empty {
    padding: 40px 22px 44px;
    text-align: center;
    color: var(--ink-3);
}
.empty i {
    font-size: 30px;
    display: block;
    margin-bottom: 8px;
    color: #d6d1c6;
}

/* ---------- Success sheet ---------- */
.main {
    display: flex;
    flex-direction: column;
    padding-bottom: 48px;
}
body.no-scroll {
    overflow: hidden;
}
.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(22, 20, 15, 0.45);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s,
        visibility 0.2s;
}
.sheet-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}
.sheet {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--surface);
    border-radius: 24px;
    padding: 30px 26px 22px;

    transform: translateY(16px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-backdrop.is-open .sheet {
    transform: none;
}
.sheet-grip {
    display: none;
}
.sheet-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: var(--line-2);
    color: var(--ink-2);
    display: grid;
    place-items: center;
}
.sheet-close:hover {
    background: var(--line);
    color: var(--ink);
}
.sheet-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    margin: 0 auto 14px;
    background: var(--ok-bg);
    color: var(--ok);
    display: grid;
    place-items: center;
    font-size: 28px;
}
.sheet-title {
    text-align: center;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
}
.sheet-sub {
    text-align: center;
    color: var(--ink-2);
    margin: 0 auto 18px;
    max-width: 340px;
    line-height: 1.5;
}
.sheet-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #faf9f6;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 20px;
}
.sheet-desc {
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}
.sheet-amount {
    font-weight: 800;
    font-size: 17px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
    margin: 0 0 8px;
}
.step span {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
}
.sheet-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 8px 8px 8px 14px;
    margin-bottom: 20px;
    border: 2px dashed #ffc58f;
    border-radius: 16px;
    background: var(--brand-bg);
    transition:
        border-color 0.15s,
        background 0.15s;
}
.sheet-link:hover {
    border-color: var(--brand);
}
.sheet-link-url {
    flex: 1;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    color: var(--brand-ink);
    font-weight: 600;
    overflow-wrap: anywhere;
}
.sheet-link-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    transition: background 0.15s;
}
.sheet-link.done {
    border-color: var(--ok);
    border-style: solid;
    background: var(--ok-bg);
}
.sheet-link.done .sheet-link-btn {
    background: var(--ok);
}
.sheet-share {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}
.share-btn {
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font-weight: 700;
    font-size: 13px;
    color: var(--ink);
    text-decoration: none;
    transition:
        border-color 0.15s,
        background 0.15s;
}
.share-btn[hidden] {
    display: none;
}
.share-btn:hover {
    border-color: #d8d4ca;
    background: #fcfbf9;
}
.share-btn i {
    font-size: 16px;
}
.share-btn.wa {
    background: #25d366;
    border-color: #25d366;
    color: #fff;
}
.share-btn.wa:hover {
    background: #1fbe5b;
}
.share-msg {
    width: 100%;
    border: 0;
    background: none;
    color: var(--ink-2);
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px;
}
.share-msg:hover,
.share-msg.done {
    color: var(--ink);
}
.sheet-done {
    width: 100%;
    justify-content: center;
    height: 46px;
    margin-top: 12px;
}

/* ---------- Login ---------- */
.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px 16px;
}
.login-box {
    width: 100%;
    max-width: 380px;
}
.login-box .logo {
    display: block;
    height: 42px;
    margin: 0 auto 26px;
}
.login-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 28px;
}
.login-card h1 {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 4px;
}
.login-card p {
    color: var(--ink-2);
    margin: 0 0 20px;
}
.login-card .field {
    margin-bottom: 14px;
}
.login-card .btn-brand {
    width: 100%;
    margin-top: 6px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .stats {
        grid-template-columns: 1fr 1fr;
    }
    .stats .stat:first-child {
        grid-column: 1 / -1;
    }
    .create-grid {
        grid-template-columns: 1fr 1fr;
    }
    .create-grid .field:first-child,
    .create-grid .btn-brand {
        grid-column: 1 / -1;
    }
    .payment-row-head {
        display: none;
    }
    .payment-row {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-areas:
            "desc   desc   amount"
            "status status actions"
            "made   paid   method";
        row-gap: 14px;
        padding: 18px 22px;
    }
    .c-desc {
        grid-area: desc;
    }
    .desc-text {
        white-space: normal;
    }
    .c-amount {
        grid-area: amount;
        font-size: 16px;
    }
    .c-status {
        grid-area: status;
    }
    .c-actions {
        grid-area: actions;
    }
    .c-made {
        grid-area: made;
    }
    .c-paid {
        grid-area: paid;
    }
    .c-method {
        grid-area: method;
    }
    .c-made,
    .c-paid,
    .c-method {
        background: #faf9f6;
        border-radius: 10px;
        padding: 8px 10px;
    }
    .meta-lbl {
        display: block;
        font-size: 10.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--ink-3);
        margin-bottom: 2px;
    }
}
@media (hover: none) {
    .icon-btn[data-tip]:hover::after {
        display: none;
    }
}
@media (max-width: 560px) {
    .wrap {
        padding: 0 16px;
    }
    .topbar {
        padding: 16px 0;
    }
    .topbar img {
        height: 26px;
    }
    .page-head {
        margin: 0 0 16px;
    }
    .page-head p {
        font-size: 13px;
    }
    /* on phones, the form comes first — that's the main task */
    .page-head {
        order: 0;
    }
    .panel-create {
        order: 1;
    }
    .stats {
        order: 2;
    }
    .panel-list {
        order: 3;
    }
    .input {
        font-size: 16px;
        height: 52px;
    } /* 16px stops iOS zooming in on focus */
    .textarea {
        height: auto;
    }
    .btn-brand {
        height: 52px;
        font-size: 15px;
    }
    .btn-sm {
        height: 40px;
        font-size: 13px;
    }
    .check {
        font-size: 13px;
    }
    .check input {
        width: 18px;
        height: 18px;
    }
    .stats {
        gap: 10px;
    }
    .stat {
        padding: 14px 16px;
    }
    .icon-btn {
        width: 40px;
        height: 40px;
    }
    .c-actions {
        gap: 4px;
    }
    .created {
        padding: 12px;
    }
    .created-actions {
        width: 100%;
    }
    .created-actions .btn-brand {
        flex: 1;
    }

    .sheet-backdrop {
        align-items: flex-end;
        padding: 0;
    }
    .sheet {
        max-width: none;
        max-height: 92vh;
        border-radius: 24px 24px 0 0;
        padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
        transform: translateY(100%);
    }
    .sheet-grip {
        display: block;
        width: 40px;
        height: 5px;
        border-radius: 3px;
        background: var(--line);
        margin: 0 auto 18px;
    }
    .sheet-close {
        top: 12px;
        right: 12px;
    }
    .sheet-icon {
        width: 52px;
        height: 52px;
        font-size: 24px;
    }
    .sheet-link {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 12px;
    }
    .sheet-link-url {
        text-align: center;
        font-size: 14px;
    }
    .sheet-link-btn {
        justify-content: center;
        height: 54px;
        font-size: 16px;
    }
    .sheet-share {
        grid-template-columns: 1fr 1fr;
    }
    .share-btn {
        height: 50px;
        font-size: 14px;
    }
    .page-head h1 {
        font-size: 24px;
    }
    .who {
        display: none;
    }
    .create-grid {
        grid-template-columns: 1fr;
    }
    .create-grid .btn-brand {
        width: 100%;
    }
    .payment-row {
        padding: 16px;
        gap: 10px;
    }
    .panel-head,
    .create {
        padding-left: 16px;
        padding-right: 16px;
    }
    .stat-val {
        font-size: 22px;
    }
}

*,
*::before,
*::after {
    box-shadow: none !important;
    text-shadow: none !important;
}
[hidden] {
    display: none !important;
}

/* ==========================================================
   CRM: navigation, leads, customers, dashboard
   ========================================================== */

a.btn-brand,
a.btn-ghost {
    text-decoration: none;
}
a.btn-brand:hover {
    color: #fff;
}
select.input {
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%2357534a' d='M1.6 4.6a.75.75 0 0 1 1.06 0L8 9.94l5.34-5.34a.75.75 0 1 1 1.06 1.06l-5.87 5.87a.75.75 0 0 1-1.06 0L1.6 5.66a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.min-w-0 {
    min-width: 0;
}
.nowrap {
    white-space: nowrap;
}
.muted {
    color: var(--ink-3);
    margin: 0 0 12px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.m-panel {
    margin: 14px 22px 0;
}
.hint-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px 2px;
}
.hint-top a {
    color: var(--brand-ink);
    font-weight: 600;
}
.btn-danger {
    color: var(--bad);
}
.btn-danger:hover {
    border-color: #f6cfcf;
    background: var(--bad-bg);
    color: var(--bad);
}
.icon-btn-sm {
    width: 28px;
    height: 28px;
    font-size: 13px;
}

/* ---------- Main navigation ---------- */
.topbar-logo {
    flex-shrink: 0;
}
.mainnav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.mainnav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--ink-2);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition:
        background 0.15s,
        color 0.15s;
}
.mainnav-link:hover {
    color: var(--ink);
    background: var(--line-2);
}
.mainnav-link.is-active {
    background: var(--ink);
    color: #fff;
}
.mainnav-link i {
    font-size: 15px;
}
.mainnav-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: inline-grid;
    place-items: center;
}

/* ---------- Page headings ---------- */
.page-head-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}
.back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
    color: var(--ink-2);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    align-self: flex-start;
}
.back:hover {
    color: var(--ink);
}
.panel-body {
    padding: 14px 22px 20px;
}
.panel-link {
    color: var(--brand-ink);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.panel-link:hover {
    text-decoration: underline;
}
.panel-accent {
    border-color: #c9d8fb;
}

/* ---------- Toolbar, tabs, search, chips ---------- */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px 0;
    flex-wrap: wrap;
}
.tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--line-2);
    border-radius: 12px;
}
.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 9px;
    color: var(--ink-2);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}
.tab:hover {
    color: var(--ink);
}
.tab.is-active {
    background: var(--surface);
    color: var(--ink);
}
.search {
    position: relative;
    flex: 1;
    max-width: 380px;
    margin: 0;
}
.search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-3);
}
.search .input {
    height: 42px;
    padding-left: 38px;
}
.chips {
    display: flex;
    gap: 6px;
    padding: 14px 22px 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-2);
    font-weight: 600;
    font-size: 12.5px;
    text-decoration: none;
    white-space: nowrap;
}
.chip span {
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}
.chip:hover {
    border-color: #d8d4ca;
    color: var(--ink);
}
.chip.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}
.chip.is-active span {
    color: rgba(255, 255, 255, 0.65);
}
.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neutral);
    flex-shrink: 0;
}
.dot.info {
    background: var(--info);
}
.dot.ok {
    background: var(--ok);
}
.dot.warn {
    background: var(--warn);
}
.dot.bad {
    background: var(--bad);
}
.pill.info {
    color: var(--info);
    background: var(--info-bg);
}

/* ---------- People, plates, tags ---------- */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--info-bg);
    color: var(--info);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.02em;
}
.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 19px;
}
.avatar-customer {
    background: var(--ok-bg);
    color: var(--ok);
}
.person-name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.person-sub {
    color: var(--ink-3);
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.plate-badge {
    display: inline-block;
    padding: 2px 7px 2px 16px;
    border-radius: 5px;
    background: linear-gradient(90deg, #003399 0 11px, #f7c600 11px);
    color: #111;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 7px;
    background: var(--line-2);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.tag-lg {
    padding: 6px 12px;
    font-size: 13px;
    background: var(--info-bg);
    color: var(--info);
}

/* ---------- Lead & customer lists ---------- */
.lead-row,
.customer-row {
    display: grid;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    border-top: 1px solid var(--line-2);
    color: inherit;
    text-decoration: none;
}
.lead-row {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(0, 1.4fr) 140px 104px 140px;
}
.customer-row {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) 150px 110px 110px;
}
.lead-row-head,
.customer-row-head {
    padding-top: 10px;
    padding-bottom: 10px;
    border-top: 0;
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
a.lead-row:hover,
a.customer-row:hover {
    background: #fcfbf9;
    color: inherit;
}
.lead-row:last-child,
.customer-row:last-child {
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}
.lead-row.is-unread .person-name::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 7px;
    border-radius: 50%;
    background: var(--brand);
    vertical-align: middle;
}
.c-person {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.c-vehicle,
.c-services {
    min-width: 0;
}
.c-vehicle .person-sub {
    margin-top: 3px;
    white-space: nowrap;
}
.services-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
}
.c-status .person-sub {
    margin-top: 4px;
    white-space: nowrap;
}
.when-day i {
    color: var(--ink-3);
    margin-right: 2px;
}
.when-day.is-past {
    color: var(--ink-3);
}
.row-customer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0;
    color: var(--brand-ink);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}
.row-customer:hover {
    text-decoration: underline;
}

/* ---------- Detail pages ---------- */
.profile-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.profile-head h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    overflow-wrap: anywhere;
}
.profile-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--ink-2);
    font-size: 13px;
}
.profile-head > .min-w-0 {
    flex: 1;
}
.profile-edit {
    margin-left: auto;
    flex-shrink: 0;
}
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.quick-actions .share-btn {
    padding: 0 16px;
    height: 42px;
}
.appointment-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    border-radius: 14px;
    background: var(--info-bg);
    color: var(--info);
}
.appointment-banner i {
    font-size: 18px;
}
.appointment-banner.is-past {
    background: var(--neutral-bg);
    color: var(--ink-2);
}
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}
.detail-side .btn-brand {
    margin-top: 2px;
}
.dl {
    margin: 0;
    padding: 6px 22px 14px;
}
.dl > div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line-2);
}
.dl > div:first-child {
    border-top: 0;
}
.dl dt {
    color: var(--ink-3);
    font-weight: 600;
    font-size: 13px;
}
.dl dd {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.dl dd a {
    color: var(--brand-ink);
    text-decoration: none;
}
.dl dd a:hover {
    text-decoration: underline;
}
.dl-stacked > div {
    grid-template-columns: 1fr;
    gap: 3px;
}
.dl-stacked dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.dl-stacked dd > div {
    margin-top: 4px;
}
.message {
    margin: 14px 0 0;
    padding: 14px 16px;
    border-left: 3px solid var(--brand);
    border-radius: 0 12px 12px 0;
    background: #faf9f6;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.mini-list {
    padding: 8px 0 8px;
}
.mini-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 22px;
    color: inherit;
    text-decoration: none;
}
.mini-row > .min-w-0 {
    flex: 1;
}
a.mini-row:hover {
    background: #fcfbf9;
    color: inherit;
}
.mini-row .bi-chevron-right {
    color: var(--ink-3);
}
.mini-title {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mini-row .person-sub {
    white-space: nowrap;
}
.mini-amount {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.customer-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
}
.customer-card:hover {
    border-color: var(--brand);
    color: inherit;
}
.customer-card > .min-w-0 {
    flex: 1;
}
.match {
    margin-top: 14px;
    padding: 12px;
    border-radius: 12px;
    background: var(--warn-bg);
}
.match-text {
    margin-bottom: 10px;
    color: var(--warn);
    font-size: 13px;
    line-height: 1.5;
}
.match-text a {
    color: inherit;
    font-weight: 700;
}
.match form {
    margin: 0;
}
.status-options {
    display: grid;
    gap: 6px;
}
.status-option {
    cursor: pointer;
    margin: 0;
}
.status-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.status-option span {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid var(--line);
    border-radius: 11px;
    font-weight: 600;
    transition:
        border-color 0.15s,
        background 0.15s;
}
.status-option:hover span {
    border-color: #d8d4ca;
}
.status-option input:checked + span {
    border-color: var(--ink);
    background: #faf9f6;
}
.status-option input:focus-visible + span {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
.side-actions {
    display: grid;
    gap: 8px;
    padding-top: 20px;
}
.side-actions form {
    margin: 0;
}
.side-delete {
    margin: 0 0 18px;
}
.side-actions .btn-ghost,
.side-delete .btn-ghost,
.match .btn-ghost {
    justify-content: center;
    height: 42px;
}
.empty-sm {
    padding: 26px 22px 30px;
}
.empty-sm i {
    font-size: 24px;
}
.empty a {
    color: var(--brand-ink);
}
.empty-page {
    padding: 80px 20px;
}
.empty-page h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 6px;
}
.empty-page p {
    margin: 0 0 18px;
}

/* ---------- Notes timeline ---------- */
.note-compose {
    margin: 0 0 22px;
}
.note-compose-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}
.note-compose-foot .hint {
    margin: 0;
}
.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--line-2);
}
.timeline-item {
    position: relative;
    display: flex;
    gap: 14px;
    padding-bottom: 14px;
}
.timeline-dot {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff8d6;
    color: #b08400;
    border: 2px solid var(--surface);
    font-size: 13px;
}
.timeline-card {
    flex: 1;
    min-width: 0;
    padding: 10px 14px 12px;
    border-radius: 12px;
    background: #fffcef;
    border: 1px solid #f3e6b5;
}
.timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 600;
    min-height: 24px;
}
.timeline-head form {
    margin: 0;
}
.timeline-body {
    margin-top: 2px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.timeline-body a {
    color: var(--brand-ink);
    font-weight: 600;
}
.timeline-system .timeline-dot {
    background: var(--line-2);
    color: var(--ink-3);
}
.timeline-system .timeline-card {
    background: transparent;
    border-color: transparent;
    padding-top: 5px;
    padding-bottom: 0;
}
.timeline-system .timeline-body {
    color: var(--ink-2);
}

/* ---------- Customer form ---------- */
.main-narrow {
    max-width: 780px;
}
.form-stack .panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-stack .panel-title i {
    color: var(--ink-3);
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-grid-address {
    grid-template-columns: repeat(3, 1fr);
}
.span-2 {
    grid-column: span 2;
}
.span-3 {
    grid-column: span 3;
}
.optional {
    color: var(--ink-3);
    font-weight: 500;
    font-size: 12px;
}
.check-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}
.check-card {
    margin: 0 !important;
    cursor: pointer;
}
.check-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.check-card span {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    transition:
        border-color 0.15s,
        background 0.15s;
}
.check-card span::before {
    content: "";
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 1.5px solid #d8d4ca;
    border-radius: 5px;
    background: #fff;
}
.check-card input:checked + span {
    border-color: var(--brand);
    background: var(--info-bg);
}
.check-card input:checked + span::before {
    border-color: var(--brand);
    background: var(--brand)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='m3.5 8.5 3 3 6-7'/%3E%3C/svg%3E")
        center / 14px no-repeat;
}
.check-card input:focus-visible + span {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 4px 0 20px;
}
.form-actions .btn-ghost {
    height: 48px;
    padding: 0 20px;
}
.lead-ref {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-left: 3px solid var(--brand);
    border-radius: 0 14px 14px 0;
    background: var(--surface);
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.lead-ref-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 13px;
}
.lead-ref-head span {
    color: var(--ink-3);
    font-weight: 500;
}

/* ---------- Dashboard ---------- */
.stats-4 {
    grid-template-columns: repeat(4, 1fr);
}
.stat-link {
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s;
}
.stat-link:hover {
    color: inherit;
    border-color: #d8d4ca;
}
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
}
.bars {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: 190px;
    padding-top: 22px;
}
.bar-col {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    cursor: default;
}
.bar-track {
    position: relative;
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-bottom: 1px solid var(--line);
}
.bar {
    width: min(70%, 34px);
    border-radius: 4px 4px 0 0;
    background: #a9c1f7;
    transition: background 0.15s;
}
.bar-col.is-current .bar,
.bar-col:hover .bar {
    background: var(--brand);
}
.bar-value {
    position: absolute;
    left: 0;
    right: 0;
    margin-bottom: 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.bar-label {
    text-align: center;
    color: var(--ink-3);
    font-size: 11px;
    white-space: nowrap;
}
.bar-col.is-current .bar-label {
    color: var(--ink);
    font-weight: 700;
}
.bar-col[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    background: var(--ink);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
}
.hbars {
    display: grid;
    gap: 4px;
}
.hbar-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    margin: 0 -8px;
    border-radius: 9px;
    color: inherit;
    text-decoration: none;
}
.hbar-row:hover {
    background: #faf9f6;
    color: inherit;
}
.hbar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}
.hbar-track {
    height: 10px;
    border-radius: 5px;
    background: var(--line-2);
    overflow: hidden;
}
.hbar {
    display: block;
    height: 100%;
    border-radius: 0 5px 5px 0;
    background: var(--brand);
}
.hbar-value {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.date-chip {
    width: 52px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--info-bg);
    color: var(--info);
    font-size: 13px;
}
.footnote {
    text-align: center;
    color: var(--ink-3);
    font-size: 12.5px;
    margin: 4px 0 0;
}

/* ---------- CRM responsive ---------- */
@media (max-width: 1080px) {
    .mainnav-link {
        padding: 8px 10px;
    }
    .who {
        display: none;
    }
}
@media (max-width: 900px) {
    .stats-4 {
        grid-template-columns: 1fr 1fr;
    }
    .stats-4 .stat:first-child {
        grid-column: auto;
    }
    .dash-grid,
    .detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    /* On the lead page the actions (convert, status) matter most: show them first. */
    .detail-grid-actions-first .detail-side {
        order: -1;
    }
    .lead-row-head,
    .customer-row-head {
        display: none;
    }
    .lead-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "person  status"
            "vehicle date"
            "services services";
        row-gap: 10px;
    }
    .lead-row .c-person {
        grid-area: person;
    }
    .lead-row .c-status {
        grid-area: status;
        text-align: right;
    }
    .lead-row .c-vehicle {
        grid-area: vehicle;
        padding-left: 50px;
    }
    .lead-row .c-date {
        grid-area: date;
        text-align: right;
    }
    .lead-row .c-services {
        grid-area: services;
        padding-left: 50px;
    }
    .lead-row .c-location {
        display: none;
    }
    .customer-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "person  amount"
            "vehicle appointment";
        row-gap: 10px;
    }
    .customer-row .c-person {
        grid-area: person;
    }
    .customer-row .c-amount {
        grid-area: amount;
    }
    .customer-row .c-vehicle {
        grid-area: vehicle;
        padding-left: 50px;
    }
    .customer-row .c-appointment {
        grid-area: appointment;
        text-align: right;
    }
    .customer-row .c-date {
        display: none;
    }
}
@media (max-width: 760px) {
    /* Phone & small tablet: main navigation becomes a bottom tab bar. */
    body.has-nav {
        padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
    }
    .mainnav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        gap: 0;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        border-radius: 0;
        border-width: 1px 0 0;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(8px);
    }
    .mainnav-link {
        flex: 1;
        flex-direction: column;
        gap: 2px;
        padding: 6px 4px;
        font-size: 11px;
    }
    .mainnav-link i {
        font-size: 19px;
    }
    .mainnav-link.is-active {
        background: transparent;
        color: var(--brand);
    }
    .mainnav-badge {
        position: absolute;
        top: 2px;
        left: calc(50% + 6px);
    }
    .hide-sm {
        display: none;
    }
}
@media (max-width: 560px) {
    .stats-4 {
        order: 0;
    }
    .page-head-row {
        align-items: stretch;
        flex-direction: column;
    }
    .toolbar {
        padding: 14px 16px 0;
    }
    .tabs {
        width: 100%;
    }
    .tab {
        flex: 1;
        justify-content: center;
    }
    .search {
        max-width: none;
        flex-basis: 100%;
    }
    .search .input {
        height: 46px;
    }
    .chips {
        padding: 12px 16px 0;
    }
    .lead-row,
    .customer-row {
        padding: 14px 16px;
    }
    .lead-row .c-vehicle,
    .lead-row .c-services,
    .customer-row .c-vehicle {
        padding-left: 0;
    }
    .panel-body {
        padding: 12px 16px 18px;
    }
    .dl {
        padding: 4px 16px 12px;
    }
    .dl > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .mini-row {
        padding: 10px 16px;
    }
    .m-panel {
        margin: 12px 16px 0;
    }
    .profile-head {
        flex-wrap: wrap;
    }
    .profile-head h1 {
        font-size: 22px;
    }
    .avatar-lg {
        width: 46px;
        height: 46px;
        font-size: 16px;
    }
    .profile-edit {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    .quick-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .quick-actions .share-btn {
        height: 46px;
    }
    .form-grid,
    .form-grid-address {
        grid-template-columns: 1fr;
    }
    .span-2,
    .span-3 {
        grid-column: auto;
    }
    .form-actions {
        flex-direction: column-reverse;
    }
    .form-actions .btn-ghost,
    .form-actions .btn-brand {
        width: 100%;
        justify-content: center;
    }
    .note-compose-foot .hint {
        display: none;
    }
    .note-compose-foot .btn-brand {
        width: 100%;
    }
    .hbar-row {
        grid-template-columns: 120px minmax(0, 1fr) 30px;
    }
    .bars {
        height: 160px;
    }
    .bar-label {
        font-size: 10px;
    }
}
