﻿/* ==========================================================================
   YLS ERPS - Tasarim Sistemi
   Mobile-first. Once kucuk ekran kurallari yazilir, medya sorgulari yalnizca
   BUYUK ekranlar icin eklenir. CSS cercevesi kullanilmaz.
   ========================================================================== */

:root {
    /* Renk */
    --c-bg: #f4f5f7;
    --c-surface: #ffffff;
    --c-surface-2: #fafbfc;
    --c-border: #e3e6ea;
    --c-border-strong: #ccd2da;
    --c-text: #161a1f;
    --c-text-2: #59616e;
    --c-muted: #8b94a1;

    --c-primary: #2563eb;
    --c-primary-dark: #1d4ed8;
    --c-primary-soft: #ecf1fe;

    --c-danger: #d92d20;
    --c-danger-soft: #fdeceb;
    --c-success: #17803d;
    --c-success-soft: #e9f7ee;
    --c-warning: #b45309;
    --c-warning-soft: #fdf4e6;

    --c-sidebar: #0f172a;
    --c-sidebar-2: #1e293b;
    --c-sidebar-text: #94a3b8;
    --c-sidebar-head: #64748b;
    --c-sidebar-active: #2563eb;
    --c-sidebar-hover: rgba(148, 163, 184, .12);

    /* Olcu */
    --r-sm: 4px;
    --r: 6px;
    --r-lg: 10px;
    --header-h: 56px;
    --sidebar-w: 236px;

    --shadow-1: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow-2: 0 10px 28px rgba(16, 24, 40, .14);

    --fs-xs: 11.5px;
    --fs-sm: 12.5px;
    --fs: 13.5px;
    --fs-md: 15px;
    --fs-lg: 18px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--fs);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure, ul, ol {
    margin: 0;
}

ul, ol {
    padding: 0;
    list-style: none;
}

a {
    color: var(--c-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.icon-sm {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

/* Klavye ile gezinen kullanici odagi her zaman gorunur olmalidir. */
:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ==========================================================================
   Yerlesim
   ========================================================================== */

.layout {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    max-width: min(var(--sidebar-w), 100vw);
    background: var(--c-sidebar);
    color: var(--c-sidebar-text);
    transform: translateX(-105%);
    box-shadow: none;
    overflow: hidden;
}

.sidebar.is-open {
    transform: translateX(0);
    box-shadow: 8px 0 28px rgba(15, 23, 42, .35);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: var(--header-h);
    padding: 12px 14px;
    flex: 0 0 auto;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.sidebar-brand-link:hover {
    text-decoration: none;
}

.sidebar-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 8px;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.02em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.sidebar-brand-text strong {
    color: #f8fafc;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand-text span {
    color: var(--c-sidebar-head);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-close {
    display: inline-flex;
    padding: 6px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--c-sidebar-text);
    cursor: pointer;
}

.sidebar-close:hover {
    background: var(--c-sidebar-hover);
    color: #fff;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 8px 16px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .35) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(148, 163, 184, .3);
}

.nav-section + .nav-section {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(148, 163, 184, .12);
}

.nav-group-title {
    padding: 8px 10px 4px;
    color: var(--c-sidebar-head);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav-section.is-fold > .nav-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.nav-section.is-fold > .nav-group-title::-webkit-details-marker {
    display: none;
}

.nav-section.is-fold > .nav-group-title::marker {
    content: '';
}

.nav-section.is-fold > .nav-group-title:hover {
    background: var(--c-sidebar-hover);
    color: #cbd5e1;
}

.nav-fold-ico {
    flex: 0 0 auto;
    opacity: .55;
    transition: transform .15s ease;
}

.nav-section.is-fold[open] > .nav-group-title .nav-fold-ico {
    transform: rotate(180deg);
}

.nav-section-items {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 8px;
    border-left: 3px solid transparent;
    color: var(--c-sidebar-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
}

.nav-link .icon {
    width: 17px;
    height: 17px;
    opacity: .9;
}

.nav-link span {
    min-width: 0;
}

.nav-link:hover {
    background: var(--c-sidebar-hover);
    color: #f1f5f9;
    text-decoration: none;
}

.nav-link.is-active {
    background: rgba(37, 99, 235, .18);
    border-left-color: var(--c-sidebar-active);
    color: #fff;
    font-weight: 600;
}

.nav-link.is-active .icon {
    opacity: 1;
    color: #93c5fd;
}

.nav-link.is-disabled {
    color: #475569;
    cursor: default;
    pointer-events: none;
}

.nav-link .badge-soon {
    margin-left: auto;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .03em;
}

.nav-sub {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0 0 4px 13px;
    padding: 2px 0 4px 10px;
    border-left: 1px solid rgba(148, 163, 184, .22);
}

.nav-sub-link {
    display: flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 8px;
    border-radius: 6px;
    color: var(--c-sidebar-text);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
}

.nav-sub-link:hover {
    background: var(--c-sidebar-hover);
    color: #f1f5f9;
    text-decoration: none;
}

.nav-sub-link.is-active {
    background: rgba(37, 99, 235, .18);
    color: #fff;
    font-weight: 600;
}

.badge-info {
    background: #eff6ff;
    border-color: transparent;
    color: #1d4ed8;
}

.badge-muted {
    background: #f3f4f6;
    border-color: transparent;
    color: #6b7280;
}

.scrim {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(9, 13, 20, .5);
    opacity: 0;
    visibility: hidden;
}

.scrim.is-visible {
    opacity: 1;
    visibility: visible;
}

.main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--header-h);
    padding: 0 14px;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
}

.topbar-toggle {
    display: inline-flex;
    padding: 7px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface);
    color: var(--c-text-2);
    cursor: pointer;
}

.topbar-toggle:hover {
    background: var(--c-surface-2);
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.top-nav::-webkit-scrollbar {
    display: none;
}

.top-nav-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    height: 32px;
    padding: 0 11px;
    border-radius: 8px;
    color: var(--c-text-2);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -.01em;
    text-decoration: none;
    white-space: nowrap;
}

.top-nav-link:hover {
    background: var(--c-surface-2);
    color: var(--c-text);
    text-decoration: none;
}

.top-nav-link.is-active {
    background: var(--c-primary-soft);
    color: var(--c-primary-dark);
    font-weight: 600;
}

.topbar-spacer {
    flex: 1 1 auto;
}

.top-nav + .topbar-spacer {
    flex: 0 0 8px;
    min-width: 8px;
}

.topbar-meta {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.topbar-branch {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.topbar-branch-select {
    max-width: 180px;
    height: 32px;
    padding: 0 28px 0 10px;
    border-radius: 999px;
    font-size: var(--fs-sm);
}

.topbar-branch-label {
    display: none;
}

.content {
    flex: 1 1 auto;
    padding: 14px;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.page-head h1 {
    font-size: var(--fs-lg);
    font-weight: 600;
    letter-spacing: -.3px;
}

.page-head p {
    width: 100%;
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

/* ==========================================================================
   Kullanici menusu
   ========================================================================== */

.usermenu {
    position: relative;
}

.usermenu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}

.usermenu-trigger:hover {
    background: var(--c-surface-2);
    border-color: var(--c-border);
}

.avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--c-primary-soft);
    color: var(--c-primary-dark);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.usermenu-name {
    display: none;
    text-align: left;
    line-height: 1.2;
}

.usermenu-name b {
    display: block;
    font-size: var(--fs);
    font-weight: 600;
}

.usermenu-name span {
    display: block;
    color: var(--c-muted);
    font-size: var(--fs-xs);
}

.usermenu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 45;
    min-width: 210px;
    padding: 5px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-surface);
    box-shadow: var(--shadow-2);
}

.usermenu-panel[hidden] {
    display: none;
}

.usermenu-head {
    padding: 8px 10px 10px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 5px;
}

.usermenu-head b {
    display: block;
    font-size: var(--fs);
}

.usermenu-head span {
    color: var(--c-muted);
    font-size: var(--fs-xs);
}

.usermenu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--r);
    background: transparent;
    color: var(--c-text);
    font-size: var(--fs);
    text-align: left;
    cursor: pointer;
}

.usermenu-item:hover {
    background: var(--c-surface-2);
    text-decoration: none;
}

.usermenu-item.is-danger {
    color: var(--c-danger);
}

.usermenu-item.is-danger:hover {
    background: var(--c-danger-soft);
}

/* ==========================================================================
   Kart
   ========================================================================== */

.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}

.card + .card {
    margin-top: 14px;
}

.card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--c-border);
}

.card-head h2 {
    font-size: var(--fs-md);
    font-weight: 600;
}

.card-head .card-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.card-body {
    padding: 14px;
}

.card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface-2);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.card-hint {
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

/* ==========================================================================
   Istatistik kartlari
   ========================================================================== */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 12px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}

.stat-top {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--c-text-2);
    font-size: var(--fs-sm);
    font-weight: 500;
}

.stat-top .icon {
    color: var(--c-muted);
}

.stat-value {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -.5px;
}

.stat-value.is-pending {
    color: var(--c-border-strong);
}

.stat-hint {
    color: var(--c-muted);
    font-size: var(--fs-xs);
}

/* ==========================================================================
   Buton
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r);
    background: var(--c-surface);
    color: var(--c-text);
    font-size: var(--fs);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .12s, border-color .12s;
}

.btn:hover {
    background: var(--c-surface-2);
    text-decoration: none;
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.btn-primary {
    border-color: var(--c-primary);
    background: var(--c-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--c-primary-dark);
    border-color: var(--c-primary-dark);
}

.btn-danger {
    border-color: var(--c-danger);
    background: var(--c-surface);
    color: var(--c-danger);
}

.btn-danger:hover {
    background: var(--c-danger-soft);
}

.btn-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--c-text-2);
}

.btn-ghost:hover {
    background: var(--c-surface-2);
    color: var(--c-text);
}

.btn-sm {
    min-height: 30px;
    padding: 0 9px;
    font-size: var(--fs-sm);
}

.btn-icon {
    width: 32px;
    min-width: 32px;
    padding: 0;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ==========================================================================
   Form
   ========================================================================== */

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.field.is-wide {
    grid-column: 1 / -1;
}

.label {
    color: var(--c-text-2);
    font-size: var(--fs-sm);
    font-weight: 500;
}

.label .req {
    color: var(--c-danger);
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r);
    background: var(--c-surface);
    font-size: var(--fs);
    transition: border-color .12s, box-shadow .12s;
}

.textarea {
    min-height: 76px;
    resize: vertical;
}

.select {
    appearance: none;
    padding-right: 30px;
    /* Ok isareti: harici ikon dosyasi yerine tek satirlik veri URI */
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2359616e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 15px;
}

.input-sm {
    min-height: 30px;
    padding: 4px 8px;
    font-size: var(--fs-sm);
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-soft);
}

.input.has-error,
.select.has-error {
    border-color: var(--c-danger);
}

.input:disabled,
.select:disabled {
    background: var(--c-surface-2);
    color: var(--c-muted);
}

.field-error {
    color: var(--c-danger);
    font-size: var(--fs-sm);
}

.field-hint {
    color: var(--c-muted);
    font-size: var(--fs-xs);
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 9px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    cursor: pointer;
}

.check:hover {
    background: var(--c-surface-2);
}

.check input {
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
    accent-color: var(--c-primary);
    cursor: pointer;
}

.check span {
    font-size: var(--fs);
    line-height: 1.3;
}

.check-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
}

.filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--c-border);
}

.filters .btn {
    min-height: 36px;
}

/* ==========================================================================
   Tablo
   Kucuk ekranda satirlar karta donusur; hucre basliklari data-label'dan gelir.
   ========================================================================== */

.table-wrap {
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs);
}

.table thead {
    display: none;
}

.table tbody tr {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid var(--c-border);
}

.table tbody tr[data-row-href] {
    cursor: pointer;
}

.table tbody tr:last-child {
    border-bottom: 0;
}

.table td {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 3px 0;
}

.table td::before {
    content: attr(data-label);
    flex: 0 0 108px;
    color: var(--c-muted);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.table td:empty {
    display: none;
}

.table .cell-actions {
    justify-content: flex-end;
    gap: 6px;
    padding-top: 8px;
}

.table .cell-actions::before {
    content: none;
}

.table .cell-strong {
    font-weight: 600;
}

.table .cell-num {
    font-variant-numeric: tabular-nums;
}

.table .cell-muted {
    color: var(--c-text-2);
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    color: var(--c-muted);
    text-align: center;
}

.empty .icon {
    width: 26px;
    height: 26px;
}

.empty b {
    color: var(--c-text-2);
    font-weight: 600;
}

/* ==========================================================================
   Rozet, uyari, bildirim
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    color: var(--c-text-2);
    font-size: var(--fs-xs);
    font-weight: 500;
    white-space: nowrap;
}

.badge-success {
    background: var(--c-success-soft);
    border-color: transparent;
    color: var(--c-success);
}

.badge-danger {
    background: var(--c-danger-soft);
    border-color: transparent;
    color: var(--c-danger);
}

.badge-warning {
    background: var(--c-warning-soft);
    border-color: transparent;
    color: var(--c-warning);
}

.badge-primary {
    background: var(--c-primary-soft);
    border-color: transparent;
    color: var(--c-primary-dark);
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 13px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface-2);
    font-size: var(--fs);
}

.alert-error {
    background: var(--c-danger-soft);
    border-color: transparent;
    color: #8f1d16;
}

.alert-success {
    background: var(--c-success-soft);
    border-color: transparent;
    color: #10592c;
}

.alert-warning {
    background: var(--c-warning-soft);
    border-color: transparent;
    color: #85400a;
}

.alert-info {
    background: var(--c-primary-soft);
    border-color: transparent;
    color: #17418f;
}

.toast {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 80;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 13px;
    border-radius: var(--r-lg);
    background: var(--c-text);
    color: #fff;
    font-size: var(--fs);
    box-shadow: var(--shadow-2);
    animation: toast-in .18s ease-out;
}

.toast.is-success {
    background: #126130;
}

.toast.is-error {
    background: #a8231a;
}

.toast.is-warning {
    background: #8b4108;
}

.toast-close {
    margin-left: auto;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: inherit;
    opacity: .75;
    cursor: pointer;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* ==========================================================================
   Sayfalama
   ========================================================================== */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r);
    background: var(--c-surface);
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.page-link:hover {
    background: var(--c-surface-2);
    text-decoration: none;
}

.page-link.is-active {
    border-color: var(--c-primary);
    background: var(--c-primary);
    color: #fff;
}

.page-gap {
    padding: 0 2px;
    color: var(--c-muted);
}

/* ==========================================================================
   Yetki matrisi (rol duzenleme)
   ========================================================================== */

.matrix-group + .matrix-group {
    margin-top: 18px;
}

.matrix-title {
    margin-bottom: 8px;
    color: var(--c-text-2);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.matrix {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    overflow: hidden;
}

.matrix th,
.matrix td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--c-border);
    text-align: center;
    font-size: var(--fs-sm);
}

.matrix thead th {
    background: var(--c-surface-2);
    color: var(--c-text-2);
    font-weight: 600;
    white-space: nowrap;
}

.matrix tbody tr:last-child th,
.matrix tbody tr:last-child td {
    border-bottom: 0;
}

.matrix tbody th {
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
}

.matrix input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--c-primary);
    cursor: pointer;
}

.matrix .is-na {
    color: var(--c-border-strong);
}

.matrix-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Kimlik dogrulama ekrani
   ========================================================================== */

.auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px 14px;
    background: var(--c-bg);
}

.auth-box {
    width: 100%;
    max-width: 384px;
}

.auth-brand {
    margin-bottom: 18px;
    text-align: center;
}

.auth-brand strong {
    display: block;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -.5px;
}

.auth-brand span {
    color: var(--c-muted);
    font-size: var(--fs-sm);
}

.auth-card {
    padding: 20px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}

.auth-foot {
    margin-top: 14px;
    color: var(--c-muted);
    font-size: var(--fs-xs);
    text-align: center;
}

/* ==========================================================================
   Hata sayfasi
   ========================================================================== */

.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 14px;
}

.error-box {
    width: 100%;
    max-width: 520px;
    padding: 26px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    text-align: center;
}

.error-code {
    color: var(--c-muted);
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1px;
}

.error-box h1 {
    margin: 4px 0 8px;
    font-size: var(--fs-lg);
    font-weight: 600;
}

.error-box p {
    color: var(--c-text-2);
}

.error-box .btn-group {
    justify-content: center;
}

.error-trace {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--r);
    background: #12161c;
    color: #cbd5e1;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: var(--fs-xs);
    line-height: 1.55;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

/* ==========================================================================
   Yardimci siniflar
   ========================================================================== */

/* ==========================================================================
   Kart ozeti (malzeme / cari kartlarinin ust bandi)
   ========================================================================== */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.summary {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 11px 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}

.summary-label {
    color: var(--c-text-2);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.summary-value {
    font-size: var(--fs-lg);
    font-weight: 600;
    letter-spacing: -.3px;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.summary-value small {
    color: var(--c-muted);
    font-size: var(--fs-sm);
    font-weight: 500;
}

/* Tedarikci adi gibi metin degerler rakam boyutunda buyuk durmasin. */
.summary-text {
    font-size: var(--fs);
    font-weight: 600;
}

.summary-hint {
    color: var(--c-muted);
    font-size: var(--fs-xs);
}

.stat-label {
    color: var(--c-text-2);
    font-size: var(--fs-sm);
    font-weight: 500;
}

/* ==========================================================================
   Sekme
   Mobilde yatay kaydirilir; kolonlar gizlenmez.
   ========================================================================== */

.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 14px;
    padding-bottom: 2px;
    overflow-x: auto;
    border-bottom: 1px solid var(--c-border);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 8px 13px;
    border-bottom: 2px solid transparent;
    color: var(--c-text-2);
    font-size: var(--fs);
    font-weight: 500;
    white-space: nowrap;
}

.tab:hover {
    color: var(--c-text);
    text-decoration: none;
}

.tab.is-active {
    border-bottom-color: var(--c-primary);
    color: var(--c-primary);
}

/* ==========================================================================
   Detay listesi (dt/dd ciftleri)
   ========================================================================== */

.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px 18px;
    margin: 0;
}

.detail-grid dt {
    color: var(--c-muted);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.detail-grid dd {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
}

/* ==========================================================================
   Malzeme secici (otomatik tamamlama)
   ========================================================================== */

.picker-results {
    position: relative;
    z-index: 20;
    max-height: 280px;
    margin-top: 2px;
    overflow-y: auto;
    background: var(--c-surface);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r);
    box-shadow: var(--shadow-2);
}

