:root {
    color-scheme: light;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-strong: #f8fafc;
    --ink: #162033;
    --muted: #667085;
    --line: #dbe3ee;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --green: #0f9f6e;
    --orange: #d97706;
    --danger: #dc2626;
    --shadow: 0 18px 55px rgba(21, 32, 51, 0.11);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 34%),
        linear-gradient(135deg, #eef4ff 0%, #f8fafc 45%, #f4fbf7 100%);
}

.auth-card {
    width: min(100%, 420px);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(219, 227, 238, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 34px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #102a43;
    color: #fff;
    font-weight: 800;
}

.brand-text strong {
    display: block;
    font-size: 18px;
}

.brand-text span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.form-stack {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: #344054;
    font-size: 14px;
    font-weight: 700;
}

.field input,
.field select,
.field textarea,
.responsive-table input,
.responsive-table select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 12px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field textarea {
    resize: vertical;
}

.date-filter-control { position: relative; min-width: 0; }
.field .date-filter-control .date-filter-input { padding-inline-end: 34px; }
.date-filter-toggle {
    position: absolute;
    inset: 0 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    padding: 0;
    border: 0;
    border-radius: 0 8px 8px 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}
.date-filter-toggle:hover, .date-filter-toggle[aria-expanded="true"] { color: var(--primary-dark); background: #eef4ff; }
.date-filter-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.date-filter-calendar .flatpickr-day.selected,
.date-filter-calendar .flatpickr-day.selected:hover,
.date-filter-calendar .flatpickr-day.selected:focus { background: var(--primary); border-color: var(--primary); }
@media (pointer: coarse) {
    .field .date-filter-control .date-filter-input { padding-inline-end: 44px; }
    .date-filter-toggle { width: 44px; }
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.responsive-table input:focus,
.responsive-table select:focus {
    border-color: rgba(37, 99, 235, 0.8);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.btn {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-ghost {
    background: transparent;
    color: #475467;
}

.btn-soft {
    background: #eef4ff;
    color: #1d4ed8;
    border: 1px solid #c7d7fe;
}

.btn-print {
    background: #0f766e;
    color: #fff;
    border: 1px solid #0d665f;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.2);
}

.btn-print:hover {
    background: #115e59;
}

.btn-print-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #101828;
    color: #f8fafc;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    overflow-y: auto;
}

.sidebar .brand-mark {
    background: #2563eb;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #cbd5e1;
}

.nav-link.is-active,
.nav-link:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #38bdf8;
}

.main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: relative;
    z-index: 10;
    min-height: 72px;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.page-title h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.page-title p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.quick-access { position: relative; flex: none; }
.quick-access-trigger {
    display: inline-flex;
    gap: 6px;
    min-height: 44px;
    list-style: none;
    cursor: pointer;
    white-space: nowrap;
}
.quick-access-trigger::-webkit-details-marker { display: none; }
.quick-access-trigger:focus-visible, .quick-access-panel a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.quick-access-icon { font-size: 20px; line-height: 1; }
.quick-access[open] .quick-access-trigger { border-color: var(--primary); }
.quick-access-panel {
    position: absolute;
    inset-block-start: calc(100% + 6px);
    inset-inline-end: 0;
    width: min(224px, calc(100vw - 32px));
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.quick-access-group + .quick-access-group {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}
.quick-access-heading {
    display: block;
    padding: 6px 10px 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.quick-access-panel a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 10px;
    border-radius: 6px;
    font-size: 14px;
}
.quick-access-panel a:hover, .quick-access-panel a:focus-visible { background: var(--surface-strong); }
.user-pill { min-width: 0; }
.user-pill .avatar { flex: none; }
.user-pill > span:last-child { overflow-wrap: anywhere; }

@media (max-width: 650px) {
    .topbar { gap: 10px; }
    .user-menu { gap: 6px; flex: none; }
    .quick-access { position: static; }
    .quick-access-trigger { min-width: 44px; padding-inline: 8px; }
    .quick-access-label { display: none; }
    .quick-access-panel { inset-inline-end: 18px; }
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #344054;
    font-size: 14px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #e0f2fe;
    color: #075985;
    font-weight: 800;
}

.content {
    width: 100%;
    max-width: 1180px;
    min-width: 0;
    margin: 0 auto;
    padding: 28px;
    flex: 1;
}

.content.content-wide {
    max-width: min(100%, 1800px);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 16px;
}

.metric-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(21, 32, 51, 0.06);
}

.metric-card {
    min-width: 0;
    padding: 20px;
    display: grid;
    gap: 14px;
    color: inherit;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.metric-card-link:hover {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 12px 34px rgba(21, 32, 51, 0.1);
    transform: translateY(-1px);
}

.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.metric-label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.metric-value {
    font-size: 30px;
    line-height: 1;
    font-weight: 850;
}

.metric-chip {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.metric-chip svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tone-blue {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.13);
}

.tone-green {
    color: #0f9f6e;
    background: rgba(15, 159, 110, 0.13);
}

.tone-orange {
    color: #b45309;
    background: rgba(217, 119, 6, 0.14);
}

.tone-red {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.13);
}

.dashboard-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: 16px;
    align-items: start;
}

.panel {
    padding: 20px;
}

.panel h2 {
    margin: 0;
    font-size: 18px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.panel-heading.compact {
    margin-bottom: 10px;
}

.recent-list {
    display: grid;
    gap: 0;
}

.recent-panel .panel-heading {
    margin-bottom: 8px;
}

.recent-panel .panel-heading .btn {
    min-height: 34px;
    padding: 8px 10px;
}

.recent-item {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) max-content 128px max-content;
    gap: 10px;
    align-items: center;
    min-height: 56px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.recent-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.recent-main,
.status-list {
    min-width: 0;
}

.recent-main {
    display: grid;
    gap: 2px;
}

.recent-date,
.recent-desc,
.status-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.recent-date {
    white-space: nowrap;
}

.recent-main strong,
.recent-desc,
.recent-type {
    min-width: 0;
    overflow-wrap: anywhere;
}

.recent-main strong {
    font-size: 13px;
    line-height: 1.25;
}

.recent-desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-type {
    justify-self: end;
    max-width: 150px;
    text-align: center;
    white-space: normal;
}

.recent-amount {
    justify-self: end;
    font-size: 13px;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
}

.detail-link {
    color: var(--primary);
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.status-list {
    display: grid;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 0;
    border-top: 1px solid var(--line);
}

.status-row:first-child {
    border-top: 0;
}

.status-row strong {
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-actions h2 {
    margin: 0;
    font-size: 22px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.filter-bar,
.form-panel,
.table-surface {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(21, 32, 51, 0.06);
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px 160px auto;
    gap: 14px;
    align-items: end;
    padding: 16px;
    margin-bottom: 18px;
}

.filter-bar.product-filter {
    grid-template-columns: minmax(210px, 1fr) minmax(160px, 0.8fr) 140px 140px auto;
}

.filter-bar.compact-filter {
    grid-template-columns: minmax(220px, 1fr) 160px auto;
}

.customer-statement-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.customer-statement .customer-header h2 { min-width: 0; overflow-wrap: anywhere; }

.customer-statement-controls {
    display: flex;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 8px 0 10px;
}

.customer-statement-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 156px)) auto;
    align-items: end;
    gap: 8px;
    min-width: 0;
}

.customer-statement-filter .field {
    min-width: 0;
    gap: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.customer-statement-filter .field label { color: inherit; font-size: inherit; }

.customer-statement-filter .field input {
    min-width: 0;
    min-height: 36px;
    padding: 5px 8px;
    font-size: 13px;
}

.customer-statement .customer-ledger-filter-error {
    margin: 0 0 10px;
}

@media (min-width: 1024px) {
    .customer-statement .ledger-table table { min-width: 0; }
    .customer-statement .ledger-table .mobile-card-description { width: 100%; min-width: 120px; max-width: 0; }
    .customer-statement .ledger-table .mobile-card-description > span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .customer-statement .ledger-table th,
    .customer-statement .ledger-table td { padding: 7px 9px; }
}

@media (max-width: 1023px) {
    .customer-statement .customer-ledger-mobile-list .mobile-list-card {
        padding: 9px 10px;
        gap: 6px 8px;
        margin-bottom: 8px;
        box-shadow: none;
    }
}

@media (max-width: 600px) {
    .customer-statement-filter { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .customer-statement-filter .field input, .customer-statement-filter-actions .btn { min-height: 44px; }
    .customer-statement-filter-actions { grid-column: 1 / -1; }
    .customer-statement .customer-header-actions .btn { min-height: 44px; }
}

.customer-ledger-empty-total {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) repeat(3, max-content);
    gap: 12px 24px;
    align-items: center;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
}

.customer-ledger-empty-total > span {
    display: grid;
    gap: 3px;
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

.customer-ledger-empty-total b {
    font-size: 14px;
}

.filter-bar.sales-filter {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.report-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.report-card {
    min-width: 0;
    min-height: 148px;
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(21, 32, 51, 0.06);
}

.report-card strong {
    font-size: 18px;
}

.report-card span:last-child {
    color: var(--muted);
    font-size: 14px;
}

.report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.report-tabs .btn.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: none;
}

.report-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.report-filter-grid .filter-actions {
    grid-column: 1 / -1;
    align-self: end;
    justify-self: end;
}

.filter-actions,
.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    min-width: max-content;
    max-width: 100%;
}

.filter-actions .btn {
    white-space: nowrap;
}

.advanced-filter-field select {
    min-width: 150px;
}

.table-surface {
    padding: 0;
    overflow: hidden;
}

.responsive-table {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.responsive-table table {
    min-width: 920px;
    table-layout: auto;
}

th,
td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    overflow-wrap: anywhere;
}

th:not(:last-child),
td:not(:last-child) {
    border-right: 1px solid #edf2f7;
}

th {
    background: #f8fafc;
    color: #475467;
    border-bottom-color: #cfd8e3;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    white-space: nowrap;
}

tbody tr:hover {
    background: #fbfdff;
}

tbody tr:last-child td {
    border-bottom: 0;
}
.col-row-no,
.col-no,
.row-no {
    width: 58px;
    min-width: 52px;
    max-width: 64px;
    text-align: center;
    color: var(--muted);
    white-space: nowrap;
}

.col-date {
    width: 154px;
    min-width: 140px;
}

.col-customer {
    width: 250px;
    min-width: 220px;
}

.col-type {
    width: 172px;
    min-width: 150px;
}

.col-description {
    width: auto;
    min-width: 320px;
}

.col-money {
    width: 132px;
    min-width: 120px;
    max-width: 150px;
}

.col-number {
    width: 118px;
    min-width: 96px;
    max-width: 140px;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.col-status {
    width: 118px;
    min-width: 100px;
}

.col-actions {
    width: 164px;
    min-width: 130px;
    max-width: 190px;
}

.responsive-table .col-date,
td[data-label*="Tarih"],
.responsive-table .col-status,
td[data-label*="Durum"],
.responsive-table .col-actions,
td[data-label*="Detay"],
td[data-label*="İşlem"] {
    white-space: nowrap;
}

.responsive-table .col-description,
td[data-label*="Açıklama"],
td[data-label*="Not"],
td[data-label*="Özet"] {
    overflow-wrap: anywhere;
}
.amount-debit,
.amount-credit,
.amount-muted,
.amount-neutral,
.col-money,
.col-number,
td[data-label*="Tutar"],
td[data-label*="Toplam"],
td[data-label*="Borç"],
td[data-label*="Alacak"],
td[data-label*="Bakiye"],
td[data-label*="Fiyat"] {
    padding-left: 10px;
    padding-right: 12px;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

td[data-label*="Tarih"] {
    white-space: nowrap;
}

td[data-label*="Açıklama"],
td[data-label*="Not"] {
    min-width: 320px;
}

td[data-label*="Durum"],
td[data-label*="İşlem"] {
    width: 1%;
    white-space: nowrap;
}

.ledger-table table {
    min-width: 1120px;
}

.ledger-table .col-description {
    width: 34%;
}

.money-empty,
.amount-empty {
    color: var(--muted);
    font-weight: 700;
}
.select2-lite {
    position: relative;
    min-width: 0;
}

.select2-lite.is-open {
    z-index: 60;
}

.select2-lite-native {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    opacity: 0;
    pointer-events: none;
}

.select2-lite-control {
    position: relative;
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 34px 10px 12px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.select2-lite-control::after {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #667085;
    border-bottom: 2px solid #667085;
    content: "";
    transform: translateY(-70%) rotate(45deg);
}

.select2-lite-control.is-empty {
    color: var(--muted);
}

.select2-lite-control:focus {
    border-color: rgba(37, 99, 235, 0.8);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    outline: none;
}

.select2-lite-dropdown {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
    min-width: 100%;
    max-width: calc(100vw - 32px);
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.select2-lite-search {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--surface-strong);
    outline: none;
}

.select2-lite-options {
    max-height: 240px;
    overflow: auto;
    margin-top: 8px;
}

.select2-lite-group-label {
    padding: 6px 10px 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.report-workspace .page-actions { gap: 8px 12px; margin-bottom: 10px; }
.report-workspace .page-actions .eyebrow, .report-workspace .report-summary-note { display: none; }
.report-workspace .page-actions h2 { margin: 0; font-size: 19px; }
.report-workspace .report-tabs { gap: 5px; margin-bottom: 10px; padding: 5px; }
.report-mobile-navigation { display: none; }
.report-workspace .ledger-summary-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0;
    margin: 0 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.report-workspace .summary-card {
    min-height: 0;
    gap: 2px;
    padding: 7px 10px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.report-workspace .summary-card + .summary-card { border-inline-start: 1px solid var(--line); }
.report-workspace .summary-card > span { font-size: 11px; }
.report-workspace .summary-card strong { font-size: 17px; }
.report-workspace .filter-bar {
    grid-template-columns: repeat(auto-fit, minmax(min(132px, 100%), 1fr));
    gap: 6px 8px;
    margin-bottom: 10px;
    padding: 8px 10px;
}
.report-workspace .filter-bar .field { gap: 3px; min-width: 0; }
.report-workspace .filter-bar .field label { font-size: 12px; }
.report-workspace .filter-actions { grid-column: auto; justify-content: flex-start; gap: 5px; }
.report-workspace .filter-bar .field input,
.report-workspace .filter-bar .field select,
.report-workspace .filter-bar .select2-lite-control {
    min-width: 0;
    min-height: 36px;
    font-size: 13px;
}
.report-workspace .empty-state { min-height: 0; padding: 12px; }

@media (min-width: 1024px) {
    .report-workspace.content { padding-top: 16px; }
    .report-workspace .btn { min-height: 32px; padding: 5px 9px; font-size: 12px; }
    .report-workspace .filter-bar .field input,
    .report-workspace .filter-bar .field select,
    .report-workspace .filter-bar .select2-lite-control { padding-block: 5px; }
    .report-workspace .responsive-table :is(th, td) { padding: 6px 8px; }
    .report-workspace .responsive-table table { min-width: 0; }
    .report-workspace .responsive-table td:is([data-label*="Açıklama"], [data-label*="Not"]) { min-width: 120px; }
    .report-workspace .ledger-table .col-date { width: 126px; min-width: 112px; }
    .report-workspace .ledger-table .col-customer { width: 148px; min-width: 100px; }
    .report-workspace .ledger-table .col-type { width: 142px; min-width: 116px; }
    .report-workspace .ledger-table .col-description { min-width: 120px; }
    .report-workspace .ledger-table .col-money { width: 104px; min-width: 84px; }
    .report-workspace .ledger-table .col-actions { width: 110px; min-width: 94px; }
    .report-workspace .responsive-table th { font-size: 11px; }
    .report-workspace .responsive-table td { font-size: 13px; }
    .report-workspace .responsive-table .subtext { font-size: 11px; }
}

@media (max-width: 600px) {
    .report-workspace .report-desktop-navigation { display: none; }
    .report-mobile-navigation {
        display: block;
        margin-bottom: 10px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--surface);
    }
    .report-mobile-navigation summary {
        min-height: 44px;
        padding: 10px 12px;
        color: var(--primary-dark);
        font-size: 13px;
        font-weight: 750;
        cursor: pointer;
    }
    .report-workspace .report-mobile-navigation .report-tabs { margin: 0; }
    .report-workspace .page-actions .row-actions .btn {
        flex: 0 1 auto;
        padding: 7px 9px;
        font-size: 13px;
        white-space: nowrap;
    }
    .report-workspace .ledger-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; }
    .report-workspace .summary-card strong { font-size: 15px; }
    .report-workspace .summary-card:last-child:nth-child(odd) { grid-column: 1 / -1; border-inline-start: 0; border-top: 1px solid var(--line); }
    .report-workspace .summary-card .amount-formatted { white-space: normal; }
    .report-workspace .filter-actions { grid-column: 1 / -1; }
    .report-workspace .filter-bar .field input,
    .report-workspace .filter-bar .field select,
    .report-workspace .filter-bar .select2-lite-control { min-height: 44px; }
    .report-workspace :is(.page-actions, .report-tabs, .filter-actions) .btn { min-height: 44px; }
}

.select2-lite-option {
    width: 100%;
    min-height: 36px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    padding: 8px 10px;
    text-align: left;
    line-height: 1.35;
    overflow-wrap: break-word;
    cursor: pointer;
}

.select2-lite-option:hover,
.select2-lite-option[aria-selected="true"] {
    background: #eef4ff;
    color: #1d4ed8;
}

.select2-lite-empty {
    padding: 10px;
    color: var(--muted);
    font-size: 13px;
}

.responsive-table .select2-lite-control {
    min-height: 38px;
    padding: 7px 30px 7px 9px;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.pagination-summary {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.pagination-size,
.pagination-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-size label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.pagination-size select {
    min-width: 80px;
}

.btn.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.strong-link {
    display: inline-block;
    max-width: 100%;
    color: var(--primary);
    font-weight: 850;
    overflow-wrap: anywhere;
}

.subtext {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.badge {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 850;
}

.badge-success {
    background: #ecfdf3;
    color: #027a48;
}

.badge-muted {
    background: #f2f4f7;
    color: #667085;
}

.badge-info {
    background: #eff8ff;
    color: #175cd3;
}

.badge-danger {
    background: #fef3f2;
    color: #b42318;
}

.badge-warning {
    background: #fffaeb;
    color: #b54708;
}

.form-panel {
    padding: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.settings-grid .form-footer {
    grid-column: 1 / -1;
    margin-top: 0;
}

.span-2 {
    grid-column: span 2;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.form-footer.split {
    justify-content: flex-start;
}

.customer-form {
    max-width: 900px;
    margin-inline: auto;
}

.customer-type-panel {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.customer-type-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.customer-type-option {
    position: relative;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    color: #344054;
    cursor: pointer;
    padding: 13px 14px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.customer-type-option input {
    position: absolute;
    inset: 0;
    cursor: pointer;
    opacity: 0;
}

.customer-type-option span,
.customer-type-option strong,
.customer-type-option small {
    display: block;
}

.customer-type-option strong {
    font-size: 15px;
}

.customer-type-option small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.customer-type-option.is-active {
    border-color: rgba(37, 99, 235, 0.85);
    background: #eef4ff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.customer-form-grid {
    align-items: start;
}

.customer-form-section {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    padding: 14px;
}

.customer-form-section[hidden] {
    display: none;
}

.compact-heading {
    margin-bottom: 12px;
}

.compact-heading h2 {
    font-size: 16px;
}

.compact-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-identity-panel {
    margin-bottom: 16px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    margin-bottom: 16px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin: 0;
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}

.detail-list div {
    min-width: 0;
}

.detail-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.note-box {
    min-height: 148px;
    color: #475467;
    background: var(--surface-strong);
    border: 1px dashed #c8d4e3;
    border-radius: 8px;
    padding: 14px;
    white-space: pre-wrap;
}

.balance-strip {
    margin-top: 14px;
    padding: 14px;
    border-radius: 8px;
    background: #101828;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.balance-strip span {
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.balance-strip strong {
    font-size: 22px;
}

.vehicle-panel {
    margin-top: 16px;
}

.vehicle-form {
    display: grid;
    grid-template-columns: 150px minmax(140px, 1fr) minmax(130px, 1fr) minmax(180px, 1.3fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.responsive-table input,
.responsive-table select {
    min-height: 38px;
    padding: 7px 9px;
}

.sales-entry {
    display: grid;
    gap: 10px;
}

.sale-header {
    margin-bottom: 0;
}

.sale-items-panel {
    min-width: 0;
    overflow: visible;
}

.sales-entry .sale-header {
    padding: 12px 16px;
}

.sale-header-fields {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, .85fr);
    gap: 10px 12px;
}

.sale-header-fields > *, .sale-header-fields input { min-width: 0; }
.sale-notes { margin-top: 8px; }
.sale-notes .field { margin-top: 8px; }
.sale-notes summary { cursor: pointer; }
.sales-entry .sale-composer-panel { padding: 14px 16px; }
.sales-entry .sale-composer-panel .section-heading { margin-bottom: 8px; }
.sales-entry [data-sale-empty] { min-height: 0; padding: 10px; }
.sale-total-mode { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.sale-total-mode[hidden] { display: none; }
.sales-entry .sale-line { padding-block: 3px; }
.sales-entry .sale-line input { min-height: 38px; }
.sales-entry .sale-line-total { display: flex; gap: 6px; align-items: end; }
.sales-entry .sale-line-total label { flex: 1; min-width: 0; }
.sales-entry .sale-line-total input {
    display: block;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 9px;
    text-align: right;
}
.sales-entry [data-row-reset][hidden] { display: none; }
.customer-overview { display: grid; gap: 12px; min-width: 0; }
.customer-header, .customer-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.customer-header h2, .customer-section-heading h2, .customer-ledger-panel .section-heading h2 {
    margin: 0;
    font-size: 18px;
    overflow-wrap: anywhere;
}
.customer-header h2 { font-size: 22px; }
.customer-header-meta, .customer-header-actions, .customer-ledger-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}
.customer-header-meta, .customer-header-actions { flex-wrap: wrap; }
.customer-header-meta { margin-top: 3px; color: var(--muted); font-size: 13px; }
.customer-identity-disclosure summary, .customer-activity-disclosure summary {
    width: fit-content;
    padding: 6px 2px;
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}
.customer-identity-disclosure .detail-list { margin: 8px 0 0; }
.customer-activity-disclosure { margin-top: 8px; }
.customer-overview .tab-list { width: fit-content; max-width: 100%; }
.customer-overview .tab-button { flex: 0 1 auto; }
.customer-balance-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.customer-balance-strip > div { padding: 8px 14px; min-width: 0; }
.customer-balance-strip > div + div { border-inline-start: 1px solid var(--line); }
.customer-balance-strip dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.customer-balance-strip dd { margin: 0; font-size: 16px; font-weight: 750; overflow-wrap: anywhere; }
.customer-balance-strip .customer-current-balance { background: var(--surface-strong); }
.customer-current-balance dd { font-size: 19px; }
.customer-ledger-panel { padding: 12px 14px; min-width: 0; }
.customer-ledger-panel .section-heading { margin-bottom: 8px; }
.customer-empty { margin: 8px 0; color: var(--muted); font-size: 14px; }
.customer-history-table { width: 100%; margin-top: 8px; border-collapse: collapse; }
.customer-history-table th, .customer-history-table td {
    padding: 6px 8px;
    text-align: start;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.customer-history-table th { background: var(--surface-strong); color: var(--muted); }
.customer-history-table .customer-history-date { white-space: nowrap; color: var(--muted); }
.customer-history-table .customer-history-type, .customer-history-table .customer-history-actions { white-space: nowrap; }
.customer-history-table .customer-history-note { width: 100%; max-width: 0; }
.customer-history-note > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-history-table .customer-history-amount, .customer-history-table th:nth-last-child(2) { text-align: end; }
.customer-history-table .customer-history-amount { white-space: nowrap; font-weight: 700; }
.customer-ledger-icons { gap: 5px; justify-content: flex-start; }
.customer-icon-button {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--primary-dark);
    font-size: 21px;
    cursor: pointer;
}
.customer-icon-button svg { width: 16px; height: 16px; }
.customer-icon-button:hover { background: #eff6ff; }
.customer-icon-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.customer-icon-danger { color: #b91c1c; }
.customer-icon-danger:hover { background: #fef2f2; }
.customer-ledger-dialog {
    width: min(480px, calc(100% - 24px));
    max-height: calc(100dvh - 24px);
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.customer-ledger-dialog::backdrop { background: rgb(15 23 42 / 42%); }
.customer-ledger-dialog form, .customer-dialog-fields { display: grid; gap: 10px; }
.customer-ledger-dialog [hidden] { display: none; }
.customer-dialog-record { margin: 0; color: var(--muted); font-size: 13px; }
.customer-dialog-fields .field { min-width: 0; font-size: 14px; font-weight: 650; }
.customer-dialog-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 10px;
    background: var(--surface-strong);
    border-radius: 6px;
    font-size: 12px;
}
.customer-dialog-preview strong { display: block; font-size: 15px; }
.customer-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

@media (max-width: 650px) {
    .customer-overview .tab-list { width: 100%; }
    .customer-overview .tab-button { min-height: 44px; flex: 1 1 auto; }
    .customer-balance-strip > div { padding: 7px; }
    .customer-balance-strip dd { font-size: 14px; }
    .customer-current-balance dd { font-size: 15px; }
    .customer-balance-strip .amount-formatted, .customer-dialog-preview .amount-formatted { white-space: normal; }
    .customer-history-table, .customer-history-table tbody { display: block; }
    .customer-history-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
    .customer-history-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "type amount" "date actions" "note actions";
        gap: 2px 8px;
        align-items: center;
        padding: 8px 0;
        border-top: 1px solid var(--line);
    }
    .customer-history-table td { padding: 0; border: 0; min-width: 0; }
    .customer-history-date { grid-area: date; }
    .customer-history-table .customer-history-type { grid-area: type; white-space: normal; overflow-wrap: anywhere; }
    .customer-history-table .customer-history-note { grid-area: note; width: auto; max-width: none; }
    .customer-history-amount { grid-area: amount; }
    .customer-history-actions { grid-area: actions; justify-self: end; }
    .customer-icon-button { width: 44px; height: 44px; }
}

.sale-items {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.sale-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(96px, 120px) minmax(118px, 150px) minmax(118px, 150px) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
}

.sale-item-row [data-remove-sale-row] {
    min-width: 54px;
}

.sale-composer {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) minmax(90px, 0.7fr) minmax(100px, 0.8fr) minmax(100px, 0.9fr) auto;
    gap: 12px;
    align-items: end;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.sale-composer > *, .sale-line > * { min-width: 0; }
.sale-composer label [data-sale-unit] { margin-left: 4px; color: var(--muted); font-weight: 500; }
.sale-lines { margin-top: 8px; }
[data-sale-empty][hidden] { display: none; }
.sale-line {
    display: grid;
    grid-template-columns: 28px minmax(110px, 1.7fr) minmax(86px, 0.7fr) minmax(100px, 0.9fr) minmax(105px, 1fr) 44px;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.sale-line-no { color: var(--muted); font-size: 12px; }
.sale-line-name { display: grid; gap: 4px; overflow-wrap: anywhere; }
.sale-line-name > span, .sale-line-price > span, .sale-line-total > span {
    display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px;
}
.sale-line-name > strong { font-size: 14px; }
.sale-line-price, .sale-line-total { text-align: right; font-variant-numeric: tabular-nums; }
.sale-line-price strong { font-size: 13px; }
.sale-line-total strong { font-size: 15px; }
.sale-line .field label { font-size: 12px; }
.sale-line input { width: 100%; }
.sale-line-remove { width: 44px; height: 44px; min-width: 44px; padding: 0; font-size: 24px; color: #b91c1c; }
.sale-line-remove:hover { background: #fef2f2; }
.sale-line.is-invalid { border-color: #dc2626; }
.sale-form-error { color: #b91c1c; font-size: 13px; margin: 12px 0; }
.sale-undo { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 12px; font-size: 13px; }
.sale-undo[hidden] { display: none; }

@media (max-width: 1200px) {
    .sale-composer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sale-composer-product { grid-column: 1 / -1; }
    .sale-composer .btn { min-height: 44px; }
    .sale-line { grid-template-columns: 22px minmax(85px, 1fr) 86px minmax(85px, 1fr) 44px; }
    .sale-line-price { display: none; }
}

@media (max-width: 1023px) {
    .sale-header-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .sale-header-fields { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
    .sale-header-customer, .sale-header-fields > .field:nth-child(2) { grid-column: 1 / -1; }
    .sales-entry .sale-line input { min-height: 44px; }
    .sales-entry .sale-line { padding-block: 8px; }
    .sale-line {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
        grid-template-areas: 'name name remove' 'quantity total total';
        gap: 10px;
        padding: 16px 0;
    }
    .sale-line-no { display: none; }
    .sale-line-name { grid-area: name; }
    .sale-line .field { grid-area: quantity; max-width: 130px; }
    .sale-line-total { grid-area: total; justify-self: end; max-width: 100%; }
    .sale-line-remove { grid-area: remove; }
    .sale-line-total .amount-formatted { white-space: normal; }
}

.line-total-cell {
    min-height: 46px;
    display: grid;
    gap: 3px;
    align-content: center;
}

.line-total-cell span,
.sale-summary span,
.total-panel span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.line-total-cell strong {
    font-size: 17px;
    overflow-wrap: anywhere;
}

.sale-summary {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    min-width: 0;
}

.sale-summary div {
    display: grid;
    gap: 3px;
}

.sale-summary strong {
    font-size: 22px;
    line-height: 1;
    overflow-wrap: anywhere;
}

.total-panel {
    display: grid;
    gap: 10px;
    align-content: start;
}

.total-panel strong {
    font-size: 34px;
    line-height: 1;
    overflow-wrap: anywhere;
}

.payment-entry {
    display: grid;
    gap: 16px;
}

.payment-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
}

.money-field input {
    min-height: 58px;
    font-size: 26px;
    font-weight: 850;
}

.payment-preview {
    display: grid;
    gap: 16px;
    position: sticky;
    top: 88px;
}

.payment-preview h2 {
    margin-bottom: 0;
}

.payment-preview-lines {
    display: grid;
    gap: 12px;
}

.payment-preview-lines div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.payment-preview-lines div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.payment-preview-lines span,
.summary-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.payment-preview-lines strong {
    font-size: 21px;
    overflow-wrap: anywhere;
}

.summary-note {
    margin: 0;
    color: #475467;
    font-size: 14px;
}

.ledger-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.summary-card {
    min-width: 0;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(21, 32, 51, 0.06);
    display: grid;
    gap: 8px;
}

.summary-card strong {
    font-size: 26px;
    line-height: 1;
    overflow-wrap: anywhere;
}

.summary-card em {
    font-style: normal;
    justify-self: start;
}

.dual-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.json-block {
    min-height: 180px;
    max-height: 460px;
    overflow: auto;
    margin: 0;
    padding: 14px;
    border-radius: 8px;
    background: #101828;
    color: #f8fafc;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ledger-table .ledger-row-sale,
.ledger-table .ledger-row-opening-balance,
.ledger-table .ledger-row-manual-debit {
    background: #fffaf3;
}

.ledger-table .ledger-row-payment,
.ledger-table .ledger-row-manual-credit {
    background: #f2fbf7;
}

.ledger-table .ledger-row-sale-cancel,
.ledger-table .ledger-row-payment-cancel,
.ledger-table .ledger-row-price-adjustment,
.ledger-table .ledger-row-fuel-price-diff,
.record-cancelled {
    background: #fff7f6;
}

.ledger-table .ledger-row-sale:hover,
.ledger-table .ledger-row-opening-balance:hover,
.ledger-table .ledger-row-manual-debit:hover {
    background: #fff4e3;
}

.ledger-table .ledger-row-payment:hover,
.ledger-table .ledger-row-manual-credit:hover {
    background: #e9f8f1;
}

.ledger-table .ledger-row-sale-cancel:hover,
.ledger-table .ledger-row-payment-cancel:hover,
.ledger-table .ledger-row-price-adjustment:hover,
.ledger-table .ledger-row-fuel-price-diff:hover,
.record-cancelled:hover {
    background: #ffefed;
}

.fuel-difference-panel {
    margin-bottom: 16px;
}

.fuel-difference-form {
    display: grid;
    grid-template-columns: minmax(130px, 0.65fr) minmax(220px, 1.2fr) auto;
    gap: 12px;
    align-items: end;
}

.manual-ledger-panel {
    margin-bottom: 16px;
}

.manual-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.manual-entry-actions .btn.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: none;
}

.manual-ledger-warning {
    margin-bottom: 12px;
}

.manual-ledger-form {
    display: grid;
    grid-template-columns: minmax(160px, 0.75fr) minmax(130px, 0.65fr) minmax(220px, 1fr) minmax(260px, 1.15fr) auto;
    gap: 12px;
    align-items: end;
}

.manual-entry-preview {
    grid-column: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
}

.manual-entry-preview div {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.manual-entry-preview span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.manual-entry-preview strong {
    font-size: 18px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.manual-entry-preview .balance-status {
    justify-self: start;
}
.toggle-control {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    color: #344054;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.toggle-control input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.price-adjustment-row {
    display: none;
}

.price-adjustment-enabled .price-adjustment-row {
    display: table-row;
}

.price-adjustment-row td {
    background: #fffdf7;
}

.price-adjustment-grid {
    display: grid;
    gap: 10px;
}

.price-adjustment-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 260px) auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid #fde7bb;
    border-radius: 8px;
    background: #fffaf0;
}

.price-adjustment-item.is-adjusted {
    border-color: #fedf89;
}

.price-change-summary {
    display: block;
    margin-top: 4px;
    color: #9a5b0a;
    font-size: 12px;
    font-weight: 850;
}

.price-adjustment-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-adjustment-input-wrap input {
    min-width: 0;
    text-align: right;
    font-weight: 850;
}

.price-adjustment-input-wrap input:disabled {
    background: #f8fafc;
    color: #667085;
}

.price-adjustment-input-wrap input.is-saving {
    border-color: #f79009;
    box-shadow: 0 0 0 4px rgba(247, 144, 9, 0.16);
}

.amount-debit {
    color: var(--danger);
    font-weight: 800;
}

.amount-credit {
    color: #047857;
    font-weight: 800;
}

.amount-muted {
    color: #667085;
    font-weight: 800;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.amount-neutral {
    color: #667085;
    font-weight: 800;
}

.cancelled-panel {
    background: #fff7f6;
    border-color: #fecdca;
}

.cancellation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.balance-status {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 850;
}

.status-debt {
    background: #fef2f2;
    color: var(--danger);
}

.status-credit {
    background: #ecfdf3;
    color: #027a48;
}

.status-even {
    background: #eff8ff;
    color: #175cd3;
}

.compact-empty {
    min-height: 112px;
}

.empty-state {
    min-height: 168px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: var(--surface-strong);
    border: 1px dashed #c8d4e3;
    border-radius: 8px;
    text-align: center;
    padding: 18px;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.alert {
    border-radius: 8px;
    padding: 12px 14px;
    border: 1px solid transparent;
    font-weight: 700;
}

.alert-success {
    background: #ecfdf3;
    color: #027a48;
    border-color: #abefc6;
}

.alert-error {
    background: #fef3f2;
    color: #b42318;
    border-color: #fecdca;
}

.alert-info {
    background: #eff8ff;
    color: #175cd3;
    border-color: #b2ddff;
}

.footer {
    color: var(--muted);
    font-size: 13px;
    padding: 18px 28px 26px;
    text-align: center;
}

.mobile-bar {
    display: none;
}

.hamburger {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.hamburger span,
.hamburger span::before,
.hamburger span::after {
    width: 18px;
    height: 2px;
    display: block;
    background: currentColor;
    content: "";
}

.hamburger span::before {
    transform: translateY(-6px);
}

.hamburger span::after {
    transform: translateY(4px);
}


@media (min-width: 901px) {
    .responsive-table th:last-child,
    .responsive-table td:last-child {
        width: 176px;
    }

    .responsive-table td[data-label*="İşlem"] .row-actions,
    .responsive-table td[data-label="Detay"] .row-actions {
        flex-wrap: nowrap;
        width: max-content;
        max-width: 100%;
    }

    .responsive-table td[data-label*="İşlem"] .row-actions .btn,
    .responsive-table td[data-label="Detay"] .row-actions .btn,
    .responsive-table td[data-label*="İşlem"] .row-actions form,
    .responsive-table td[data-label="Detay"] .row-actions form {
        flex: 0 0 auto;
    }
}

.report-summary-note {
    margin: -6px 0 16px;
}
@media (min-width: 1600px) {
    .content {
        max-width: 1440px;
    }

    .content.content-wide {
        max-width: 1800px;
    }
}

@media (min-width: 2200px) {
    .content.content-wide {
        max-width: 2080px;
    }
}

@media (max-width: 1100px) {
    .ledger-table table {
        min-width: 0;
    }
}

@media (max-width: 900px) {
    .responsive-table table {
        min-width: 0;
    }

    .responsive-table th:not(:last-child),
    .responsive-table td:not(:last-child) {
        border-right: 0;
    }

    .responsive-table .col-date,
    .responsive-table .col-customer,
    .responsive-table .col-type,
    .responsive-table .col-description,
    .responsive-table .col-money,
    .responsive-table .col-number,
    .responsive-table .col-status,
    .responsive-table .col-actions {
        width: auto;
        min-width: 0;
        max-width: none;
        white-space: normal;
    }

    .responsive-table td[data-label*="Açıklama"],
    .responsive-table td[data-label*="Not"],
    .responsive-table td[data-label*="Özet"] {
        min-width: 0;
    }
}
@media (max-width: 1100px) {
    .filter-bar,
    .filter-bar.product-filter,
    .filter-bar.compact-filter,
    .filter-bar.sales-filter,
    .report-filter-grid,
    .vehicle-form,
    .fuel-difference-form,
    .manual-ledger-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-bar .filter-actions,
    .filter-bar.product-filter .filter-actions,
    .report-filter-grid .filter-actions {
        grid-column: 1 / -1;
        justify-self: start;
        min-width: 0;
        flex-wrap: wrap;
    }

    .vehicle-form > .btn,
    .fuel-difference-form > .btn,
    .manual-ledger-form > .btn {
        justify-self: start;
    }
}


@media (max-width: 1100px) {
    /* ledger-table tablet card layout */
    .ledger-table {
        overflow-x: visible;
    }

    .ledger-table table,
    .ledger-table thead,
    .ledger-table tbody,
    .ledger-table th,
    .ledger-table td,
    .ledger-table tr {
        display: block;
    }

    .ledger-table thead {
        display: none;
    }

    .ledger-table tr {
        border-bottom: 1px solid var(--line);
        padding: 12px 14px;
    }

    .ledger-table tr:last-child {
        border-bottom: 0;
    }

    .ledger-table td {
        display: grid;
        grid-template-columns: 128px minmax(0, 1fr);
        gap: 12px;
        align-items: center;
        width: auto;
        min-width: 0;
        border-bottom: 0;
        padding: 8px 0;
        text-align: left;
        white-space: normal;
    }

    .ledger-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 850;
        text-transform: uppercase;
    }

    .ledger-table .amount-debit,
    .ledger-table .amount-credit,
    .ledger-table .amount-muted,
    .ledger-table td[data-label*="Tutar"],
    .ledger-table td[data-label*="Toplam"],
    .ledger-table td[data-label*="Borç"],
    .ledger-table td[data-label*="Alacak"],
    .ledger-table td[data-label*="Bakiye"],
    .ledger-table td[data-label*="Fiyat"] {
        text-align: left;
        white-space: normal;
    }
}
@media (max-width: 900px) {
    .customer-ledger-empty-total {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .customer-ledger-empty-total > strong {
        grid-column: 1 / -1;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        z-index: 20;
        inset: 0 auto 0 0;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .mobile-bar {
        display: block;
    }

    .topbar {
        padding: 14px 18px;
    }

    .content {
        padding: 20px 16px;
    }

    .metric-grid,
    .dashboard-grid,
    .filter-bar,
    .filter-bar.product-filter,
    .filter-bar.compact-filter,
    .filter-bar.sales-filter,
    .detail-layout,
    .dual-panel-grid,
    .ledger-summary-grid,
    .payment-layout,
    .vehicle-form,
    .fuel-difference-form,
    .manual-ledger-form,
    .price-adjustment-item,
    .settings-grid,
    .sale-item-row {
        grid-template-columns: 1fr;
    }

    .recent-item {
        grid-template-columns: minmax(0, 1fr) max-content;
        gap: 6px 10px;
        min-height: 0;
        padding: 10px 0;
        align-items: start;
    }

    .recent-date {
        grid-column: 1 / 2;
    }

    .recent-type {
        grid-column: 2 / 3;
        max-width: 132px;
    }

    .recent-main {
        grid-column: 1 / -1;
    }

    .recent-amount {
        grid-column: 1 / 2;
        justify-self: start;
        text-align: left;
    }

    .detail-link {
        grid-column: 2 / 3;
        justify-self: end;
    }

    .user-pill {
        display: none;
    }

    .page-actions {
        align-items: flex-start;
        flex-direction: column;
    }
    .filter-actions,
    .row-actions,
    .report-tabs {
        width: 100%;
    }

    .filter-actions {
        flex-wrap: wrap;
        min-width: 0;
    }
    .filter-actions .btn,
    .row-actions .btn,
    .report-tabs .btn,
    .row-actions form {
        flex: 1;
    }

    .responsive-table {
        overflow-x: visible;
    }

    .responsive-table table,
    .responsive-table thead,
    .responsive-table tbody,
    .responsive-table th,
    .responsive-table td,
    .responsive-table tr {
        display: block;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        border-bottom: 1px solid var(--line);
        padding: 12px 14px;
    }

    .responsive-table tr:last-child {
        border-bottom: 0;
    }

    .price-adjustment-enabled .price-adjustment-row {
        display: block;
    }

    .responsive-table td {
        display: grid;
        grid-template-columns: 116px minmax(0, 1fr);
        gap: 12px;
        align-items: center;
        border-bottom: 0;
        padding: 8px 0;
    }

    .responsive-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 850;
        text-transform: uppercase;
    }

    .span-2 {
        grid-column: span 1;
    }

    .form-grid,
    .detail-list {
        grid-template-columns: 1fr;
    }

    .customer-type-selector,
    .compact-form-grid {
        grid-template-columns: 1fr;
    }

    .sale-summary {
        gap: 8px;
    }

    .sale-summary button { white-space: normal; min-height: 44px; }

    .payment-preview {
        position: static;
    }

    .manual-entry-preview {
        grid-column: span 1;
        grid-template-columns: 1fr;
    }
}



@media (max-width: 1100px) {
    /* ledger-table tablet card layout */
    .ledger-table {
        overflow-x: visible;
    }

    .ledger-table table,
    .ledger-table thead,
    .ledger-table tbody,
    .ledger-table th,
    .ledger-table td,
    .ledger-table tr {
        display: block;
    }

    .ledger-table thead {
        display: none;
    }

    .ledger-table tr {
        border-bottom: 1px solid var(--line);
        padding: 12px 14px;
    }

    .ledger-table tr:last-child {
        border-bottom: 0;
    }

    .ledger-table td {
        display: grid;
        grid-template-columns: 128px minmax(0, 1fr);
        gap: 12px;
        align-items: center;
        width: auto;
        min-width: 0;
        border-bottom: 0;
        padding: 8px 0;
        text-align: left;
        white-space: normal;
    }

    .ledger-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 850;
        text-transform: uppercase;
    }

    .ledger-table .amount-debit,
    .ledger-table .amount-credit,
    .ledger-table .amount-muted,
    .ledger-table td[data-label*="Tutar"],
    .ledger-table td[data-label*="Toplam"],
    .ledger-table td[data-label*="Borç"],
    .ledger-table td[data-label*="Alacak"],
    .ledger-table td[data-label*="Bakiye"],
    .ledger-table td[data-label*="Fiyat"] {
        text-align: left;
        white-space: normal;
    }
}
@media (max-width: 900px) {
    .pagination-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination-size,
    .pagination-links {
        width: 100%;
    }

    .pagination-links .btn {
        flex: 1;
    }
}
@media (max-width: 520px) {
    .auth-card {
        padding: 24px;
    }

    .topbar {
        align-items: flex-start;
    }

    .page-title h1 {
        font-size: 21px;
    }

    .metric-value {
        font-size: 26px;
    }

    .btn {
        padding-inline: 12px;
    }

    .responsive-table td {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

.detail-tabs {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 30px rgba(21, 32, 51, 0.06);
}

.tab-button {
    flex: 1 1 180px;
    min-width: 0;
    min-height: 42px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #f8fbff;
    color: #334155;
    padding: 9px 12px;
    cursor: pointer;
    font-weight: 850;
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.03);
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.tab-button:hover {
    border-color: #bfd3f7;
    background: #eef4ff;
    color: #1d4ed8;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
}

.tab-button:focus {
    outline: none;
}

.tab-button:focus-visible {
    border-color: rgba(37, 99, 235, 0.85);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.tab-button.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.tab-button.is-active:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
    color: #fff;
}

.tab-panel {
    min-width: 0;
}

.tab-panel[hidden] {
    display: none !important;
}

.detail-tabs .vehicle-panel,
.detail-tabs .manual-ledger-panel,
.detail-tabs .fuel-difference-panel {
    margin-top: 0;
    margin-bottom: 0;
}

.detail-tabs .dual-panel-grid {
    margin-bottom: 16px;
}

.sales-detail-table .sale-detail-price-adjustment {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    align-items: stretch;
    min-width: 260px;
    padding: 9px;
}

.sale-detail-price-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sale-detail-price-copy .subtext {
    flex-basis: 100%;
}

.sales-detail-table .price-adjustment-input-wrap {
    align-items: stretch;
}

.sales-detail-table .price-adjustment-input-wrap input {
    min-width: 120px;
}

@media (min-width: 1400px) {
    .sales-detail-table .sale-detail-price-adjustment {
        grid-template-columns: minmax(0, 1fr) minmax(210px, 250px);
        align-items: center;
    }
}

@media (max-width: 520px) {
    .tab-button {
        flex-basis: 100%;
    }

    .sales-detail-table .sale-detail-price-adjustment {
        min-width: 0;
    }

    .sales-detail-table .price-adjustment-input-wrap {
        flex-direction: column;
    }
}

/* FAZ-10 controlled sales edit and totals */
.sale-detail { display: grid; gap: 12px; min-width: 0; }
.sale-detail > .panel { min-width: 0; padding: 12px 14px; }
.sale-detail-heading,
.sale-detail-identity {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
}
.sale-detail-heading { justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sale-detail-identity { min-width: 0; }
.sale-detail h2 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.sale-detail-actions .btn { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.sale-detail-menu { position: relative; }
.sale-detail-menu > summary {
    width: 36px;
    padding: 0;
    list-style: none;
}
.sale-detail-menu > summary::-webkit-details-marker,
.sale-detail-history summary::-webkit-details-marker { display: none; }
.sale-detail-menu form {
    position: absolute;
    inset: calc(100% + 5px) 0 auto auto;
    z-index: 4;
    width: max-content;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.sale-detail-menu .sale-detail-cancel { color: #b91c1c; background: transparent; }
.sale-detail-menu .sale-detail-cancel:hover { background: #fef2f2; transform: none; }
.sale-detail-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 8px 20px;
    align-items: center;
    padding-top: 10px;
}
.sale-detail-meta {
    display: flex;
    gap: 6px 20px;
    flex-wrap: wrap;
    margin: 0;
    min-width: 0;
}
.sale-detail-meta > div { min-width: 0; max-width: 100%; }
.sale-detail-meta dt, .sale-detail-total > span { color: var(--muted); font-size: 12px; }
.sale-detail-meta dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.sale-detail-total { text-align: end; min-width: 0; }
.sale-detail-total > strong { display: block; font-size: 23px; line-height: 1.2; }
.sale-detail-total .amount-formatted { text-align: inherit; white-space: normal; }
.sale-detail-note, .sale-detail-cancellation { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.sale-detail-note { white-space: pre-line; }
.sale-detail-cancellation { color: #991b1b; }
.sale-detail-cancellation > div { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.sale-detail .section-heading { gap: 6px 10px; margin-bottom: 8px; }
.sale-detail .responsive-table table { min-width: 0; }
.sale-detail .responsive-table :is(th, td) { padding: 7px 9px; font-size: 13px; }
.sale-detail .responsive-table th { font-size: 11px; }
.sale-detail .sales-detail-table :is(th, td):nth-last-child(-n + 3) { text-align: end; }
.sale-detail .sale-item-name .subtext, .sale-detail .sale-item-number .subtext { margin: 0; font-size: 11px; }
.sale-detail [hidden] { display: none; }
.sale-detail .sale-edit-panel { margin-top: 0; padding-top: 0; border-top: 0; gap: 8px; }
.sale-detail-history summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 8px;
    min-height: 32px;
    font-size: 13px;
    list-style: none;
    cursor: pointer;
}
.sale-detail-history summary::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-inline: 2px 4px;
    border-inline-end: 2px solid var(--muted);
    border-block-end: 2px solid var(--muted);
    transform: rotate(-45deg);
}
.sale-detail-history details[open] > summary::before,
.sale-detail-history[open] > summary::before { transform: rotate(45deg); }
.sale-history-body { display: grid; gap: 10px; }
.sale-history-totals { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: 12px; }
.sale-history-group { padding-top: 6px; border-top: 1px solid var(--line); }
.sale-history-group h3 { margin: 0 0 6px; font-size: 13px; }
.sale-history-empty { margin: 0; padding: 2px 4px; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
    .sale-detail .sale-detail-actions { width: auto; }
    .sale-detail .sale-detail-actions .btn { flex: 0 0 auto; min-height: 44px; white-space: nowrap; }
    .sale-detail-menu > summary { width: 44px; }
    .sale-detail :is([data-sale-edit-open], .sale-edit-panel .btn, .sale-detail-history summary) { min-height: 44px; }
    .sale-detail .sales-detail-table tbody tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px 8px;
        padding: 8px 0;
    }
    .sale-detail .sales-detail-table tbody td { display: block; padding: 0; border: 0; min-width: 0; }
    .sale-detail .sales-detail-table tbody td.row-no { display: none; }
    .sale-detail .sales-detail-table .sale-item-name { grid-column: 1 / -1; }
    .sale-detail .sales-detail-table .sale-item-name::before { display: none; }
    .sale-detail .sales-detail-table .sale-item-number { text-align: start; }
    .sale-detail .sales-detail-table .sale-item-number::before { display: block; font-size: 10px; }
    .sale-detail .sales-detail-table :is(.amount-formatted, .quantity-formatted) { text-align: inherit; white-space: normal; }
    .sale-detail-items > .section-heading { align-items: center; flex-wrap: wrap; }
    .sale-detail [data-sale-edit-open] { white-space: nowrap; }
    .sale-detail .sale-edit-panel .row-actions { width: auto; justify-content: flex-start; }
}
@media (max-width: 600px) {
    .sale-detail-summary { grid-template-columns: minmax(0, 1fr); }
    .sale-detail-total { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 8px; flex-wrap: wrap; }
    .sale-detail-meta { gap: 6px 14px; }
}

tfoot td {
    background: #f8fafc;
    border-top: 2px solid #cfd8e3;
    color: #344054;
    font-weight: 850;
}

.sale-edit-panel {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.sale-edit-panel[hidden] {
    display: none !important;
}

.sale-edit-table table {
    min-width: 860px;
}

.sale-edit-table input,
.sale-edit-table select {
    min-height: 38px;
    padding: 7px 9px;
}

.sale-edit-table td[data-label="Miktar"],
.sale-edit-table td[data-label="Birim Fiyat"],
.sale-edit-table td[data-label="Satır Toplamı"] {
    white-space: nowrap;
}

.compact-heading {
    margin-bottom: 0;
}

.compact-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.detail-tabs .vehicle-form {
    grid-template-columns: minmax(220px, 260px) minmax(140px, 170px);
    justify-content: start;
}

.detail-tabs .vehicle-form .btn {
    width: 100%;
}

.ledger-table .ledger-row-sale-revision,
.ledger-table .ledger-row-sale-revision:hover {
    background: #fffaf3;
}

@media (max-width: 1100px) {
    .detail-tabs .vehicle-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .responsive-table tfoot,
    .responsive-table tfoot tr,
    .responsive-table tfoot td {
        display: block;
    }

    .responsive-table tfoot tr {
        padding: 12px 14px;
        border-top: 1px solid var(--line);
    }

    .responsive-table tfoot td {
        border-bottom: 0;
        padding: 8px 0;
        text-align: left;
        white-space: normal;
    }

    .sale-edit-table table {
        min-width: 0;
    }

    .compact-actions {
        justify-content: stretch;
    }

    .detail-tabs .vehicle-form {
        grid-template-columns: 1fr;
    }
}


/* UI/report total hotfix */
.amount-formatted.amount-formatted {
    display: inline-block;
    align-items: baseline;
    justify-content: flex-end;
    white-space: nowrap;
    font-size: inherit;
    color: inherit;
    font-variant-numeric: tabular-nums;
}

.amount-formatted.amount-formatted > .amount-main,
.amount-formatted.amount-formatted > .amount-decimal,
.amount-formatted.amount-formatted > .amount-currency {
    display: inline-block;
}

.amount-formatted.amount-formatted > .amount-main {
    color: inherit;
    font-size: 1em;
    font-weight: inherit;
}

.amount-formatted.amount-formatted > .amount-decimal {
    color: inherit;
    font-size: 0.82em;
    font-weight: 700;
    margin-left: 1px;
    opacity: 0.72;
}

.amount-formatted.amount-formatted > .amount-currency {
    color: inherit;
    font-size: 0.78em;
    font-weight: 700;
    margin-left: 0;
    opacity: 0.72;
}

.balance-state-label {
    display: block;
    color: inherit;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.2;
    margin-top: 2px;
}

.amount-debit .amount-formatted,
.amount-credit .amount-formatted,
.amount-muted .amount-formatted,
.amount-neutral .amount-formatted,
.col-money .amount-formatted,
td[data-label*="Tutar"] .amount-formatted,
td[data-label*="Toplam"] .amount-formatted,
td[data-label*="Borç"] .amount-formatted,
td[data-label*="Alacak"] .amount-formatted,
td[data-label*="Bakiye"] .amount-formatted,
td[data-label*="Fiyat"] .amount-formatted {
    min-width: 0;
}

.responsive-table tfoot td {
    vertical-align: middle;
}

.responsive-table tfoot .amount-debit,
.responsive-table tfoot .amount-credit,
.responsive-table tfoot .amount-neutral,
.responsive-table tfoot .col-money,
.responsive-table tfoot .col-number {
    text-align: right;
}

.vehicle-panel .vehicle-form,
.detail-tabs .vehicle-form {
    grid-template-columns: minmax(220px, 260px) minmax(140px, 170px) !important;
    align-items: end;
    justify-content: start;
    max-width: 450px;
}

.vehicle-panel .vehicle-form .field,
.vehicle-panel .vehicle-form input,
.vehicle-panel .vehicle-form .btn {
    width: 100%;
}

.vehicle-panel table {
    min-width: 720px;
}

.vehicle-panel .col-plate {
    width: 250px;
}

.vehicle-panel .col-status {
    width: 130px;
}

.vehicle-panel .col-actions {
    width: 340px;
}

.vehicle-panel td[data-label="Plaka"] input {
    max-width: 190px;
    min-width: 130px;
}

.vehicle-panel td[data-label="Durum"] select {
    max-width: 124px;
}

.vehicle-panel td[data-label="İşlem / Detay"] .row-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
}

@media (max-width: 900px) {
    .vehicle-panel .vehicle-form,
    .detail-tabs .vehicle-form {
        grid-template-columns: 1fr !important;
        max-width: none;
    }

    .vehicle-panel table {
        min-width: 0;
        width: 100%;
    }

    .vehicle-panel colgroup {
        display: none;
    }

    .vehicle-panel .col-plate,
    .vehicle-panel .col-status,
    .vehicle-panel .col-actions {
        width: auto;
    }

    .vehicle-panel td[data-label="Plaka"] input,
    .vehicle-panel td[data-label="Durum"] select {
        max-width: none;
        width: 100%;
    }

    .responsive-table tfoot .amount-debit,
    .responsive-table tfoot .amount-credit,
    .responsive-table tfoot .amount-neutral,
    .responsive-table tfoot .col-money,
    .responsive-table tfoot .col-number {
        text-align: left;
    }
}

/* Denetim kayıtları modal ve okunabilir değer tablosu */
.checkbox-field {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #344054;
    font-size: 14px;
    font-weight: 800;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.audit-filter-grid .audit-auth-toggle {
    align-self: end;
}

.audit-log-table table {
    min-width: 860px;
}

body.modal-open {
    overflow: hidden;
}

.audit-modal-backdrop[hidden] {
    display: none !important;
}

.audit-modal-backdrop {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(16, 24, 40, 0.56);
}

.audit-modal-panel {
    width: min(100%, 980px);
    max-height: min(88vh, 920px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    padding: 20px;
    outline: none;
}

.audit-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.audit-modal-header h2,
.audit-modal-values h3 {
    margin: 0;
}

.audit-modal-header .eyebrow,
.audit-modal-summary dt,
.audit-change-table th,
.audit-change-table td::before {
    text-transform: none !important;
}

.audit-modal-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}

.audit-modal-summary div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    padding: 10px 12px;
}

.audit-modal-summary dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.audit-modal-summary dd {
    margin: 3px 0 0;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.audit-modal-values {
    display: grid;
    gap: 10px;
}

.audit-change-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.audit-change-table th,
.audit-change-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
}

.audit-change-table th {
    background: #f8fafc;
    color: #475467;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.audit-change-table tr:last-child td {
    border-bottom: 0;
}

.audit-change-table th:first-child,
.audit-change-table td:first-child {
    width: 28%;
    font-weight: 850;
}

.audit-value,
.audit-change-table td {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.audit-change-empty {
    color: var(--muted);
    border: 1px dashed #c8d4e3;
    border-radius: 8px;
    background: var(--surface-strong);
    padding: 14px;
    text-align: center;
    font-weight: 750;
}

.audit-detail-values {
    margin-top: 16px;
}

@media (max-width: 900px) {
    .audit-log-table table {
        min-width: 0;
    }

    .audit-modal-backdrop {
        align-items: stretch;
        padding: 12px;
    }

    .audit-modal-panel {
        max-height: calc(100vh - 24px);
        padding: 16px;
    }

    .audit-modal-header {
        flex-direction: column;
    }

    .audit-modal-header .btn {
        width: 100%;
    }

    .audit-modal-summary {
        grid-template-columns: 1fr;
    }

    .audit-modal-summary .span-2 {
        grid-column: span 1;
    }

    .audit-change-table,
    .audit-change-table thead,
    .audit-change-table tbody,
    .audit-change-table tr,
    .audit-change-table th,
    .audit-change-table td {
        display: block;
    }

    .audit-change-table thead {
        display: none;
    }

    .audit-change-table tr {
        border-bottom: 1px solid var(--line);
        padding: 10px 12px;
    }

    .audit-change-table tr:last-child {
        border-bottom: 0;
    }

    .audit-change-table td {
        border-bottom: 0;
        padding: 7px 0;
    }

    .audit-change-table td:first-child {
        width: auto;
    }

    .audit-change-table td::before {
        display: block;
        color: var(--muted);
        font-size: 11px;
        font-weight: 850;
        text-transform: uppercase;
        margin-bottom: 2px;
    }

    .audit-change-table td:nth-child(1)::before { content: "Alan"; }
    .audit-change-table td:nth-child(2)::before { content: "Eski Değer"; }
    .audit-change-table td:nth-child(3)::before { content: "Yeni Değer"; }
}


/* Mobile customer list card pilot */
.mobile-card-money-label {
    display: none;
}

@media (max-width: 1023px) {
    .customer-mobile-list.responsive-table {
        overflow-x: visible;
    }

    .customer-mobile-list table,
    .customer-mobile-list thead,
    .customer-mobile-list tbody,
    .customer-mobile-list tr,
    .customer-mobile-list th,
    .customer-mobile-list td {
        display: block;
    }

    .customer-mobile-list table {
        min-width: 0;
        width: 100%;
    }

    .customer-mobile-list thead {
        display: none;
    }

    .customer-mobile-list .mobile-list-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "primary status"
            "type vehicle"
            "phone phone"
            "tax contact"
            "money money"
            "actions actions";
        gap: 10px 12px;
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid #dbe4f0;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(21, 32, 51, 0.06);
    }

    .customer-mobile-list .mobile-list-card:last-child {
        margin-bottom: 0;
    }

    .customer-mobile-list .mobile-list-card > td {
        min-width: 0;
        border: 0;
        padding: 0;
    }

    .customer-mobile-list .mobile-list-card > td::before {
        display: none;
        content: none;
    }

    .customer-mobile-list .mobile-card-primary {
        grid-area: primary;
        align-self: start;
    }

    .customer-mobile-list .mobile-card-title {
        display: block;
        color: #172033;
        font-size: 16px;
        font-weight: 900;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .customer-mobile-list .mobile-card-meta {
        display: block;
        margin-top: 4px;
        color: var(--muted);
        font-size: 12px;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .customer-mobile-list .mobile-card-status {
        grid-area: status;
        justify-self: end;
        align-self: start;
    }

    .customer-mobile-list .mobile-card-type {
        grid-area: type;
    }

    .customer-mobile-list .mobile-card-phone {
        grid-area: phone;
    }

    .customer-mobile-list .mobile-card-tax {
        grid-area: tax;
    }

    .customer-mobile-list .mobile-card-contact {
        grid-area: contact;
    }

    .customer-mobile-list .mobile-card-vehicle {
        grid-area: vehicle;
        justify-self: end;
        text-align: right;
    }

    .customer-mobile-list .mobile-card-field {
        display: flex;
        align-items: center;
        gap: 7px;
        min-width: 0;
        color: #344054;
        font-size: 13px;
        line-height: 1.35;
    }

    .customer-mobile-list .mobile-card-field::before {
        display: inline;
        flex: 0 0 auto;
        color: var(--muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 850;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .customer-mobile-list .mobile-card-type::before {
        content: none;
    }

    .customer-mobile-list .mobile-card-empty {
        display: none !important;
    }

    .customer-mobile-list .mobile-card-badge,
    .customer-mobile-list .badge {
        flex-shrink: 0;
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
    }

    .customer-mobile-list .mobile-card-money {
        grid-area: money;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface-strong);
        text-align: left;
    }

    .customer-mobile-list .mobile-card-money::before {
        content: none;
    }

    .customer-mobile-list .mobile-card-money-label {
        display: block;
        color: var(--muted);
        font-size: 12px;
        font-weight: 900;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .customer-mobile-list .mobile-card-money-value {
        display: grid;
        gap: 2px;
        justify-items: end;
        min-width: 0;
        text-align: right;
    }

    .customer-mobile-list .mobile-card-balance-state {
        margin-top: 0;
        text-align: right;
    }

    .customer-mobile-list .mobile-card-actions-cell {
        grid-area: actions;
    }

    .customer-mobile-list .mobile-card-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
        width: 100%;
    }

    .customer-mobile-list .mobile-card-actions .btn,
    .customer-mobile-list .mobile-card-action {
        min-height: 44px;
        justify-content: center;
        font-size: 14px;
    }
}

@media (max-width: 520px) {
    .customer-mobile-list .mobile-list-card {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "primary status"
            "type vehicle"
            "phone phone"
            "tax tax"
            "contact contact"
            "money money"
            "actions actions";
        gap: 9px 10px;
        padding: 12px;
    }

    .customer-mobile-list .mobile-card-money {
        align-items: flex-start;
    }
}


.customer-mobile-list .mobile-card-badge {
    flex-shrink: 0;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}


/* Mobile sales and payments list card pilot */
.mobile-only-card-meta {
    display: none;
}

@media (max-width: 1023px) {
    .transaction-mobile-list.responsive-table {
        overflow-x: visible;
    }

    .transaction-mobile-list table,
    .transaction-mobile-list thead,
    .transaction-mobile-list tbody,
    .transaction-mobile-list tfoot,
    .transaction-mobile-list tr,
    .transaction-mobile-list th,
    .transaction-mobile-list td {
        display: block;
    }

    .transaction-mobile-list table {
        min-width: 0;
        width: 100%;
    }

    .transaction-mobile-list thead {
        display: none;
    }

    .transaction-mobile-list .mobile-list-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 12px;
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid #dbe4f0;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(21, 32, 51, 0.06);
    }

    .sales-mobile-list .mobile-list-card {
        grid-template-areas:
            "primary status"
            "date date"
            "record record"
            "plate plate"
            "money money"
            "actions actions";
    }

    .payments-mobile-list .mobile-list-card {
        grid-template-areas:
            "primary status"
            "date date"
            "record record"
            "method method"
            "money money"
            "actions actions";
    }

    .transaction-mobile-list .mobile-list-card:last-child {
        margin-bottom: 0;
    }

    .transaction-mobile-list .mobile-list-card > td {
        min-width: 0;
        border: 0;
        padding: 0;
    }

    .transaction-mobile-list .mobile-list-card > td::before {
        display: none;
        content: none;
    }

    .transaction-mobile-list .mobile-card-primary {
        grid-area: primary;
        align-self: start;
    }

    .transaction-mobile-list .mobile-card-title {
        display: block;
        color: #172033;
        font-size: 16px;
        font-weight: 900;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .transaction-mobile-list .mobile-card-status {
        grid-area: status;
        justify-self: end;
        align-self: start;
    }

    .transaction-mobile-list .mobile-card-date {
        grid-area: date;
    }

    .transaction-mobile-list .mobile-card-record {
        grid-area: record;
        display: grid;
        gap: 4px;
        min-width: 0;
    }

    .transaction-mobile-list .mobile-card-plate {
        grid-area: plate;
    }

    .transaction-mobile-list .mobile-card-method {
        grid-area: method;
    }

    .transaction-mobile-list .mobile-card-field {
        display: flex;
        align-items: center;
        gap: 7px;
        min-width: 0;
        color: #344054;
        font-size: 13px;
        line-height: 1.35;
    }

    .transaction-mobile-list .mobile-card-field::before {
        display: inline;
        flex: 0 0 auto;
        color: var(--muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 850;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .transaction-mobile-list .mobile-card-record-link {
        display: inline-flex;
        max-width: 100%;
        width: fit-content;
        color: #344054;
        font-size: 13px;
        font-weight: 850;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .transaction-mobile-list .mobile-card-meta,
    .transaction-mobile-list .mobile-only-card-meta {
        display: block;
        color: var(--muted);
        font-size: 12px;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .transaction-mobile-list .mobile-card-clamp {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .transaction-mobile-list .mobile-card-empty {
        display: none !important;
    }

    .transaction-mobile-list .mobile-card-badge,
    .transaction-mobile-list .badge,
    .transaction-mobile-list .mobile-card-inline-pill {
        flex-shrink: 0;
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
    }

    .transaction-mobile-list .mobile-card-inline-pill {
        display: inline-flex;
        align-items: center;
        width: fit-content;
        max-width: 100%;
        padding: 5px 9px;
        border: 1px solid #dbe4f0;
        border-radius: 999px;
        background: #f8fafc;
        color: #344054;
        font-size: 12px;
        font-weight: 850;
    }

    .transaction-mobile-list .mobile-card-money {
        grid-area: money;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface-strong);
        text-align: left;
    }

    .transaction-mobile-list .mobile-card-money::before {
        content: none;
    }

    .transaction-mobile-list .mobile-card-money-label {
        display: block;
        color: var(--muted);
        font-size: 12px;
        font-weight: 900;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .transaction-mobile-list .mobile-card-money-value {
        display: grid;
        justify-items: end;
        min-width: 0;
        text-align: right;
    }

    .transaction-mobile-list .mobile-card-actions-cell {
        grid-area: actions;
    }

    .transaction-mobile-list .mobile-card-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
        width: 100%;
    }

    .transaction-mobile-list .mobile-card-actions .btn,
    .transaction-mobile-list .mobile-card-action {
        min-height: 44px;
        justify-content: center;
        font-size: 14px;
    }

    .transaction-mobile-list .mobile-card-actions form {
        min-width: 0;
        width: 100%;
    }

    .transaction-mobile-list tfoot {
        margin-top: 12px;
    }

    .transaction-mobile-list tfoot tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 12px;
        align-items: center;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface-strong);
    }

    .transaction-mobile-list tfoot td {
        border: 0;
        padding: 0;
    }

    .transaction-mobile-list tfoot td:first-child {
        color: var(--muted);
        font-size: 12px;
        font-weight: 900;
        text-transform: uppercase;
    }

    .transaction-mobile-list tfoot td:empty {
        display: none;
    }
}

@media (max-width: 520px) {
    .transaction-mobile-list .mobile-list-card {
        gap: 9px 10px;
        padding: 12px;
    }

    .transaction-mobile-list .mobile-card-money {
        align-items: flex-start;
    }
}

@media (max-width: 1023px) {
    .transaction-mobile-list .mobile-list-card > td.mobile-card-money {
        padding: 10px 12px;
        border: 1px solid var(--line);
    }
}


/* Mobile ledger list card pilot */
@media (max-width: 1023px) {
    .ledger-mobile-list.responsive-table,
    .customer-ledger-mobile-list.responsive-table {
        overflow-x: visible;
    }

    .ledger-mobile-list table,
    .ledger-mobile-list thead,
    .ledger-mobile-list tbody,
    .ledger-mobile-list tfoot,
    .ledger-mobile-list tr,
    .ledger-mobile-list th,
    .ledger-mobile-list td,
    .customer-ledger-mobile-list table,
    .customer-ledger-mobile-list thead,
    .customer-ledger-mobile-list tbody,
    .customer-ledger-mobile-list tfoot,
    .customer-ledger-mobile-list tr,
    .customer-ledger-mobile-list th,
    .customer-ledger-mobile-list td {
        display: block;
    }

    .ledger-mobile-list table,
    .customer-ledger-mobile-list table {
        min-width: 0;
        width: 100%;
    }

    .ledger-mobile-list thead,
    .customer-ledger-mobile-list thead {
        display: none;
    }

    .ledger-mobile-list .mobile-list-card,
    .customer-ledger-mobile-list .mobile-list-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 12px;
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid #dbe4f0;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(21, 32, 51, 0.06);
    }

    .ledger-mobile-list .mobile-list-card {
        grid-template-areas:
            'primary status'
            'date date'
            'description description'
            'debit credit'
            'actions actions';
    }

    .customer-ledger-mobile-list .mobile-list-card {
        grid-template-areas:
            'status date'
            'description description'
            'debit credit'
            'balance balance'
            'actions actions';
    }

    .ledger-mobile-list .mobile-list-card:last-child,
    .customer-ledger-mobile-list .mobile-list-card:last-child {
        margin-bottom: 0;
    }

    .ledger-mobile-list .mobile-list-card > td,
    .customer-ledger-mobile-list .mobile-list-card > td {
        min-width: 0;
        border: 0;
        padding: 0;
        text-align: left;
        white-space: normal;
    }

    .ledger-mobile-list .mobile-list-card > td::before,
    .customer-ledger-mobile-list .mobile-list-card > td::before {
        display: none;
        content: none;
    }

    .ledger-mobile-list .mobile-card-primary {
        grid-area: primary;
        align-self: start;
    }

    .ledger-mobile-list .mobile-card-title {
        display: block;
        color: #172033;
        font-size: 16px;
        font-weight: 900;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .ledger-mobile-list .mobile-card-status,
    .customer-ledger-mobile-list .mobile-card-status {
        grid-area: status;
        align-self: start;
    }

    .ledger-mobile-list .mobile-card-status {
        justify-self: end;
    }

    .customer-ledger-mobile-list .mobile-card-status {
        justify-self: start;
    }

    .ledger-mobile-list .mobile-card-badge,
    .ledger-mobile-list .badge,
    .customer-ledger-mobile-list .mobile-card-badge,
    .customer-ledger-mobile-list .badge {
        flex-shrink: 0;
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
    }

    .ledger-mobile-list .mobile-card-date,
    .customer-ledger-mobile-list .mobile-card-date {
        grid-area: date;
        display: flex;
        align-items: center;
        gap: 7px;
        min-width: 0;
        color: var(--muted);
        font-size: 12px;
        font-weight: 750;
        line-height: 1.35;
    }

    .customer-ledger-mobile-list .mobile-card-date {
        justify-self: end;
        text-align: right;
    }

    .ledger-mobile-list .mobile-card-date::before,
    .customer-ledger-mobile-list .mobile-card-date::before {
        display: inline;
        flex: 0 0 auto;
        color: var(--muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 850;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .ledger-mobile-list .mobile-card-description,
    .customer-ledger-mobile-list .mobile-card-description {
        grid-area: description;
        min-width: 0;
        color: #344054;
        font-size: 13px;
        line-height: 1.4;
        overflow-wrap: anywhere;
    }

    .ledger-mobile-list .mobile-card-description::before,
    .customer-ledger-mobile-list .mobile-card-description::before {
        display: block;
        margin-bottom: 3px;
        color: var(--muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 850;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .ledger-mobile-list .mobile-card-clamp,
    .customer-ledger-mobile-list .mobile-card-clamp {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .ledger-mobile-list .mobile-card-debit,
    .customer-ledger-mobile-list .mobile-card-debit {
        grid-area: debit;
    }

    .ledger-mobile-list .mobile-card-credit,
    .customer-ledger-mobile-list .mobile-card-credit {
        grid-area: credit;
    }

    .customer-ledger-mobile-list .mobile-card-balance {
        grid-area: balance;
        background: #fff;
    }

    .ledger-mobile-list .mobile-card-ledger-money,
    .customer-ledger-mobile-list .mobile-card-ledger-money {
        display: grid;
        gap: 4px;
        align-content: start;
        min-width: 0;
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface-strong);
        text-align: right;
        white-space: normal;
    }

    .ledger-mobile-list .mobile-card-ledger-money::before,
    .customer-ledger-mobile-list .mobile-card-ledger-money::before {
        display: block;
        color: var(--muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 900;
        line-height: 1.2;
        text-align: left;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .ledger-mobile-list .mobile-card-ledger-money .amount-formatted,
    .customer-ledger-mobile-list .mobile-card-ledger-money .amount-formatted {
        justify-self: end;
        max-width: 100%;
    }

    .ledger-mobile-list .mobile-card-ledger-money .amount-empty,
    .customer-ledger-mobile-list .mobile-card-ledger-money .amount-empty {
        justify-self: end;
    }

    .ledger-mobile-list .mobile-card-actions-cell,
    .customer-ledger-mobile-list .mobile-card-actions-cell {
        grid-area: actions;
    }

    .ledger-mobile-list .mobile-card-actions-cell::before,
    .customer-ledger-mobile-list .mobile-card-actions-cell::before {
        content: none;
    }

    .ledger-mobile-list .mobile-card-action,
    .customer-ledger-mobile-list .mobile-card-action {
        display: inline-flex;
        justify-content: center;
        min-height: 44px;
        width: 100%;
        font-size: 14px;
    }

    .ledger-mobile-list tfoot,
    .customer-ledger-mobile-list tfoot {
        margin-top: 12px;
    }

    .ledger-mobile-list tfoot tr,
    .customer-ledger-mobile-list tfoot tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 10px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface-strong);
    }

    .ledger-mobile-list tfoot td,
    .customer-ledger-mobile-list tfoot td {
        min-width: 0;
        border: 0;
        padding: 0;
        text-align: right;
        white-space: normal;
    }

    .ledger-mobile-list tfoot td::before,
    .customer-ledger-mobile-list tfoot td::before {
        content: none;
    }

    .ledger-mobile-list tfoot td:first-child,
    .customer-ledger-mobile-list tfoot td:first-child {
        grid-column: 1 / -1;
        color: var(--muted);
        font-size: 12px;
        font-weight: 900;
        text-align: left;
        text-transform: uppercase;
    }

    .ledger-mobile-list tfoot td:not(:first-child),
    .customer-ledger-mobile-list tfoot td:not(:first-child) {
        padding: 8px 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
    }

    .ledger-mobile-list tfoot td:nth-child(4),
    .customer-ledger-mobile-list tfoot td:nth-child(4) {
        grid-column: 1 / -1;
    }

    .ledger-mobile-list tfoot td:empty,
    .customer-ledger-mobile-list tfoot td:empty {
        display: none;
    }
}

@media (max-width: 520px) {
    .ledger-mobile-list .mobile-list-card,
    .customer-ledger-mobile-list .mobile-list-card {
        gap: 9px 10px;
        padding: 12px;
    }

    .ledger-mobile-list .mobile-card-ledger-money,
    .customer-ledger-mobile-list .mobile-card-ledger-money {
        padding: 9px 10px;
    }
}

@media (min-width: 1024px) and (max-width: 1100px) {
    .ledger-mobile-list.responsive-table,
    .customer-ledger-mobile-list.responsive-table {
        overflow-x: auto;
    }

    .ledger-mobile-list table,
    .customer-ledger-mobile-list table {
        display: table;
        min-width: 0;
        width: 100%;
    }

    .ledger-mobile-list thead,
    .customer-ledger-mobile-list thead {
        display: table-header-group;
    }

    .ledger-mobile-list tbody,
    .customer-ledger-mobile-list tbody {
        display: table-row-group;
    }

    .ledger-mobile-list tfoot,
    .customer-ledger-mobile-list tfoot {
        display: table-footer-group;
    }

    .ledger-mobile-list tr,
    .ledger-mobile-list .mobile-list-card,
    .customer-ledger-mobile-list tr,
    .customer-ledger-mobile-list .mobile-list-card {
        display: table-row;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .ledger-mobile-list th,
    .ledger-mobile-list td,
    .customer-ledger-mobile-list th,
    .customer-ledger-mobile-list td,
    .ledger-mobile-list .mobile-list-card > td,
    .customer-ledger-mobile-list .mobile-list-card > td {
        display: table-cell;
        border-bottom: 1px solid var(--line);
        padding: 12px 14px;
        white-space: normal;
    }

    .ledger-mobile-list td::before,
    .customer-ledger-mobile-list td::before,
    .ledger-mobile-list .mobile-list-card > td::before,
    .customer-ledger-mobile-list .mobile-list-card > td::before,
    .ledger-mobile-list tfoot td::before,
    .customer-ledger-mobile-list tfoot td::before {
        display: none;
        content: none;
    }

    .ledger-mobile-list .mobile-card-ledger-money,
    .customer-ledger-mobile-list .mobile-card-ledger-money {
        border: 0;
        border-radius: 0;
        background: transparent;
        text-align: right;
        white-space: nowrap;
    }

    .ledger-mobile-list .mobile-card-ledger-money::before,
    .customer-ledger-mobile-list .mobile-card-ledger-money::before {
        display: none;
        content: none;
    }

    .ledger-mobile-list .mobile-card-action,
    .customer-ledger-mobile-list .mobile-card-action {
        min-height: 0;
        width: auto;
    }
}


@media (max-width: 1023px) {
    .ledger-mobile-list .mobile-list-card > td.mobile-card-ledger-money,
    .customer-ledger-mobile-list .mobile-list-card > td.mobile-card-ledger-money {
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface-strong);
        box-sizing: border-box;
    }

    .customer-ledger-mobile-list .mobile-list-card > td.mobile-card-balance {
        background: #fff;
    }
}

@media (max-width: 520px) {
    .ledger-mobile-list .mobile-list-card > td.mobile-card-ledger-money,
    .customer-ledger-mobile-list .mobile-list-card > td.mobile-card-ledger-money {
        padding: 9px 10px;
    }
}

@media (min-width: 1024px) and (max-width: 1100px) {
    .ledger-mobile-list table,
    .customer-ledger-mobile-list table {
        min-width: 1120px;
    }

    .ledger-mobile-list .badge,
    .ledger-mobile-list .mobile-card-badge,
    .customer-ledger-mobile-list .badge,
    .customer-ledger-mobile-list .mobile-card-badge,
    .ledger-mobile-list td[data-label],
    .customer-ledger-mobile-list td[data-label] {
        word-break: normal;
        overflow-wrap: normal;
    }

    .ledger-mobile-list .mobile-card-status,
    .customer-ledger-mobile-list .mobile-card-status,
    .ledger-mobile-list .mobile-card-date,
    .customer-ledger-mobile-list .mobile-card-date,
    .ledger-mobile-list .mobile-card-actions-cell,
    .customer-ledger-mobile-list .mobile-card-actions-cell {
        white-space: nowrap;
    }
}


/* Mobile report cards pilot */
@media (max-width: 1023px) {
    .report-mobile-list.responsive-table {
        overflow-x: visible;
    }

    .report-mobile-list table,
    .report-mobile-list thead,
    .report-mobile-list tbody,
    .report-mobile-list tfoot,
    .report-mobile-list tr,
    .report-mobile-list th,
    .report-mobile-list td {
        display: block;
    }

    .report-mobile-list table {
        min-width: 0;
        width: 100%;
    }

    .report-mobile-list thead {
        display: none;
    }

    .report-mobile-list .mobile-list-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
        gap: 10px 12px;
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid #dbe4f0;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(21, 32, 51, 0.06);
    }

    .customer-balance-report-mobile .mobile-list-card {
        grid-template-areas:
            'primary balance'
            'type status'
            'phone tax'
            'debit credit'
            'date date'
            'actions actions';
    }

    .payment-report-mobile .mobile-list-card {
        grid-template-areas:
            'primary method'
            'date date'
            'amount amount'
            'status status'
            'actions actions';
    }

    .report-mobile-list .mobile-list-card:last-child {
        margin-bottom: 0;
    }

    .report-mobile-list .mobile-list-card > td {
        min-width: 0;
        border: 0;
        padding: 0;
        text-align: left;
        white-space: normal;
    }

    .report-mobile-list .mobile-list-card > td::before {
        display: none;
        content: none;
    }

    .report-mobile-list .mobile-card-primary {
        grid-area: primary;
        align-self: start;
    }

    .report-mobile-list .mobile-card-title {
        display: block;
        color: #172033;
        font-size: 16px;
        font-weight: 900;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .report-mobile-list .mobile-card-meta {
        display: block;
        margin-top: 4px;
        color: var(--muted);
        font-size: 12px;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .report-mobile-list .mobile-card-clamp {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .report-mobile-list .mobile-card-status {
        grid-area: status;
        align-self: start;
    }

    .customer-balance-report-mobile .mobile-card-status {
        justify-self: end;
    }

    .payment-report-mobile .mobile-card-status {
        justify-self: start;
    }

    .payment-report-mobile .mobile-card-method {
        grid-area: method;
        justify-self: end;
        align-self: start;
    }

    .report-mobile-list .mobile-card-badge,
    .report-mobile-list .badge {
        flex-shrink: 0;
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
    }

    .payment-report-mobile .mobile-card-method-badge {
        border-color: #dbe4f0;
        background: #f8fafc;
        color: #344054;
    }

    .report-mobile-list .mobile-card-field,
    .report-mobile-list .mobile-card-date {
        display: flex;
        align-items: center;
        gap: 7px;
        min-width: 0;
        color: #344054;
        font-size: 13px;
        line-height: 1.35;
    }

    .report-mobile-list .mobile-card-date {
        grid-area: date;
        color: var(--muted);
        font-size: 12px;
        font-weight: 750;
    }

    .customer-balance-report-mobile .mobile-card-type {
        grid-area: type;
    }

    .customer-balance-report-mobile .mobile-card-phone {
        grid-area: phone;
    }

    .customer-balance-report-mobile .mobile-card-tax {
        grid-area: tax;
    }

    .report-mobile-list .mobile-card-field::before,
    .report-mobile-list .mobile-card-date::before {
        display: inline;
        flex: 0 0 auto;
        color: var(--muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 850;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .report-mobile-list .mobile-card-report-money {
        display: grid;
        gap: 4px;
        align-content: start;
        min-width: 0;
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface-strong);
        text-align: right;
        white-space: normal;
    }

    .report-mobile-list .mobile-card-report-money::before {
        display: block;
        color: var(--muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 900;
        line-height: 1.2;
        text-align: left;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .report-mobile-list .mobile-card-report-money .amount-formatted {
        justify-self: end;
        max-width: 100%;
    }

    .customer-balance-report-mobile .mobile-card-debit {
        grid-area: debit;
    }

    .customer-balance-report-mobile .mobile-card-credit {
        grid-area: credit;
    }

    .customer-balance-report-mobile .mobile-card-balance {
        grid-area: balance;
        background: #fff;
    }

    .customer-balance-report-mobile .mobile-card-balance-state {
        justify-self: end;
        padding: 3px 7px;
        border: 1px solid currentColor;
        border-radius: 999px;
        font-size: 10px;
        line-height: 1.15;
        opacity: 0.88;
        white-space: nowrap;
    }

    .payment-report-mobile .mobile-card-amount {
        grid-area: amount;
        background: #f0fdf4;
    }

    .report-mobile-list .mobile-card-actions-cell {
        grid-area: actions;
    }

    .report-mobile-list .mobile-card-actions-cell::before {
        content: none;
    }

    .report-mobile-list .mobile-card-action {
        display: inline-flex;
        justify-content: center;
        min-height: 44px;
        width: 100%;
        font-size: 14px;
    }

    .report-mobile-list tfoot {
        margin-top: 12px;
    }

    .report-mobile-list tfoot tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 10px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface-strong);
    }

    .report-mobile-list tfoot td {
        min-width: 0;
        border: 0;
        padding: 0;
        text-align: right;
        white-space: normal;
    }

    .report-mobile-list tfoot td::before {
        content: none;
    }

    .report-mobile-list tfoot td:first-child {
        grid-column: 1 / -1;
        color: var(--muted);
        font-size: 12px;
        font-weight: 900;
        text-align: left;
        text-transform: uppercase;
    }

    .report-mobile-list tfoot td:not(:first-child) {
        padding: 8px 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
    }

    .customer-balance-report-mobile tfoot td:nth-child(4) {
        grid-column: 1 / -1;
    }

    .payment-report-mobile tfoot td:nth-child(2) {
        grid-column: 1 / -1;
    }

    .report-mobile-list tfoot td:empty {
        display: none;
    }
}

@media (max-width: 520px) {
    .report-mobile-list .mobile-list-card {
        gap: 9px 10px;
        padding: 12px;
    }

    .report-mobile-list .mobile-card-report-money {
        padding: 9px 10px;
    }

    .customer-balance-report-mobile .mobile-list-card {
        grid-template-columns: minmax(0, 1fr) minmax(104px, auto);
        grid-template-areas:
            'primary balance'
            'type status'
            'phone phone'
            'tax tax'
            'debit credit'
            'date date'
            'actions actions';
    }
}


@media (max-width: 1023px) {
    .report-mobile-list .mobile-list-card > td.mobile-card-report-money {
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface-strong);
        box-sizing: border-box;
    }

    .payment-report-mobile .mobile-list-card > td.mobile-card-amount {
        background: #f0fdf4;
    }

    .customer-balance-report-mobile .mobile-list-card > td.mobile-card-balance {
        background: #fff;
    }
}

@media (max-width: 520px) {
    .report-mobile-list .mobile-list-card > td.mobile-card-report-money {
        padding: 9px 10px;
    }
}

.catalog-workspace { min-width: 0; }
.catalog-heading { gap: 8px 16px; margin-bottom: 12px; }
.catalog-heading .row-actions { flex-wrap: wrap; }
.catalog-heading .btn { min-height: 36px; padding: 6px 11px; font-size: 13px; }
.filter-bar.catalog-filter {
    grid-template-columns: minmax(140px, 1.25fr) minmax(120px, 1fr) minmax(84px, .55fr)
        minmax(84px, .55fr) minmax(156px, .85fr) auto;
    gap: 8px 10px;
    padding: 12px;
    margin-bottom: 12px;
}
.catalog-filter .field, .catalog-order-picker .field { min-width: 0; gap: 4px; }
.catalog-filter .field label, .catalog-order-picker label { font-size: 12px; }
.catalog-filter .field input, .catalog-filter .field select, .catalog-filter .select2-lite-control,
.catalog-order-picker select, .catalog-filter .btn, .catalog-order-picker .btn {
    min-height: 36px;
    padding: 6px 9px;
    font-size: 13px;
}
.catalog-workspace .filter-actions { gap: 6px; flex-wrap: wrap; }
.catalog-workspace .responsive-table table { min-width: 0; }
.catalog-workspace .catalog-product-name > div { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.catalog-workspace td { font-size: 13px; }
.catalog-workspace .catalog-price { text-align: right; white-space: nowrap; }
.catalog-workspace .catalog-row-action { width: 70px; }
.catalog-workspace .catalog-icon { width: 34px; min-height: 34px; padding: 0; }
.catalog-workspace .catalog-icon:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.catalog-workspace .catalog-icon:disabled, .catalog-order-footer button:disabled {
    opacity: .42;
    cursor: default;
    transform: none;
    box-shadow: none;
}
.catalog-order-workspace { max-width: 800px; }
.catalog-order-picker { display: flex; align-items: end; gap: 8px; margin-bottom: 16px; }
.catalog-order-toolbar { display: flex; margin-bottom: 12px; }
.catalog-order-picker .field { flex: 0 1 290px; }
.catalog-order-back { margin-inline-start: auto; white-space: nowrap; }
.catalog-order-heading { display: flex; gap: 8px 12px; align-items: baseline; flex-wrap: wrap; padding: 0 0 8px; }
.catalog-order-heading h2 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.catalog-order-heading span { font-size: 13px; }
.catalog-order-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}
.catalog-order-list li {
    display: grid;
    grid-template-columns: 44px 3ch minmax(0, 1fr) repeat(2, 44px);
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-bottom: 1px solid var(--line);
}
.catalog-order-list li:last-child { border-bottom: 0; }
.catalog-order-list li.is-dragging { background: #eaf1ff; }
.catalog-order-item { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.catalog-order-item strong { font-size: 14px; overflow-wrap: anywhere; }
.catalog-order-list .catalog-icon { width: 44px; min-height: 44px; }
.catalog-order-position { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.catalog-drag-handle { cursor: grab; touch-action: none; user-select: none; }
.catalog-drag-handle:hover { background: var(--surface-strong); transform: none; }
.is-dragging .catalog-drag-handle { cursor: grabbing; }
.catalog-order-footer { display: flex; justify-content: flex-end; padding-top: 12px; }
.catalog-order-error { margin: 8px 0 0; color: var(--danger); font-weight: 700; font-size: 13px; }
.catalog-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (min-width: 901px) {
    .catalog-workspace th, .catalog-workspace td { padding: 6px 10px; }
    .catalog-workspace tbody tr { height: 47px; }
}
@media (max-width: 1200px) {
    .filter-bar.catalog-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .catalog-workspace .responsive-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
        grid-template-areas: "name name" "category price" "unit rank";
        gap: 4px 10px;
        padding: 8px 12px 10px;
    }
    .catalog-workspace.catalog-can-manage .responsive-table tbody tr {
        grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) 44px;
        grid-template-areas: "name name edit" "category price price" "unit rank rank";
    }
    .catalog-workspace .responsive-table tbody td {
        display: block;
        padding: 0;
        border-right: 0;
        min-width: 0;
        font-size: 13px;
    }
    .catalog-workspace .responsive-table td::before { display: none; }
    .catalog-workspace .responsive-table td.row-no { display: none; }
    .catalog-workspace .catalog-product-name { grid-area: name; }
    .catalog-workspace .catalog-product-name a { display: inline-flex; align-items: center; min-height: 44px; }
    .catalog-workspace .catalog-row-action { grid-area: edit; width: auto; }
    .catalog-workspace .catalog-category { grid-area: category; }
    .catalog-workspace .catalog-unit { grid-area: unit; color: var(--muted); }
    .catalog-workspace .catalog-rank { grid-area: rank; color: var(--muted); text-align: end; }
    .catalog-workspace .responsive-table .catalog-rank::before { display: inline; content: "Sıra: "; text-transform: none; font-weight: 650; }
    .catalog-workspace .catalog-status { grid-column: 1 / -1; }
    .catalog-workspace .catalog-icon { width: 44px; min-height: 44px; }
    .catalog-workspace .responsive-table .catalog-price { grid-area: price; text-align: end; font-weight: 750; }
    .catalog-heading .btn, .catalog-filter .btn, .catalog-order-picker .btn { min-height: 44px; }
    .catalog-order-toolbar .btn { min-height: 44px; }
    .catalog-filter .field input, .catalog-filter .field select, .catalog-filter .select2-lite-control,
    .catalog-order-picker select { min-height: 44px; }
}
@media (max-width: 600px) {
    .filter-bar.catalog-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalog-filter .filter-actions, .catalog-sort-field { grid-column: 1 / -1; }
    .catalog-heading .row-actions .btn { flex: 0 0 auto; white-space: nowrap; }
    .catalog-heading .row-actions .btn svg { display: none; }
}


/* PetrolCari sale editor sizing */
.sale-edit-panel > .section-heading { flex-wrap: wrap; }
.sale-detail .sale-edit-table :is(input:not([type="hidden"]), select, .select2-lite, .select2-lite-control) {
    min-width: 0;
    max-width: 100%;
}
.sale-detail .sale-edit-table [data-sale-edit-mode] { display: block; margin-top: 4px; }
.sale-detail .sale-edit-table [data-sale-edit-remove] { margin-top: 4px; }
.sale-detail .sale-edit-table td:not(.row-no) { white-space: normal; overflow-wrap: anywhere; }
@media (min-width: 901px) {
    .sale-detail .sale-edit-table table { width: 100%; max-width: 66rem; table-layout: fixed; }
    .sale-detail .sale-edit-table thead th:nth-last-child(1) { width: 13rem; }
    .sale-detail .sale-edit-table thead th:nth-last-child(2) { width: 8rem; }
    .sale-detail .sale-edit-table thead th:nth-last-child(3) { width: 7rem; }
    .sale-detail .sale-edit-table thead th:nth-last-child(4) { width: 4.5rem; }
    .sale-detail .sale-edit-table thead th.col-row-no { width: 3rem; }
}
@media (max-width: 900px) {
    .sale-detail .sale-edit-table tbody td:not(.row-no) {
        grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr);
        gap: 4px 8px;
    }
    .sale-detail .sale-edit-table :is([data-sale-edit-mode], [data-sale-edit-remove], td .subtext) { grid-column: 2; margin-top: 0; }
    .sale-detail .sale-edit-table td.row-no { display: none; }
    .sale-detail .sale-edit-table tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; }
}

@media (max-width: 440px) {
    .sale-detail .sale-edit-table tbody td:has([data-sale-edit-mode]) {
        grid-template-columns: minmax(0, 1fr);
    }
    .sale-detail .sale-edit-table tbody td:has([data-sale-edit-mode]) > * { grid-column: 1; }
    .sale-detail .sale-edit-table tbody td:has([data-sale-edit-mode]) > select { margin-top: 0; }
}
@media (min-width: 901px) and (max-width: 1050px) {
    .sale-detail .sale-edit-table thead th:nth-last-child(1) { width: 30%; }
    .sale-detail .sale-edit-table thead th:nth-last-child(2) { width: 17%; }
    .sale-detail .sale-edit-table thead th:nth-last-child(3) { width: 15%; }
    .sale-detail .sale-edit-table thead th:nth-last-child(4) { width: 10%; }
    .sale-detail .sale-edit-table thead th.col-row-no { width: 7%; min-width: 0; }
}
/* Keep the amount and its calculation mode together on wide screens. */
@media (min-width: 1280px) {
    .sale-detail .sale-edit-table table { max-width: 78rem; }
    .sale-detail .sale-edit-table thead th:nth-last-child(1) { width: 20rem; }
    .sale-detail .sale-edit-table [data-sale-edit-amount] {
        display: inline-block;
        width: 34%;
        vertical-align: middle;
    }
    .sale-detail .sale-edit-table [data-sale-edit-mode] {
        display: inline-block;
        width: calc(66% - 10px);
        margin-top: 0;
        vertical-align: middle;
    }
    .sale-detail .sale-edit-table [data-sale-edit-remove] { display: table; }
}
