/* Dealers, ledger, payments and cheques (admin) */

/* balances: B = dealer owes, A = dealer is in credit */
.dl-bal { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.dl-bal.is-credit { color: var(--success); }
.dl-bal.is-zero { color: var(--faint); font-weight: 600; }
.dl-bal.is-over, .dl-bal.is-over .dl-side { color: var(--danger); }
.dl-side { margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--faint); }
.dl-bal.is-credit .dl-side { color: inherit; opacity: 0.75; }

/* credit usage meter in tables */
.dl-usage { display: flex; align-items: center; gap: 8px; min-width: 120px; justify-content: flex-end; }
.dl-usage .meter { width: 84px; height: 6px; flex: none; }
.dl-usage .dl-pct { font-size: 12px; font-weight: 650; color: var(--muted); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.dl-usage .dl-pct.is-over { color: var(--danger); }
.dl-usage .dl-pct.is-warn { color: var(--warning); }
.dl-unlimited { font-size: 12.5px; color: var(--faint); font-weight: 600; }

/* dealer hero header */
.dl-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.dl-hero-main { display: flex; gap: 16px; align-items: flex-start; min-width: 0; flex: 1 1 420px; }
.dl-mark {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: var(--brand-text); font-family: var(--font-display); font-weight: 650; font-size: 18px; letter-spacing: -0.02em;
}
.dl-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dl-title .page-title { overflow-wrap: anywhere; }
.dl-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.dl-meta span, .dl-meta a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.dl-meta a:hover { color: var(--ink); }
.dl-meta .icon { width: 15px; height: 15px; color: var(--faint); }
.dl-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; letter-spacing: 0.01em; }
.dl-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dl-actions form { display: inline-flex; }

.dl-kpis { margin-bottom: 20px; }
.dl-kpis .stat-value.is-danger { color: var(--danger); }
.dl-kpis .stat-value.is-success { color: var(--success); }
.dl-kpis .meter { height: 6px; margin-top: 10px; }