.picker-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    padding: 8px 11px;
    border: 0;
    border-bottom: 1px solid var(--c-border);
    background: none;
    text-align: left;
    cursor: pointer;
}

.picker-item:last-child {
    border-bottom: 0;
}

.picker-item:hover,
.picker-item.is-active {
    background: var(--c-primary-soft);
}

.picker-item b {
    font-weight: 600;
}

.picker-item span {
    color: var(--c-muted);
    font-size: var(--fs-xs);
}

.picker-empty {
    padding: 11px;
    color: var(--c-muted);
    font-size: var(--fs-sm);
    text-align: center;
}

/* ==========================================================================
   FAZ 2 tablo / form eklentileri
   ========================================================================== */

.table-compact {
    font-size: var(--fs-sm);
}

.table tbody tr.row-danger {
    background: var(--c-danger-soft);
}

.input-qty {
    max-width: 130px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.check-inline {
    align-self: end;
    min-height: 36px;
    align-items: center;
}

.error-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 260px;
    overflow-y: auto;
    color: var(--c-danger);
    font-size: var(--fs-sm);
}

.error-list li {
    padding-left: 12px;
    border-left: 2px solid var(--c-danger);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

/* Dar ekranda ikincil kolonlar gizlenir; bilgi kartin genis halinde durur. */
.hide-sm,
.hide-md {
    display: none;
}

.grid-2 > .card + .card {
    margin-top: 0;
}

.text-success {
    color: var(--c-success);
}

.text-danger {
    color: var(--c-danger);
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.muted {
    color: var(--c-muted);
}

.text-sm {
    font-size: var(--fs-sm);
}

.mt {
    margin-top: 12px;
}

.divider {
    height: 1px;
    margin: 14px 0;
    background: var(--c-border);
}

/* ==========================================================================
   >= 640px  (buyuk telefon / kucuk tablet)
   ========================================================================== */

@media (min-width: 640px) {
    .content {
        padding: 18px;
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters {
        grid-template-columns: 1fr auto auto auto;
        align-items: end;
    }

    .filters-wide {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .field-grow {
        grid-column: 1 / -1;
    }

    .summary-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .table td.hide-sm {
        display: flex;
    }

    .toast {
        left: auto;
        right: 18px;
        bottom: 18px;
        max-width: 380px;
    }
}

/* ==========================================================================
   >= 900px  (tablet yatay) : tablo gercek tabloya doner
   ========================================================================== */

@media (min-width: 900px) {
    .table-wrap {
        overflow-x: auto;
    }

    .table-wrap.is-sales {
        overflow: visible;
    }

    .report-strip {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .table thead {
        display: table-header-group;
    }

    .table tbody tr {
        display: table-row;
        padding: 0;
    }

    .table tbody tr:hover {
        background: var(--c-surface-2);
    }

    .table th {
        padding: 9px 14px;
        border-bottom: 1px solid var(--c-border);
        background: var(--c-surface-2);
        color: var(--c-text-2);
        font-size: var(--fs-xs);
        font-weight: 600;
        letter-spacing: .04em;
        text-transform: uppercase;
        text-align: left;
        white-space: nowrap;
    }

    .table td {
        display: table-cell;
        padding: 9px 14px;
        border-bottom: 1px solid var(--c-border);
        vertical-align: middle;
    }

    .table td::before {
        content: none;
    }

    .table .cell-actions {
        text-align: right;
        white-space: nowrap;
    }

    .table .cell-num {
        text-align: right;
    }

    .table th.cell-num,
    .table th.cell-actions {
        text-align: right;
    }

    .table th.hide-sm,
    .table td.hide-sm,
    .table th.hide-md,
    .table td.hide-md {
        display: table-cell;
    }

    .table-compact td,
    .table-compact th {
        padding: 6px 10px;
    }

    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

/* ==========================================================================
   >= 1024px (masaustu)
   ========================================================================== */

@media (min-width: 1024px) {
    .sidebar {
        transform: none;
        box-shadow: none;
    }

    .sidebar.is-open {
        transform: none;
        box-shadow: none;
    }

    .sidebar-close,
    .topbar-toggle,
    .scrim {
        display: none !important;
    }

    .main {
        margin-left: var(--sidebar-w);
    }

    .topbar {
        padding: 0 20px;
        gap: 12px;
    }

    .top-nav {
        flex: 0 1 auto;
        gap: 4px;
    }

    .top-nav + .topbar-spacer {
        flex: 1 1 auto;
        min-width: 12px;
    }

    .topbar-meta {
        display: inline-flex;
    }

    .topbar-branch {
        display: inline-flex;
    }

    .topbar-branch-label {
        display: none;
    }

    .usermenu-name {
        display: block;
    }

    .content {
        padding: 20px;
    }

    .form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .filters-wide {
        grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    }

    .field-grow {
        grid-column: span 2;
    }

    .detail-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.filters-compact {
    align-items: end;
}

.ekstre-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px 18px;
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-surface);
}

.ekstre-head b { font-size: var(--fs-md); }

.ekstre-nums {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.ekstre-nums b {
    margin-left: 6px;
    color: var(--c-text);
    font-variant-numeric: tabular-nums;
    font-size: var(--fs-lg);
}

.ekstre-screen .page-head {
    align-items: flex-start;
    justify-content: space-between;
}

.ekstre-screen .page-head-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ekstre-screen .page-lead {
    margin: 0;
    width: auto;
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.ekstre-screen .sales-card,
.ekstre-card {
    overflow: visible;
}

.ekstre-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: end;
    padding: 10px 12px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface-2);
}

.ekstre-pick {
    position: relative;
}

.ekstre-summary {
    display: grid;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--c-border);
    background: linear-gradient(180deg, #fff 0%, var(--c-surface-2) 100%);
}

.ekstre-party {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ekstre-party-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--c-primary-soft);
    color: var(--c-primary);
}

.ekstre-party-icon .icon {
    width: 20px;
    height: 20px;
}

.ekstre-party-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ekstre-code {
    color: var(--c-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ekstre-title {
    font-size: var(--fs-md);
    font-weight: 700;
    letter-spacing: -.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ekstre-phone {
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.ekstre-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ekstre-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-left-width: 3px;
    border-radius: var(--r-lg);
    background: #fff;
}

.ekstre-kpi span {
    color: var(--c-muted);
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ekstre-kpi b {
    font-size: 15px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.ekstre-kpi.is-debit { border-left-color: #ea580c; }
.ekstre-kpi.is-debit b { color: #c2410c; }
.ekstre-kpi.is-credit { border-left-color: var(--c-success); }
.ekstre-kpi.is-credit b { color: var(--c-success); }

.ekstre-kpi.is-balance {
    border-left-color: var(--c-primary);
    border-color: transparent;
    background: var(--c-primary-soft);
}

.ekstre-kpi.is-balance b { color: var(--c-text); }
.ekstre-kpi.is-balance.is-neg b { color: var(--c-danger); }

.ekstre-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.ekstre-table {
    width: 100%;
    font-variant-numeric: tabular-nums;
}

.ekstre-table tbody tr.ekstre-row:hover {
    background: #f8fafc;
}

.ekstre-date {
    white-space: nowrap;
}

.ekstre-docno {
    display: block;
    overflow: hidden;
    color: var(--c-text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ekstre-type .badge {
    max-width: 100%;
    text-align: left;
    line-height: 1.25;
}

.ekstre-route {
    display: block;
    margin-top: 3px;
    color: var(--c-muted);
    font-size: var(--fs-xs);
    font-weight: 500;
    line-height: 1.3;
}

.ekstre-note {
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.ekstre-col-action {
    white-space: nowrap;
}

.ekstre-view {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    min-height: 28px;
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: var(--r);
    background: none;
    color: var(--c-primary);
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
}

.ekstre-view .icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.ekstre-view:hover {
    border-color: #bfdbfe;
    background: var(--c-primary-soft);
    color: var(--c-primary-dark);
}

.ekstre-screen .page-actions .btn.is-active {
    border-color: #93c5fd;
    background: var(--c-primary-soft);
    color: var(--c-primary-dark);
}

.ekstre-col-action {
    white-space: nowrap;
}

.ekstre-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.ekstre-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: #fff;
    color: var(--c-text-2);
    cursor: pointer;
}

.ekstre-toggle .icon {
    width: 14px;
    height: 14px;
    transition: transform .15s ease;
}

.ekstre-toggle.is-open {
    border-color: #93c5fd;
    background: var(--c-primary-soft);
    color: var(--c-primary);
}

.ekstre-toggle.is-open .icon {
    transform: rotate(180deg);
}

.ekstre-detail-row td {
    padding: 0 !important;
    overflow: visible !important;
}

.ekstre-detail-row td::before {
    content: none !important;
}

.ekstre-detail {
    margin: 0 10px 10px;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface-2);
}

.ekstre-detail-empty {
    margin: 0;
    color: var(--c-muted);
    font-size: var(--fs-sm);
}

.ekstre-pay-detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
}

.ekstre-pay-detail .is-wide {
    grid-column: 1 / -1;
}

.ekstre-pay-detail span {
    display: block;
    color: var(--c-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.ekstre-pay-detail b {
    display: block;
    margin-top: 2px;
    color: var(--c-text);
    font-size: 13px;
    font-weight: 650;
}

.ekstre-lines {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.ekstre-lines th,
.ekstre-lines td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--c-border);
    text-align: left;
}

.ekstre-lines th {
    color: var(--c-muted);
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.ekstre-lines .cell-num {
    text-align: right;
}

.ekstre-lines tr:last-child td {
    border-bottom: 0;
}

.ekstre-doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--c-border);
}

.ekstre-doc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: #fff;
    color: var(--c-text);
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.ekstre-doc-btn .icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.ekstre-doc-btn.is-wa {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.ekstre-doc-btn.is-print {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.ekstre-doc-btn.is-pdf {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.ekstre-bulk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--c-border);
    background: #fff;
}

.ekstre-bulk-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ekstre-bulk-copy b {
    font-size: 13px;
    font-weight: 750;
    letter-spacing: -.02em;
}

.ekstre-bulk-copy span {
    color: var(--c-muted);
    font-size: 12px;
}

.ekstre-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ekstre-wa-text {
    margin: 0 16px 12px;
    padding: 10px 12px;
    overflow: auto;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface-2);
    color: var(--c-text);
    font: inherit;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.ekstre-screen.is-detailed .ekstre-bulk {
    padding: 8px 10px;
}

.ekstre-screen.is-detailed .page-head {
    margin-bottom: 8px;
}

.ekstre-screen.is-detailed .page-lead {
    display: none;
}

.ekstre-screen.is-detailed .ekstre-filters {
    gap: 6px;
    padding: 8px 10px;
}

.ekstre-screen.is-detailed .ekstre-summary {
    gap: 8px;
    padding: 8px 10px;
}

.ekstre-screen.is-detailed .ekstre-party {
    gap: 8px;
}

.ekstre-screen.is-detailed .ekstre-party-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.ekstre-screen.is-detailed .ekstre-party-icon .icon {
    width: 16px;
    height: 16px;
}

.ekstre-screen.is-detailed .ekstre-title {
    font-size: 14px;
}

.ekstre-screen.is-detailed .ekstre-phone {
    font-size: 12px;
}

.ekstre-screen.is-detailed .ekstre-kpis {
    gap: 6px;
}

.ekstre-screen.is-detailed .ekstre-kpi {
    padding: 6px 8px;
    border-radius: var(--r);
}

.ekstre-screen.is-detailed .ekstre-kpi b {
    font-size: 13px;
}

.ekstre-screen.is-detailed .ekstre-foot {
    gap: 6px;
    padding: 8px 10px;
}

.ekstre-screen.is-detailed .ekstre-foot-item {
    padding: 6px 8px;
}

.ekstre-screen.is-detailed .ekstre-foot-item b {
    font-size: 13px;
}

.ekstre-screen.is-detailed .ekstre-detail {
    margin: 0 8px 6px;
    padding: 6px 8px;
}

.ekstre-screen.is-detailed .ekstre-doc-actions {
    margin-top: 6px;
    padding-top: 6px;
}

.ekstre-screen .doc-no {
    padding: 0;
    border: 0;
    background: none;
    color: var(--c-text);
    font: inherit;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    text-align: left;
    cursor: pointer;
}

.ekstre-screen .doc-no:hover {
    color: var(--c-primary);
    text-decoration: underline;
}

.badge-doc-receipt {
    background: #f3f4f6;
    border-color: transparent;
    color: #4b5563;
}

.badge-doc-invoice {
    background: var(--c-primary-soft);
    border-color: transparent;
    color: var(--c-primary-dark);
}

.badge-doc-in {
    background: var(--c-success-soft);
    border-color: transparent;
    color: var(--c-success);
}

.badge-doc-out {
    background: var(--c-warning-soft);
    border-color: transparent;
    color: var(--c-warning);
}

.badge-doc-return {
    background: #f5f3ff;
    border-color: transparent;
    color: #6d28d9;
}

.badge-doc-carry {
    background: #f8fafc;
    border-color: transparent;
    color: #64748b;
}

.badge-doc-offset {
    background: #ecfeff;
    border-color: transparent;
    color: #0f766e;
}

.ekstre-amt {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ekstre-amt.is-debit { color: #c2410c; }
.ekstre-amt.is-credit { color: var(--c-success); }

.badge.ekstre-amt.is-debit {
    background: #fff7ed;
    border-color: transparent;
    color: #c2410c;
}

.badge.ekstre-amt.is-credit {
    background: var(--c-success-soft);
    border-color: transparent;
    color: var(--c-success);
}

.ekstre-bal {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

.ekstre-bal.is-pos { color: var(--c-text); }
.ekstre-bal.is-neg { color: var(--c-danger); }

.ekstre-foot {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface-2);
}

.ekstre-foot-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--c-border);
    border-left-width: 3px;
    border-radius: var(--r);
    background: var(--c-surface);
}

.ekstre-foot-item.is-debit { border-left-color: #ea580c; }
.ekstre-foot-item.is-credit { border-left-color: var(--c-success); }

.ekstre-foot-item span {
    color: var(--c-muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.ekstre-foot-item b {
    font-size: 14px;
}

.ekstre-foot-item.is-net {
    background: var(--c-primary-soft);
    border-color: transparent;
    border-left-color: var(--c-primary);
}

.ekstre-empty {
    margin: 0;
    border: 0;
    border-radius: 0;
}

.ekstre-filters .btn {
    width: 100%;
}

@media (max-width: 639px) {
    .ekstre-kpis,
    .ekstre-foot,
    .ekstre-pay-detail {
        grid-template-columns: 1fr;
    }

    .ekstre-note {
        white-space: normal;
    }

    .ekstre-view,
    .ekstre-toggle,
    .ekstre-doc-btn {
        min-height: 40px;
    }

    .ekstre-doc-actions,
    .ekstre-bulk-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ekstre-bulk {
        align-items: stretch;
    }

    .ekstre-bulk-actions .ekstre-doc-btn {
        justify-content: center;
        min-height: 40px;
        width: 100%;
    }

    .ekstre-lines thead {
        display: none;
    }

    .ekstre-lines,
    .ekstre-lines tbody,
    .ekstre-lines tr,
    .ekstre-lines td {
        display: block;
        width: 100%;
    }

    .ekstre-lines tr {
        padding: 6px 0;
        border-bottom: 1px solid var(--c-border);
    }

    .ekstre-lines td {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        padding: 2px 0;
        border: 0;
        text-align: right;
    }

    .ekstre-lines td::before {
        content: attr(data-label);
        color: var(--c-muted);
        font-size: 11px;
        font-weight: 650;
        text-align: left;
    }

    .ekstre-table-wrap {
        overflow-x: visible;
    }
}

.pay-dlg {
    width: min(680px, 100%);
    max-height: min(92dvh, 860px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--c-surface);
    box-shadow: 0 24px 64px rgba(15, 23, 42, .28);
}

.pay-dlg-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    padding: 14px 18px;
    border-bottom: 1px solid var(--c-border);
    background: linear-gradient(180deg, #fff 0%, var(--c-surface-2) 100%);
}

.pay-dlg-bar-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    min-width: 0;
}

.pay-dlg-bar-title h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--c-text);
}

.pay-dlg-no {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 3px 10px;
    overflow: hidden;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pay-dlg-cancelled:not([hidden]) {
    display: inline-flex;
}

.pay-dlg-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 14px 16px 12px;
}

.pay-dlg-hero {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 14px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .06), transparent 55%),
        var(--c-surface-2);
}

.pay-dlg.is-out .pay-dlg-hero {
    background:
        linear-gradient(135deg, rgba(217, 45, 32, .06), transparent 55%),
        var(--c-surface-2);
}

.pay-dlg-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.pay-dlg-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pay-method {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 7px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    background: #fff;
    color: var(--c-text);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.2;
}

.pay-method .icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.pay-method.is-cash {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.pay-method.is-card {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.pay-method.is-transfer {
    border-color: #c7d2fe;
    background: #eef2ff;
    color: #3730a3;
}

.pay-method.is-check,
.pay-method.is-note {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.pay-method.is-other {
    border-color: var(--c-border-strong);
    background: #fff;
    color: var(--c-text-2);
}

.pay-dlg-hero-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-text-2);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.pay-dlg-hero-date .icon {
    color: var(--c-muted);
}

.pay-dlg-hero-amount {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pay-dlg-hero-amount > span {
    color: var(--c-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pay-dlg-hero-amount > b {
    color: var(--c-success);
    font-size: clamp(1.55rem, 2.4vw, 1.85rem);
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.pay-dlg.is-out .pay-dlg-hero-amount > b {
    color: #c2410c;
}

.pay-dlg-party {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: #fff;
}

.pay-dlg-party-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--c-primary-soft);
    color: var(--c-primary);
}

.pay-dlg-party-icon .icon {
    width: 20px;
    height: 20px;
}

.pay-dlg-party-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.pay-dlg-party-body b {
    color: var(--c-text);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pay-dlg-party-body > span:not(.pay-dlg-kicker):not(.visually-hidden) {
    color: var(--c-text-2);
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pay-dlg-kicker {
    display: block;
    margin-bottom: 2px;
    color: var(--c-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pay-dlg-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pay-dlg-meta > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface-2);
}

.pay-dlg-meta span {
    color: var(--c-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.pay-dlg-meta b {
    color: var(--c-text);
    font-size: 13px;
    font-weight: 650;
    word-break: break-word;
    font-variant-numeric: tabular-nums;
}

.pay-dlg-note {
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: #fff;
}

.pay-dlg-note p {
    margin: 0;
    color: var(--c-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.pay-dlg-related-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pay-dlg-related {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pay-dlg-related-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: #fff;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.pay-dlg-related-row:hover,
.pay-dlg-related-row:focus-visible {
    border-color: #93c5fd;
    background: #f8fbff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
    outline: none;
}

.pay-dlg-related-row.is-static {
    cursor: default;
}

.pay-dlg-related-row.is-static:hover,
.pay-dlg-related-row.is-static:focus-visible {
    border-color: var(--c-border);
    background: #fff;
    box-shadow: none;
}

.pay-dlg-related-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 8px;
    background: var(--c-primary-soft);
    color: var(--c-primary);
}

.pay-dlg-related-icon .icon {
    width: 16px;
    height: 16px;
}

.pay-dlg-related-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1 1 auto;
}

.pay-dlg-related-body span {
    color: var(--c-muted);
    font-size: 11px;
    font-weight: 650;
}

.pay-dlg-related-body b {
    color: var(--c-text);
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pay-dlg-related-amt {
    color: var(--c-text);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pay-dlg-related-go {
    display: grid;
    place-items: center;
    color: var(--c-muted);
    flex-shrink: 0;
}

.pay-dlg-related-go .icon {
    width: 16px;
    height: 16px;
}

.pay-dlg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    padding: 12px 16px;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface-2);
}

.pay-dlg-actions .btn {
    min-width: 96px;
}

@media (max-width: 640px) {
    .pay-dlg {
        width: 100%;
        max-height: min(96dvh, 100%);
    }

    .pay-dlg-meta {
        grid-template-columns: 1fr;
    }

    .pay-dlg-hero-amount > b {
        font-size: 1.55rem;
    }

    .pay-dlg-related-row {
        flex-wrap: wrap;
    }

    .pay-dlg-related-amt {
        margin-left: 44px;
    }

    .pay-dlg-related-go {
        margin-left: auto;
    }
}

@media (min-width: 900px) {
    .ekstre-filters {
        grid-template-columns: minmax(200px, 1.5fr) repeat(2, minmax(120px, .7fr)) minmax(140px, .9fr) minmax(120px, .8fr) auto;
    }

    .ekstre-filters .btn {
        width: auto;
        min-height: 38px;
    }

    .ekstre-summary {
        grid-template-columns: minmax(0, 1.15fr) minmax(340px, 1fr);
        align-items: center;
        gap: 16px;
        padding: 14px 16px;
    }

    .ekstre-bulk {
        padding: 10px 16px;
    }

    .ekstre-table-wrap {
        overflow-x: auto;
    }

    .ekstre-table {
        table-layout: fixed;
        width: 100%;
        min-width: 0;
        border-collapse: collapse;
    }

    .ekstre-table col.ekstre-c-date { width: 88px; }
    .ekstre-table col.ekstre-c-no { width: 108px; }
    .ekstre-table col.ekstre-c-type { width: 16%; }
    .ekstre-table col.ekstre-c-note { width: auto; }
    .ekstre-table col.ekstre-c-debit { width: 92px; }
    .ekstre-table col.ekstre-c-credit { width: 92px; }
    .ekstre-table col.ekstre-c-bal { width: 100px; }
    .ekstre-table col.ekstre-c-act { width: 112px; }

    .ekstre-screen .ekstre-table th,
    .ekstre-screen .ekstre-table td {
        box-sizing: border-box;
        padding: 8px 10px;
        overflow: hidden;
        vertical-align: middle;
    }

    .ekstre-table th {
        white-space: nowrap;
    }

    .ekstre-table td.ekstre-type .badge {
        display: inline-block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ekstre-table td.ekstre-note {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ekstre-table th.cell-num,
    .ekstre-table td.cell-num {
        overflow: hidden;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ekstre-screen.sales-screen .ekstre-table th.ekstre-col-action,
    .ekstre-screen.sales-screen .ekstre-table td.ekstre-col-action {
        width: 112px;
        min-width: 112px;
        max-width: 112px;
        padding-left: 6px;
        padding-right: 10px;
        overflow: hidden;
        text-align: right;
        white-space: nowrap;
    }

    .ekstre-table.is-detailed col.ekstre-c-act {
        width: 156px;
    }

    .ekstre-screen.sales-screen .ekstre-table.is-detailed th.ekstre-col-action,
    .ekstre-screen.sales-screen .ekstre-table.is-detailed td.ekstre-col-action {
        width: 156px;
        min-width: 156px;
        max-width: 156px;
        overflow: visible;
    }

    .ekstre-detail-row {
        display: table-row;
    }

    .ekstre-screen.is-detailed .ekstre-table th,
    .ekstre-screen.is-detailed .ekstre-table td {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .ekstre-screen.is-detailed .ekstre-table tbody tr.ekstre-row:hover {
        background: #f8fafc;
    }
}

.table .cell-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.page-actions form,
.table .cell-actions > form {
    display: contents;
}

@media (max-width: 639px) {
    .table .cell-actions {
        justify-content: flex-start;
        margin-top: 6px;
    }
}

.link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--c-primary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.link-btn:hover {
    text-decoration: underline;
}

.dlg {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
    background: rgba(17, 24, 39, .46);
}

.dlg[hidden] {
    display: none;
}

.dlg-card {
    width: min(720px, 100%);
    max-height: min(88dvh, 820px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    background: var(--c-surface);
    box-shadow: var(--shadow-2);
}

.dlg-card.pay-dlg {
    width: min(680px, 100%);
    max-height: min(92dvh, 860px);
}

.dlg-card-sm {
    width: min(420px, 100%);
    padding-bottom: 16px;
}

.dlg-card-sm .dlg-copy,
.dlg-card-sm .field,
.dlg-card-sm .dlg-actions {
    margin-left: 16px;
    margin-right: 16px;
}

.dlg-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 0;
}

.dlg-head h2 {
    font-size: var(--fs-lg);
    font-weight: 650;
}

.dlg-head p {
    margin-top: 2px;
}

.dlg-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin: 14px 16px 0;
    padding: 10px 12px;
    border-radius: var(--r);
    background: var(--c-surface-2);
}

.dlg-meta span {
    display: block;
    color: var(--c-muted);
    font-size: var(--fs-xs);
}

.dlg-meta b {
    font-weight: 600;
}

.dlg-scroll {
    overflow: auto;
    margin-top: 12px;
    padding: 0 16px;
}

.dlg-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.dlg-table th,
.dlg-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--c-border);
    text-align: left;
    font-size: var(--fs-sm);
}

.dlg-table th {
    color: var(--c-muted);
    font-weight: 600;
}

.dlg-table .cell-num {
    text-align: right;
}

.dlg-table .dlg-code {
    display: block;
    color: var(--c-muted);
    font-size: var(--fs-xs);
    font-weight: 400;
}

.dlg-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 18px;
    padding: 12px 16px 16px;
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.dlg-foot b {
    margin-left: 6px;
    color: var(--c-text);
    font-variant-numeric: tabular-nums;
}

.dlg-total {
    color: var(--c-text);
    font-weight: 650;
}

.dlg-total b {
    font-size: var(--fs-md);
}

.dlg-copy {
    margin: 12px 0;
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.dlg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.catalog-dlg {
    width: min(960px, 100%);
    max-height: min(92dvh, 880px);
}

.catalog-dlg-sm {
    width: min(520px, 100%);
    max-height: min(92dvh, 640px);
}

.catalog-dlg form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.catalog-dlg .dlg-scroll {
    flex: 1 1 auto;
    overflow: auto;
}

.catalog-dlg .dlg-actions {
    flex: 0 0 auto;
    margin-top: 0;
    padding: 10px 14px 12px;
}

.catalog-dlg .card {
    box-shadow: none;
}

.catalog-dlg .card + .card {
    margin-top: 8px;
}

.catalog-dlg .mat-form .card {
    margin-top: 8px;
}

.catalog-dlg .mat-form,
.catalog-dlg .acc-form {
    max-width: none;
}

.catalog-dlg .dlg-scroll > .card:first-of-type {
    margin-top: 0;
}

@media (max-width: 639px) {
    .dlg[data-dlg^="record-"] {
        align-items: stretch;
        padding: 0;
    }

    .dlg[data-dlg^="record-"] .catalog-dlg {
        width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }

    .dlg[data-dlg^="record-"] .dlg-actions {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

.report-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 12px;
}

.report-strip > div {
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-surface);
}

.report-strip span {
    display: block;
    color: var(--c-muted);
    font-size: var(--fs-xs);
}

.report-strip b {
    display: block;
    margin-top: 2px;
    font-size: var(--fs-md);
    font-variant-numeric: tabular-nums;
}

.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface-2);
}

.bulk-bar[hidden] {
    display: none;
}

.bulk-bar span {
    margin-right: auto;
    font-weight: 600;
}

.print-state {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-weight: 500;
}

.print-state b {
    font-weight: 600;
}

.print-state .muted {
    font-size: var(--fs-xs);
}

.cell-check {
    width: 36px;
}

.table td.cell-check {
    align-items: center;
}

@media (min-width: 900px) {
    .table td.cell-check::before {
        content: none;
    }
}

@media (max-width: 899px) {
    .table-wrap.is-sales .table thead {
        display: block;
    }

    .table-wrap.is-sales .table thead tr {
        display: flex;
        align-items: center;
        padding: 8px 14px;
        border-bottom: 1px solid var(--c-border);
    }

    .table-wrap.is-sales .table thead th {
        display: none;
        padding: 0;
        border: 0;
        background: none;
        text-transform: none;
        letter-spacing: 0;
        font-size: var(--fs-sm);
        font-weight: 600;
        color: var(--c-text);
    }

    .table-wrap.is-sales .table thead th.cell-check {
        display: flex;
        align-items: center;
        gap: 8px;
        width: auto;
    }

    .table-wrap.is-sales .table thead th.cell-check::after {
        content: 'Tümünü seç';
    }

    .sales-screen .table .cell-actions {
        justify-content: flex-end;
        margin-top: 8px;
    }

    .row-menu-panel {
        left: auto;
        right: 0;
        min-width: 176px;
    }
}

.row-menu {
    position: relative;
}

.row-menu-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 46;
    min-width: 188px;
    padding: 4px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-surface);
    box-shadow: var(--shadow-2);
}

.row-menu-panel.is-up {
    top: auto;
    bottom: calc(100% + 4px);
}

.row-menu-panel a,
.row-menu-panel button {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--r);
    background: none;
    color: var(--c-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.row-menu-panel a:hover,
.row-menu-panel button:hover {
    background: var(--c-surface-2);
    text-decoration: none;
}

.row-menu-panel .is-danger {
    color: var(--c-danger);
}

.row-menu-panel form {
    margin: 0;
}

.dlg-list {
    margin: 0 16px 4px;
    padding-left: 18px;
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.print-break {
    break-after: page;
    page-break-after: always;
}

.table-wrap.is-sales {
    overflow: visible;
}

@media (min-width: 640px) {
    .report-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 640px) {
    .dlg {
        align-items: center;
        padding: 24px;
    }
}

/* ==========================================================================
   Satış fişleri ekranı
   ========================================================================== */

.sales-screen .page-head {
    margin-bottom: 10px;
}

.sales-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 10px;
}

.sales-kpi {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 58px;
    padding: 8px 10px 8px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface);
    box-shadow: var(--shadow-1);
    border-left-width: 3px;
}

.sales-kpi span {
    color: var(--c-muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sales-kpi b {
    margin-top: 2px;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.sales-kpi.is-count { border-left-color: var(--c-text-2); }
.sales-kpi.is-cash { border-left-color: var(--c-success); }
.sales-kpi.is-card { border-left-color: var(--c-primary); }
.sales-kpi.is-transfer { border-left-color: #0f766e; }
.sales-kpi.is-account { border-left-color: var(--c-warning); }
.sales-kpi.is-net {
    border-left-color: var(--c-primary-dark);
    background: var(--c-primary-soft);
}

.sales-card {
    overflow: visible;
}

.sales-filter {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface-2);
}

.sales-filter-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 10px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r);
    background: var(--c-surface);
}

.sales-filter-search .icon-sm {
    color: var(--c-muted);
}

.sales-filter-search .input {
    border: 0;
    min-height: 32px;
    padding: 4px 0;
    box-shadow: none;
}

.sales-filter-search:focus-within {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-soft);
}

.sales-filter-date .input,
.sales-filter-account .input,
.sales-filter > .btn {
    min-height: 32px;
    width: 100%;
}

.sales-filter-account {
    position: relative;
    min-width: 0;
}

.sales-filter-account .picker-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
}

@media (min-width: 900px) {
    .sales-filter {
        grid-template-columns: 45fr 12fr 12fr 23fr minmax(7.5rem, 8fr);
        align-items: center;
    }

    .invoice-filter {
        grid-template-columns: 26fr 12fr 12fr 20fr 16fr minmax(7.5rem, 8fr);
    }
}

.invoice-filter .select {
    min-height: 32px;
    width: 100%;
}

.invoice-screen .table td {
    padding-top: 11px;
    padding-bottom: 11px;
}

.sales-bulk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #bfdbfe;
    background: var(--c-primary-soft);
    position: sticky;
    top: 0;
    z-index: 24;
}

.sales-bulk[hidden] {
    display: none;
}

.sales-bulk b {
    margin-right: auto;
    font-size: var(--fs-sm);
}

.badge-pay-cash {
    background: var(--c-success-soft);
    border-color: transparent;
    color: var(--c-success);
}

.badge-pay-card {
    background: var(--c-primary-soft);
    border-color: transparent;
    color: var(--c-primary-dark);
}

.badge-pay-transfer {
    background: #ecfdf8;
    border-color: transparent;
    color: #0f766e;
}

.badge-pay-account {
    background: var(--c-warning-soft);
    border-color: transparent;
    color: var(--c-warning);
}

.badge-pay-split {
    background: #f5f3ff;
    border-color: transparent;
    color: #6d28d9;
}

.badge-pay-return {
    background: var(--c-surface-2);
    color: var(--c-text-2);
}

.badge-print-on {
    background: var(--c-success-soft);
    border-color: transparent;
    color: var(--c-success);
}

.badge-print-off {
    background: #f3f4f6;
    border-color: transparent;
    color: #6b7280;
}

.sales-screen .doc-stack {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.sales-screen .doc-no {
    padding: 0;
    border: 0;
    background: none;
    color: var(--c-text);
    font: inherit;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    text-align: left;
    cursor: pointer;
}

.sales-screen .doc-no:hover {
    color: var(--c-primary);
    text-decoration: underline;
}

.sales-screen .doc-meta {
    color: var(--c-muted);
    font-size: var(--fs-xs);
}

.sales-screen .doc-converted {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.sales-screen .doc-link {
    color: var(--c-primary);
    font-size: var(--fs-xs);
    font-weight: 650;
}

.badge-converted {
    background: #eef2ff;
    border-color: transparent;
    color: #3730a3;
}

.sales-screen .cell-amount {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.row-split {
    display: inline-flex;
    align-items: stretch;
    vertical-align: middle;
    white-space: nowrap;
    flex: 0 0 auto;
}

.row-split .btn {
    min-height: 28px;
    font-size: 12px;
    font-weight: 600;
}

.row-btn-view {
    padding: 0 9px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.row-btn-more {
    width: 24px;
    min-width: 24px;
    padding: 0;
    border-left-width: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.row-btn-more .icon-sm {
    width: 12px;
    height: 12px;
}

.row-btn-more.is-open {
    background: var(--c-surface-2);
}

.sales-screen .row-menu-panel {
    min-width: 176px;
}

.sales-screen .table th.cell-actions,
.sales-screen .table td.cell-actions {
    width: auto;
    white-space: nowrap;
}

.dlg[data-dlg="receipt"] {
    align-items: center;
    background: rgba(15, 23, 42, .58);
}

.fis-dlg {
    width: min(960px, 100%);
    max-height: min(92dvh, 920px);
    background: #fff;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .28);
}

.fis-dlg-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    padding: 14px 18px;
    border-bottom: 1px solid var(--c-border);
}

.fis-dlg-bar-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    min-width: 0;
}

.fis-dlg-bar-title h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
}

.fis-no-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 3px 10px;
    overflow: hidden;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fis-dlg-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    padding: 16px 20px 18px;
}

.fis-dlg-brand {
    text-align: center;
}

.fis-dlg-brand b {
    display: block;
    font-size: 15px;
    font-weight: 750;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.fis-dlg-brand b:empty {
    display: none;
}

.fis-dlg-brand span {
    display: block;
    margin-top: 4px;
    color: var(--c-text-2);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.fis-dlg-ids {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 16px;
    margin-top: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text-2);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.fis-dlg-ids b {
    color: var(--c-text);
    font-variant-numeric: tabular-nums;
    text-transform: none;
}

.fis-dlg-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    margin-top: 14px;
    overflow: hidden;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: var(--c-border);
}

.fis-dlg-meta > div {
    min-width: 0;
    padding: 10px 12px;
    background: #fff;
}

.fis-dlg-meta > div > span:first-child {
    display: block;
    color: var(--c-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.fis-dlg-meta b {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    font-size: 13px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fis-dlg-table-wrap {
    margin-top: 16px;
    overflow-x: auto;
    border: 1px solid var(--c-border);
    border-radius: 8px;
}

.fis-dlg-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.fis-dlg-table th,
.fis-dlg-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--c-border);
    text-align: left;
    font-size: 12.5px;
    vertical-align: top;
}

.fis-dlg-table th {
    background: #f8fafc;
    color: var(--c-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.fis-dlg-table tbody tr:last-child td {
    border-bottom: none;
}

.fis-dlg-table .cell-num {
    text-align: right;
    white-space: nowrap;
}

.fis-dlg-table .is-amount {
    font-weight: 700;
}

.fis-dlg-table .is-empty {
    padding: 18px 10px;
    color: var(--c-muted);
    text-align: center;
}

.fis-dlg-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(280px, 100%);
    margin: 14px 0 0 auto;
    padding: 11px 14px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: #f8fafc;
}

.fis-dlg-total span {
    color: var(--c-text-2);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.fis-dlg-total b {
    color: var(--c-primary);
    font-size: 22px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.fis-dlg-total.is-invoice {
    width: min(320px, 100%);
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.fis-dlg-sum {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.fis-dlg-sum b {
    color: var(--c-text);
    font-size: 14px;
}

.fis-dlg-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--c-border);
    background: #fff;
}

.fis-dlg-actions .btn {
    flex: 1 1 calc(50% - 8px);
}

.fis-dlg-actions a.btn {
    text-decoration: none;
}

.btn-wa {
    border-color: #1dae57;
    background: #25d366;
    color: #fff;
}

.btn-wa:hover {
    border-color: #128c3e;
    background: #1dae57;
    color: #fff;
}

.btn-print {
    border-color: var(--c-primary);
    background: var(--c-primary);
    color: #fff;
}

.btn-print:hover,
.btn-print:visited {
    border-color: var(--c-primary-dark);
    background: var(--c-primary-dark);
    color: #fff;
}

.btn-pdf {
    border-color: #b91c1c;
    background: #dc2626;
    color: #fff;
}

.btn-pdf:hover,
.btn-pdf:visited {
    border-color: #991b1b;
    background: #b91c1c;
    color: #fff;
}

.btn-excel {
    border-color: #166534;
    background: #15803d;
    color: #fff;
}

.btn-excel:hover {
    border-color: #14532d;
    background: #166534;
    color: #fff;
}

.fis-dlg-actions [hidden] {
    display: none !important;
}

.invoice-dlg .fis-dlg-meta {
    grid-template-columns: 1fr 1fr;
}

.invoice-dlg .fis-dlg-table th,
.invoice-dlg .fis-dlg-table td {
    padding: 6px 7px;
}

@media (min-width: 640px) {
    .sales-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .fis-dlg-meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .invoice-dlg .fis-dlg-meta {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .fis-dlg-actions .btn {
        flex: 0 0 auto;
    }
}

@media (min-width: 900px) {
    .sales-kpis {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 8px;
    }

    .invoice-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .sales-kpi {
        min-height: 54px;
    }

    .sales-screen .table td {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .invoice-screen .table td {
        padding-top: 11px;
        padding-bottom: 11px;
    }

    .sales-screen .table th.cell-actions,
    .sales-screen .table td.cell-actions {
        width: 1%;
        padding-right: 10px;
    }
}

/* ==========================================================================
   Satış fişleri — profesyonel liste (receipt-screen)
   Faturalar ekranına dokunmaz.
   ========================================================================== */

.receipt-screen .page-head {
    margin-bottom: 8px;
    gap: 8px;
}

.receipt-screen .page-head h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.receipt-screen .sales-kpis {
    gap: 6px;
    margin: 0 0 8px;
}

.receipt-screen .sales-kpi {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 7px 10px;
    box-shadow: none;
    border-left-width: 3px;
}

.receipt-screen .sales-kpi-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: var(--r-sm);
    background: var(--c-surface-2);
    color: var(--c-text-2);
}

.receipt-screen .sales-kpi-icon .icon {
    width: 16px;
    height: 16px;
}

.receipt-screen .sales-kpi-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.receipt-screen .sales-kpi span {
    font-size: 10px;
    font-weight: 700;
}

.receipt-screen .sales-kpi b {
    margin-top: 0;
    font-size: 15px;
    font-weight: 750;
}

.receipt-screen .sales-kpi.is-count .sales-kpi-icon { color: var(--c-text-2); background: #f3f4f6; }
.receipt-screen .sales-kpi.is-cash { border-left-color: var(--c-success); }
.receipt-screen .sales-kpi.is-cash .sales-kpi-icon { color: var(--c-success); background: var(--c-success-soft); }
.receipt-screen .sales-kpi.is-card { border-left-color: var(--c-warning); }
.receipt-screen .sales-kpi.is-card .sales-kpi-icon { color: var(--c-warning); background: var(--c-warning-soft); }
.receipt-screen .sales-kpi.is-card b { color: var(--c-warning); }
.receipt-screen .sales-kpi.is-transfer { border-left-color: #0f766e; }
.receipt-screen .sales-kpi.is-transfer .sales-kpi-icon { color: #0f766e; background: #ecfdf8; }
.receipt-screen .sales-kpi.is-account { border-left-color: var(--c-warning); }
.receipt-screen .sales-kpi.is-account .sales-kpi-icon { color: var(--c-warning); background: var(--c-warning-soft); }
.receipt-screen .sales-kpi.is-net {
    border-left-color: var(--c-primary);
    background: var(--c-primary-soft);
}
.receipt-screen .sales-kpi.is-net .sales-kpi-icon { color: var(--c-primary); background: #fff; }
.receipt-screen .sales-kpi.is-net b { color: var(--c-primary-dark); }

.receipt-screen .sales-filter {
    gap: 6px;
    padding: 8px 10px;
}

.receipt-screen .sales-filter-date,
.receipt-screen .sales-filter-account {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 10px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r);
    background: var(--c-surface);
}

.receipt-screen .sales-filter-date .icon-sm,
.receipt-screen .sales-filter-account .icon-sm,
.receipt-screen .sales-filter-search .icon-sm {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--c-muted);
}

.receipt-screen .sales-filter-search,
.receipt-screen .sales-filter-date,
.receipt-screen .sales-filter-account {
    min-height: 36px;
}

.receipt-screen .sales-filter-date .input,
.receipt-screen .sales-filter-account .input {
    border: 0;
    min-height: 34px;
    padding: 4px 0;
    box-shadow: none;
    width: 100%;
}

.receipt-screen .sales-filter-date:focus-within,
.receipt-screen .sales-filter-account:focus-within {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-soft);
}

.receipt-screen .sales-filter > .btn {
    min-height: 36px;
    width: 100%;
}

.receipt-screen .sales-empty {
    padding: 48px 20px;
}

.receipt-screen .sales-empty .icon {
    width: 32px;
    height: 32px;
    color: var(--c-muted);
}

.receipt-screen .sales-empty span {
    max-width: 280px;
    color: var(--c-muted);
    font-size: var(--fs-sm);
}

.receipt-screen .badge-pay-card {
    background: var(--c-warning-soft);
    color: var(--c-warning);
}

.receipt-screen .badge.badge-converted,
.receipt-screen .badge.badge-print-on,
.receipt-screen .badge.badge-print-off {
    gap: 4px;
    min-height: 20px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 650;
}

.receipt-screen .badge .icon-sm {
    width: 12px;
    height: 12px;
}

.receipt-screen .doc-converted {
    gap: 4px;
    margin-top: 1px;
}

.receipt-screen .account-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.receipt-screen .cell-amount {
    font-weight: 750;
    letter-spacing: -.02em;
}

@media (min-width: 640px) {
    .receipt-screen .sales-filter {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }

    .receipt-screen .sales-filter-search {
        grid-column: 1 / -1;
    }

    .receipt-screen .sales-filter-account {
        grid-column: 1 / -1;
    }

    .receipt-screen .sales-filter > .btn {
        grid-column: 1 / -1;
        width: auto;
        justify-self: end;
        min-width: 120px;
    }
}

@media (min-width: 900px) {
    .receipt-screen .sales-filter {
        grid-template-columns: minmax(140px, 1.2fr) minmax(132px, .7fr) minmax(132px, .7fr) minmax(160px, 1fr) auto;
        align-items: center;
    }

    .receipt-screen .sales-filter-search,
    .receipt-screen .sales-filter-account,
    .receipt-screen .sales-filter > .btn {
        grid-column: auto;
    }

    .receipt-screen .table-wrap.is-sales {
        overflow: visible;
    }

    .receipt-screen .table {
        table-layout: fixed;
        width: 100%;
        min-width: 0;
    }

    .receipt-screen .table col.col-check { width: 40px; }
    .receipt-screen .table col.col-doc { width: 148px; }
    .receipt-screen .table col.col-account { width: auto; }
    .receipt-screen .table col.col-total { width: 118px; }
    .receipt-screen .table col.col-pay { width: 118px; }
    .receipt-screen .table col.col-print { width: 128px; }
    .receipt-screen .table col.col-act { width: 168px; }

    .receipt-screen .table th,
    .receipt-screen .table td {
        box-sizing: border-box;
        overflow: hidden;
        vertical-align: middle;
    }

    .receipt-screen .table thead th {
        padding: 8px 10px;
    }

    .receipt-screen .table td {
        padding: 8px 10px;
    }

    .receipt-screen .table tbody tr:nth-child(even) {
        background: #fafbfc;
    }

    .receipt-screen .table tbody tr:hover {
        background: #f3f6fb;
    }

    .receipt-screen .table th.cell-check,
    .receipt-screen .table td.cell-check {
        width: 40px;
        padding-left: 10px;
        padding-right: 6px;
        overflow: visible;
    }

    .receipt-screen .table th.cell-actions,
    .receipt-screen .table td.cell-actions {
        width: 168px;
        min-width: 168px;
        max-width: 168px;
        padding-right: 10px;
        overflow: visible;
        text-align: right;
        white-space: nowrap;
    }

    .receipt-screen .row-split {
        display: inline-flex;
        width: 148px;
        justify-content: flex-end;
    }

    .receipt-screen .row-btn-view {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        padding: 0 8px;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    .receipt-screen .row-btn-view .icon-sm {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    .receipt-screen .row-btn-more {
        flex: 0 0 28px;
        width: 28px;
        min-width: 28px;
    }

    .receipt-screen .cell-pay .badge,
    .receipt-screen .col-print .badge {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .receipt-screen .table col.col-print,
    .receipt-screen .table th.col-print,
    .receipt-screen .table td.col-print {
        display: none;
    }

    .receipt-screen .table col.col-act { width: 160px; }
    .receipt-screen .table th.cell-actions,
    .receipt-screen .table td.cell-actions {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
    }
}

@media (max-width: 899px) {
    .receipt-screen .table tbody tr {
        padding: 10px 12px;
    }

    .receipt-screen .table td.cell-account .account-name {
        white-space: normal;
    }

    .receipt-screen .table .cell-actions {
        margin-top: 6px;
        justify-content: stretch;
    }

    .receipt-screen .row-split {
        width: 100%;
    }

    .receipt-screen .row-btn-view {
        flex: 1 1 auto;
        justify-content: center;
        min-height: 40px;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    .receipt-screen .row-btn-more {
        min-height: 40px;
        min-width: 40px;
        width: 40px;
    }
}

a.sales-kpi {
    color: inherit;
    text-decoration: none;
}

a.sales-kpi:hover {
    border-color: var(--c-border-strong);
    background: var(--c-surface-2);
}

.sales-kpi.is-warn {
    border-left-color: var(--c-danger);
}

.dash-kpis {
    margin-bottom: 10px;
}

.dash-panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.dash-panels > .card {
    margin-top: 0;
}

.dash-panels > .card + .card {
    margin-top: 0;
}

.dash-screen .card-head a {
    color: var(--c-muted);
    text-decoration: none;
    font-weight: 600;
}

.dash-screen .card-head a:hover {
    color: var(--c-primary);
}

.dash-screen a.doc-no {
    text-decoration: none;
}

.dash-empty {
    padding: 28px 16px;
}

.dash-empty .text-sm {
    max-width: 28ch;
}

@media (min-width: 900px) {
    .dash-kpis {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .dash-panels {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-panels > .card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1180px) {
    .dash-panels {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dash-panels > .card:last-child:nth-child(odd) {
        grid-column: auto;
    }
}

/* ==========================================================================
   Ana sayfa — günlük iş masası
   ========================================================================== */

.desk {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.desk-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
}

.desk-head h1 {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: 650;
    letter-spacing: -.3px;
}

.desk-head p {
    margin: 0;
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.desk-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 8px;
}

.desk-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 72px;
    padding: 10px 8px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-surface);
    box-shadow: var(--shadow-1);
    color: var(--c-text);
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
}

.desk-action .icon {
    width: 22px;
    height: 22px;
}

.desk-action:hover {
    text-decoration: none;
    border-color: var(--c-border-strong);
    background: var(--c-surface-2);
}

.desk-action.is-sale {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #eff6ff, #fff);
    color: #1d4ed8;
}

.desk-action.is-buy {
    border-color: #c7d2fe;
    background: linear-gradient(180deg, #eef2ff, #fff);
    color: #4338ca;
}

.desk-action.is-cash {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, #f0fdf4, #fff);
    color: #15803d;
}

.desk-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.desk-kpi {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 58px;
    padding: 8px 10px 8px 12px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-surface);
    box-shadow: var(--shadow-1);
    border-left: 3px solid var(--c-text-2);
    color: inherit;
    text-decoration: none;
}

.desk-kpi span {
    color: var(--c-muted);
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.desk-kpi b {
    margin-top: 2px;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    line-height: 1.2;
}

a.desk-kpi:hover {
    border-color: var(--c-border-strong);
    background: var(--c-surface-2);
    text-decoration: none;
}

.desk-kpi.is-net { border-left-color: var(--c-primary-dark); background: var(--c-primary-soft); }
.desk-kpi.is-cash { border-left-color: var(--c-success); }
.desk-kpi.is-account { border-left-color: var(--c-warning); }
.desk-kpi.is-count { border-left-color: var(--c-text-2); }
.desk-kpi.is-warn { border-left-color: var(--c-danger); }

.desk-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.desk-card {
    margin-top: 0;
}

.desk-feeds {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
}

.desk-feeds > .card,
.desk-feeds > .card + .card {
    height: auto;
    min-height: 0;
    margin-top: 0;
    align-self: start;
}

.desk-feed .desk-quiet {
    padding: 8px 12px 10px;
}

.desk-card .card-head {
    padding: 10px 12px;
}

.desk-card .card-head h2 {
    font-size: 13.5px;
}

.desk-card .card-head a {
    color: var(--c-muted);
    text-decoration: none;
    font-weight: 600;
}

.desk-card .card-head a:hover {
    color: var(--c-primary);
}

.desk-quiet {
    margin: 0;
    padding: 12px 14px 14px;
    color: var(--c-muted);
    font-size: 13px;
}

.desk-list {
    list-style: none;
    margin: 0;
    padding: 0 0 6px;
}

.desk-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-top: 1px solid var(--c-border);
}

.desk-row-main {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1 1 auto;
    color: inherit;
    text-decoration: none;
}

.desk-row-main:hover {
    text-decoration: none;
}

.desk-row-main:hover b {
    color: var(--c-primary);
}

.desk-row-main b {
    font-size: 13px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.desk-row-main span {
    color: var(--c-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.desk-row-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex: 0 0 auto;
}

.desk-amt {
    font-size: 13px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.desk-amt.is-warn {
    color: var(--c-danger);
}

@media (max-width: 639px) {
    .desk-action {
        min-height: 68px;
        font-size: 12px;
    }

    .desk-row-side .btn {
        min-height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }
}

@media (min-width: 720px) {
    .desk-actions {
        gap: 10px;
    }

    .desk-action {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        min-height: 52px;
        font-size: 14px;
    }

    .desk-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .desk-kpis[data-cols="1"] { grid-template-columns: minmax(0, 1fr); }
    .desk-kpis[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .desk-kpis[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
    .desk-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .desk-feeds {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .desk-row-side {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
}

/* ==========================================================================
   Yazdırma
   ========================================================================== */

body.is-print {
    background: #fff;
    color: #111;
}

body.is-print-a5 {
    background: #e8eaed;
}

.slip {
    width: 148mm;
    min-height: 210mm;
    margin: 16px auto;
    padding: 10mm;
    background: #fff;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .12);
}

.slip-brand {
    text-align: center;
}

.slip-brand b {
    display: block;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.slip-brand span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.slip-ids {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #222;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.slip-ids b {
    font-variant-numeric: tabular-nums;
    text-transform: none;
}

.slip-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 10px;
    border: 1px solid #222;
}

.slip-meta > div {
    min-width: 0;
    padding: 8px 10px;
    text-align: center;
}

.slip-meta > div + div {
    border-left: 1px solid #222;
}

.slip-meta span {
    display: block;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.slip-meta b {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slip-void {
    margin-top: 10px;
    padding: 6px;
    border: 1px solid #111;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
}

.slip-table {
    width: 100%;
    margin-top: 14px;
    border-collapse: collapse;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.slip-table th,
.slip-table td {
    padding: 6px 5px;
    text-align: left;
    vertical-align: top;
}

.slip-table th {
    border-bottom: 1px solid #222;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.slip-table td {
    border-bottom: 1px solid #e5e7eb;
}

.slip-table tbody tr:last-child td {
    border-bottom: 1px solid #222;
}

.slip-table .cell-num {
    text-align: right;
    white-space: nowrap;
}

.slip-table .slip-amount {
    font-weight: 700;
}

.slip-total {
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin: 14px 0 0 auto;
    border: 1px solid #222;
    font-variant-numeric: tabular-nums;
}

.slip-total span,
.slip-total b {
    padding: 8px 12px;
}

.slip-total span {
    background: #f3f4f6;
    border-right: 1px solid #222;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.slip-total b {
    font-size: 16px;
    font-weight: 700;
}

.receipt {
    width: 80mm;
    margin: 0 auto;
    padding: 8px 10px 16px;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
}

.receipt-wide {
    width: 148mm;
}

.receipt-head,
.receipt-meta,
.receipt-foot {
    text-align: center;
}

.receipt-head b,
.receipt-meta b {
    display: block;
}

.receipt-head span,
.receipt-meta span,
.receipt-foot span {
    display: block;
}

.receipt-lines,
.receipt-totals {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
}

.receipt-amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.receipt-grand {
    font-weight: 700;
}

.receipt-void {
    margin-top: 6px;
    font-weight: 700;
}

@media print {
    body.is-print,
    body.is-print-a5,
    body.is-print-a4 {
        background: #fff;
    }

    body.is-print-a5,
    body.is-print-a4 {
        margin: 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .slip {
        width: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    .inv-paper,
    .stmt-paper {
        width: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        box-shadow: none;
        overflow: visible;
    }

    .inv-overlay,
    .inv-dlg-actions {
        display: none !important;
    }

    .print-break {
        break-after: page;
        page-break-after: always;
    }

    .stmt-head,
    .stmt-account,
    .stmt-kpis,
    .stmt-foot {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .stmt-table thead {
        display: table-header-group;
    }

    .stmt-table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

body.is-print-a4 {
    background: #d8dce3;
}

.inv-paper {
    position: relative;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 12mm 14mm 14mm;
    overflow: hidden;
    background: #fff;
    color: #111;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 11px;
    line-height: 1.35;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .18);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.stmt-paper {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 9mm 11mm 11mm;
    background: #fff;
    color: #161a1f;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 11px;
    line-height: 1.35;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .18);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.stmt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 8px;
    border-bottom: 1px solid #c5cdd6;
}

.stmt-brand {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    max-width: 58%;
}

.stmt-logo {
    display: block;
    width: auto;
    height: 34px;
    max-width: 72px;
    object-fit: contain;
}

.stmt-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid #1d4ed8;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
}

.stmt-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.stmt-brand-copy b {
    color: #0f172a;
    font-size: 15px;
    font-weight: 750;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.stmt-brand-copy span {
    color: #59616e;
    font-size: 10px;
    line-height: 1.3;
}

.stmt-head-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    min-width: 0;
    text-align: right;
}

.stmt-head-meta strong {
    color: #0f172a;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1;
}

.stmt-head-meta em {
    margin-bottom: 4px;
    color: #2563eb;
    font-size: 10px;
    font-style: normal;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.stmt-head-meta dl {
    display: grid;
    gap: 1px 10px;
    margin: 0;
}

.stmt-head-meta dl div {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px;
    align-items: baseline;
    justify-content: end;
}

.stmt-head-meta dt {
    color: #8b94a1;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.stmt-head-meta dd {
    margin: 0;
    color: #161a1f;
    font-size: 10.5px;
    font-weight: 650;
}

.stmt-account {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin: 8px 0;
    padding: 7px 9px;
    border: 1px solid #e3e6ea;
    background: #f8fafc;
}

.stmt-account-main {
    min-width: 0;
}

.stmt-kicker {
    display: block;
    margin-bottom: 3px;
    color: #8b94a1;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.stmt-account-title {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.stmt-code {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 6px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .04em;
}

.stmt-account-title b {
    color: #0f172a;
    font-size: 15px;
    font-weight: 750;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.stmt-account-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 2px 14px;
    max-width: 46%;
    color: #59616e;
    font-size: 10px;
    text-align: right;
}

.stmt-kpis,
.stmt-foot {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.stmt-kpis {
    margin: 0 0 8px;
}

.stmt-kpis div,
.stmt-foot div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 46px;
    padding: 6px 9px;
    border: 1px solid #e3e6ea;
    background: #fafbfc;
}

.stmt-kpis span,
.stmt-foot span {
    display: block;
    color: #8b94a1;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.stmt-kpis b,
.stmt-foot b {
    margin-top: 2px;
    font-size: 16px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.03em;
    line-height: 1.15;
}

.stmt-kpis .is-debit {
    border-color: #f3d5b3;
    border-left: 3px solid #c2410c;
    background: #fff8f1;
}

.stmt-kpis .is-debit b {
    color: #c2410c;
}

.stmt-kpis .is-credit {
    border-color: #c9e6d3;
    border-left: 3px solid #17803d;
    background: #f3faf5;
}

.stmt-kpis .is-credit b {
    color: #17803d;
}

.stmt-kpis .is-balance {
    border-color: #bfdbfe;
    border-left: 3px solid #1d4ed8;
    background: #eef4ff;
}

.stmt-kpis .is-balance b {
    color: #1d4ed8;
    font-size: 17px;
    font-weight: 800;
}

.stmt-kpis .is-balance.is-neg,
.stmt-kpis .is-balance.is-neg b {
    border-left-color: #d92d20;
    color: #d92d20;
}

.stmt-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.stmt-table th,
.stmt-table td {
    padding: 5px 6px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.stmt-table thead th {
    border-bottom: 1px solid #94a3b8;
    background: #f1f5f9;
    color: #334155;
    font-size: 9.5px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.stmt-table .cell-num {
    text-align: right;
    white-space: nowrap;
}

.stmt-table tr.is-carry td {
    background: #f8fafc;
    color: #444;
    font-style: italic;
}

.stmt-items-row td {
    padding: 0 0 8px 18px;
    border-bottom: 1px solid #d1d5db;
    background: #fafafa;
}

.stmt-items {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.stmt-items th,
.stmt-items td {
    padding: 3px 6px;
    border-bottom: 1px solid #e5e7eb;
}

.stmt-items thead th {
    border-bottom: 1px solid #9ca3af;
    background: transparent;
    color: #555;
    font-size: 9px;
}

.stmt-foot {
    margin-top: 8px;
}

.stmt-foot div:last-child {
    border-color: #bfdbfe;
    border-left: 3px solid #1d4ed8;
    background: #eef4ff;
}

.stmt-foot div:last-child b {
    color: #1d4ed8;
}

.inv-paper .inv-watermark {
    position: absolute;
    top: 42%;
    left: 50%;
    z-index: 0;
    margin: 0;
    color: rgba(185, 28, 28, .12);
    font-size: 92px;
    font-weight: 800;
    letter-spacing: .12em;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-18deg);
}

.inv-paper .inv-head,
.inv-paper .inv-ids,
.inv-paper .inv-parties,
.inv-paper .inv-lines,
.inv-paper .inv-bottom,
.inv-paper .inv-foot {
    position: relative;
    z-index: 1;
}

.inv-paper .inv-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #111;
}

.inv-paper .inv-brand {
    display: flex;
    gap: 10px;
    min-width: 0;
}

.inv-paper .inv-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid #111;
    background: #111;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .04em;
}

.inv-paper .inv-brand b {
    display: block;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .01em;
    text-transform: uppercase;
}

.inv-paper .inv-brand span {
    display: block;
    color: #444;
    font-size: 10.5px;
}

.inv-paper .inv-brand span:empty,
.inv-paper .inv-parties p:empty {
    display: none;
}

.inv-paper .inv-title {
    text-align: right;
}

.inv-paper .inv-draft-badge {
    display: inline-block;
    margin-bottom: 6px;
    padding: 2px 8px;
    border: 1px solid #b45309;
    background: #fdf4e6;
    color: #b45309;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.inv-paper .inv-draft-badge[hidden],
.inv-paper .inv-watermark[hidden] {
    display: none !important;
}

.inv-paper .inv-title strong {
    display: block;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: .14em;
    line-height: 1;
}

.inv-paper .inv-title span {
    display: block;
    margin-top: 4px;
    color: #555;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.inv-paper .inv-ids {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #d4d4d4;
}

.inv-paper .inv-ids [data-inv-source-wrap],
.inv-paper .inv-ids > div:nth-child(5) {
    grid-column: 1 / -1;
}

.inv-paper .inv-ids span {
    display: block;
    color: #666;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.inv-paper .inv-ids b {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.inv-paper .inv-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.inv-paper .inv-parties > div {
    min-height: 78px;
    padding: 8px 10px;
    border: 1px solid #d4d4d4;
}

.inv-paper .inv-parties h3 {
    margin: 0 0 6px;
    color: #666;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.inv-paper .inv-parties p {
    margin: 0 0 2px;
}

.inv-paper table.inv-lines {
    width: 100%;
    margin-top: 12px;
    border-collapse: collapse;
}

.inv-paper .inv-lines th,
.inv-paper .inv-lines td {
    padding: 5px 6px;
    border: 1px solid #cfcfcf;
    vertical-align: top;
    font-size: 10.5px;
}

.inv-paper .inv-lines th {
    background: #111;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}

.inv-paper .inv-lines .is-row {
    width: 28px;
    text-align: center;
    color: #555;
}

.inv-paper .inv-lines .cell-num,
.inv-paper .inv-lines th.cell-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.inv-paper .inv-lines tbody tr {
    height: 22px;
}

.inv-paper .inv-bottom {
    display: grid;
    grid-template-columns: 1fr 210px;
    gap: 16px;
    margin-top: 12px;
    align-items: start;
}

.inv-paper .inv-paybox {
    padding: 8px 10px;
    border: 1px solid #d4d4d4;
}

.inv-paper .inv-paybox h3 {
    margin: 0 0 6px;
    color: #666;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.inv-paper .inv-paybox p {
    margin: 0 0 3px;
}

.inv-paper .inv-totals {
    margin: 0;
    border: 1px solid #111;
}

.inv-paper .inv-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 10px;
    border-bottom: 1px solid #e5e5e5;
}

.inv-paper .inv-totals dt {
    color: #555;
    font-size: 11px;
}

.inv-paper .inv-totals dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.inv-paper .inv-totals .is-grand {
    background: #111;
    color: #fff;
    border-bottom: 0;
}

.inv-paper .inv-totals .is-grand dt {
    color: #fff;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.inv-paper .inv-totals .is-grand dd {
    font-size: 16px;
    font-weight: 800;
}

.inv-paper .inv-foot {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding-top: 8px;
    border-top: 1px solid #d4d4d4;
}

.inv-paper .inv-foot span {
    display: block;
    color: #666;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.inv-paper .inv-foot p {
    margin: 4px 0 0;
    min-height: 28px;
}

.inv-paper .inv-page {
    align-self: flex-end;
    color: #666;
    font-size: 10px;
    white-space: nowrap;
}

.dlg.inv-overlay {
    align-items: stretch;
    padding: 0;
    background: rgba(17, 24, 39, .38);
}

.inv-dlg {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #d8dce3;
}

.inv-dlg-stage {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 18px 16px 16px;
}

.inv-dlg-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #c5cad1;
    background: #eef0f3;
}

.inv-dlg-actions [hidden] {
    display: none !important;
}

.inv-dlg-actions .btn {
    flex: 1 1 calc(50% - 8px);
}

@media (min-width: 720px) {
    .inv-dlg-actions .btn {
        flex: 0 0 auto;
    }
}

@media (max-width: 900px) {
    .inv-paper {
        width: 100%;
        min-height: 0;
        padding: 14px;
    }

    .inv-paper .inv-ids,
    .inv-paper .inv-parties,
    .inv-paper .inv-bottom {
        grid-template-columns: 1fr 1fr;
    }

    .inv-paper .inv-title strong {
        font-size: 22px;
    }
}

@media (max-width: 560px) {
    .inv-paper .inv-head,
    .inv-paper .inv-ids,
    .inv-paper .inv-parties,
    .inv-paper .inv-bottom,
    .inv-paper .inv-foot {
        display: block;
    }

    .inv-paper .inv-title {
        text-align: left;
        margin-top: 10px;
    }

    .inv-paper .inv-lines {
        display: block;
        overflow-x: auto;
    }
}

/* ==========================================================================
   Satış / alış faturası oluşturma ekranı
   Tek yüzey, kompakt başlık, kalem tablosu ve yapışkan kayıt çubuğu.
   ========================================================================== */

.inv-screen .page-head {
    margin-bottom: 10px;
}

.inv-screen .page-head p {
    max-width: 42em;
}

.inv-sheet {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.inv-block {
    padding: 10px 12px 12px;
}

.inv-block + .inv-block,
.inv-foot,
.inv-pay {
    border-top: 1px solid var(--c-border);
}

.inv-block-title {
    margin: 0 0 10px;
    color: var(--c-text-2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.inv-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
}

.inv-no {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.inv-no > span {
    color: var(--c-text-2);
    font-size: var(--fs-sm);
    font-weight: 500;
}

.inv-no > b {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border: 1px dashed var(--c-border-strong);
    border-radius: var(--r);
    background: var(--c-surface-2);
    font-size: var(--fs);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inv-account {
    position: relative;
    margin-top: 10px;
}

.inv-account > .field-hint {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.inv-account .picker-results,
.inv-search .picker-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
}

.inv-account-chip {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid #d9e4fd;
    border-left: 3px solid var(--c-primary);
    border-radius: var(--r);
    background: var(--c-primary-soft);
}

.inv-account-chip[hidden] {
    display: none;
}

.inv-account-code {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.inv-account-name {
    font-weight: 600;
}

.inv-account-bal {
    margin-left: auto;
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.inv-account-bal:empty {
    display: none;
}

.inv-search {
    position: relative;
    margin-bottom: 10px;
}

.inv-quick-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.inv-quick-head .label {
    margin-bottom: 0;
}

.inv-quick-head .btn {
    flex: 0 0 auto;
    min-height: 32px;
}

.inv-quick-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inv-quick-row .input {
    flex: 1 1 auto;
    min-width: 0;
}

.inv-quick-row .btn {
    flex: 0 0 auto;
}

.quick-dlg {
    width: min(540px, 100%);
}

.quick-dlg form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.quick-dlg .dlg-scroll {
    flex: 1 1 auto;
}

.quick-dlg .dlg-actions {
    flex: 0 0 auto;
    padding: 12px 16px 16px;
    margin-top: 0;
}

.quick-form-error {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: var(--r);
    background: var(--c-danger-soft, #fef2f2);
    color: var(--c-danger);
    font-size: 13px;
}

.quick-form-error[hidden],
.quick-dlg .field-error[hidden] {
    display: none;
}

.acc-form-page {
    max-width: 960px;
    margin: 0 auto;
}

.acc-form .card + .card {
    margin-top: 8px;
}

.acc-form .card-head {
    padding: 8px 12px;
}

.acc-form .card-head h2 {
    font-size: 13.5px;
}

.acc-form .card-body {
    padding: 10px 12px;
}

.acc-form .card-foot {
    padding: 10px 12px;
}

.acc-form .form-grid {
    gap: 8px 10px;
}

.acc-form .field {
    gap: 3px;
}

.acc-form .field-hint {
    font-size: 11px;
}

.acc-form .textarea {
    min-height: 68px;
}

.quick-acc-dlg {
    width: min(460px, 100%);
    max-height: min(92dvh, 620px);
}

.quick-acc-grid {
    gap: 8px 10px;
}

.quick-acc-dlg .dlg-head {
    padding: 12px 14px 0;
}

.quick-acc-dlg .dlg-head h2 {
    font-size: 16px;
}

.quick-acc-dlg .dlg-scroll {
    margin-top: 8px;
    padding: 0 14px 4px;
    overflow: auto;
}

.quick-acc-dlg .dlg-actions {
    padding: 10px 14px 12px;
}

@media (min-width: 640px) {
    .acc-form .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-acc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .acc-form .form-grid,
    .quick-acc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 639px) {
    .quick-acc-grid {
        grid-template-columns: 1fr;
    }

    .dlg[data-dlg="quick-account"] {
        align-items: flex-end;
        padding: 0;
    }

    .quick-acc-dlg {
        width: 100%;
        max-height: min(96dvh, 100%);
        border-radius: 12px 12px 0 0;
    }

    .quick-acc-dlg .dlg-actions {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 719px) {
    .inv-quick-head .btn {
        min-height: 40px;
        padding: 0 10px;
    }

    .quick-dlg .dlg-actions .btn {
        min-height: 42px;
        flex: 1 1 auto;
    }
}

.inv-search .input {
    min-height: 48px;
    padding: 10px 12px;
    font-size: 16px;
}

.inv-table-wrap {
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    overflow-x: auto;
}

.inv-form .inv-table {
    font-size: var(--fs);
}

.inv-form .inv-table tbody tr {
    background: var(--c-surface);
}

.inv-form .inv-table tbody tr:nth-child(even) {
    background: var(--c-surface-2);
}

.inv-form .inv-table .input {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.inv-form .cell-code,
.inv-form .cell-unit {
    color: var(--c-text-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.inv-form .cell-line-total {
    font-variant-numeric: tabular-nums;
}

.inv-lines-empty {
    margin: 8px 0 0;
    color: var(--c-muted);
    font-size: var(--fs-sm);
}

.inv-lines-empty[hidden] {
    display: none;
}

.inv-foot {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 12px;
    background: var(--c-surface-2);
}

.inv-foot-left {
    display: grid;
    gap: 10px;
    align-content: start;
}

.inv-note {
    min-height: 72px;
}

.inv-summary {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface);
}

.inv-summary > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.inv-summary dt {
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.inv-summary dd {
    margin: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.inv-summary .is-grand {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--c-border);
}

.inv-summary .is-grand dt {
    color: var(--c-text);
    font-size: var(--fs);
    font-weight: 700;
}

.inv-summary .is-grand dd {
    color: var(--c-primary-dark);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.inv-pay {
    padding: 10px 12px 12px;
}

.inv-pay-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.inv-pay-box {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface);
}

.inv-pay-box .input {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.inv-pay-box .select {
    min-height: 28px;
    padding: 2px 26px 2px 8px;
    font-size: var(--fs-xs);
}

.inv-pay-box.is-account {
    border-color: transparent;
    background: var(--c-warning-soft);
}

.inv-pay-cari {
    display: flex;
    align-items: center;
    min-height: 36px;
    font-size: var(--fs-md);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.inv-pay-cari.is-due,
.inv-pay-status b.is-due {
    color: var(--c-warning);
}

.inv-pay-hint {
    color: var(--c-text-2);
    font-size: 10.5px;
}

.inv-pay-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.inv-pay-status > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface);
}

.inv-pay-status span {
    color: var(--c-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.inv-pay-status b {
    font-size: var(--fs-lg);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

.inv-actions {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: 0 -8px 24px rgba(16, 24, 40, .08);
}

.inv-actions .btn-primary {
    min-width: 8.5rem;
}

/* Alış faturası: aynı inv-* yüzeyi, daha dar ve tek ekrana sığacak sıkılık. */
.inv-screen.is-purchase {
    max-width: 1160px;
    margin-inline: auto;
}

.inv-screen.is-purchase .page-head {
    margin-bottom: 8px;
}

.inv-screen.is-purchase .page-head p {
    max-width: none;
    margin-top: 2px;
    font-size: var(--fs-sm);
}

.inv-screen.is-purchase .inv-block {
    padding: 8px 10px 10px;
}

.inv-screen.is-purchase .inv-block-title {
    margin: 0 0 6px;
}

.inv-screen.is-purchase .inv-meta {
    gap: 6px 8px;
}

.inv-screen.is-purchase .inv-no {
    gap: 3px;
}

.inv-screen.is-purchase .inv-no > b {
    min-height: 32px;
    padding: 0 8px;
    font-size: var(--fs-sm);
}

.inv-screen.is-purchase .inv-sheet .input,
.inv-screen.is-purchase .inv-sheet .select {
    min-height: 32px;
    padding: 4px 8px;
}

.inv-screen.is-purchase .inv-account {
    margin-top: 8px;
    max-width: 36rem;
}

.inv-screen.is-purchase .inv-search {
    max-width: 36rem;
    margin-bottom: 8px;
}

.inv-screen.is-purchase .inv-search .input {
    min-height: 32px;
    padding: 4px 8px;
    font-size: var(--fs);
}

.inv-screen.is-purchase .inv-quick-row .btn {
    min-height: 32px;
}

.inv-screen.is-purchase .inv-account-chip {
    margin-top: 6px;
    padding: 4px 8px;
}

.inv-screen.is-purchase .inv-meta > .field:last-child {
    max-width: 12rem;
}

.inv-screen.is-purchase .inv-lines-empty {
    margin-top: 6px;
}

.inv-screen.is-purchase .inv-foot {
    gap: 10px;
    padding: 8px 10px;
}

.inv-screen.is-purchase .inv-foot-left {
    grid-template-columns: 7.2rem 20rem;
    gap: 8px;
    max-width: none;
    width: max-content;
}

.inv-screen.is-purchase .inv-note {
    min-height: 52px;
}

.inv-screen.is-purchase .inv-summary {
    padding: 8px 10px;
    gap: 4px;
}

.inv-screen.is-purchase .inv-summary .is-grand {
    margin-top: 2px;
    padding-top: 6px;
}

.inv-screen.is-purchase .inv-summary .is-grand dd {
    font-size: 18px;
}

.inv-screen.is-purchase .inv-pay {
    padding: 8px 10px 10px;
}

.inv-screen.is-purchase .inv-pay-box {
    padding: 6px 8px;
    gap: 4px;
}

.inv-screen.is-purchase .inv-pay-cari {
    min-height: 32px;
    font-size: var(--fs);
}

.inv-screen.is-purchase .inv-pay-status {
    margin-top: 8px;
    gap: 6px;
}

.inv-screen.is-purchase .inv-pay-status > div {
    padding: 6px 8px;
}

.inv-screen.is-purchase .inv-pay-status b {
    font-size: var(--fs-md);
}

.inv-screen.is-purchase .inv-actions {
    margin-top: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 720px) {
    .inv-form .inv-table thead {
        display: table-header-group;
    }

    .inv-form .inv-table tbody tr {
        display: table-row;
        padding: 0;
    }

    .inv-form .inv-table tbody tr:hover {
        background: #eef3ff;
    }

    .inv-form .inv-table th {
        padding: 8px 10px;
        border-bottom: 1px solid var(--c-border);
        background: #eef1f5;
        color: var(--c-text-2);
        font-size: 10.5px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        text-align: left;
        white-space: nowrap;
    }

    .inv-form .inv-table td {
        display: table-cell;
        padding: 7px 10px;
        border-bottom: 1px solid var(--c-border);
        vertical-align: middle;
    }

    .inv-form .inv-table td::before {
        content: none;
    }

    .inv-form .inv-table .cell-num,
    .inv-form .inv-table th.cell-num,
    .inv-form .inv-table th.cell-actions,
    .inv-form .inv-table .cell-actions {
        text-align: right;
    }

    .inv-form .inv-table .col-code { width: 7.2rem; }
    .inv-form .inv-table .col-qty { width: 5.6rem; }
    .inv-form .inv-table .col-unit { width: 4.4rem; }
    .inv-form .inv-table .col-price { width: 7.2rem; }
    .inv-form .inv-table .col-pct { width: 5.4rem; }
    .inv-form .inv-table .col-total { width: 7.2rem; }
    .inv-form .inv-table .col-del { width: 3.2rem; }

    .inv-form .inv-table .cell-actions {
        white-space: nowrap;
    }

    .inv-foot {
        grid-template-columns: minmax(0, 1fr) minmax(240px, 18rem);
        align-items: start;
    }

    .inv-screen.is-purchase .inv-meta {
        grid-template-columns: minmax(7.5rem, 0.9fr) repeat(3, minmax(0, 1fr));
    }

    .inv-screen.is-purchase .inv-form .inv-table {
        table-layout: fixed;
        width: 100%;
    }

    .inv-screen.is-purchase .inv-table-wrap {
        overflow-x: hidden;
    }

    .inv-screen.is-purchase .inv-form .inv-table th,
    .inv-screen.is-purchase .inv-form .inv-table td {
        padding: 5px 6px;
    }

    .inv-screen.is-purchase .inv-form .inv-table .col-code,
    .inv-screen.is-purchase .inv-form .inv-table .cell-code {
        width: 124px;
        min-width: 124px;
        max-width: 124px;
        overflow: hidden;
    }

    .inv-screen.is-purchase .inv-form .inv-table .cell-code span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .inv-screen.is-purchase .inv-form .inv-table .col-name,
    .inv-screen.is-purchase .inv-form .inv-table .cell-strong {
        width: auto;
        min-width: 0;
        overflow: hidden;
    }

    .inv-screen.is-purchase .inv-form .inv-table .cell-strong span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .inv-screen.is-purchase .inv-form .inv-table .col-qty { width: 72px; }
    .inv-screen.is-purchase .inv-form .inv-table .col-unit,
    .inv-screen.is-purchase .inv-form .inv-table .cell-unit { width: 52px; }
    .inv-screen.is-purchase .inv-form .inv-table .col-price { width: 92px; }
    .inv-screen.is-purchase .inv-form .inv-table .col-pct { width: 68px; }
    .inv-screen.is-purchase .inv-form .inv-table .col-total { width: 88px; }
    .inv-screen.is-purchase .inv-form .inv-table .col-del { width: 40px; }

    .inv-screen.is-purchase .inv-form .inv-table .input {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .inv-screen.is-purchase .inv-foot {
        grid-template-columns: max-content 15.5rem;
        justify-content: space-between;
    }

    .inv-screen.is-purchase .inv-pay-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .inv-meta {
        grid-template-columns: minmax(10rem, 1.2fr) repeat(3, minmax(0, 1fr));
    }

    .inv-account {
        grid-column: 1 / -1;
    }

    .inv-pay-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 719px) {
    .inv-form .inv-table tbody tr {
        padding: 10px 10px 8px;
        border-bottom: 1px solid var(--c-border);
    }

    .inv-form .inv-table tbody tr:last-child {
        border-bottom: 0;
    }

    .inv-form .inv-table .input {
        max-width: 9.5rem;
        margin-left: auto;
    }

    .inv-screen.is-purchase .inv-account,
    .inv-screen.is-purchase .inv-search {
        max-width: none;
    }

    .inv-screen.is-purchase .inv-foot-left {
        grid-template-columns: 1fr;
        max-width: none;
        width: auto;
    }

    .inv-screen.is-purchase .inv-meta > .field:last-child {
        max-width: none;
    }

    .inv-screen.is-purchase .inv-search .input {
        min-height: 40px;
        font-size: 16px;
    }
}

/* ==========================================================================
   Satış faturası detay
   ========================================================================== */

.content:has(.invoice-detail) {
    flex: 0 0 auto;
    padding: 8px 12px 14px;
}

.invoice-detail {
    display: block;
    max-width: 100%;
    overflow-x: hidden;
    height: auto;
    min-height: 0;
}

.invoice-detail > * {
    flex: none;
}

.invoice-detail .alert {
    margin: 0 0 8px;
}

.invoice-detail .card {
    margin-top: 0;
    height: auto;
    min-height: 0;
}

.invoice-detail .card + .card {
    margin-top: 12px;
}

.invoice-detail .table-wrap {
    max-width: 100%;
    height: auto;
    min-height: 0;
}

.invoice-detail .card-head {
    padding: 7px 12px;
}

.invoice-detail .card-head h2 {
    font-size: 13px;
}

.invoice-detail .card-body {
    padding: 12px 14px;
}

.invd-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin: 0 0 10px;
    padding: 0;
}

.invd-head-main {
    min-width: 0;
    flex: 1 1 200px;
}

.invd-kicker {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--c-text-2);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1.2;
}

.invd-kicker .icon-sm {
    color: var(--c-primary);
}

.invd-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.invd-docno {
    display: inline-flex;
    align-items: center;
    padding: 0 7px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r);
    background: var(--c-surface);
    color: var(--c-text);
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
    line-height: 24px;
}

.invd-status {
    font-weight: 600;
}

.invd-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.invd-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    margin: 3px 0 0;
    color: var(--c-text-2);
    font-size: var(--fs-sm);
    line-height: 1.3;
}

.invd-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.invd-meta-sep {
    margin: 0 7px;
    color: var(--c-muted);
}

.invd-meta .icon-sm {
    color: var(--c-muted);
}

.invd-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-left: auto;
    max-width: 100%;
}

.invd-actions .btn,
.invd-actions-drop summary.btn {
    min-height: 34px;
    height: 34px;
    padding: 0 9px;
    font-size: var(--fs-sm);
}

.invd-actions-row {
    display: none;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
}

.invd-actions-drop {
    position: relative;
}

.invd-actions-drop summary {
    list-style: none;
    cursor: pointer;
}

.invd-actions-drop summary::-webkit-details-marker {
    display: none;
}

.invd-actions-drop-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 210px;
    padding: 6px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface);
    box-shadow: var(--shadow-1);
}

.invd-actions-drop-panel .btn {
    justify-content: flex-start;
    width: 100%;
}

.invd-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--c-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.invd-label .icon-sm {
    color: var(--c-primary);
}

.invd-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
    align-items: start;
}

.invd-summary > .card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
}

.invd-summary > .card .card-body {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}

.invd-kv {
    display: grid;
    gap: 5px;
}

.invd-kv div {
    display: grid;
    grid-template-columns: 6.75rem minmax(0, 1fr);
    gap: 8px;
    align-items: baseline;
}

.invd-kv dt {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--c-muted);
    font-size: 11px;
}

.invd-kv dd {
    margin: 0;
    color: var(--c-text);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.invd-party-name {
    font-weight: 650;
    color: var(--c-text);
}

.invd-party-btn {
    margin-top: 8px;
    align-self: flex-start;
}

.invd-sum {
    display: grid;
    gap: 5px;
}

.invd-sum div,
.invd-foot-sum div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.invd-sum dt,
.invd-foot-sum dt {
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.invd-sum dd,
.invd-foot-sum dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.invd-sum .is-grand dt,
.invd-sum .is-grand dd,
.invd-foot-sum .is-grand dt,
.invd-foot-sum .is-grand dd {
    color: var(--c-text);
    font-size: 15px;
    font-weight: 700;
}

.invd-sum .is-grand,
.invd-foot-sum .is-grand {
    margin-top: 2px;
    padding-top: 6px;
    border-top: 1px solid var(--c-border);
}

.invd-remain-badge {
    display: inline-flex;
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 700;
}

.invd-sum .is-remain.is-due .invd-remain-badge,
.invd-foot-sum .is-remain.is-due dd {
    color: var(--c-danger);
    background: var(--c-danger-soft);
}

.invd-sum .is-remain.is-warn .invd-remain-badge,
.invd-foot-sum .is-remain.is-warn dd {
    color: var(--c-warning);
    background: var(--c-warning-soft);
}

.invd-sum .is-remain.is-ok .invd-remain-badge,
.invd-foot-sum .is-remain.is-ok dd {
    color: var(--c-success);
    background: var(--c-success-soft);
}

.invd-foot-sum .is-remain.is-due dd,
.invd-foot-sum .is-remain.is-warn dd,
.invd-foot-sum .is-remain.is-ok dd {
    background: transparent;
    font-weight: 700;
}

.invd-foot-sum .is-profit dd {
    color: var(--c-success);
    font-weight: 650;
}

.invd-foot-sum .is-loss dd {
    color: var(--c-danger);
    font-weight: 650;
}

.invd-lines {
    display: block;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    align-self: start;
}

.invd-lines .card-head {
    gap: 8px;
}

.invd-lines .card-head [data-invd-stock-toggle] {
    margin-left: auto;
}

.invd-lines .card-head .card-hint {
    font-weight: 500;
}

.invd-lines .table-wrap {
    display: block;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    height: auto !important;
    max-height: none;
    min-height: 0 !important;
}

.invd-lines .table {
    table-layout: fixed;
    min-width: 820px;
    width: 100%;
    height: auto !important;
    max-height: none;
}

.invd-lines .table thead {
    display: table-header-group;
}

.invd-lines .table tbody {
    display: table-row-group;
}

.invd-lines .table tbody tr {
    display: table-row;
    padding: 0;
    height: auto;
}

.invd-lines .table th,
.invd-lines .table td {
    display: table-cell;
    padding: 4px 8px;
    vertical-align: middle;
    border-bottom: 1px solid var(--c-border);
    height: auto;
}

.invd-lines .table tbody tr:last-child td {
    border-bottom: 0;
}

.invd-lines .table thead th {
    background: #f3f5f8;
    color: var(--c-text-2);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.invd-lines .table td::before {
    content: none;
}

.invd-lines .table tbody tr:hover {
    background: var(--c-surface-2);
}

.invd-lines .table .cell-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.invd-col-no { width: 40px; }
.invd-col-code { width: 110px; }
.invd-col-item { width: auto; }
.invd-col-qty { width: 72px; }
.invd-col-unit { width: 60px; }
.invd-col-price { width: 108px; }
.invd-col-disc { width: 80px; }
.invd-col-vat { width: 60px; }
.invd-col-amt { width: 112px; }

.invd-item-name {
    display: block;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.invd-item-code {
    color: var(--c-muted);
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
}

.invd-line-amt {
    font-weight: 700;
}

.invd-foot {
    display: flex;
    justify-content: flex-end;
    padding: 8px 14px 10px;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface-2);
}

.invd-foot-sum {
    width: min(260px, 100%);
}

.invd-flow-card .card-body {
    padding: 10px 14px;
}

.invd-flow {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.invd-flow > li {
    min-width: 0;
    list-style: none;
}

.invd-flow-sep {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-muted);
}

.invd-flow-node {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface);
    color: inherit;
    text-decoration: none;
}

a.invd-flow-node:hover {
    border-color: var(--c-primary);
    background: var(--c-primary-soft);
    text-decoration: none;
}

.invd-flow-node.is-current {
    border-color: var(--c-primary);
    background: var(--c-primary-soft);
}

.invd-flow-node.is-cancelled {
    opacity: .7;
}

.invd-flow-icon {
    display: inline-flex;
    color: var(--c-success);
}

.invd-flow-node.is-current .invd-flow-icon {
    color: var(--c-primary);
}

.invd-flow-type {
    color: var(--c-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.invd-flow-node b {
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.invd-flow-date {
    color: var(--c-text-2);
    font-size: var(--fs-xs);
}

.invd-cancel {
    border-color: #f0c9c6;
}

.invd-cancel .card-head {
    background: var(--c-danger-soft);
}

.invd-cancel .card-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-danger);
}

.invd-cancel-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
}

.invd-cancel-row .field {
    flex: 1 1 220px;
    margin: 0;
}

.invd-stock .card-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (min-width: 768px) {
    .content:has(.invoice-detail) {
        padding: 8px 14px 14px;
    }

    .invd-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .invd-totals-card {
        grid-column: 1 / -1;
    }
}

@media (min-width: 900px) {
    .invd-flow {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .invd-flow > li:not(.invd-flow-sep) {
        flex: 0 1 168px;
        max-width: 200px;
    }

    .invd-flow-sep {
        flex: 0 0 auto;
        padding: 0 2px;
    }
}

@media (min-width: 1100px) {
    .invd-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
    }

    .invd-summary > .card .card-body {
        flex: 1 1 auto;
    }

    .invd-party-btn {
        margin-top: auto;
        padding-top: 8px;
    }

    .invd-totals-card {
        grid-column: auto;
    }
}

@media (min-width: 1280px) {
    .invd-actions-drop {
        display: none;
    }

    .invd-actions-row {
        display: flex;
    }
}

@media (max-width: 479px) {
    .invd-kv div {
        grid-template-columns: 1fr;
        gap: 1px;
    }

    .invd-docno {
        font-size: 15px;
    }
}
/* ==========================================================================
   Kasa / Banka
   ========================================================================== */

.finance-screen .page-head {
    margin-bottom: 10px;
}

.finance-screen .page-head h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.finance-screen .page-head p {
    margin-top: 2px;
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.finance-screen .fin-kpis {
    gap: 6px;
    margin: 0 0 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-screen .sales-kpi {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 7px 10px;
    box-shadow: none;
    border-left-width: 3px;
}

.finance-screen .sales-kpi-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: var(--r-sm);
    background: var(--c-surface-2);
    color: var(--c-text-2);
}

.finance-screen .sales-kpi-icon .icon {
    width: 16px;
    height: 16px;
}

.finance-screen .sales-kpi-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.finance-screen .sales-kpi span {
    color: var(--c-muted);
}

.finance-screen .sales-kpi b {
    margin-top: 0;
    font-size: 14px;
}

.finance-screen .sales-kpi.is-cash { border-left-color: var(--c-success); }
.finance-screen .sales-kpi.is-cash .sales-kpi-icon { color: var(--c-success); background: var(--c-success-soft); }
.finance-screen .sales-kpi.is-account { border-left-color: var(--c-warning); }
.finance-screen .sales-kpi.is-account .sales-kpi-icon { color: var(--c-warning); background: var(--c-warning-soft); }
.finance-screen .sales-kpi.is-transfer { border-left-color: #0f766e; }
.finance-screen .sales-kpi.is-transfer .sales-kpi-icon { color: #0f766e; background: #ecfdf8; }
.finance-screen .sales-kpi.is-pos { border-left-color: var(--c-warning); }
.finance-screen .sales-kpi.is-pos .sales-kpi-icon { color: var(--c-warning); background: var(--c-warning-soft); }
.finance-screen .sales-kpi.is-net .sales-kpi-icon { color: var(--c-primary); background: var(--c-primary-soft); }
.finance-screen .sales-kpi.is-net b { color: var(--c-primary-dark); }

.fin-section {
    margin-bottom: 12px;
}

.fin-section-title {
    margin: 0 0 6px;
    color: var(--c-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.fin-acc-list {
    display: grid;
    gap: 6px;
}

.fin-acc {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface);
}

.fin-acc-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: var(--r-sm);
    background: var(--c-surface-2);
    color: var(--c-text-2);
}

.fin-acc-icon.is-cash { color: var(--c-success); background: var(--c-success-soft); }
.fin-acc-icon.is-bank { color: #0f766e; background: #ecfdf8; }
.fin-acc-icon.is-pos { color: var(--c-warning); background: var(--c-warning-soft); }

.fin-acc-icon .icon {
    width: 16px;
    height: 16px;
}

.fin-acc-main {
    flex: 1 1 180px;
    min-width: 0;
}

.fin-acc-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.fin-acc-name {
    color: var(--c-text);
    font-weight: 650;
    text-decoration: none;
}

.fin-acc-name:hover {
    color: var(--c-primary);
}

.fin-acc-kind {
    flex: 0 0 auto;
    padding: 1px 6px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    color: var(--c-text-2);
    font-size: 10.5px;
    font-weight: 650;
}

.fin-acc-meta,
.fin-acc-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 2px;
    color: var(--c-muted);
    font-size: var(--fs-xs);
}

.fin-iban {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .02em;
}

.fin-acc-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    margin-left: auto;
}

.fin-acc-bal {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

.fin-acc-bal.is-neg {
    color: var(--c-danger);
}

.fin-acc.is-inactive {
    opacity: .72;
    background: var(--c-surface-2);
}

.fin-acc-kind.is-off {
    color: var(--c-danger);
    border-color: color-mix(in srgb, var(--c-danger) 35%, var(--c-border));
}

.fin-acc-actions form {
    display: inline;
}

.fin-filters {
    padding: 10px 12px 4px;
}

.fin-table-wrap {
    overflow-x: auto;
}

.fin-table {
    table-layout: fixed;
    min-width: 920px;
    width: 100%;
}

.fin-table col.col-date { width: 88px; }
.fin-table col.col-no { width: 112px; }
.fin-table col.col-type { width: 168px; }
.fin-table col.col-desc { width: auto; }
.fin-table col.col-in,
.fin-table col.col-out,
.fin-table col.col-bal { width: 100px; }
.fin-table col.col-act { width: 196px; }

.fin-table th,
.fin-table td {
    vertical-align: middle;
}

.fin-table .cell-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.fin-table th.cell-act,
.fin-table td.cell-act {
    width: 108px;
    min-width: 108px;
    padding-right: 8px;
    text-align: right;
    white-space: nowrap;
    position: sticky;
    right: 0;
    z-index: 1;
    background: var(--c-surface);
    box-shadow: -8px 0 8px -8px rgba(16, 24, 40, .12);
}

.fin-table thead th.cell-act {
    background: var(--c-surface-2);
}

.fin-table tbody tr:nth-child(even) td.cell-act {
    background: var(--c-surface-2);
}

.fin-table tbody tr:hover td.cell-act {
    background: #f8fafc;
}

.fin-table .cell-act .btn {
    max-width: 100%;
}

.fin-docno {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.fin-type {
    display: block;
    font-weight: 650;
}

.fin-cari,
.fin-note {
    display: block;
    overflow: hidden;
    color: var(--c-muted);
    font-size: var(--fs-xs);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fin-in {
    color: var(--c-success);
    font-weight: 600;
}

.fin-out {
    color: var(--c-danger);
    font-weight: 600;
}

.fin-table tr.is-reversal td {
    color: var(--c-text-2);
}

.fin-dlg {
    width: min(560px, 100%);
}

.fin-move-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 12px;
}

.fin-move-groups .btn {
    justify-content: center;
}

.fin-move-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.fin-move-grid .field [data-fin-tr-filter] {
    margin-bottom: 6px;
}

.fin-move-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 0 16px 16px;
    margin-top: 4px;
}

.fin-tr-preview {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px dashed var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface-2);
}

.fin-tr-leg {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.fin-tr-leg b {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--fs-sm);
}

.fin-tr-arrow {
    display: grid;
    place-items: center;
    padding: 4px 0;
    color: var(--c-muted);
}

.fin-tr-preview .badge {
    flex: 0 0 auto;
    min-width: 52px;
    justify-content: center;
    letter-spacing: .04em;
    font-size: 10px;
    font-weight: 700;
}

.fin-view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    margin: 0;
}

.fin-view-grid div {
    min-width: 0;
}

.fin-view-span {
    grid-column: 1 / -1;
}

.fin-view-grid dt {
    color: var(--c-muted);
    font-size: var(--fs-xs);
    font-weight: 650;
}

.fin-view-grid dd {
    margin: 1px 0 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.fin-view-links {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--c-border);
}

.fin-view-kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--c-muted);
    font-size: var(--fs-xs);
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.fin-view-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 8px 6px 0;
    font-size: var(--fs-sm);
}

@media (min-width: 640px) {
    .finance-screen .fin-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .topbar-branch {
        display: inline-flex;
    }

    .fin-move-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 900px) {
    .finance-screen .fin-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .finance-screen .fin-kpis-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .finance-screen .fin-kpis-6 {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .fin-acc-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .finance-screen .fin-kpis-6 {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 639px) {
    .fin-acc-side {
        width: 100%;
        align-items: stretch;
        margin-left: 0;
    }

    .fin-acc-bal {
        text-align: right;
    }

    .fin-acc-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .finance-screen .page-actions {
        width: 100%;
    }

    .finance-screen .page-actions .btn {
        flex: 1 1 auto;
    }

    .fin-view-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ==========================================================================
   Çek / Senet
   ========================================================================== */

.checks-screen .page-head {
    margin-bottom: 10px;
}

.checks-screen .chk-kpis {
    gap: 6px;
    margin: 0 0 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checks-screen .sales-kpi {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 7px 10px;
    box-shadow: none;
    border-left-width: 3px;
}

.checks-screen .sales-kpi-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: var(--r-sm);
    background: var(--c-surface-2);
    color: var(--c-text-2);
}

.checks-screen .sales-kpi-icon .icon {
    width: 16px;
    height: 16px;
}

.checks-screen .sales-kpi-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.checks-screen .sales-kpi-copy em {
    color: var(--c-muted);
    font-size: 10px;
    font-style: normal;
    font-weight: 500;
}

.checks-screen .sales-kpi.is-warn {
    border-left-color: var(--c-danger);
}

.checks-screen .sales-kpi.is-warn .sales-kpi-icon {
    color: var(--c-danger);
    background: var(--c-danger-soft);
}

.chk-due-grid {
    display: grid;
    gap: 8px;
    margin: 0 0 10px;
}

.chk-due-card {
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface);
}

.chk-due-card h2 {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--c-text-2);
}

.chk-due-card.is-overdue h2 {
    color: var(--c-danger);
}

.chk-due-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.chk-due-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.chk-due-item:hover {
    background: var(--c-surface-2);
}

.chk-due-item b {
    display: block;
    font-size: 13px;
}

.chk-due-item small,
.chk-due-amt small {
    display: block;
    color: var(--c-muted);
    font-size: 11px;
}

.chk-due-amt {
    text-align: right;
    flex: 0 0 auto;
}

.chk-due-amt b {
    font-variant-numeric: tabular-nums;
}

.chk-portfolio {
    margin: 0;
}

.chk-port-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.chk-filters {
    grid-template-columns: 1fr 1fr;
    padding: 10px 12px 8px;
}

.chk-filters .filters-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
}

.chk-serial {
    padding: 0;
    border: 0;
    background: none;
    color: var(--c-primary);
    font-weight: 600;
    cursor: pointer;
}

.chk-serial:hover {
    text-decoration: underline;
}

.chk-type.is-check {
    background: #eff6ff;
    color: #1d4ed8;
}

.chk-type.is-note {
    background: #f5f3ff;
    color: #6d28d9;
}

.chk-type-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
}

.chk-due-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

.chk-due-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    background: #fff;
    color: var(--c-text);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.chk-due-chip:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
}

.chk-due-chip.is-on {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}

.chk-view-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    background: #f8fafc;
}

.chk-view-facts > div {
    min-width: 0;
}

.chk-view-facts dt {
    font-size: 11px;
    color: var(--c-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.chk-view-facts dd {
    margin: 2px 0 0;
    font-size: 14px;
    font-weight: 600;
}

.chk-timeline-wrap {
    margin-top: 12px;
}

.chk-timeline {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.chk-timeline li {
    position: relative;
    padding: 0 0 14px 16px;
    border-left: 1px solid var(--c-border);
}

.chk-timeline li:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.chk-timeline li.is-arrow {
    height: 14px;
    padding: 0 0 0 16px;
    border-left: 1px solid var(--c-border);
}

.chk-timeline li.is-arrow::before {
    top: 4px;
    background: var(--c-border);
}

.chk-timeline li::before {
    content: "";
    position: absolute;
    left: -4px;
    top: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--c-primary);
}

.chk-timeline b {
    display: block;
    font-size: 13px;
}

.chk-timeline span,
.chk-timeline small {
    color: var(--c-muted);
    font-size: 12px;
}

.chk-timeline span {
    display: block;
    font-weight: 600;
    letter-spacing: .02em;
}

.chk-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.chk-transition {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--c-border);
}

.chk-print {
    max-width: 210mm;
    margin: 0 auto;
}

.chk-print-sheet {
    padding: 8mm 10mm;
    background: #fff;
    break-after: page;
    page-break-after: always;
}

.chk-print-sheet:last-child {
    break-after: auto;
    page-break-after: auto;
}

.chk-print-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #d1d5db;
}

.chk-print-doc {
    text-align: right;
}

.chk-print-doc b {
    display: block;
    font-size: 16px;
}

.chk-print-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin: 0 0 16px;
}

.chk-print-grid dt {
    color: #6b7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.chk-print-grid dd {
    margin: 2px 0 0;
    font-weight: 600;
}

.chk-print-span {
    grid-column: 1 / -1;
}

.chk-print-hist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.chk-print-hist li {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}

@media (min-width: 640px) {
    .checks-screen .chk-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .chk-due-grid {
        grid-template-columns: 1fr 1fr;
    }

    .chk-filters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .checks-screen .chk-kpis {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .chk-filters {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .chk-dlg {
        width: min(760px, 100%);
        max-height: min(92dvh, 860px);
    }
}

@media (max-width: 639px) {
    .chk-dlg {
        width: 100%;
        max-height: 96dvh;
        border-radius: 10px 10px 0 0;
    }
}

.badge-doc-price-diff {
    background: #fef3c7;
    border-color: transparent;
    color: #92400e;
    letter-spacing: .04em;
    font-size: 10.5px;
}

.pd-form-grid {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 20px;
}

.pd-source-box {
    padding: 14px 16px;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    background: var(--c-soft, #f8fafc);
}

.pd-source-box h2 {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--c-muted);
}

.pd-source-no {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.pd-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pd-fields .is-wide {
    grid-column: 1 / -1;
}

.pd-form-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
}

.pd-related {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pd-related li {
    display: flex;
    gap: 12px;
    align-items: baseline;
}

.pd-paper .inv-head {
    margin-bottom: 10px;
}

.pd-paper .inv-ids {
    margin-bottom: 12px;
}

.pd-lines h3,
.pd-foot h3 {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.pd-foot {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 800px) {
    .pd-form-grid,
    .pd-fields,
    .pd-foot {
        grid-template-columns: 1fr;
    }
}

.offset-dlg {
    width: min(520px, 100%);
}

.collect-dlg {
    width: min(440px, 100%);
}

.collect-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.collect-error {
    margin: 0;
    padding: 8px 10px;
    border-radius: var(--r);
    background: #fef2f2;
    color: #b91c1c;
    font-size: var(--fs-sm);
}

.collect-cari {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface-2);
}

.collect-cari-kicker {
    font-size: var(--fs-xs);
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.collect-cari b {
    font-size: var(--fs-md);
}

.collect-cari-bal {
    font-size: var(--fs-sm);
    color: var(--c-text-2);
}

.collect-cari-bal.is-debt {
    color: #b45309;
    font-weight: 600;
}

.collect-cari-bal.is-credit {
    color: #047857;
    font-weight: 600;
}

.collect-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.collect-method {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface);
    color: var(--c-text);
    font-size: var(--fs-sm);
    cursor: pointer;
}

.collect-method:hover {
    border-color: var(--c-text-2);
}

.collect-method.is-active {
    border-color: var(--c-primary, #2563eb);
    box-shadow: inset 0 0 0 1px var(--c-primary, #2563eb);
    background: rgba(37, 99, 235, .06);
    font-weight: 600;
}

.collect-kind {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.collect-check-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.collect-hint {
    margin: 10px 0 0;
    color: var(--c-muted);
    font-size: var(--fs-xs);
    line-height: 1.45;
}

.collect-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@media (max-width: 640px) {
    .collect-dlg {
        width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .collect-methods {
        grid-template-columns: 1fr 1fr;
    }

    .collect-check-grid {
        grid-template-columns: 1fr;
    }

    .ekstre-screen .page-actions {
        flex-wrap: wrap;
    }
}

.offset-pick {
    position: relative;
}

.offset-preview-type {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--c-border);
    color: var(--c-muted);
    font-size: var(--fs-xs);
}

.offset-hint {
    margin: 12px 0 0;
    padding: 8px 10px;
    border-radius: var(--r);
    background: var(--c-surface-2);
    color: var(--c-text-2);
    font-size: var(--fs-xs);
    line-height: 1.45;
}

.offset-hint small {
    display: block;
    margin-top: 4px;
    color: var(--c-muted);
}

.offset-view-dlg .fin-move-body {
    padding-bottom: 8px;
}

.offset-view-grid dd {
    margin: 0;
}

@media (max-width: 640px) {
    .offset-dlg {
        width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .fin-view-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Malzeme yönetimi
   ========================================================================== */

.mat-page .page-head-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mat-page .mat-head {
    align-items: flex-start;
    margin-bottom: 12px;
}

.mat-page .mat-head h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mat-page .mat-head p {
    width: auto;
}

.mat-back {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    width: max-content;
    color: var(--c-muted);
    font-size: var(--fs-xs);
    text-decoration: none;
}

.mat-back .icon {
    transform: rotate(90deg);
}

.mat-back:hover {
    color: var(--c-primary);
}

.mat-head-code {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--c-text-2);
}

.mat-head-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.mat-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.mat-stat {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--c-border);
    border-left-width: 3px;
    border-radius: var(--r);
    background: var(--c-surface);
    color: inherit;
    text-decoration: none;
}

a.mat-stat:hover {
    border-color: var(--c-border-strong);
    background: var(--c-surface-2);
}

.mat-stat.is-on {
    border-color: var(--c-primary);
    background: var(--c-primary-soft);
}

.mat-stat.is-total { border-left-color: var(--c-text-2); }
.mat-stat.is-success { border-left-color: var(--c-success); }
.mat-stat.is-neutral { border-left-color: var(--c-muted); }
.mat-stat.is-primary { border-left-color: var(--c-primary); }
.mat-stat.is-warning { border-left-color: var(--c-warning); }
.mat-stat.is-danger { border-left-color: var(--c-danger); }

.mat-stat-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: var(--r);
    background: var(--c-surface-2);
    color: var(--c-text-2);
}

.mat-stat.is-success .mat-stat-icon { color: var(--c-success); background: var(--c-success-soft); }
.mat-stat.is-warning .mat-stat-icon { color: var(--c-warning); background: var(--c-warning-soft); }
.mat-stat.is-danger .mat-stat-icon { color: var(--c-danger); background: var(--c-danger-soft); }
.mat-stat.is-primary .mat-stat-icon { color: var(--c-primary); background: var(--c-primary-soft); }

.mat-stat-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.mat-stat-label {
    color: var(--c-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.mat-stat b {
    overflow: hidden;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -.3px;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mat-stat b small {
    color: var(--c-muted);
    font-size: var(--fs-xs);
    font-weight: 500;
}

.mat-stat-text {
    font-size: var(--fs) !important;
}

.mat-stat-hint {
    overflow: hidden;
    color: var(--c-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mat-card {
    overflow: visible;
}

.mat-toolbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--c-border);
}

.mat-search {
    position: relative;
    flex: 1 1 220px;
    min-width: 0;
}

.mat-search-icon {
    position: absolute;
    top: 50%;
    left: 10px;
    display: grid;
    place-items: center;
    color: var(--c-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.mat-search .input {
    padding-left: 32px;
}

.mat-filters {
    position: relative;
}

.mat-filter-btn {
    gap: 6px;
}

.mat-filters > summary,
.mat-menu > summary {
    list-style: none;
}

.mat-filters > summary::-webkit-details-marker,
.mat-menu > summary::-webkit-details-marker {
    display: none;
}

.mat-filter-panel {
    position: absolute;
    z-index: 8;
    top: calc(100% + 6px);
    right: 0;
    width: min(520px, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    padding: 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface);
    box-shadow: var(--shadow-1);
}

.mat-filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.mat-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.mat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 0;
}

.mat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--c-primary-soft);
    color: var(--c-primary-dark);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-decoration: none;
}

.mat-chip span {
    color: var(--c-muted);
}

.mat-empty {
    gap: 10px;
}

.mat-table-wrap {
    width: 100%;
    overflow: visible;
}

.mat-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--c-text-2);
}

.mat-name-link {
    display: block;
    overflow: hidden;
    font-weight: 600;
    color: var(--c-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mat-name-link:hover {
    color: var(--c-primary);
}

.mat-name-meta {
    display: block;
    overflow: hidden;
    color: var(--c-muted);
    font-size: var(--fs-xs);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mat-stock-qty {
    display: block;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mat-stock b {
    font-variant-numeric: tabular-nums;
}

.mat-price-val {
    display: block;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mat-stock-badge.is-ok {
    background: var(--c-success-soft);
    border-color: transparent;
    color: var(--c-success);
}

.mat-stock-badge.is-low {
    background: var(--c-warning-soft);
    border-color: transparent;
    color: var(--c-warning);
}

.mat-stock-badge.is-out {
    background: var(--c-danger-soft);
    border-color: transparent;
    color: var(--c-danger);
}

.mat-price {
    font-variant-numeric: tabular-nums;
}

.mat-status {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.mat-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
}

.mat-menu {
    position: relative;
}

.mat-menu-panel {
    position: absolute;
    z-index: 9;
    top: calc(100% + 4px);
    right: 0;
    min-width: 196px;
    padding: 6px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface);
    box-shadow: var(--shadow-1);
}

.mat-menu-panel a,
.mat-menu-panel button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--c-text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.mat-menu-panel a:hover,
.mat-menu-panel button:hover {
    background: var(--c-surface-2);
}

.mat-form {
    max-width: 880px;
}

@media (min-width: 640px) {
    .mat-form .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.mat-form-foot {
    justify-content: flex-end;
}

.mat-form-page .form-grid .field.is-wide {
    grid-column: 1 / -1;
}

@media (max-width: 899px) {
    .mat-page .page-actions {
        width: 100%;
        margin-left: 0;
    }

    .mat-page .mat-create {
        flex: 1 1 auto;
        justify-content: center;
        min-height: 40px;
    }

    .mat-page .mat-table thead {
        display: none;
    }

    .mat-page .mat-table .hide-sm,
    .mat-page .mat-table .hide-md,
    .mat-page .mat-table .hide-lg {
        display: none !important;
    }

    .mat-page .mat-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 4px 10px;
        margin: 8px 10px;
        padding: 12px;
        border: 1px solid var(--c-border);
        border-radius: var(--r);
        background: var(--c-surface);
    }

    .mat-page .mat-table tbody tr:last-child {
        margin-bottom: 10px;
    }

    .mat-page .mat-table td {
        display: block;
        padding: 0;
        gap: 0;
    }

    .mat-page .mat-table td::before {
        display: none;
    }

    .mat-page .mat-table .mat-name {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }

    .mat-page .mat-table .mat-status {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-end;
        align-self: start;
    }

    .mat-page .mat-table .mat-code {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .mat-page .mat-table .mat-code::before {
        content: "KOD: ";
        font-family: inherit;
        font-weight: 700;
        letter-spacing: .04em;
        color: var(--c-muted);
    }

    .mat-page .mat-table .mat-stock::before,
    .mat-page .mat-table .mat-price::before {
        display: block;
        margin-bottom: 2px;
        color: var(--c-muted);
        font-size: 10px;
        font-weight: 600;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .mat-page .mat-table .mat-stock::before {
        content: "Stok";
    }

    .mat-page .mat-table .mat-price::before {
        content: "Satış";
    }

    .mat-page .mat-table .mat-stock {
        grid-column: 1;
        grid-row: 3;
        margin-top: 6px;
        text-align: left;
    }

    .mat-page .mat-table .mat-price {
        grid-column: 2;
        grid-row: 3;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        margin-top: 6px;
    }

    .mat-page .mat-table .cell-actions {
        grid-column: 1 / -1;
        grid-row: 4;
        justify-content: space-between;
        padding-top: 8px;
    }

    .mat-page .mat-table .mat-actions {
        width: 100%;
        justify-content: space-between;
    }

    .mat-page .mat-table .mat-actions .btn {
        min-height: 40px;
    }

    .mat-filters {
        position: static;
    }

    .mat-filter-panel {
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
    }
}

@media (min-width: 640px) {
    .mat-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mat-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .mat-stats {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .mat-stats-detail {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .mat-table-wrap {
        overflow: visible;
    }

    .mat-page .mat-table {
        table-layout: fixed;
        width: 100%;
    }

    .mat-page .mat-table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        white-space: nowrap;
    }

    .mat-page .mat-table th,
    .mat-page .mat-table td {
        padding: 8px 10px;
        vertical-align: middle;
    }

    .mat-page .mat-table .hide-lg {
        display: none;
    }

    .mat-c-code { width: 92px; }
    .mat-c-name { width: auto; }
    .mat-c-group,
    .mat-c-buy { display: none; }
    .mat-c-unit { width: 48px; }
    .mat-c-stock { width: 96px; }
    .mat-c-price { width: 108px; }
    .mat-c-status { width: 96px; }
    .mat-c-act { width: 136px; }

    .mat-page .mat-table .mat-name {
        min-width: 160px;
    }

    .mat-page .mat-table .mat-stock {
        white-space: normal;
    }

    .mat-page .mat-table tbody tr:nth-child(even) {
        background: color-mix(in srgb, var(--c-surface-2) 70%, transparent);
    }
}

@media (min-width: 1366px) {
    .mat-page .mat-table th.hide-lg,
    .mat-page .mat-table td.hide-lg {
        display: table-cell;
    }

    .mat-c-group,
    .mat-c-buy {
        display: table-column;
        width: 110px;
    }

    .mat-c-buy {
        width: 108px;
    }
}

@media (min-width: 1280px) {
    .mat-stats {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* ==========================================================================
   Faturalar listesi
   Tek table + colgroup + table-layout:fixed. Satış fişleri kurallarına dokunmaz.
   ========================================================================== */

.invoice-screen .invoice-head {
    align-items: flex-start;
    margin-bottom: 10px;
}

.invoice-screen .page-head-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.invoice-screen .invoice-head h1 {
    font-size: var(--fs-lg);
    font-weight: 650;
    letter-spacing: -.3px;
}

.invoice-screen .invoice-head p {
    width: auto;
    color: var(--c-text-2);
    font-size: var(--fs-sm);
}

.invoice-screen .sales-kpi {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 7px 10px;
    box-shadow: none;
}

.invoice-screen .sales-kpi-icon {
    display: grid;
    flex: 0 0 28px;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    background: var(--c-surface-2);
    color: var(--c-text-2);
}

.invoice-screen .sales-kpi.is-count .sales-kpi-icon { color: var(--c-text-2); }
.invoice-screen .sales-kpi.is-account .sales-kpi-icon { color: var(--c-warning); background: var(--c-warning-soft); }
.invoice-screen .sales-kpi.is-cash .sales-kpi-icon { color: var(--c-success); background: var(--c-success-soft); }
.invoice-screen .sales-kpi.is-net .sales-kpi-icon { color: var(--c-primary); background: var(--c-primary-soft); }

.invoice-screen .sales-kpi-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1px;
}

.invoice-screen .sales-kpi b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-filter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    align-items: end;
    padding: 10px 12px;
}

.invoice-filter .field {
    margin: 0;
    min-width: 0;
}

.invoice-filter .label {
    margin-bottom: 4px;
    font-size: 10.5px;
}

.invoice-filter .input,
.invoice-filter .select,
.invoice-filter .btn {
    width: 100%;
    min-height: 34px;
}

.invoice-filter-search,
.invoice-filter-account,
.invoice-filter-type,
.invoice-filter-status,
.invoice-filter-go {
    grid-column: 1 / -1;
}

.invoice-filter-search .sales-filter-search {
    width: 100%;
}

.invoice-empty {
    gap: 10px;
    padding: 36px 16px;
}

.invoice-screen .table-wrap.is-sales {
    overflow: visible;
}

.invoice-screen .invoice-table .inv-account-name {
    display: block;
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-screen .invoice-table .inv-account-meta {
    display: block;
    overflow: hidden;
    color: var(--c-muted);
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-screen .invoice-table .inv-type .badge {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.invoice-screen .invoice-table .inv-status .badge {
    max-width: 100%;
}

.invoice-screen .invoice-table .inv-date {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.invoice-screen .row-split {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    min-width: 0;
}

@media (max-width: 899px) {
    .invoice-screen .page-actions {
        width: 100%;
        margin-left: 0;
    }

    .invoice-screen .invoice-create {
        flex: 1 1 auto;
        justify-content: center;
        min-height: 40px;
    }

    .invoice-screen .table-wrap.is-sales .table thead {
        display: none;
    }

    .invoice-screen .invoice-table .inv-col-src,
    .invoice-screen .invoice-table .inv-col-amt,
    .invoice-screen .invoice-table .inv-col-vat {
        display: none !important;
    }

    .invoice-screen .invoice-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 4px 10px;
        margin: 8px 10px;
        padding: 12px;
        border: 1px solid var(--c-border);
        border-radius: var(--r);
        background: var(--c-surface);
    }

    .invoice-screen .invoice-table tbody tr:last-child {
        margin-bottom: 10px;
        border-bottom: 1px solid var(--c-border);
    }

    .invoice-screen .invoice-table td {
        display: block;
        padding: 0;
        gap: 0;
    }

    .invoice-screen .invoice-table td::before {
        display: none;
    }

    .invoice-screen .invoice-table .inv-no {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }

    .invoice-screen .invoice-table .inv-status {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        align-self: start;
    }

    .invoice-screen .invoice-table .inv-date {
        grid-column: 1 / -1;
        grid-row: 2;
        color: var(--c-muted);
        font-size: var(--fs-xs);
    }

    .invoice-screen .invoice-table .inv-account {
        grid-column: 1 / -1;
        grid-row: 3;
        margin-top: 4px;
    }

    .invoice-screen .invoice-table .inv-type {
        grid-column: 1 / -1;
        grid-row: 4;
        margin-top: 2px;
    }

    .invoice-screen .invoice-table .inv-total {
        grid-column: 1 / -1;
        grid-row: 5;
        margin-top: 6px;
        text-align: left;
        font-size: 15px;
    }

    .invoice-screen .invoice-table .inv-total::before {
        display: block;
        margin-bottom: 2px;
        color: var(--c-muted);
        font-size: 10px;
        font-weight: 600;
        letter-spacing: .04em;
        text-transform: uppercase;
        content: "Genel Toplam";
    }

    .invoice-screen .invoice-table .cell-actions {
        grid-column: 1 / -1;
        grid-row: 6;
        width: auto;
        margin-top: 8px;
        padding-top: 0;
        justify-content: space-between;
    }

    .invoice-screen .invoice-table .row-split {
        justify-content: space-between;
    }

    .invoice-screen .invoice-table .row-split .btn {
        min-height: 40px;
    }
}

@media (min-width: 640px) {
    .invoice-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .invoice-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .invoice-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .invoice-screen .table-wrap.is-sales {
        overflow: visible;
    }

    .invoice-screen .invoice-table {
        table-layout: fixed;
        width: 100%;
    }

    .invoice-screen .invoice-table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        padding: 8px 10px;
        white-space: nowrap;
    }

    .invoice-screen .invoice-table th,
    .invoice-screen .invoice-table td {
        padding: 8px 10px;
        vertical-align: middle;
        overflow: hidden;
    }

    .invoice-screen .invoice-table td.cell-actions {
        overflow: visible;
    }

    .invoice-screen.sales-screen .invoice-table th.cell-actions,
    .invoice-screen.sales-screen .invoice-table td.cell-actions {
        width: 136px;
        min-width: 136px;
        max-width: 136px;
        padding-left: 8px;
        padding-right: 8px;
        white-space: nowrap;
    }

    .invoice-screen .invoice-table .inv-col-type,
    .invoice-screen .invoice-table .inv-col-src,
    .invoice-screen .invoice-table .inv-col-amt,
    .invoice-screen .invoice-table .inv-col-vat {
        display: none;
    }

    .inv-c-date { width: 88px; }
    .inv-c-no { width: 118px; }
    .inv-c-type,
    .inv-c-src,
    .inv-c-amt,
    .inv-c-vat { display: none; }
    .inv-c-account { width: auto; }
    .inv-c-total { width: 112px; }
    .inv-c-status { width: 110px; }
    .inv-c-act { width: 136px; }

    .invoice-screen .invoice-table tbody tr:nth-child(even) {
        background: color-mix(in srgb, var(--c-surface-2) 70%, transparent);
    }

    .invoice-screen .invoice-table .inv-status {
        white-space: nowrap;
    }

    .invoice-screen .inv-overlay .inv-dlg {
        max-width: min(1100px, calc(100vw - 32px));
    }
}

@media (min-width: 1024px) {
    .invoice-filter {
        grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
        align-items: end;
    }

    .invoice-filter-search {
        grid-column: 1 / 3;
    }

    .invoice-filter-account {
        grid-column: 3 / 4;
    }

    .invoice-filter-type,
    .invoice-filter-status,
    .invoice-filter-date,
    .invoice-filter-go {
        grid-column: auto;
    }
}

@media (min-width: 1200px) {
    .invoice-screen .invoice-table th.inv-col-amt,
    .invoice-screen .invoice-table td.inv-col-amt,
    .invoice-screen .invoice-table th.inv-col-vat,
    .invoice-screen .invoice-table td.inv-col-vat {
        display: table-cell;
    }

    .inv-c-amt,
    .inv-c-vat {
        display: table-column;
        width: 96px;
    }

    .inv-c-vat { width: 84px; }
}

@media (min-width: 1280px) {
    .invoice-filter {
        grid-template-columns: minmax(180px, 1.5fr) 118px 118px minmax(140px, 1fr) minmax(140px, .9fr) 128px auto;
    }

    .invoice-filter-search,
    .invoice-filter-account,
    .invoice-filter-type,
    .invoice-filter-status,
    .invoice-filter-date,
    .invoice-filter-go {
        grid-column: auto;
    }
}

@media (min-width: 1366px) {
    .invoice-screen .invoice-table th.inv-col-type,
    .invoice-screen .invoice-table td.inv-col-type,
    .invoice-screen .invoice-table th.inv-col-src,
    .invoice-screen .invoice-table td.inv-col-src {
        display: table-cell;
    }

    .inv-c-type,
    .inv-c-src {
        display: table-column;
        width: 118px;
    }

    .inv-c-src { width: 104px; }
}

@media (max-width: 639px) {
    .invoice-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .invoice-dlg {
        width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* ==========================================================================
   Alış faturaları KPI + kasa hareket düzenleme
   ========================================================================== */

.purchase-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 900px) {
    .purchase-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .purchase-kpis {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.invoice-detail.is-purchase .invd-actions-row .btn-primary {
    order: -1;
}

.fin-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}

.fin-view-hero {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    background: var(--c-surface-2);
}

.fin-view-hero.is-in {
    border-color: transparent;
    background: var(--c-success-soft);
}

.fin-view-hero.is-out {
    border-color: transparent;
    background: var(--c-danger-soft);
}

.fin-view-hero b {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.fin-view-block {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: var(--r);
    background: var(--c-warning-soft);
    color: #85400a;
    font-size: var(--fs-sm);
}

.dlg[data-dlg="fin-view"] .dlg-card,
.dlg[data-dlg="fin-edit"] .dlg-card,
.dlg[data-dlg="fin-move"] .dlg-card {
    width: min(560px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: hidden;
}

.dlg[data-dlg="fin-view"] .dlg-scroll,
.dlg[data-dlg="fin-edit"] .dlg-scroll,
.dlg[data-dlg="fin-move"] .dlg-scroll {
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

@media (max-width: 768px) {
    .fin-table thead {
        display: none;
    }

    .fin-table,
    .fin-table tbody,
    .fin-table tr,
    .fin-table td {
        display: block;
        width: 100%;
    }

    .fin-table tbody tr {
        margin: 8px 0;
        padding: 12px;
        border: 1px solid var(--c-border);
        border-radius: var(--r);
        background: var(--c-surface);
    }

    .fin-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 4px 0;
    }

    .fin-table td::before {
        color: var(--c-muted);
        font-size: 11px;
        font-weight: 600;
        content: attr(data-label);
    }

    .fin-table td.cell-act {
        display: block;
        width: auto;
        padding-top: 8px;
    }

    .fin-row-actions {
        justify-content: stretch;
    }

    .fin-row-actions .btn {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
        min-height: 40px;
    }

    .finance-screen .page-actions .btn,
    .invoice-detail .invd-actions-drop-panel .btn {
        min-height: 40px;
    }
}

@media (max-width: 479px) {
    .fin-move-actions .btn {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
    }
}

/* ==========================================================================
   Stok fişleri (fazla / eksik / transfer)
   ========================================================================== */

.voucher-screen {
    max-width: 48rem;
    margin: 0 auto;
}

.voucher-screen .voucher-form {
    gap: 12px;
}

.voucher-screen .input-qty {
    max-width: 8.5rem;
}

.voucher-screen .card-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

@media (min-width: 640px) {
    .voucher-screen .voucher-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 639px) {
    .voucher-screen .page-actions {
        width: 100%;
        margin-left: 0;
    }

    .voucher-screen .input-qty,
    .voucher-dlg .input-qty {
        max-width: none;
    }
}

.voucher-dlg {
    width: min(32rem, 100%);
}

.voucher-dlg .voucher-form {
    gap: 12px;
}

.voucher-dlg .input-qty {
    max-width: 8.5rem;
}

.voucher-dlg .empty {
    margin: 8px 0 4px;
}

.voucher-line-add {
    display: grid;
    gap: 12px;
    padding: 12px 16px 4px;
    border-top: 1px solid var(--c-border);
    align-items: end;
}

@media (min-width: 640px) {
    .voucher-line-add {
        grid-template-columns: minmax(0, 1fr) 8.5rem auto;
    }
}

.content:has(.voucher-detail) {
    flex: 0 0 auto;
    padding: 8px 12px 16px;
}

.voucher-detail {
    max-width: 56rem;
    margin: 0 auto;
}

.voucher-detail > * {
    flex: none;
}

.vch-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 10px;
}

.vch-head-main {
    min-width: 0;
    flex: 1 1 220px;
}

.vch-kicker {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--c-text-2);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1.2;
}

.vch-kicker .icon-sm {
    color: var(--c-primary);
}

.vch-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.vch-docno {
    display: inline-flex;
    align-items: center;
    padding: 0 7px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r);
    background: var(--c-surface);
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 24px;
}

.vch-status {
    font-weight: 600;
}

.vch-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.voucher-detail .alert {
    margin: 0 0 8px;
}

.vch-card {
    margin-top: 0;
    height: auto;
    min-height: 0;
}

.vch-facts {
    display: grid;
    gap: 8px 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--c-border);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vch-facts .field {
    margin: 0;
}

.vch-facts .label {
    margin-bottom: 3px;
}

.vch-facts .is-wide {
    grid-column: 1 / -1;
}

.vch-facts > div > span:not(.vch-static):not(.field-error) {
    display: block;
    color: var(--c-text-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
}

.vch-facts > div > b {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 650;
}

.vch-static {
    display: flex;
    align-items: center;
    min-height: 34px;
    color: var(--c-text);
    font-size: 13px;
    font-weight: 650;
}

.vch-lines-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px 6px;
}

.vch-lines-head h2 {
    margin: 0;
    font-size: 13px;
}

.vch-lines-head span {
    color: var(--c-text-2);
    font-size: 12px;
}

.vch-card .table-wrap {
    height: auto;
    min-height: 0;
}

.vch-table {
    margin: 0;
}

.vch-empty {
    margin: 4px 12px 10px;
}

.vch-add {
    display: grid;
    gap: 8px 10px;
    padding: 8px 12px;
    border-top: 1px solid var(--c-border);
    align-items: center;
    grid-template-columns: minmax(0, 1fr) 6.5rem auto;
}

.vch-add .field {
    position: relative;
    margin: 0;
}

.vch-add .is-wide {
    grid-column: auto;
}

.vch-add .picker-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    z-index: 40;
    margin-top: 0;
    max-height: 220px;
}

.vch-add-msg {
    grid-column: 1 / -1;
    margin: 0;
}

.vch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface-2);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.voucher-detail .input-qty {
    width: 6.5rem;
    max-width: 100%;
}

@media (min-width: 720px) {
    .vch-facts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .vch-table th,
    .vch-table td {
        padding: 7px 10px;
    }

    .vch-table .input-qty {
        width: 5.5rem;
    }
}

@media (max-width: 639px) {
    .vch-head .btn {
        width: 100%;
        justify-content: center;
    }

    .vch-facts,
    .vch-add {
        grid-template-columns: 1fr;
        padding-left: 10px;
        padding-right: 10px;
    }

    .voucher-detail .input-qty {
        width: 100%;
        max-width: none;
    }

    .vch-actions .btn {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
        min-height: 40px;
    }

    .vch-actions .btn-primary {
        flex: 1 1 100%;
        order: -1;
    }
}