/* overview */
.dl-aging { display: grid; gap: 10px; }
.dl-aging-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.dl-aging-row .k { color: var(--muted); font-weight: 600; }
.dl-aging-row .v { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; min-width: 92px; }
.dl-aging-track { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.dl-aging-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.dl-aging-track span.t-warn { background: var(--tape); }
.dl-aging-track span.t-danger { background: var(--danger); }
.dl-aging-track span.t-ok { background: var(--success); }
.dl-terms .kv { grid-template-columns: 132px minmax(0, 1fr); }
.dl-chart { height: 200px; }

/* users */
.dl-user { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); }
.dl-user:first-child { border-top: 0; }
.dl-user.is-off { background: var(--surface-2); }
.dl-user.is-off .dl-user-name { color: var(--muted); }
.dl-user-main { flex: 1; min-width: 0; }
.dl-user-name { font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dl-user-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.dl-user-end { display: flex; align-items: center; gap: 10px; flex: none; }
.dl-user-state { font-size: 12.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.dl-share { display: grid; gap: 10px; }
.dl-share .copy-field { flex-wrap: nowrap; }
.dl-share .row { flex-wrap: wrap; }

/* addresses */
.dl-addresses { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dl-address { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.dl-address.is-default { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); box-shadow: 0 0 0 3px var(--brand-soft); }
.dl-address-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dl-address-title { font-weight: 700; }
.dl-address-body { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.dl-address-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); }

/* special prices */
.dl-price-picked { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.dl-price-picked .grow { min-width: 0; }
.dl-price-add { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.dl-price-add > .field { flex: 1 1 180px; min-width: 0; }
.dl-price-add > .field:first-child { flex: 3 1 300px; }
.dl-price-add > .field:last-child { flex: none; }
.dl-import-errors { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); max-height: 180px; overflow: auto; }

/* notes and visits */
.dl-visit-form { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; }
.timeline .tl-note { white-space: pre-line; }
.dl-tl-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.dl-history-item { padding: 12px 20px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.dl-history-item:first-child { border-top: 0; }
.dl-history-item .icon-tile { width: 32px; height: 32px; border-radius: 9px; }
.dl-history-time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.dl-changes { margin-top: 6px; font-size: 12.5px; }
.dl-changes summary { cursor: pointer; color: var(--brand-text); font-weight: 600; }
.dl-changes table { margin-top: 6px; border-collapse: collapse; width: 100%; }
.dl-changes td { padding: 4px 8px 4px 0; border-top: 1px dashed var(--line); vertical-align: top; overflow-wrap: anywhere; }
.dl-changes td:first-child { color: var(--muted); white-space: nowrap; }
.dl-changes del { color: var(--danger); text-decoration: line-through; opacity: 0.8; }
.dl-changes ins { color: var(--success); text-decoration: none; }

/* dealer form */
.dl-form-wrap { max-width: 1080px; margin: 0 auto; }
.dl-form-card .card-body { padding: 8px 24px; }
.dl-form-foot {
  position: sticky; bottom: 12px; z-index: 15; display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  margin-top: 16px; padding: 10px 12px 10px 18px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px); box-shadow: var(--shadow-md);
}
.dl-form-foot .hint { margin-right: auto; }
.dl-chain-preview { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; color: var(--brand-text); min-height: 18px; }
.dl-chain-preview.is-error { color: var(--danger); }
.dl-chain-preview .icon { width: 15px; height: 15px; }
.dl-cats { max-height: 300px; overflow: auto; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.dl-cats .check { display: flex; padding: 5px 0; font-size: 13.5px; }
.dl-cats .depth-1 { padding-left: 22px; }
.dl-cats .depth-2 { padding-left: 44px; }
.dl-cats .depth-3, .dl-cats .depth-4, .dl-cats .depth-5 { padding-left: 66px; }
.dl-methods { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.dl-invite-fields { margin-top: 14px; }
.dl-app-note { white-space: pre-line; }

/* statement */
.dl-period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dl-period .segmented { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.dl-period .segmented::-webkit-scrollbar { display: none; }
.dl-period-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dl-period-custom .input { height: 32px; width: 150px; font-size: 13px; }
.table tr.dl-opening td { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.table tr.is-reversed td:not(.actions) { color: var(--faint); }
.table tr.is-reversed .cell-title { text-decoration: line-through; color: var(--faint); }
.dl-type { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 650; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.dl-type.t-order { background: var(--brand-soft); color: var(--brand-text); }
.dl-type.t-payment { background: var(--success-soft); color: var(--success); }
.dl-type.t-cheque_bounce, .dl-type.t-fee { background: var(--danger-soft); color: var(--danger); }
.dl-type.t-debit, .dl-type.t-credit { background: var(--violet-soft); color: var(--violet); }
.dl-type.t-return, .dl-type.t-cancel { background: var(--warning-soft); color: var(--warning); }
.dl-amount-debit { color: var(--ink); }
.dl-amount-credit { color: var(--success); }

/* payments */
.dl-methods-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.dl-method { padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg); color: inherit; text-decoration: none !important; transition: border-color 0.12s, background 0.12s; }
a.dl-method:hover { border-color: var(--line-strong); background: var(--surface-2); }
.dl-method.is-active { border-color: var(--brand); box-shadow: var(--ring); }
.dl-method-label { font-size: 12.5px; color: var(--muted); font-weight: 650; display: flex; justify-content: space-between; gap: 6px; }
.dl-method-value { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.dl-method.is-total { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.dl-method.is-total .dl-method-label { color: color-mix(in srgb, var(--surface) 65%, transparent); }
.dl-amount-hero { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.dl-receipt-frame { width: 100%; height: 620px; border: 0; border-radius: var(--r); background: var(--surface-2); }
.dl-receipt-img { width: 100%; max-height: 720px; object-fit: contain; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.dl-method-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dl-method-choice {
  position: relative; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer;
  font-weight: 650; color: var(--ink-2); transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.dl-method-choice:hover { border-color: var(--faint); }
.dl-method-choice input { position: absolute; opacity: 0; pointer-events: none; }
.dl-method-choice .icon { color: var(--muted); }
.dl-method-choice:has(input:checked) { border-color: var(--brand); box-shadow: var(--ring); background: var(--brand-soft); color: var(--brand-text); }
.dl-method-choice:has(input:checked) .icon { color: var(--brand); }
.dl-method-choice:has(input:focus-visible) { box-shadow: var(--ring); }
.dl-dealer-picked { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.dl-summary .kv-row .v { white-space: nowrap; }
.dl-paper[hidden] { display: none !important; }

/* drawer variant of the modal (desktop: right side panel) */
@media (min-width: 721px) {
  dialog.modal.dl-drawer {
    margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(520px, 100vw); border-radius: 0;
    border-left: 1px solid var(--line);
  }
  dialog.modal.dl-drawer[open] { animation: dl-drawer-in 0.22s var(--ease); }
}
@keyframes dl-drawer-in { from { transform: translateX(32px); opacity: 0.4; } }
.dl-drawer .modal-body { flex: 1; padding-top: 0; }
.dl-drawer-loading { display: grid; gap: 12px; padding: 8px 0; }
.dl-drawer-loading .skeleton { height: 16px; }

/* cheques */
.dl-buckets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.dl-bucket { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: inherit; text-decoration: none !important; transition: border-color 0.12s, background 0.12s; min-width: 0; }
a.dl-bucket:hover { border-color: var(--line-strong); background: var(--surface-2); }
.dl-bucket.is-active { border-color: var(--brand); box-shadow: var(--ring); }
.dl-bucket-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 650; }
.dl-bucket-label .dot { width: 7px; height: 7px; }
.dl-bucket-value { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-bucket-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dl-bucket.is-danger .dl-bucket-value { color: var(--danger); }
.dl-due { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.dl-due small { font-size: 11.5px; font-weight: 650; color: var(--muted); }
.dl-due small.is-late { color: var(--danger); }
.dl-due small.is-soon { color: var(--warning); }

/* bank accounts */
.dl-banks { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.dl-bank { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.dl-bank.is-off { background: var(--surface-2); }
.dl-bank.is-off .dl-bank-name { color: var(--muted); }
.dl-bank-head { display: flex; align-items: flex-start; gap: 12px; }
.dl-bank-name { font-weight: 700; font-size: 15px; }
.dl-iban { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.dl-iban code { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.01em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .dl-iban code { white-space: normal; overflow-wrap: anywhere; } }
.dl-bank-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }

/* misc */
.dl-toggle { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); font-size: 13px; font-weight: 650; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.dl-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.dl-toggle:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.dl-callout { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.dl-callout .btn { margin-left: auto; }
.table td.dl-nowrap, .table th.dl-nowrap { white-space: nowrap; }
.dl-dot-sep { color: var(--faint); margin: 0 6px; }
.dl-danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.dl-danger-zone .card-head h2 { color: var(--danger); }
.dl-empty-inline { padding: 18px 20px; color: var(--muted); font-size: 13.5px; }
.dl-sticky-aside { position: sticky; top: calc(var(--topbar-h) + 16px); }
.dl-preview-num { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .dl-buckets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl-buckets .dl-bucket:first-child { grid-column: 1 / -1; }
  .dl-sticky-aside { position: static; }
}
@media (max-width: 1024px) {
  .dl-form-foot { bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); }
  .dl-form-foot .hint { display: none; }
  .dl-form-card .card-body { padding: 4px 16px; }
}
@media (max-width: 720px) {
  .dl-hero { gap: 14px; }
  .dl-hero-main { flex-basis: 100%; gap: 12px; }
  .dl-mark { width: 44px; height: 44px; font-size: 16px; border-radius: 12px; }
  .dl-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; width: 100%; }
  .dl-actions .btn, .dl-actions form .btn {
    flex-direction: column; height: auto; min-height: 58px; padding: 9px 4px; gap: 5px; font-size: 11.5px; white-space: normal; text-align: center; line-height: 1.2; width: 100%;
  }
  .dl-actions form { display: block; }
  .dl-actions .btn .icon { width: 19px; height: 19px; margin: 0; }
  .dl-user { flex-wrap: wrap; padding: 14px 16px; }
  .dl-user-end { width: 100%; justify-content: space-between; padding-left: 46px; }
  .dl-user-state { text-align: left; }
  .dl-visit-form { grid-template-columns: minmax(0, 1fr); }
  .dl-history-item { grid-template-columns: 32px minmax(0, 1fr); padding: 12px 16px; }
  .dl-history-time { grid-column: 2; }
  .dl-aging-row { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .dl-period { padding: 10px 12px; }
  .dl-period-custom { width: 100%; }
  .dl-period-custom .input { flex: 1; width: auto; min-width: 0; }
  .dl-method-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl-price-add > .field:last-child { flex: 1 1 100%; }
  .dl-price-add > .field:last-child .btn { width: 100%; height: 42px; flex: none; }
  .dl-receipt-frame { height: 440px; }
  .dl-amount-hero { font-size: 26px; }
  .dl-usage { justify-content: flex-end; }
  .dl-banks { grid-template-columns: minmax(0, 1fr); }
  .dl-callout { flex-wrap: wrap; }
  .dl-callout .alert-body { flex: 1 1 calc(100% - 40px); }
  .dl-callout .btn { margin-left: 30px; }
  .table-stack td.dl-nowrap { white-space: normal; }
}

/* table toolbars: compact selects instead of full-width rows */
.dl-toolbar .select { width: auto; flex: 0 1 auto; min-width: 140px; max-width: 220px; }
.dl-toolbar > .input:not([type="search"]) { width: 150px; flex: 0 0 auto; }
.dl-toolbar .segmented { flex: none; }
@media (max-width: 720px) {
  .dl-toolbar { padding: 10px 12px; gap: 8px; }
  .dl-toolbar .input-icon { flex: 1 1 100%; max-width: none; }
  .dl-toolbar .select { flex: 1 1 calc(50% - 4px); max-width: none; min-width: 0; }
  .dl-toolbar > .input:not([type="search"]) { flex: 1 1 calc(50% - 4px); width: auto; min-width: 0; }
  .dl-toolbar .spacer { display: none; }
  .dl-toolbar .dl-toggle { flex: 1 1 calc(50% - 4px); justify-content: center; }
  .dl-toolbar .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .dl-toolbar .segmented::-webkit-scrollbar { display: none; }
  .dl-toolbar > form.input-icon { flex: 1 1 100% !important; max-width: none !important; }
}
.dl-tb-group { display: flex; gap: 8px; flex: none; }
@media (max-width: 720px) {
  .dl-tb-group { flex: 1 1 100%; }
  .dl-tb-group .dl-toggle { flex: 1 1 0; }
}

/* mobile cards: multi-line cell values stay together on the right, actions sit in the card corner */
@media (max-width: 720px) {
  .dl-table td[data-label] { display: grid !important; grid-template-columns: auto minmax(0, 1fr); gap: 1px 12px; justify-items: end; align-items: center; }
  .dl-table td[data-label]::before { grid-column: 1; grid-row: 1; justify-self: start; }
  .dl-table td[data-label] > * { grid-column: 2; }
  .dl-table td.dl-hide-m { display: none !important; }
  .dl-table tfoot tr { padding: 12px 16px; }
  .dl-table tfoot td:empty { display: none; }
  .dl-corner tbody tr { position: relative; }
  .dl-corner td.primary { padding-right: 44px !important; }
  .dl-corner td.actions { position: absolute; top: 8px; right: 10px; width: auto; padding: 0 !important; }
  .dl-corner td.actions:empty { display: none; }
}
.dl-kv { margin: 0; }
.field > .segmented { align-self: flex-start; max-width: 100%; }
.dl-chain-preview:empty { display: none; }
.dl-ledger-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dl-ledger-table td:nth-child(2) { min-width: 260px; }
@media (max-width: 1100px) { .dl-ledger-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 720px) { .dl-ledger-cards { grid-template-columns: minmax(0, 1fr); } .dl-ledger-table td:nth-child(2) { min-width: 0; } }
@media (max-width: 720px) {
  .dl-table td.dl-hide-m { display: none !important; }
  .dl-ledger-table td.actions { padding-top: 4px !important; }
  .dl-ledger-table td.actions:not(:has(*)) { display: none; }
  .dl-period-custom .btn { flex: none; }
}
.dl-m-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
@media (max-width: 720px) { .dl-m-label { position: static; width: auto; height: auto; clip: auto; } }
@media (max-width: 720px) {
  .dl-table td.actions .menu { right: auto; left: 0; transform-origin: top left; }
}
.dl-act-short { display: none; }
@media (max-width: 720px) {
  .dl-act-long { display: none; }
  .dl-act-short { display: inline; }
  .dl-actions { grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); align-items: stretch; }
  .dl-actions .btn, .dl-actions form .btn { height: 100%; min-height: 60px; }
  .dl-actions form { display: flex; }
}
.dl-pager-note { display: flex; justify-content: space-between; gap: 16px; }
@media (max-width: 720px) { .dl-pager-note { flex-direction: column; align-items: flex-start; gap: 4px; } }

/* ---------------------------------------------------------------- dealer list (overview + side panel) */
.dl-av { width: 36px; height: 36px; border-radius: 11px; display: inline-grid; place-items: center; flex: none; font-size: 12.5px; font-weight: 750; letter-spacing: 0; }
.dl-av-sm { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.dl-av-lg { width: 56px; height: 56px; border-radius: 17px; font-size: 18px; font-weight: 800; }

.chip.g-violet { background: var(--violet-soft); color: var(--violet); }
.chip.g-blue { background: var(--blue-soft); color: var(--blue-ink); }
.chip.g-sky { background: var(--sky-soft); color: var(--sky); }
.chip.g-mint { background: var(--success-soft); color: var(--success); }
.chip.g-tape { background: var(--tape-soft); color: var(--tape-ink); }
.chip.g-coral { background: var(--danger-soft); color: var(--danger); }
.chip.g-neutral { background: var(--surface-3); color: var(--ink-2); }

.dl-head { margin-bottom: 0; }
.dl-groups { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.dl-grp {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink); text-decoration: none !important; transition: border-color 0.15s, box-shadow 0.15s;
}
.dl-grp:hover { border-color: var(--line-strong); color: var(--ink); }
.dl-grp.is-active { border-color: var(--brand); box-shadow: var(--ring); }
.dl-grp b { font-size: 18px; font-stretch: 112%; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.dl-grp span { font-size: 13px; font-weight: 600; color: var(--muted); }
.dl-grp i { width: 10px; height: 10px; border-radius: 3px; display: block; flex: none; }
.dl-grp i.g-violet { background: var(--violet); }
.dl-grp i.g-blue { background: var(--blue); }
.dl-grp i.g-sky { background: var(--sky-bright); }
.dl-grp i.g-mint { background: var(--success-bright); }
.dl-grp i.g-tape { background: var(--tape); }
.dl-grp i.g-coral { background: var(--danger-bright); }
.dl-grp i.g-neutral { background: var(--faint); }
.dl-grp-apply { background: var(--tape-soft); border-color: color-mix(in srgb, var(--tape) 35%, var(--tape-soft)); }
.dl-grp-apply:hover { border-color: var(--tape); }
.dl-grp-apply span { color: var(--tape-ink); }
.dl-grp-apply .icon { width: 18px; height: 18px; color: var(--ink); }

.dl-layout { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.dl-layout.is-single { grid-template-columns: minmax(0, 1fr); }
.dl-list { overflow: clip; }
.dl-list .bulkbar { margin-bottom: 12px; }
.dl-list-tools { padding: 14px 14px 12px; gap: 8px; }
.dl-list-tools .input-icon { flex: 1 1 170px; max-width: 300px; }
.dl-list-tools .select { min-width: 0; max-width: 170px; flex: 0 1 auto; }
.dl-list-tools .spacer { flex: 1 1 0; }
.dl-tool-btn { width: 38px; height: 38px; flex: none; }
.dl-views { flex: 0 1 auto; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.dl-views::-webkit-scrollbar { display: none; }
.dl-views a { height: 30px; padding: 0 10px; font-size: 13px; }
.dl-views b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.dl-views b.is-tape { background: var(--tape-soft); color: var(--tape-ink); }
.dl-views .is-active b { background: color-mix(in srgb, var(--surface) 18%, transparent); color: var(--surface); }
.dl-select-toggle[aria-pressed="true"] { --btn-bg: var(--brand-soft); color: var(--brand-text); }

.dl-dtable { font-size: 14px; }
.dl-dtable th, .dl-dtable td { padding-left: 14px; padding-right: 14px; white-space: nowrap; }
.dl-dtable th:first-child, .dl-dtable td:first-child { padding-left: 14px; }
.dl-dtable th:last-child, .dl-dtable td:last-child { padding-right: 10px; }
.dl-dtable th { border-top: 1px solid var(--line-2); }
.dl-dtable tbody tr { cursor: pointer; }
.dl-dtable tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.dl-dtable tbody tr.is-selected { background: color-mix(in srgb, var(--blue-soft) 70%, var(--surface)); }
.dl-dtable tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.dl-who { display: flex; align-items: center; gap: 10px; }
.dl-who-text { color: var(--ink); text-decoration: none !important; min-width: 0; }
.dl-who-text:hover b { color: var(--brand-text); }
.dl-who-text b { display: block; font-weight: 650; line-height: 1.3; }
.dl-who-text small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; font-stretch: 90%; }
.dl-pick { position: relative; display: inline-grid; flex: none; }
.dl-pick .dl-check { position: absolute; inset: 0; margin: auto; opacity: 0; pointer-events: none; }
.dl-check { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.dl-col-who > .dl-check { display: none; margin-right: 10px; vertical-align: -4px; }
@media (hover: hover) {
  .dl-dtable tbody tr:hover .dl-pick .dl-check { opacity: 1; pointer-events: auto; }
  .dl-dtable tbody tr:hover .dl-pick .dl-av { opacity: 0; }
}
.dl-dtable.is-selecting .dl-pick .dl-check { opacity: 1; pointer-events: auto; }
.dl-dtable.is-selecting .dl-pick .dl-av { opacity: 0; }
.dl-dtable.is-selecting .dl-col-who > .dl-check { display: inline-block; }
.dl-select-toggle { display: none; }
@media (hover: none) { .dl-select-toggle { display: inline-flex; } }

.dl-amt { font-weight: 750; font-variant-numeric: tabular-nums; }
.dl-amt.is-debt { color: var(--danger); }
.dl-amt.is-credit { color: var(--success); }
.dl-amt .dl-side { color: currentColor; opacity: 0.6; }
.dl-lim { min-width: 120px; }
.dl-lim span { font-size: 12.5px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.dl-meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 5px; }
.dl-meter i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.dl-meter i.is-mid { background: var(--tape); }
.dl-meter i.is-high { background: var(--danger-bright); }

/* side panel */
.dl-pane-card { position: sticky; top: calc(var(--topbar-h) + 16px); }
.dl-pane { padding: 20px; display: grid; gap: 18px; }
.dl-pane.is-loading { opacity: 0.55; transition: opacity 0.15s; }
.dl-pane-h { display: flex; gap: 14px; align-items: center; }
.dl-pane-name { display: block; font-size: 18px; font-weight: 750; line-height: 1.25; color: var(--ink); text-decoration: none !important; }
.dl-pane-name:hover { color: var(--brand-text); }
.dl-pane-h small { font-size: 13px; color: var(--muted); font-weight: 600; }
.dl-pane-chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.dl-pane-open { align-self: flex-start; margin: -6px -8px 0 0; color: var(--muted); }
.dl-pane-kv { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.dl-pane-kv li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); line-height: 1.45; min-width: 0; }
.dl-pane-kv li > span, .dl-pane-kv li > a { min-width: 0; overflow-wrap: anywhere; }
.dl-pane-kv a { color: var(--ink-2); }
.dl-pane-kv a:hover { color: var(--brand-text); }
.dl-pane-kv .icon { width: 16px; height: 16px; color: var(--faint); margin-top: 2px; }
.dl-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dl-mini > div { padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); min-width: 0; }
.dl-mini small { display: block; font-size: 12px; color: var(--muted); font-weight: 650; }
.dl-mini b { display: block; margin-top: 4px; font-size: 16px; font-stretch: 108%; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.dl-box { padding: 14px; border-radius: 16px; border: 1px solid var(--line-2); }
.dl-box-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dl-box-h small { font-size: 13px; color: var(--muted); font-weight: 650; }
.dl-box-h strong { font-size: 20px; font-stretch: 110%; font-weight: 800; font-variant-numeric: tabular-nums; }
.dl-box-h strong.is-debt { color: var(--danger); }
.dl-box-h strong.is-credit { color: var(--success); }
.dl-box .dl-meter { height: 8px; margin-top: 10px; }
.dl-box-f { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.dl-box-note { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; font-weight: 650; color: var(--danger); }
.dl-pl { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--violet-soft); color: var(--ink); text-decoration: none !important; }
a.dl-pl:hover { background: color-mix(in srgb, var(--violet-soft) 85%, var(--violet)); color: var(--ink); }
.dl-pl .ti { width: 38px; height: 38px; border-radius: 12px; background: var(--surface); color: var(--violet); }
.dl-pl .ti .icon { width: 17px; height: 17px; }
.dl-pl b { display: block; font-size: 14.5px; font-weight: 750; }
.dl-pl b + span { font-size: 13px; color: var(--ink-2); font-weight: 550; }
.dl-pane-a { display: grid; gap: 8px; }
.dl-pane-a form { display: block; }
.dl-pane-a .btn { width: 100%; }
.dl-btn-firm { --btn-bg: var(--firm); --btn-fg: var(--firm-ink, #fff); --btn-bd: var(--firm); }
.dl-btn-firm:hover { --btn-bg: color-mix(in srgb, var(--firm) 84%, #000); --btn-bd: color-mix(in srgb, var(--firm) 84%, #000); }

@media (max-width: 1240px) {
  .dl-layout { grid-template-columns: minmax(0, 1fr); }
  .dl-pane-card { position: static; }
}
@media (max-width: 720px) {
  .dl-head .page-actions { width: 100%; }
  .dl-list-tools { padding: 12px; }
  .dl-list-tools .input-icon { flex: 1 1 100%; max-width: none; }
  .dl-list-tools .select { flex: 1 1 calc(50% - 4px); max-width: none; }
  .dl-dtable td.dl-nowrap { white-space: nowrap; }
}

/* ---------------------------------------------------------------- cari ve tahsilat overview */
.dl-tabs { margin-bottom: 22px; }
.dl-cari-kpis { margin-bottom: 0; }
.dl-cari-kpis .stat-value.is-danger { color: var(--danger); }
.dl-cari-kpis .stat-value.is-success { color: var(--success); }
.dl-cari-row { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dl-cari-row.is-single { grid-template-columns: minmax(0, 1fr); }
.dl-quiet { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; }
.dl-quiet b { display: block; font-weight: 700; }
.dl-quiet span:not(.ti) { display: block; font-size: 13px; color: var(--muted); font-weight: 550; margin-top: 2px; }
.dl-quiet .lnk { display: inline-flex; }
.dl-card-more { padding: 12px 20px 16px; border-top: 1px solid var(--line-2); }

.dl-aging-bar { height: 22px; border-radius: 8px; overflow: hidden; display: flex; gap: 3px; }
.dl-aging-bar i { display: block; height: 100%; }
/* aging tones (overview bar + legend, dealer card) */
.dl-aging-bar .a-current, .dl-ag .a-current, .dl-aging-track span.a-current { background: var(--blue); }
.dl-aging-bar .a-30, .dl-ag .a-30, .dl-aging-track span.a-30 { background: var(--tape); }
.dl-aging-bar .a-60, .dl-ag .a-60, .dl-aging-track span.a-60 { background: var(--danger-bright); }
.dl-aging-bar .a-60plus, .dl-ag .a-60plus, .dl-aging-track span.a-60plus { background: color-mix(in srgb, var(--danger) 72%, #000); }
.dl-ag { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 4px; }
.dl-ag li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line-2); font-size: 14px; }
.dl-ag li:last-child { border-bottom: 0; }
.dl-ag em { width: 12px; height: 12px; border-radius: 4px; display: block; }
.dl-ag span, .dl-ag a { font-weight: 600; color: var(--ink-2); }
.dl-ag a:hover { color: var(--brand-text); }
.dl-ag small { font-size: 12.5px; color: var(--muted); font-weight: 650; min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.dl-ag b { min-width: 110px; text-align: right; font-variant-numeric: tabular-nums; }

.dl-tr { list-style: none; margin: 0; padding: 0 20px 20px; display: grid; gap: 10px; }
.dl-tr li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); flex-wrap: wrap; }
.dl-tr li.is-done { opacity: 0.75; }
.dl-tr-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 180px; }
.dl-tr-name { display: block; font-weight: 650; line-height: 1.3; color: var(--ink); }
.dl-tr-name:hover { color: var(--brand-text); }
.dl-tr-who small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 550; line-height: 1.45; }
.dl-tr strong { font-size: 16px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dl-tr-acts { display: flex; gap: 6px; }
.dl-doc { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; color: var(--blue-ink); }
.dl-doc .icon { width: 14px; height: 14px; }
.dl-dup { font-weight: 700; color: var(--tape-ink); }

.dl-late td, .dl-late th { white-space: nowrap; }
.dl-late .dl-who { gap: 10px; }
.dl-late .dl-who b { display: block; font-weight: 650; line-height: 1.3; }
.dl-late .dl-who small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.dl-late-days { color: var(--danger); font-weight: 750; }
.dl-sent { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--success-soft); color: var(--success); font-size: 13px; font-weight: 700; }
.dl-sent .icon { width: 15px; height: 15px; }

.dl-cardpay { list-style: none; margin: 0; padding: 0 20px 20px; display: grid; gap: 4px; }
.dl-cardpay li { border-bottom: 1px dashed var(--line-2); }
.dl-cardpay li:last-child { border-bottom: 0; }
.dl-cardpay li > a, .dl-cardpay li > div { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: inherit; text-decoration: none !important; }
.dl-cardpay li > a:hover b { color: var(--brand-text); }
.dl-cardpay .ti { width: 36px; height: 36px; border-radius: 11px; }
.dl-cardpay .grow { line-height: 1.35; }
.dl-cardpay b { font-weight: 650; }
.dl-cardpay small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.dl-cardpay strong { font-weight: 800; color: var(--success); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dl-secure { display: flex; gap: 10px; align-items: flex-start; margin: 0 20px 20px; padding: 12px 14px; border-radius: 14px; background: var(--success-soft); color: var(--success); font-size: 13px; font-weight: 650; line-height: 1.45; }
.dl-secure .icon { width: 16px; height: 16px; margin-top: 1px; flex: none; }

.dl-balances { margin-top: 18px; scroll-margin-top: 88px; }
.dl-balances td.primary { min-width: 230px; }

@media (max-width: 1180px) {
  .dl-cari-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .dl-cari-kpis { grid-template-columns: minmax(0, 1fr); }
  .dl-cari-kpis .stat + .stat { border-left: 0; border-top: 1px solid var(--line-2); }
}
@media (max-width: 1024px) {
  .dl-list .bulkbar { bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); }
}
.dl-choices .choice-title, .dl-choices .choice-desc { display: block; }
.dl-choices .choice-title .badge { margin-left: 4px; vertical-align: 1px; }
@media (max-width: 720px) {
  .dl-hero .dl-av-lg { width: 44px; height: 44px; border-radius: 13px; font-size: 16px; }
}
