:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: rgba(255, 255, 255, .92);
  --surface-solid: #fff;
  --surface-subtle: #f8f9fb;
  --ink: #151b25;
  --muted: #687181;
  --muted-2: #8d96a5;
  --line: rgba(24, 32, 43, .10);
  --line-strong: rgba(24, 32, 43, .18);
  --blue: #1769e0;
  --blue-hover: color-mix(in srgb, var(--blue) 86%, #000);
  --blue-soft: #edf4ff;
  --blue-focus: rgba(23, 105, 224, .24);
  --blue-border: rgba(23, 105, 224, .62);
  --blue-shadow: rgba(23, 105, 224, .18);
  --red: #d92d20;
  --green: #16845b;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 5px 16px rgba(16, 24, 40, .04);
  --shadow-md: 0 12px 32px rgba(16, 24, 40, .09), 0 2px 8px rgba(16, 24, 40, .04);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --app-bar-height: 64px;
  font-family: "Google Sans Flex", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  font-size: 100%;
  line-height: 1.5;
}

/* Proforma faturalar */
.proforma-list-heading,.proforma-form-heading,.proforma-detail-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:24px}.proforma-form-heading h1,.proforma-detail-heading h1{margin:3px 0 5px}.proforma-form-heading>div:first-child p:last-child{color:var(--muted);margin:0}.proforma-form-actions,.proforma-detail-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap}.proforma-list-card{padding:0;overflow:hidden}.proforma-list-toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px;border-bottom:1px solid var(--line)}.proforma-list-table tr.status-cancelled{opacity:.58}.proforma-status{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:6px 10px;background:#edf1f6;color:#596579;font-size:11px;font-weight:800;letter-spacing:.04em}.proforma-status.ready{background:#e8f7ef;color:#08724d}.proforma-status.cancelled{background:#fff0ef;color:#a33831}.proforma-status.draft{background:var(--blue-soft);color:var(--blue)}

.proforma-meta-card,.proforma-logistics-card,.proforma-items-card{margin-bottom:18px}.proforma-party-grid{display:grid;grid-template-columns:minmax(0,.78fr) minmax(0,1.22fr);gap:18px;margin-bottom:18px}.proforma-party-grid>.surface-card,.proforma-logistics-card,.proforma-items-card,.proforma-meta-card{padding:22px}.form-grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.proforma-segmented{display:flex;border:1px solid var(--line);background:#f2f4f7;border-radius:12px;padding:3px;min-height:44px}.proforma-segmented button{flex:1;border:0;background:transparent;color:#667085;border-radius:9px;font:inherit;font-size:12px;font-weight:750;cursor:pointer;padding:8px 10px;white-space:nowrap}.proforma-segmented button.active{background:#fff;color:var(--blue);box-shadow:0 2px 9px rgba(15,23,42,.09)}.proforma-seller-preview{display:flex;gap:18px;align-items:center;min-height:150px;padding:18px;border:1px solid var(--line);border-radius:18px;background:#fafbfc}.proforma-seller-preview img{width:125px;height:70px;object-fit:contain}.proforma-seller-preview div{display:flex;flex-direction:column;gap:5px;min-width:0}.proforma-seller-preview strong{font-size:18px}.proforma-seller-preview span,.proforma-seller-preview small{color:var(--muted)}

.proforma-items-wrap{overflow:auto}.proforma-items-table{table-layout:fixed;min-width:1180px}.proforma-items-table th:nth-child(1){width:62px}.proforma-items-table th:nth-child(2){width:125px}.proforma-items-table th:nth-child(3){width:190px}.proforma-items-table th:nth-child(4){width:270px}.proforma-items-table th:nth-child(5){width:90px}.proforma-items-table th:nth-child(6){width:155px}.proforma-items-table th:nth-child(7){width:145px}.proforma-items-table th:nth-child(8){width:64px}.proforma-items-table td{vertical-align:middle;padding:9px}.proforma-cell-input{width:100%;border:1px solid transparent;background:transparent;border-radius:9px;padding:9px 10px;color:var(--ink);font:inherit;font-size:13px;outline:none}.proforma-cell-input:hover,.proforma-cell-input:focus{border-color:var(--line);background:#fff}.proforma-cell-input:focus{box-shadow:0 0 0 3px var(--blue-focus);border-color:var(--blue)}.proforma-cell-input[readonly]{font-weight:700}.proforma-cell-input.code{color:var(--blue);font-weight:800}.proforma-cell-input.specs{resize:vertical;min-height:62px;line-height:1.35}.proforma-cell-input.number{text-align:center;font-weight:800}.proforma-unit-note{display:block;margin-top:2px;color:var(--muted);font-size:10px;line-height:1.25;text-align:center;white-space:nowrap}.money-field.compact{min-height:42px}.money-field.compact input{min-width:0}.proforma-row-order{display:flex!important;flex-direction:column;gap:2px;justify-content:center}.proforma-row-order button{border:0;background:transparent;color:#98a2b3;cursor:pointer;padding:1px}.proforma-row-order svg{width:16px;height:16px}.proforma-lower-grid{display:grid;grid-template-columns:minmax(0,1fr) 390px;gap:18px;align-items:start}.proforma-terms-card,.proforma-finance-card,.proforma-bank-card{padding:22px}.proforma-finance-column{display:grid;gap:14px}.proforma-term-row{display:grid;grid-template-columns:180px minmax(0,1fr) 42px;gap:10px;align-items:start;padding:10px 0;border-bottom:1px solid var(--line)}.proforma-term-row:last-child{border-bottom:0}.proforma-term-row input,.proforma-term-row textarea{border:1px solid var(--line);border-radius:11px;padding:11px;background:#fff;color:var(--ink);font:inherit;outline:none;resize:vertical}.proforma-term-row input{font-size:12px;font-weight:800;color:var(--blue)}.proforma-term-row input:focus,.proforma-term-row textarea:focus{border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-focus)}.proforma-check{position:relative;display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;font-weight:650;cursor:pointer;margin-top:7px}.proforma-check input{position:absolute;opacity:0;pointer-events:none}.proforma-check i{width:19px;height:19px;border:1px solid #cfd5df;border-radius:6px;padding:3px;color:transparent;background:#fff}.proforma-check input:checked+i{background:var(--blue);border-color:var(--blue);color:#fff}.proforma-bank-select{position:relative}.proforma-bank-select>[data-bank-trigger]{width:100%;min-height:48px;border:1px solid var(--line);border-radius:13px;background:#fff;display:flex;align-items:center;justify-content:space-between;padding:10px 13px;color:var(--ink);font:inherit;font-weight:700;cursor:pointer}.proforma-bank-select>[data-bank-menu]{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:35;padding:6px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 45px rgba(15,23,42,.15);max-height:250px;overflow:auto}.proforma-bank-select>[data-bank-menu] button{width:100%;display:flex;align-items:center;gap:10px;text-align:left;border:0;background:transparent;padding:10px;border-radius:10px;cursor:pointer;color:var(--ink)}.proforma-bank-select>[data-bank-menu] button:hover,.proforma-bank-select>[data-bank-menu] button.selected{background:var(--blue-soft)}.proforma-bank-select>[data-bank-menu] button span{display:flex;flex-direction:column;gap:2px;flex:1}.proforma-bank-select>[data-bank-menu] small{color:var(--muted)}.proforma-bank-select>[data-bank-menu] svg{width:17px;color:transparent}.proforma-bank-select>[data-bank-menu] button.selected svg{color:var(--blue)}.proforma-totals-card{border-radius:20px;background:#fff;border:1px solid var(--line);overflow:hidden}.proforma-totals-card>div{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:11px 18px;border-bottom:1px solid var(--line);color:#667085}.proforma-totals-card>div strong{color:var(--ink)}.proforma-totals-card>div.grand{background:#1b2430;color:#fff;border:0;padding:17px 18px;font-size:16px}.proforma-totals-card>div.grand strong{color:#fff;font-size:20px}

.proforma-picker-dialog{width:min(780px,calc(100vw - 32px))}.proforma-picker-content{padding:22px}.proforma-picker-list{display:grid;gap:7px;max-height:min(62vh,620px);overflow:auto}.proforma-picker-list>button{display:flex;align-items:center;gap:14px;width:100%;border:1px solid var(--line);background:#fff;border-radius:14px;padding:13px;text-align:left;color:var(--ink);cursor:pointer;min-height:62px}.proforma-picker-list>button:hover{border-color:var(--blue);background:var(--blue-soft)}.proforma-picker-list>button>span{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.proforma-picker-list>button small{color:var(--muted);white-space:normal}.proforma-picker-list>button em{font-style:normal;font-weight:800;white-space:nowrap}.proforma-picker-list>button>svg{color:var(--blue);width:18px}.proforma-mobile-actions{display:none}

.proforma-detail-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px}.proforma-detail-summary article{background:#fff;border:1px solid var(--line);border-radius:17px;padding:17px;display:flex;flex-direction:column;gap:5px}.proforma-detail-summary small{color:var(--muted);font-weight:800;letter-spacing:.05em}.proforma-detail-summary strong{font-size:18px}.proforma-detail-summary .dark{background:#1b2430;border-color:#1b2430;color:#fff}.proforma-detail-summary .dark small{color:#b9c2d0}.proforma-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px}.proforma-detail-grid>.surface-card,.proforma-detail-items,.proforma-detail-lower>.surface-card{padding:22px}.proforma-info-list{display:grid;gap:0}.proforma-info-list>div{display:grid;grid-template-columns:120px 1fr;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}.proforma-info-list>div:last-child{border:0}.proforma-info-list dt{color:var(--muted);font-size:12px;font-weight:700}.proforma-info-list dd{margin:0;font-weight:650;white-space:pre-line}.proforma-detail-items{margin-bottom:18px}.pre-line{white-space:pre-line}.proforma-detail-lower{display:grid;grid-template-columns:minmax(0,1fr) 390px;gap:18px}.proforma-terms-readonly>div{display:grid;grid-template-columns:160px 1fr;gap:12px;padding:9px 0;border-bottom:1px solid var(--line)}.proforma-terms-readonly dt{color:var(--blue);font-size:12px;font-weight:800}.proforma-terms-readonly dd{margin:0;white-space:pre-line}.proforma-detail-totals>div{display:flex;justify-content:space-between;gap:20px;padding:10px 0;border-bottom:1px solid var(--line)}.proforma-detail-totals>div.grand{margin:12px -22px -22px;padding:18px 22px;background:#1b2430;color:#fff;border-radius:0 0 20px 20px;font-size:17px}.proforma-default-settings{border-top:1px solid var(--line);margin-top:26px;padding-top:26px}.proforma-bank-settings{margin-top:18px;padding:22px}.bank-account-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.bank-account-list article{display:grid;grid-template-columns:42px minmax(0,1fr) auto auto;align-items:center;gap:12px;border:1px solid var(--line);border-radius:15px;padding:13px}.bank-account-list article>span{width:40px;height:40px;border-radius:12px;background:var(--blue-soft);color:var(--blue);display:grid;place-items:center}.bank-account-list article>span svg{width:20px}.bank-account-list article>div:not(.row-actions){display:flex;flex-direction:column;gap:2px;min-width:0}.bank-account-list strong em{font-style:normal;font-size:10px;color:#08724d;background:#e8f7ef;border-radius:999px;padding:3px 6px}.bank-account-list small{color:var(--muted)}.bank-account-list code{font:600 12px "Google Sans Flex",sans-serif;overflow-wrap:anywhere}.bank-account-list article.inactive{opacity:.52}

@media (max-width:1100px){.form-grid.four{grid-template-columns:repeat(2,minmax(0,1fr))}.proforma-party-grid{grid-template-columns:1fr}.proforma-lower-grid,.proforma-detail-lower{grid-template-columns:1fr}.proforma-finance-column{grid-template-columns:1fr 1fr}.proforma-totals-card{grid-column:1/-1}.bank-account-list{grid-template-columns:1fr}}
@media (max-width:760px){body[data-page="panel-proforma-form"] .panel-content{padding-bottom:88px}.proforma-list-heading,.proforma-form-heading,.proforma-detail-heading{flex-direction:column}.proforma-form-actions{display:none}.proforma-list-toolbar{align-items:stretch;flex-direction:column}.proforma-list-toolbar .account-search-form{width:100%}.proforma-list-toolbar .orders-search{flex:1}.form-grid.four{grid-template-columns:1fr}.proforma-party-grid,.proforma-detail-grid,.proforma-detail-summary{grid-template-columns:1fr}.proforma-finance-column{grid-template-columns:1fr}.proforma-items-wrap{overflow:visible}.proforma-items-table{min-width:0;display:block}.proforma-items-table thead{display:none}.proforma-items-table tbody{display:grid;gap:12px}.proforma-items-table tr{display:grid;border:1px solid var(--line);border-radius:16px;padding:12px;background:#fff;box-shadow:0 8px 24px rgba(15,23,42,.05)}.proforma-items-table td{display:grid!important;grid-template-columns:110px minmax(0,1fr);gap:10px;align-items:center;border:0!important;padding:6px!important}.proforma-items-table td:before{content:attr(data-label);font-size:11px;color:var(--muted);font-weight:800;text-transform:uppercase}.proforma-items-table .proforma-row-order{display:none!important}.proforma-items-table .actions-cell{display:flex!important;justify-content:flex-end}.proforma-items-table .actions-cell:before{display:none}.proforma-cell-input.specs{min-height:80px}.proforma-term-row{grid-template-columns:1fr 42px}.proforma-term-row textarea{grid-column:1/-1;grid-row:2}.proforma-term-row button{grid-column:2;grid-row:1}.proforma-mobile-actions{position:fixed;z-index:45;left:12px;right:12px;bottom:calc(10px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(4,1fr);padding:6px;background:rgba(255,255,255,.94);border:1px solid var(--line);box-shadow:0 18px 45px rgba(15,23,42,.22);border-radius:18px;backdrop-filter:blur(16px)}.proforma-mobile-actions button{border:0;background:transparent;border-radius:13px;min-height:52px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font:inherit;font-size:10px;font-weight:750;color:#667085}.proforma-mobile-actions button.primary{background:var(--blue);color:#fff}.proforma-mobile-actions svg{width:19px}.proforma-detail-actions{width:100%;justify-content:flex-start}.proforma-info-list>div,.proforma-terms-readonly>div{grid-template-columns:1fr}.bank-account-list article{grid-template-columns:42px minmax(0,1fr) auto}.bank-account-list .row-actions{grid-column:2/-1;justify-content:flex-end}.proforma-picker-dialog{width:calc(100vw - 16px);margin:8px}.proforma-picker-content{padding:16px}.proforma-picker-list>button em{display:none}}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { color: inherit; }
::selection { background: var(--blue-soft); }
:focus-visible { outline: 3px solid var(--blue-focus); outline-offset: 2px; }

.app-bar {
  position: sticky;
  z-index: 50;
  top: 0;
  height: var(--app-bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(249, 250, 252, .78);
  border-bottom: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 1px 0 rgba(24, 32, 43, .07);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-size: 1.08rem; font-weight: 700; letter-spacing: -.025em; }
.brand img { width: auto; max-width: 160px; height: 36px; object-fit: contain; }
.brand-mark, .auth-brand-mark, .brand-preview-mark { display: grid; place-items: center; color: #fff; background: #18202b; border-radius: 11px; box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.brand-mark { width: 34px; height: 34px; }
.brand-mark svg { width: 18px; }
.app-bar-actions { display: flex; align-items: center; gap: 8px; }
.app-bar-actions form, .row-actions form { margin: 0; }
.user-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; color: #4e5868; font-size: .86rem; font-weight: 600; }
.user-chip svg { width: 18px; }

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 100ms ease, color 160ms ease;
}
.icon-button:hover { background: rgba(24, 32, 43, .06); border-color: rgba(24, 32, 43, .05); }
.icon-button:active { transform: scale(.95); }
.icon-button svg { width: 19px; height: 19px; }
.icon-button.danger { color: var(--red); }
.icon-button.danger:hover { background: #fff0ef; }

.app-main { width: 100%; padding: 22px 16px 92px; }
.offer-hero, .page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.offer-hero { align-items: center; padding: 8px 2px 14px; }
.eyebrow { margin: 0 0 6px; color: var(--blue); font-size: .69rem; line-height: 1.2; font-weight: 700; letter-spacing: .12em; }
h1, h2, h3, p { overflow-wrap: break-word; }
.offer-hero h1, .page-heading h1 { margin: 0; font-size: clamp(1.72rem, 2.5vw, 2.45rem); line-height: 1.08; font-weight: 700; letter-spacing: -.04em; }
.hero-subtitle, .page-heading > div > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: .96rem; }
.hero-actions { display: flex; align-items: center; gap: 8px; }
.offer-hero .hero-actions .button { min-height: 58px; border-radius: var(--radius-md); }
.hero-side { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: .88rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 180ms ease, transform 100ms ease, opacity 160ms ease;
}
.button svg { width: 18px; height: 18px; }
.button:active:not(:disabled) { transform: scale(.97); }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 4px 12px var(--blue-shadow), inset 0 1px 0 rgba(255,255,255,.22); }
.button.primary:hover:not(:disabled) { background: var(--blue-hover); box-shadow: 0 6px 18px color-mix(in srgb, var(--blue) 25%, transparent); }
.button.secondary { background: rgba(255, 255, 255, .85); border-color: var(--line); box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.button.secondary:hover:not(:disabled) { background: #fff; border-color: var(--line-strong); }
.button.danger-solid { color: #fff; background: var(--red); box-shadow: 0 5px 14px rgba(217,45,32,.2); }
.button.danger-solid:hover:not(:disabled) { background: #bd251a; }
.button:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.button.full { width: 100%; }
.button.small { min-height: 38px; padding: 0 12px; font-size: .81rem; }

.summary-grid { display: flex; align-items: stretch; gap: 6px; margin: 0; }
.summary-card, .stat-card {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.summary-card.featured { color: var(--ink); background: transparent; border-color: transparent; box-shadow: none; }
.summary-card { min-width: 126px; padding: 5px 12px; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.summary-card + .summary-card { border-left: 1px solid var(--line); }
.summary-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; }
.summary-icon svg { width: 15px; height: 15px; }
.summary-icon.blue { color: var(--blue); background: transparent; }
.summary-icon.violet { color: #7558ca; background: transparent; }
.summary-icon.green { color: #16845b; background: #e9f8f1; }
.summary-icon.dark { color: var(--blue); background: transparent; }
.summary-card > div:last-child, .stat-card > div:last-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.summary-card span:not(.summary-icon), .stat-card span:not(.summary-icon) { color: var(--muted); font-size: .67rem; line-height: 1.2; font-weight: 700; letter-spacing: .08em; }
.summary-card.featured span:not(.summary-icon) { color: var(--muted); }
.summary-card strong { font-size: .86rem; line-height: 1.15; letter-spacing: -.018em; font-variant-numeric: tabular-nums; white-space: nowrap; }

.offer-toolbar {
  position: sticky;
  z-index: 30;
  top: calc(var(--app-bar-height) + 8px);
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) minmax(170px, 1fr) minmax(160px, 1fr) minmax(112px, .52fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.toolbar-buttons { display: flex; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: #3c4655; font-size: .78rem; font-weight: 600; }
.field > span:first-child { padding-left: 2px; }
.field input:not([type="file"]), .field select, .field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  font-size: .9rem;
  font-weight: 500;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: #a0a7b2; }
.field input:not([type="file"]):focus, .field select:focus, .field textarea:focus { border-color: var(--blue-border); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 10%, transparent); }
.field small, .form-hint { color: var(--muted); font-size: .73rem; font-weight: 500; }
.input-with-icon { position: relative; display: block; }
.input-with-icon > svg { position: absolute; z-index: 1; left: 12px; top: 50%; width: 17px; height: 17px; color: #858e9c; transform: translateY(-50%); pointer-events: none; }
.field .input-with-icon input { padding-left: 38px; }
.password-field input { padding-right: 46px !important; }
.password-toggle { position: absolute; right: 3px; top: 50%; width: 38px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); transform: translateY(-50%); cursor: pointer; }
.password-toggle svg { width: 17px; }

.results-meta { display: flex; align-items: center; justify-content: space-between; padding: 15px 3px 8px; color: var(--muted); font-size: .8rem; }
.results-meta p { margin: 0; }
.results-meta strong { color: var(--ink); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 10px; }
.product-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 1px 3px rgba(16,24,40,.03);
  transition: transform 190ms cubic-bezier(.2,.75,.2,1), border-color 170ms ease, box-shadow 190ms ease;
}
.product-card:hover { transform: translateY(-2px) scale(1.008); border-color: rgba(24,32,43,.17); box-shadow: 0 12px 25px rgba(16,24,40,.09); }
.product-card.selected { border-color: var(--blue-border); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 12%, transparent), 0 13px 28px color-mix(in srgb, var(--blue) 12%, transparent); }
.product-select { position: absolute; z-index: 2; top: 10px; right: 10px; width: 32px; height: 32px; cursor: pointer; }
.product-select input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.product-select span { width: 32px; height: 32px; display: grid; place-items: center; color: transparent; background: rgba(255,255,255,.86); border: 1px solid rgba(24,32,43,.16); border-radius: 50%; box-shadow: 0 3px 10px rgba(16,24,40,.09); backdrop-filter: blur(8px); transition: color 150ms ease, background 150ms ease, transform 100ms ease; }
.product-select span svg { width: 16px; stroke-width: 3; }
.product-select input:checked + span { color: #fff; background: var(--blue); border-color: var(--blue); }
.product-select input:focus-visible + span { outline: 3px solid var(--blue-focus); outline-offset: 2px; }
.product-select:active span { transform: scale(.9); }
.product-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #fff; border-bottom: 1px solid rgba(24,32,43,.06); }
.product-media img { width: 100%; height: 100%; object-fit: contain; transition: transform 220ms ease; }
.product-card:hover .product-media img { transform: scale(1.018); }
.image-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #9ca3af; font-size: .7rem; }
.image-placeholder svg { width: 30px; height: 30px; stroke-width: 1.3; }
.product-info { padding: 12px; }
.product-codes { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted-2); font-size: .65rem; font-weight: 650; letter-spacing: .025em; }
.product-codes strong { overflow: hidden; color: #4b5563; text-overflow: ellipsis; white-space: nowrap; }
.product-info h2 { min-height: 2.6em; margin: 7px 0 8px; display: -webkit-box; overflow: hidden; font-size: .91rem; line-height: 1.3; font-weight: 650; letter-spacing: -.012em; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-price { margin: 0; font-size: 1.03rem; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.product-price-row { display: flex; align-items: baseline; gap: 4px; margin: 0 0 11px; }
.product-price-row > span { color: var(--muted); font-size: .68rem; font-weight: 650; }
.product-unit-content { margin: -5px 0 10px; color: var(--muted); font-size: .68rem; font-weight: 600; }
.quantity-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-top: 9px; border-top: 1px solid rgba(24,32,43,.07); }
.quantity-row > span { color: var(--muted); font-size: .7rem; font-weight: 600; }
.stepper { height: 34px; display: flex; align-items: center; overflow: hidden; background: #f4f5f7; border: 1px solid rgba(24,32,43,.07); border-radius: 10px; }
.stepper button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; cursor: pointer; transition: background 130ms ease, transform 90ms ease; }
.stepper button:hover { background: #e9ebef; }
.stepper button:active { transform: scale(.87); }
.stepper svg { width: 14px; }
.stepper input { width: 38px; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; text-align: center; font-size: .8rem; font-weight: 700; appearance: textfield; }
.stepper input::-webkit-inner-spin-button { appearance: none; }

.empty-state { min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; background: rgba(255,255,255,.7); border: 1px dashed rgba(24,32,43,.15); border-radius: var(--radius-lg); }
.empty-state > svg { width: 42px; height: 42px; margin-bottom: 14px; color: #87909e; stroke-width: 1.4; }
.empty-state h2 { margin: 0; font-size: 1.12rem; letter-spacing: -.02em; }
.empty-state p { max-width: 460px; margin: 7px 0 18px; color: var(--muted); font-size: .88rem; }
.empty-state.compact { min-height: 240px; border: 0; background: transparent; }
.search-empty { margin-top: 10px; }
.mobile-action-bar { display: none; }

/* Authentication */
.auth-page, .error-page { background: #edf1f6; }
.auth-main, .error-main { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-main::before, .error-main::before { content: ""; position: fixed; inset: 0; z-index: -1; background: radial-gradient(circle at 50% -10%, rgba(255,255,255,.95), transparent 48%); }
.auth-card { width: min(100%, 430px); padding: 32px; background: rgba(255,255,255,.86); border: 1px solid rgba(255,255,255,.95); border-radius: 26px; box-shadow: 0 24px 70px rgba(20,29,43,.12), inset 0 1px 0 #fff; backdrop-filter: blur(20px) saturate(140%); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; font-size: 1.08rem; font-weight: 700; letter-spacing: -.025em; }
.auth-brand-mark { width: 38px; height: 38px; }
.auth-brand-mark svg { width: 19px; }
.auth-copy { margin-bottom: 25px; }
.auth-copy h1 { margin: 0; font-size: 1.72rem; line-height: 1.12; letter-spacing: -.04em; }
.auth-copy > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.stack-form { display: flex; flex-direction: column; gap: 16px; }
.check-row { width: fit-content; display: flex; align-items: center; gap: 9px; color: #4c5666; font-size: .83rem; font-weight: 550; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--blue); }

/* Panel */
.panel-shell { min-height: calc(100vh - var(--app-bar-height)); display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { position: sticky; top: var(--app-bar-height); z-index: 40; height: calc(100vh - var(--app-bar-height)); display: flex; flex-direction: column; padding: 18px 12px 14px; background: rgba(237,240,244,.72); border-right: 1px solid var(--line); backdrop-filter: blur(15px); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 2px 11px 13px; color: #7c8593; font-size: .69rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a, .sidebar-return { min-height: 44px; display: flex; align-items: center; gap: 11px; padding: 0 12px; border-radius: 12px; color: #535e6d; font-size: .86rem; font-weight: 600; transition: color 150ms ease, background-color 150ms ease, transform 100ms ease; }
.sidebar-nav a:hover, .sidebar-return:hover { color: var(--ink); background: rgba(255,255,255,.72); }
.sidebar-nav a:active, .sidebar-return:active { transform: scale(.985); }
.sidebar-nav a.active { color: var(--ink); background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 5px 13px rgba(16,24,40,.05); }
.sidebar-nav svg, .sidebar-return svg { width: 18px; height: 18px; }
.sidebar-nav a.active svg { color: var(--blue); }
.sidebar-return { margin-top: auto; }
.panel-content { min-width: 0; width: 100%; padding: 28px 16px 48px; }
.page-heading { align-items: center; margin-bottom: 22px; }
.page-heading h1 { font-size: clamp(1.65rem, 2.4vw, 2.25rem); }
.back-link { width: fit-content; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; color: var(--muted); font-size: .81rem; font-weight: 600; }
.back-link:hover { color: var(--blue); }
.back-link svg { width: 16px; }
.heading-with-status { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-card { min-height: 104px; }
.stat-card strong { font-size: 1.55rem; line-height: 1.15; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.surface-card { padding: 18px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-size: 1.08rem; line-height: 1.3; letter-spacing: -.025em; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-size: .8rem; font-weight: 650; }
.text-link svg { width: 15px; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid rgba(24,32,43,.07); border-radius: 15px; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { padding: 11px 13px; color: #788291; background: #f7f8fa; border-bottom: 1px solid var(--line); text-align: left; font-size: .67rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.data-table td { padding: 11px 13px; border-bottom: 1px solid rgba(24,32,43,.07); color: #4d5867; font-size: .8rem; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 140ms ease; }
.data-table tbody tr:hover { background: #fafbfc; }
.data-table td strong { color: var(--ink); font-weight: 650; }
.data-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .actions-cell { text-align: right; }
.code-link { color: var(--blue); font-weight: 650; }
.code-pill { display: inline-flex; align-items: center; min-height: 25px; padding: 2px 8px; color: #445064; background: #f1f3f6; border: 1px solid rgba(24,32,43,.06); border-radius: 7px; font-size: .7rem; font-weight: 700; letter-spacing: .02em; }
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }
.row-actions .icon-button { width: 36px; height: 36px; }
.table-product { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.table-product img, .mini-placeholder { width: 52px; height: 40px; flex: 0 0 auto; border: 1px solid rgba(24,32,43,.07); border-radius: 9px; object-fit: contain; background: #f4f5f7; }
.mini-placeholder { display: grid; place-items: center; color: #9aa2ae; }
.mini-placeholder svg { width: 17px; }
.status { width: fit-content; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; font-size: .69rem; font-weight: 650; }
.status svg { width: 7px; height: 7px; fill: currentColor; }
.status.active { color: #087653; background: #e9f8f1; }
.status.inactive { color: #747d8a; background: #eff1f4; }

/* Forms and settings */
.form-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .65fr); gap: 12px; align-items: start; }
.form-card { padding: 20px; }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-two { grid-column: span 2; }
.span-layout { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.upload-zone { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; background: #f6f7f9; border: 1px dashed rgba(24,32,43,.22); border-radius: 16px; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease, transform 100ms ease; }
.upload-zone:hover, .upload-zone.dragover { background: var(--blue-soft); border-color: var(--blue-border); }
.upload-zone:active { transform: scale(.99); }
.upload-zone > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone > img { width: 100%; height: 100%; object-fit: contain; }
.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--muted); font-size: .8rem; }
.upload-placeholder svg { width: 32px; height: 32px; margin-bottom: 5px; color: #8792a2; stroke-width: 1.5; }
.upload-placeholder strong { color: var(--ink); }
.upload-placeholder small { color: var(--muted-2); }
.form-hint { margin: 10px 2px 0; line-height: 1.45; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .45fr); gap: 12px; align-items: start; margin-bottom: 12px; }
.settings-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 12px; }
.settings-icon svg { width: 19px; }
.file-input { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 8px 11px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.file-input svg { width: 17px; flex: 0 0 auto; color: var(--muted); }
.file-input input { min-width: 0; font-size: .78rem; }
.color-field { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 6px 11px 6px 7px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.color-field input[type="color"] { width: 54px; height: 32px; flex: 0 0 auto; padding: 0; overflow: hidden; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 8px; }
.color-field strong { color: var(--ink); font-size: .79rem; letter-spacing: .025em; }
.brand-preview-card { padding: 20px; }
.brand-preview { display: flex; flex-direction: column; align-items: center; padding: 24px 12px; text-align: center; background: #f6f7f9; border: 1px solid rgba(24,32,43,.06); border-radius: 17px; }
.brand-preview img { max-width: 160px; max-height: 70px; object-fit: contain; margin-bottom: 15px; }
.brand-preview-mark { width: 50px; height: 50px; margin-bottom: 13px; }
.brand-preview h2 { margin: 0; font-size: 1.1rem; letter-spacing: -.025em; }
.brand-preview p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.company-preview-list { margin: 14px 0 0; }
.company-preview-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; border-bottom: 1px solid rgba(24,32,43,.07); }
.company-preview-list > div:last-child { border-bottom: 0; }
.company-preview-list dt { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .75rem; }
.company-preview-list dt svg { width: 15px; }
.company-preview-list dd { max-width: 58%; margin: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-size: .76rem; font-weight: 600; white-space: nowrap; }
.users-section { scroll-margin-top: calc(var(--app-bar-height) + 15px); }
.user-list { display: flex; flex-direction: column; border: 1px solid rgba(24,32,43,.07); border-radius: 15px; }
.user-row { display: grid; grid-template-columns: 42px minmax(150px, 1fr) 90px 100px auto; align-items: center; gap: 11px; padding: 11px 13px; border-bottom: 1px solid rgba(24,32,43,.07); }
.user-row:last-child { border-bottom: 0; }
.user-avatar { width: 38px; height: 38px; display: grid; place-items: center; color: #34445a; background: #e9edf3; border-radius: 50%; font-size: .83rem; font-weight: 700; }
.user-identity { min-width: 0; display: flex; flex-direction: column; }
.user-identity strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.user-identity span, .user-date { color: var(--muted); font-size: .72rem; }

/* Offer editor */
.offer-edit-meta { margin-bottom: 12px; }
.inline-field { display: flex; gap: 7px; }
.inline-field input { min-width: 0; }
.offer-items { display: flex; flex-direction: column; gap: 8px; }
.offer-item-row { display: grid; grid-template-columns: minmax(190px, 1.45fr) minmax(105px, .55fr) minmax(125px, .65fr) 36px; align-items: end; gap: 9px; padding: 11px; background: #f8f9fb; border: 1px solid rgba(24,32,43,.07); border-radius: 14px; }
.offer-item-product { display: flex; align-items: center; gap: 10px; min-width: 0; padding-bottom: 3px; }
.offer-item-product img, .offer-item-product .mini-placeholder { width: 48px; height: 42px; object-fit: contain; border-radius: 9px; background: #fff; }
.offer-item-product > div { min-width: 0; display: flex; flex-direction: column; }
.offer-item-product strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.offer-item-product span { color: var(--muted); font-size: .68rem; }
.edit-totals { width: min(100%, 460px); display: flex; flex-direction: column; gap: 7px; margin: 18px 0 0 auto; }
.edit-totals > div { display: flex; align-items: center; justify-content: space-between; padding: 5px 11px; color: var(--muted); font-size: .8rem; }
.edit-totals strong { color: var(--ink); font-size: .9rem; font-variant-numeric: tabular-nums; }
.edit-totals .grand { padding: 12px; color: #fff; background: #1b2430; border-radius: 12px; }
.edit-totals .grand strong { color: #fff; font-size: 1.06rem; }
.sticky-save-bar { position: sticky; z-index: 20; bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding: 10px 12px; background: rgba(255,255,255,.84); border: 1px solid rgba(255,255,255,.95); border-radius: 16px; box-shadow: var(--shadow-md); backdrop-filter: blur(16px) saturate(150%); }
.sticky-save-bar p { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: .75rem; }
.sticky-save-bar p svg { width: 17px; color: var(--green); }
.sticky-save-bar > div { display: flex; gap: 7px; }

/* Dialogs, toasts, errors */
.app-dialog { width: min(calc(100% - 24px), 470px); padding: 0; color: var(--ink); background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.95); border-radius: 22px; box-shadow: 0 30px 90px rgba(16,24,40,.28); opacity: 0; transform: translateY(8px) scale(.98); transition: opacity 180ms ease, transform 220ms cubic-bezier(.2,.75,.2,1); }
.app-dialog[open] { opacity: 1; transform: translateY(0) scale(1); }
.app-dialog::backdrop { background: rgba(25,32,43,.28); backdrop-filter: blur(3px); }
.app-dialog form { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.025em; }
.dialog-heading p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 4px; }
.toast-region { position: fixed; z-index: 130; top: 14px; right: 14px; width: min(calc(100% - 28px), 390px); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { max-width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #fff; background: rgba(27,36,48,.94); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; box-shadow: 0 14px 35px rgba(16,24,40,.2); backdrop-filter: blur(14px); font-size: .82rem; font-weight: 550; animation: toast-in 260ms cubic-bezier(.2,.8,.2,1) both; pointer-events: auto; }
.toast svg { width: 19px; flex: 0 0 auto; color: #8bd9bc; }
.toast-error svg { color: #ffaba4; }
.toast.leaving { animation: toast-out 180ms ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateX(18px) translateY(-5px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(14px) translateY(-4px) scale(.98); } }
.error-card { width: min(100%, 520px); display: flex; flex-direction: column; align-items: center; padding: 36px; text-align: center; background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.96); border-radius: 26px; box-shadow: var(--shadow-md); }
.error-code { color: var(--blue); font-size: .73rem; font-weight: 700; letter-spacing: .12em; }
.error-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 14px 0; color: #546172; background: #edf0f4; border-radius: 17px; }
.error-icon svg { width: 26px; }
.error-card h1 { margin: 0; font-size: 1.55rem; line-height: 1.15; letter-spacing: -.035em; }
.error-card > p:not(.eyebrow) { margin: 10px 0 20px; color: var(--muted); font-size: .88rem; }
.database-error code { width: 100%; padding: 13px; color: #dcecff; background: #1b2430; border-radius: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; }
.database-error .error-note { display: flex; align-items: center; gap: 7px; margin-bottom: 0 !important; font-size: .73rem !important; }
.error-note svg { width: 16px; color: var(--green); }
.mobile-only { display: none; }
.sidebar-scrim { display: none; }

/* Global confirmation */
.confirm-region { position: fixed; z-index: 120; top: 14px; right: 14px; width: min(calc(100% - 28px), 420px); pointer-events: none; }
.confirm-card { display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.96); border-radius: 20px; box-shadow: 0 24px 70px rgba(16,24,40,.2), 0 2px 8px rgba(16,24,40,.07); opacity: 0; transform: translateY(-10px) translateX(12px) scale(.98); transition: opacity 170ms ease, transform 210ms cubic-bezier(.2,.75,.2,1); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); pointer-events: auto; }
.confirm-region.visible .confirm-card { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
.confirm-region.leaving .confirm-card { opacity: 0; transform: translateY(-7px) translateX(8px) scale(.985); }
.confirm-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; color: var(--red); background: #fff0ef; border-radius: 12px; }
.confirm-icon svg { width: 19px; height: 19px; }
.confirm-content { min-width: 0; flex: 1; }
.confirm-content h2 { margin: 0; font-size: .97rem; line-height: 1.3; letter-spacing: -.018em; }
.confirm-content p { margin: 5px 0 13px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 7px; }
.confirm-actions .button { min-height: 44px; padding: 0 13px; font-size: .8rem; }

/* Orders */
.order-overview { margin: 12px 0; }
.next-order-card { width: min(100%, 520px); display: flex; align-items: center; gap: 14px; padding: 18px; overflow: hidden; color: #fff; background: linear-gradient(135deg, #1b2430, #263448); border: 1px solid rgba(255,255,255,.12); border-radius: 20px; box-shadow: 0 16px 34px rgba(24,32,43,.15); }
.next-order-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: color-mix(in srgb, var(--blue) 74%, transparent); border: 1px solid rgba(255,255,255,.15); border-radius: 15px; }
.next-order-icon svg { width: 23px; height: 23px; }
.next-order-card > div { min-width: 0; display: flex; flex-direction: column; }
.next-order-card span:not(.next-order-icon) { color: rgba(255,255,255,.64); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.next-order-card strong { margin: 1px 0; font-size: 1.7rem; line-height: 1.15; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.next-order-card small { color: rgba(255,255,255,.58); font-size: .7rem; }
.orders-section { margin-top: 12px; }
.orders-heading { align-items: flex-end; }
.orders-search { width: min(100%, 280px); height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 11px; color: var(--muted); background: #f8f9fb; border: 1px solid var(--line); border-radius: 11px; transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease; }
.orders-search:focus-within { background: #fff; border-color: var(--blue-border); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 10%, transparent); }
.orders-search svg { width: 17px; flex: 0 0 auto; }
.orders-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .84rem; }
.order-number { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-weight: 700; font-variant-numeric: tabular-nums; }
.order-number svg { width: 14px; height: 14px; }
.order-actions { gap: 1px; }
.order-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 12px 0; }
.order-detail-card { min-height: 104px; display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.order-detail-card > span { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: var(--blue-soft); border-radius: 13px; }
.order-detail-card > span svg { width: 20px; height: 20px; }
.order-detail-card > div { min-width: 0; display: flex; flex-direction: column; }
.order-detail-card small { color: var(--muted); font-size: .68rem; font-weight: 650; }
.order-detail-card strong { overflow: hidden; font-size: 1rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.order-products-section { margin-top: 12px; }

/* Stock management */
.compact-button { min-height: 40px; padding: 0 12px; }
.stock-toolbar { position: relative; z-index: 25; display: grid; grid-template-columns: minmax(220px, 310px) auto minmax(220px, 1fr); align-items: center; gap: 9px; margin-bottom: 12px; padding: 10px; background: rgba(255,255,255,.86); border: 1px solid rgba(255,255,255,.95); border-radius: 18px; box-shadow: var(--shadow-sm); }
.stock-view-picker { position: relative; }
.stock-view-trigger { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 12px; color: var(--ink); background: #f7f9fb; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; text-align: left; }
.stock-view-trigger > span { min-width: 0; display: flex; flex-direction: column; }
.stock-view-trigger small { color: var(--muted); font-size: .65rem; font-weight: 650; }
.stock-view-trigger strong { overflow: hidden; font-size: .87rem; text-overflow: ellipsis; white-space: nowrap; }
.stock-view-trigger > svg { width: 17px; color: var(--muted); }
.stock-view-menu { position: absolute; z-index: 40; top: calc(100% + 7px); left: 0; width: min(330px, calc(100vw - 48px)); max-height: 360px; overflow-y: auto; padding: 6px; background: rgba(255,255,255,.98); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 20px 45px rgba(16,24,40,.16); }
.stock-view-menu a { display: grid; grid-template-columns: 36px minmax(0,1fr) 18px; align-items: center; gap: 9px; min-height: 54px; padding: 7px 9px; border-radius: 11px; }
.stock-view-menu a:hover, .stock-view-menu a.active { background: var(--blue-soft); }
.stock-view-menu a > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.stock-view-menu strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.stock-view-menu small { color: var(--muted); font-size: .67rem; }
.stock-view-menu a > svg { width: 16px; color: var(--blue); }
.stock-option-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--blue); background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.stock-option-icon svg { width: 16px; }
.stock-page-actions { display: flex; align-items: center; gap: 3px; }
.stock-search { min-width: 0; height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); background: #f7f9fb; border: 1px solid var(--line); border-radius: 12px; }
.stock-search:focus-within { background: #fff; border-color: var(--blue-border); box-shadow: 0 0 0 4px var(--blue-focus); }
.stock-search svg { width: 17px; flex: 0 0 auto; }
.stock-search input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: .84rem; }
.stock-section-heading { margin-bottom: 13px; }
.stock-row-count { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.stock-row-count strong { color: var(--ink); }
.stock-table td { height: 61px; }
.stock-product-code { color: var(--blue); font-weight: 700; }
.stock-product-code:hover { text-decoration: underline; text-underline-offset: 3px; }
.location-count { display: block; margin-top: 2px; color: var(--muted); font-size: .66rem; }
.stock-remaining { min-width: 34px; min-height: 28px; display: inline-grid; place-items: center; padding: 2px 9px; color: #08724d; background: #e9f8f1; border-radius: 8px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stock-remaining.empty { color: #a33831; background: #fff0ef; }
.stock-actions { gap: 4px; }
.mini-action { min-height: 34px; display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: .7rem; font-weight: 650; cursor: pointer; }
.mini-action svg { width: 14px; height: 14px; }
.mini-action.sale { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 17%, transparent); }
.mini-action.return { color: #7558ca; background: #f4f0ff; border-color: #e7dcff; }
.mini-action:hover { filter: brightness(.97); }
.stock-dialog-product { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; padding: 11px 13px; background: #f7f9fb; border: 1px solid var(--line); border-radius: 12px; }
.stock-dialog-product small { grid-column: 1 / -1; color: var(--muted); font-size: .66rem; font-weight: 650; }
.stock-dialog-product strong { min-width: 0; overflow: hidden; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.stock-dialog-product > span { color: var(--blue); font-size: .75rem; font-weight: 700; }

.custom-picker { position: relative; min-width: 0; }
.custom-picker-trigger { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 8px 11px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 11px; text-align: left; font-size: .86rem; font-weight: 550; cursor: pointer; }
.custom-picker-trigger:hover { border-color: var(--line-strong); }
.custom-picker.open .custom-picker-trigger { border-color: var(--blue-border); box-shadow: 0 0 0 4px var(--blue-focus); }
.custom-picker-trigger > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-picker-trigger > svg { width: 16px; flex: 0 0 auto; color: var(--muted); }
.custom-picker-menu { position: absolute; z-index: 90; top: calc(100% + 6px); left: 0; width: 100%; min-width: 280px; max-height: 310px; padding: 6px; overflow: hidden; background: rgba(255,255,255,.99); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 19px 44px rgba(16,24,40,.18); }
.custom-picker-search { height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 9px; margin-bottom: 5px; color: var(--muted); background: #f7f9fb; border: 1px solid var(--line); border-radius: 9px; }
.custom-picker-search:focus-within { background: #fff; border-color: var(--blue-border); }
.custom-picker-search svg { width: 15px; flex: 0 0 auto; }
.custom-picker-search input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; background: transparent; font-size: .78rem; }
.custom-picker-list { max-height: 245px; overflow-y: auto; }
.custom-picker-option { width: 100%; min-height: 47px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 0; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; }
.custom-picker-option:hover, .custom-picker-option[aria-selected="true"] { background: var(--blue-soft); }
.custom-picker-option > span { min-width: 0; display: flex; flex-direction: column; }
.custom-picker-option strong { overflow: hidden; color: var(--ink); font-size: .79rem; text-overflow: ellipsis; white-space: nowrap; }
.custom-picker-option small { color: var(--muted); font-size: .66rem; }
.custom-picker-option > svg { width: 15px; color: var(--blue); opacity: 0; }
.custom-picker-option[aria-selected="true"] > svg { opacity: 1; }
.custom-picker-empty { margin: 11px; color: var(--muted); text-align: center; font-size: .75rem; }

.detail-stock-picker { position: relative; }
.detail-stock-picker summary { min-width: 210px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 11px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); cursor: pointer; list-style: none; }
.detail-stock-picker summary::-webkit-details-marker { display: none; }
.detail-stock-picker summary > span { display: flex; flex-direction: column; }
.detail-stock-picker summary small { color: var(--muted); font-size: .64rem; }
.detail-stock-picker summary strong { font-size: .82rem; }
.detail-stock-picker summary > svg { width: 16px; color: var(--muted); }
.detail-stock-picker > div { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: 230px; padding: 5px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-md); }
.detail-stock-picker > div a { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 9px; border-radius: 9px; font-size: .78rem; font-weight: 600; }
.detail-stock-picker > div a:hover, .detail-stock-picker > div a.active { background: var(--blue-soft); color: var(--blue); }
.detail-stock-picker > div svg { width: 15px; }
.stock-detail-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.stock-detail-summary article { min-height: 105px; display: flex; align-items: center; gap: 12px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.stock-detail-summary article.featured { color: #fff; background: #1b2430; border-color: #1b2430; }
.summary-tone { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; }
.summary-tone svg { width: 20px; }
.summary-tone.blue { color: var(--blue); background: var(--blue-soft); }
.summary-tone.amber { color: #b06b09; background: #fff6df; }
.summary-tone.green { color: #73d3ad; background: rgba(255,255,255,.1); }
.stock-detail-summary article > div { display: flex; flex-direction: column; }
.stock-detail-summary small { color: var(--muted); font-size: .68rem; font-weight: 650; }
.stock-detail-summary .featured small { color: rgba(255,255,255,.62); }
.stock-detail-summary strong { font-size: 1.55rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stock-locations-section { margin-bottom: 12px; }
.stock-location-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 8px; }
.stock-location-grid > article { padding: 12px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 14px; }
.stock-location-grid > article > div { display: flex; align-items: center; gap: 8px; }
.stock-location-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 10px; }
.stock-location-icon svg { width: 16px; }
.stock-location-grid strong { font-size: .82rem; }
.stock-location-grid dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin: 11px 0 0; }
.stock-location-grid dl div { display: flex; flex-direction: column; padding: 7px; background: #fff; border-radius: 8px; }
.stock-location-grid dt { color: var(--muted); font-size: .62rem; }
.stock-location-grid dd { margin: 0; font-size: .86rem; font-weight: 700; }
.movement-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 8px; font-size: .69rem; font-weight: 700; }
.movement-badge svg { width: 13px; }
.movement-badge.sale { color: var(--blue); background: var(--blue-soft); }
.movement-badge.return { color: #7558ca; background: #f4f0ff; }

/* Offer stock filter */
.product-codes > strong:first-child { color: #4b5563; }
.product-stock-badge { min-height: 24px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; color: #08724d; background: #e9f8f1; border-radius: 7px; font-size: .63rem; font-weight: 650; letter-spacing: 0; white-space: nowrap; }
.product-stock-badge[hidden] { display: none; }
.product-stock-badge.empty { color: #a33831; background: #fff0ef; }
.product-stock-badge svg { width: 12px; height: 12px; }
.product-stock-badge b { font-weight: 750; }
.stock-filter-dialog { width: min(calc(100% - 24px), 560px); }
.stock-filter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.stock-filter-option { min-width: 0; display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; gap: 9px; min-height: 58px; padding: 9px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; transition: border-color 150ms ease, background 150ms ease; }
.stock-filter-option:hover { background: #f3f6fa; border-color: var(--line-strong); }
.stock-filter-option:has(input:checked) { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.stock-filter-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.stock-filter-check { width: 30px; height: 30px; display: grid; place-items: center; color: transparent; background: #fff; border: 1px solid var(--line-strong); border-radius: 9px; transition: color 150ms ease, background 150ms ease, border-color 150ms ease; }
.stock-filter-check svg { width: 16px; stroke-width: 3; }
.stock-filter-option input:checked + .stock-filter-check { color: #fff; background: var(--blue); border-color: var(--blue); }
.stock-filter-option input:focus-visible + .stock-filter-check { outline: 3px solid var(--blue-focus); outline-offset: 2px; }
.stock-filter-option > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.stock-filter-option strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.stock-filter-option small { color: var(--muted); font-size: .65rem; }

@media (max-width: 860px) {
  .stock-toolbar { grid-template-columns: minmax(210px,1fr) auto; }
  .stock-search { grid-column: 1 / -1; }
  .stock-table .mini-action { width: 34px; padding: 0; justify-content: center; font-size: 0; }
}

@media (max-width: 720px) {
  .stock-page-heading { gap: 12px; }
  .stock-toolbar { z-index: 25; grid-template-columns: 1fr; padding: 9px; }
  .stock-page-actions { grid-row: 2; }
  .stock-page-actions .compact-button { flex: 1; }
  .stock-search { grid-column: 1; }
  .stock-section { padding: 12px; }
  .stock-table-wrap, .stock-history-section .table-wrap, .order-products-section .table-wrap { overflow: visible; border: 0; }
  .stock-table, .stock-table tbody, .stock-history-table, .stock-history-table tbody, .order-products-table, .order-products-table tbody { display: block; }
  .stock-table thead, .stock-history-table thead, .order-products-table thead { display: none; }
  .stock-table tbody, .stock-history-table tbody, .order-products-table tbody { display: grid; gap: 8px; }
  .stock-table tr, .stock-history-table tr, .order-products-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 13px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 15px; }
  .stock-table tr[hidden] { display: none; }
  .stock-table td, .stock-history-table td, .order-products-table td { height: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0; border: 0; white-space: normal; text-align: right; }
  .stock-table td::before, .stock-history-table td::before, .order-products-table td::before { content: attr(data-label); color: var(--muted); font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
  .stock-table td:nth-child(1), .stock-table td:nth-child(2), .stock-table .actions-cell,
  .stock-history-table td:nth-child(1), .stock-history-table td:nth-child(4), .stock-history-table td:nth-child(5),
  .order-products-table td:nth-child(1), .order-products-table td:nth-child(2) { grid-column: 1 / -1; }
  .stock-table .actions-cell { padding-top: 9px; border-top: 1px solid var(--line); }
  .stock-actions { width: auto; flex-wrap: wrap; }
  .stock-table .mini-action { width: auto; padding: 0 9px; font-size: .7rem; }
  .stock-detail-summary { grid-template-columns: 1fr; }
  .stock-detail-summary article { min-height: 85px; }
  .detail-stock-picker, .detail-stock-picker summary { width: 100%; }
  .detail-stock-picker > div { right: auto; left: 0; width: 100%; }
}

@media (max-width: 480px) {
  .stock-toolbar { margin-right: -3px; margin-left: -3px; }
  .stock-view-menu { width: calc(100vw - 42px); }
  .custom-picker-menu { min-width: 0; }
  .app-dialog form { padding: 17px; }
  .stock-section-heading { align-items: flex-start; }
  .stock-filter-grid { grid-template-columns: 1fr; }
  .toolbar-buttons { flex-wrap: wrap; }
  .toolbar-buttons #stock-filter-open { flex-basis: 100%; }
}

@media (min-width: 1600px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); }
  .app-main, .panel-content { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 1180px) {
  .hero-side { align-items: flex-end; flex-direction: column; }
  .offer-toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toolbar-search { grid-column: span 2; }
  .toolbar-buttons { grid-column: span 2; justify-content: flex-end; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 900px) {
  .mobile-only { display: inline-grid; }
  .user-chip { display: none; }
  .panel-shell { display: block; }
  .sidebar { position: fixed; top: 0; left: 0; z-index: 70; width: min(84vw, 290px); height: 100dvh; padding-top: 16px; background: rgba(245,247,250,.94); box-shadow: 18px 0 55px rgba(16,24,40,.16); transform: translateX(-105%); transition: transform 260ms cubic-bezier(.2,.75,.2,1); }
  body.sidebar-open { overflow: hidden; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(20,28,39,.25); opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
  body.sidebar-open .sidebar-scrim { display: block; opacity: 1; pointer-events: auto; }
  .panel-content { padding-top: 22px; }
  .form-layout, .settings-layout { grid-template-columns: 1fr; }
  .media-form-card { grid-row: 2; }
  .settings-layout .brand-preview-card { grid-row: 1; }
  .user-row { grid-template-columns: 42px minmax(130px, 1fr) 80px auto; }
  .user-date { display: none; }
}

@media (max-width: 720px) {
  :root { --app-bar-height: 58px; }
  .app-bar { padding: 0 12px; }
  .brand-mark { width: 32px; height: 32px; }
  .app-main, .panel-content { padding: 16px 12px 94px; }
  .offer-hero, .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .hero-side { width: 100%; align-items: stretch; }
  .page-heading .button, .hero-actions, .hero-actions .button { width: 100%; }
  .offer-hero h1, .page-heading h1 { font-size: 1.65rem; }
  .summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-card { min-width: 0; }
  .offer-toolbar { position: static; grid-template-columns: 1fr 1fr; padding: 10px; border-radius: 16px; }
  .toolbar-search { grid-column: 1 / -1; }
  .toolbar-buttons { grid-column: 1 / -1; }
  .toolbar-buttons .button { flex: 1; }
  .mobile-action-bar { position: fixed; z-index: 45; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 9px 9px 13px; color: #fff; background: rgba(27,36,48,.94); border: 1px solid rgba(255,255,255,.13); border-radius: 16px; box-shadow: 0 16px 35px rgba(16,24,40,.26); backdrop-filter: blur(16px) saturate(150%); }
  .mobile-action-bar > div { min-width: 0; display: flex; flex-direction: column; }
  .mobile-action-bar span { color: rgba(255,255,255,.62); font-size: .64rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
  .mobile-action-bar strong { overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .mobile-action-bar .button { min-height: 40px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .product-info { padding: 10px; }
  .product-info h2 { font-size: .84rem; }
  .product-price { font-size: .93rem; }
  .quantity-row { align-items: flex-start; flex-direction: column; }
  .stepper { width: 100%; height: 38px; justify-content: space-between; }
  .stepper button { width: 40px; height: 38px; }
  .stepper input { flex: 1; }
  .product-select, .product-select span { width: 36px; height: 36px; }
  .surface-card { padding: 14px; border-radius: 18px; }
  .form-grid.three { grid-template-columns: 1fr; }
  .offer-item-row { grid-template-columns: 1fr 1fr 36px; }
  .offer-item-product { grid-column: 1 / -1; }
  .offer-item-row > .field:nth-of-type(2) { grid-column: span 1; }
  .sticky-save-bar { bottom: 8px; align-items: stretch; flex-direction: column; }
  .sticky-save-bar > p { display: none; }
  .sticky-save-bar > div, .sticky-save-bar .button { flex: 1; }
  .user-row { grid-template-columns: 38px minmax(110px, 1fr) auto; }
  .user-row > .status { display: none; }
  .auth-card { padding: 25px 20px; border-radius: 23px; }
  .orders-heading { align-items: stretch; flex-direction: column; }
  .orders-search { width: 100%; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .order-detail-card { min-height: 84px; }
  .orders-table-wrap { overflow: visible; border: 0; border-radius: 0; }
  .orders-table, .orders-table tbody { display: block; }
  .orders-table thead { display: none; }
  .orders-table tbody { display: grid; gap: 8px; }
  .orders-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 13px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 15px; }
  .orders-table tr[hidden] { display: none; }
  .orders-table td { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0; border: 0; white-space: normal; }
  .orders-table td::before { content: attr(data-label); color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
  .orders-table td:nth-child(1), .orders-table td:nth-child(3), .orders-table .actions-cell { grid-column: 1 / -1; }
  .orders-table .actions-cell { padding-top: 8px; border-top: 1px solid var(--line); }
  .orders-table .order-actions { width: auto; }
}

@media (max-width: 520px) {
  .confirm-region { top: 12px; right: 12px; left: 12px; width: auto; }
  .confirm-card { padding: 14px; border-radius: 18px; }
  .confirm-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .confirm-actions .button { width: 100%; }
  .next-order-card { padding: 15px; border-radius: 18px; }
  .next-order-card strong { font-size: 1.45rem; }
  .summary-card { gap: 6px; padding: 8px; }
  .summary-icon { width: 26px; height: 26px; border-radius: 8px; }
  .summary-icon svg { width: 13px; height: 13px; }
  .summary-card span:not(.summary-icon) { font-size: .6rem; }
  .summary-card strong { font-size: .78rem; }
  .offer-toolbar { grid-template-columns: 1fr; }
  .offer-toolbar > *, .toolbar-search, .toolbar-buttons { grid-column: 1; }
  .compact-field { width: 100%; }
  .toolbar-buttons .button { padding: 0 10px; }
  .results-meta { font-size: .75rem; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-codes { flex-direction: column; align-items: flex-start; }
  .product-codes strong { max-width: 100%; }
  .form-grid.two { grid-template-columns: 1fr; }
  .span-two { grid-column: span 1; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 90px; align-items: flex-start; flex-direction: column; gap: 9px; }
  .stat-card strong { font-size: 1.2rem; }
  .section-heading { align-items: flex-start; }
  .section-heading > .button { min-height: 40px; padding: 0 10px; }
  .section-heading > .button svg { display: none; }
  .offer-item-row { grid-template-columns: 1fr 36px; }
  .offer-item-row .field { grid-column: 1; }
  .offer-item-row > .icon-button { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
}

/* Sevkiyat Formları */
.shipment-list-heading, .shipment-detail-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.shipment-list-section, .shipment-info-card, .shipment-items-section, .shipment-note-card { margin-bottom: 12px; }
.shipment-list-toolbar { gap: 20px; }
.shipment-search-form { display: flex; align-items: center; gap: 7px; }
.shipment-search-form .orders-search { width: min(360px,42vw); }
.shipment-customer { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.shipment-customer:hover strong { color: var(--blue); }
.shipment-customer small, .shipment-list-table .table-subline { margin-top: 3px; color: var(--muted); font-size: .65rem; }
.shipment-create-dialog { width: min(calc(100% - 24px),650px); }
.shipment-create-content, .shipment-large-dialog, .shipment-import-content { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.shipment-order-list, .shipment-choice-list { max-height: 315px; display: flex; flex-direction: column; gap: 6px; overflow: auto; padding: 2px; }
.shipment-order-list > button, .shipment-choice-list > button { width: 100%; min-height: 58px; display: flex; align-items: center; gap: 11px; padding: 10px 12px; text-align: left; color: var(--ink); background: #f8f9fb; border: 1px solid var(--line); border-radius: 13px; transition: 160ms ease; }
.shipment-order-list > button > span:first-child, .shipment-choice-list > button > span:first-child { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.shipment-order-list strong, .shipment-choice-list strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.shipment-order-list small, .shipment-choice-list small { margin-top: 3px; color: var(--muted); font-size: .65rem; }
.shipment-order-list > button > svg, .shipment-choice-list > button > svg { width: 17px; color: #a7afba; }
.shipment-order-list > button.selected, .shipment-choice-list > button.selected { color: var(--blue); background: var(--blue-soft); border-color: var(--blue-border); }
.shipment-order-list > button.selected > svg, .shipment-choice-list > button.selected > svg { color: var(--blue); }
.shipment-manual-link { display: inline-flex; align-items: center; align-self: flex-start; gap: 6px; padding: 3px 0; color: var(--blue); background: transparent; border: 0; font-size: .72rem; font-weight: 700; }
.shipment-manual-link svg { width: 15px; }
.shipment-create-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding-top: 13px; border-top: 1px solid var(--line); }

.shipment-detail-title { display: flex; align-items: center; gap: 13px; min-width: 0; }
.shipment-detail-title > span { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: var(--blue-soft); border-radius: 15px; }
.shipment-detail-title > span svg { width: 22px; }
.shipment-detail-title h1 { margin: 1px 0 2px; font-size: 1.45rem; letter-spacing: -.035em; }
.shipment-detail-title p:last-child { margin: 0; color: var(--muted); font-size: .76rem; }
.shipment-detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.shipment-detail-actions .button { padding-inline: 11px; }
.shipment-info-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.72fr) minmax(220px,.65fr); align-items: end; gap: 11px; }
.shipment-link-state { min-height: 50px; display: flex; align-items: center; gap: 10px; padding: 8px 11px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 12px; }
.shipment-link-state > span { width: 32px; height: 32px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 9px; }
.shipment-link-state svg { width: 15px; }
.shipment-link-state div { min-width: 0; display: flex; flex-direction: column; }
.shipment-link-state small { color: var(--muted); font-size: .57rem; font-weight: 700; }
.shipment-link-state strong { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.shipment-items-table th:first-child { width: 54px; }
.shipment-items-table th:nth-child(3) { width: 145px; }
.shipment-items-table th:nth-child(4) { width: 100px; }
.shipment-items-table th:nth-child(5) { width: 225px; }
.shipment-sort-cell > div { display: flex; flex-direction: column; }
.shipment-sort-cell button { width: 27px; height: 21px; display: grid; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 6px; }
.shipment-sort-cell button:hover:not(:disabled) { color: var(--blue); background: var(--blue-soft); }
.shipment-sort-cell button:disabled { opacity: .25; }
.shipment-sort-cell svg { width: 14px; }
.shipment-code { color: var(--blue); font-size: .78rem; }
.shipment-product-copy { display: flex; flex-direction: column; }
.shipment-product-copy > strong { font-size: .79rem; }
.shipment-source-meta { display: flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--muted); font-size: .61rem; }
.shipment-source-meta svg { width: 12px; }
.shipment-inline-input, .shipment-quantity-input { width: 100%; min-height: 39px; padding: 7px 9px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-weight: 650; outline: none; }
.shipment-inline-input:focus, .shipment-quantity-input:focus { border-color: var(--blue-border); box-shadow: 0 0 0 3px var(--blue-soft); }
.shipment-inline-input.code { color: var(--blue); }
.shipment-quantity-input { max-width: 80px; text-align: center; }
.shipment-package-control { display: inline-grid; grid-template-columns: repeat(2,1fr); overflow: hidden; padding: 3px; background: #eef0f3; border-radius: 11px; }
.shipment-package-control button { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 10px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; font-size: .65rem; font-weight: 750; }
.shipment-package-control button.active { color: #fff; background: var(--blue); box-shadow: 0 3px 8px var(--blue-shadow); }
.shipment-package-control svg { width: 14px; }
.shipment-note-card > p { margin: 0; color: #3f4a59; font-size: .8rem; line-height: 1.65; white-space: pre-wrap; }
.shipment-product-dialog, .shipment-order-dialog { width: min(calc(100% - 24px),730px); }
.shipment-large-dialog { min-height: 480px; }
.shipment-large-dialog .shipment-choice-list { flex: 1; max-height: 390px; }
.shipment-modal-quantity { width: 140px; }
.shipment-order-dialog .order-choices > button { min-height: 67px; }
.shipment-import-dialog { width: min(calc(100% - 24px),600px); }
.shipment-import-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.shipment-import-actions > button { min-height: 128px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; color: var(--ink); text-align: left; background: #f8f9fb; border: 1px solid var(--line); border-radius: 15px; }
.shipment-import-actions > button:hover { background: var(--blue-soft); border-color: var(--blue-border); }
.shipment-import-actions > button > span { width: 35px; height: 35px; display: grid; place-items: center; margin-bottom: 5px; color: var(--blue); background: #fff; border-radius: 10px; }
.shipment-import-actions svg { width: 17px; }
.shipment-import-actions strong { font-size: .77rem; }
.shipment-import-actions small { color: var(--muted); font-size: .65rem; line-height: 1.45; }
.shipment-update-customer { display: flex; align-items: center; gap: 10px; padding: 11px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 12px; }
.shipment-update-customer input { width: 18px; height: 18px; accent-color: var(--blue); }
.shipment-update-customer > span { display: flex; flex-direction: column; }
.shipment-update-customer strong { font-size: .72rem; }
.shipment-update-customer small { margin-top: 2px; color: var(--muted); font-size: .62rem; }
.shipment-mobile-actions { display: none; }

@media (max-width: 1200px) {
  .shipment-detail-heading { align-items: flex-start; flex-direction: column; }
  .shipment-detail-actions { width: 100%; justify-content: flex-start; }
  .shipment-info-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .shipment-link-state { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .shipment-list-heading, .shipment-list-toolbar { align-items: flex-start; flex-direction: column; }
  .shipment-list-heading .button, .shipment-search-form { width: 100%; }
  .shipment-search-form .orders-search { width: 100%; }
  .shipment-list-table thead, .shipment-items-table thead { display: none; }
  .shipment-list-table, .shipment-list-table tbody, .shipment-list-table tr, .shipment-items-table, .shipment-items-table tbody, .shipment-items-table tr { display: block; }
  .shipment-list-table tr, .shipment-items-table tr { margin-bottom: 9px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
  .shipment-list-table td, .shipment-items-table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); }
  .shipment-list-table td:last-child, .shipment-items-table td:last-child { border-bottom: 0; }
  .shipment-list-table td::before, .shipment-items-table td::before { content: attr(data-label); flex: 0 0 auto; color: var(--muted); font-size: .61rem; font-weight: 700; text-transform: uppercase; }
  .shipment-list-table .actions-cell, .shipment-items-table .actions-cell { justify-content: flex-end; }
  .shipment-list-table .actions-cell::before, .shipment-items-table .actions-cell::before { margin-right: auto; }
  .shipment-items-wrap { overflow: visible; }
  .shipment-product-copy { align-items: flex-end; text-align: right; }
  .shipment-inline-input { min-width: min(300px,60vw); }
}
@media (max-width: 720px) {
  body[data-page="panel-shipment-detail"] .panel-content { padding-bottom: 88px; }
  .shipment-detail-title > span { display: none; }
  .shipment-detail-title h1 { font-size: 1.3rem; }
  .shipment-detail-actions > [data-shipment-action="save"], .shipment-detail-actions > [data-shipment-action="download"] { display: none; }
  .shipment-info-grid, .shipment-create-fields { grid-template-columns: 1fr; }
  .shipment-link-state { grid-column: 1; }
  .shipment-product-dialog, .shipment-order-dialog { width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }
  .shipment-large-dialog { height: 100%; min-height: 0; padding: 16px 12px; }
  .shipment-large-dialog .shipment-choice-list { max-height: none; }
  .shipment-import-actions { grid-template-columns: 1fr; }
  .shipment-import-actions > button { min-height: 105px; }
  .shipment-mobile-actions { position: fixed; z-index: 48; right: 9px; bottom: max(9px,env(safe-area-inset-bottom)); left: 9px; display: grid; grid-template-columns: repeat(4,1fr); overflow: hidden; padding: 6px; background: rgba(27,36,48,.96); border: 1px solid rgba(255,255,255,.13); border-radius: 16px; box-shadow: 0 16px 38px rgba(16,24,40,.3); backdrop-filter: blur(16px); }
  .shipment-mobile-actions button { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 2px; color: rgba(255,255,255,.72); background: transparent; border: 0; border-radius: 11px; font-size: .59rem; font-weight: 650; }
  .shipment-mobile-actions button.primary { color: #fff; background: var(--blue); }
  .shipment-mobile-actions button:disabled { opacity: .4; }
  .shipment-mobile-actions svg { width: 17px; }
}
@media (max-width: 520px) {
  .shipment-search-form { display: grid; grid-template-columns: minmax(0,1fr) auto auto; }
  .shipment-detail-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .shipment-detail-actions .button { justify-content: center; }
  .shipment-package-control button { padding-inline: 7px; }
}

/* Dispatch notes */
.dispatch-settings-fields { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); scroll-margin-top: 88px; }
.stamp-settings-grid { display: grid; grid-template-columns: minmax(180px,.65fr) minmax(240px,1.35fr); gap: 12px; margin-bottom: 13px; }
.stamp-preview { min-height: 150px; display: grid; place-items: center; overflow: hidden; padding: 12px; background: #f8f9fb; border: 1px dashed var(--line-strong); border-radius: 15px; }
.stamp-preview img { width: 100%; height: 126px; object-fit: contain; }
.stamp-preview > span { display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--muted); text-align: center; }
.stamp-preview > span svg { width: 24px; color: var(--blue); }
.stamp-preview strong { color: var(--ink); font-size: .76rem; }
.stamp-preview small { font-size: .66rem; }
.stamp-upload-actions { display: flex; flex-direction: column; justify-content: center; gap: 9px; }
.stamp-upload-actions .danger-outline { align-self: flex-start; }
.button.danger-outline { color: var(--red); background: #fff; border-color: color-mix(in srgb,var(--red) 25%,var(--line)); }
.button.danger-outline:hover { background: #fff5f5; border-color: color-mix(in srgb,var(--red) 45%,var(--line)); }

.dispatch-list-section { padding: 0; overflow: hidden; }
.dispatch-list-heading { padding: 15px 17px; border-bottom: 1px solid var(--line); }
.dispatch-search-form { display: flex; align-items: center; gap: 7px; }
.dispatch-search-form .orders-search { width: min(34vw,340px); }
.dispatch-serial { display: flex; flex-direction: column; gap: 2px; }
.dispatch-serial strong { color: var(--blue); font-size: .82rem; }
.dispatch-serial small { color: var(--muted); font-size: .65rem; }
.dispatch-code-badge { min-height: 27px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; color: #35536f; background: #edf5fb; border-radius: 8px; font-size: .65rem; font-weight: 700; }
.dispatch-code-badge.factory { color: #6c4cb0; background: #f2edff; }
.dispatch-code-badge svg { width: 13px; }
.dispatch-row-actions { justify-content: flex-end; flex-wrap: nowrap; }

.dispatch-form-heading { position: relative; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.dispatch-form-title { min-width: 0; display: flex; align-items: center; gap: 13px; }
.dispatch-form-title > span { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: var(--blue-soft); border: 1px solid color-mix(in srgb,var(--blue) 14%,transparent); border-radius: 15px; }
.dispatch-form-title > span svg { width: 22px; }
.dispatch-form-title h1 { margin: 0; font-size: clamp(1.55rem,2.25vw,2rem); line-height: 1.1; letter-spacing: -.035em; }
.dispatch-form-title > div > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: .79rem; }
.dispatch-form-title .back-link { margin-bottom: 7px; }
.dispatch-form-actions, .dispatch-detail-actions { display: flex; align-items: center; gap: 7px; }
.dispatch-form-actions .button { min-height: 40px; padding: 0 12px; font-size: .78rem; }
.dispatch-general-card, .dispatch-items-section { margin-bottom: 12px; }
.dispatch-general-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.dispatch-source-summary { min-height: 67px; display: flex; flex-direction: column; justify-content: center; padding: 8px 11px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 12px; }
.dispatch-source-summary span { margin-bottom: 4px; color: #3c4655; font-size: .73rem; font-weight: 650; }
.dispatch-source-summary strong { color: var(--ink); font-size: .84rem; }
.dispatch-source-summary small { margin-top: 2px; color: var(--muted); font-size: .62rem; }

.dispatch-items-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.dispatch-items-heading h2 { margin: 0; font-size: 1rem; }
.dispatch-items-heading p { margin: 4px 0 0; color: var(--muted); font-size: .73rem; }
.dispatch-item-tools { display: flex; align-items: center; gap: 6px; }
.dispatch-item-tools .button { min-height: 38px; padding: 0 10px; font-size: .72rem; }
.dispatch-code-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; padding: 12px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 15px; }
.dispatch-code-row .eyebrow { margin-bottom: 4px; }
.dispatch-code-row p { margin: 0; color: var(--muted); font-size: .68rem; }
.dispatch-code-segment { min-width: 390px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; margin: 0; padding: 4px; background: #e9edf2; border: 0; border-radius: 13px; }
.dispatch-code-segment label { min-height: 42px; display: grid; grid-template-columns: 19px minmax(0,1fr) 16px; align-items: center; gap: 7px; padding: 6px 10px; color: var(--muted); border-radius: 10px; font-size: .72rem; font-weight: 700; cursor: pointer; transition: background 150ms ease,color 150ms ease,box-shadow 150ms ease; }
.dispatch-code-segment label.active { color: var(--ink); background: #fff; box-shadow: 0 3px 10px rgba(16,24,40,.09); }
.dispatch-code-segment input { position: absolute; opacity: 0; pointer-events: none; }
.dispatch-code-segment svg { width: 16px; }
.dispatch-code-segment label > svg:last-child { color: var(--blue); opacity: 0; }
.dispatch-code-segment label.active > svg:last-child { opacity: 1; }
.dispatch-factory-warning { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; padding: 10px 12px; color: #8b4b09; background: #fff6e8; border: 1px solid #f4d7a5; border-radius: 12px; }
.dispatch-factory-warning[hidden] { display: none; }
.dispatch-factory-warning > svg { width: 18px; flex: 0 0 auto; }
.dispatch-factory-warning > span { display: flex; flex-direction: column; }
.dispatch-factory-warning strong { font-size: .73rem; }
.dispatch-factory-warning small { font-size: .66rem; }
.dispatch-items-table-wrap { border: 1px solid var(--line); border-radius: 14px; }
.dispatch-items-table { table-layout: fixed; }
.dispatch-items-table th:nth-child(1) { width: 26%; }
.dispatch-items-table th:nth-child(2) { width: auto; }
.dispatch-items-table th:nth-child(3) { width: 120px; }
.dispatch-items-table th:last-child { width: 140px; }
.dispatch-items-table td { white-space: normal; vertical-align: middle; }
.dispatch-items-table input { width: 100%; min-height: 42px; padding: 8px 10px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; outline: 0; font-size: .78rem; font-weight: 650; }
.dispatch-items-table input:focus { border-color: var(--blue-border); box-shadow: 0 0 0 3px var(--blue-focus); }
.dispatch-code-cell { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dispatch-code-cell strong { color: var(--blue); }
.dispatch-code-cell strong.missing { color: #a85b0a; }
.dispatch-code-cell small { color: var(--muted); font-size: .62rem; }
.dispatch-quantity-input { max-width: 90px; text-align: center; font-variant-numeric: tabular-nums; }
.dispatch-item-actions { justify-content: flex-end; flex-wrap: nowrap; }
.dispatch-item-actions .icon-button { width: 34px; height: 34px; }
.dispatch-items-empty[hidden] { display: none; }
.dispatch-mobile-actions { display: none; }
.dispatch-bottom-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 2px 0 18px; }
.dispatch-bottom-actions > span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .68rem; }
.dispatch-bottom-actions > span svg { width: 15px; color: var(--blue); }
.dispatch-bottom-actions > div { display: flex; align-items: center; gap: 7px; }

.dispatch-product-dialog, .dispatch-order-dialog { width: min(calc(100% - 24px),820px); max-height: min(88dvh,780px); }
.dispatch-dialog-content { display: flex; flex-direction: column; gap: 13px; padding: 20px; }
.dispatch-dialog-content .dialog-search { width: 100%; }
.dispatch-picker-list, .dispatch-order-list { min-height: 120px; max-height: 57dvh; display: flex; flex-direction: column; gap: 6px; padding: 2px; overflow-y: auto; }
.dispatch-picker-row, .dispatch-order-list > button { width: 100%; min-height: 62px; display: grid; grid-template-columns: 40px minmax(0,1fr) 24px; align-items: center; gap: 10px; padding: 8px 11px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 13px; text-align: left; cursor: pointer; }
.dispatch-picker-row:hover, .dispatch-order-list > button:hover, .dispatch-order-list > button.active { background: var(--blue-soft); border-color: var(--blue-border); }
.dispatch-picker-row > span:nth-child(2), .dispatch-order-list > button > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.dispatch-picker-row strong, .dispatch-order-list strong { font-size: .76rem; line-height: 1.35; }
.dispatch-picker-row small, .dispatch-order-list small { margin-top: 2px; color: var(--muted); font-size: .65rem; line-height: 1.4; }
.dispatch-order-list em { margin-top: 2px; color: var(--muted); font-size: .61rem; font-style: normal; }
.dispatch-picker-row input { width: 20px; height: 20px; accent-color: var(--blue); }
.dispatch-picker-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 10px; }
.dispatch-picker-icon svg { width: 17px; }
.dispatch-order-list > button > svg { width: 17px; color: var(--blue); opacity: 0; }
.dispatch-order-list > button.active > svg { opacity: 1; }
.dispatch-picker-empty { padding: 18px; color: var(--muted); background: #f8f9fb; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; font-size: .74rem; }
.dispatch-picker-empty[hidden] { display: none; }
.dispatch-import-dialog { width: min(calc(100% - 24px),610px); }
.dispatch-import-content { padding: 20px; }
.dispatch-import-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 15px 0 11px; }
.dispatch-import-actions button { min-height: 145px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 14px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 15px; text-align: left; cursor: pointer; }
.dispatch-import-actions button:hover { background: var(--blue-soft); border-color: var(--blue-border); }
.dispatch-import-actions button > span { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 7px; color: var(--blue); background: var(--blue-soft); border-radius: 11px; }
.dispatch-import-actions svg { width: 18px; }
.dispatch-import-actions strong { font-size: .78rem; }
.dispatch-import-actions small { color: var(--muted); font-size: .66rem; line-height: 1.45; }

.dispatch-detail-heading { align-items: flex-end; }
.dispatch-detail-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; margin-bottom: 12px; }
.dispatch-detail-summary article { min-width: 0; min-height: 84px; display: flex; align-items: center; gap: 10px; padding: 13px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow-sm); }
.dispatch-detail-summary article > span { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: var(--blue-soft); border-radius: 11px; }
.dispatch-detail-summary article > span svg { width: 18px; }
.dispatch-detail-summary article > div { min-width: 0; display: flex; flex-direction: column; }
.dispatch-detail-summary small { color: var(--muted); font-size: .65rem; font-weight: 650; }
.dispatch-detail-summary strong { overflow: hidden; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.dispatch-detail-customer, .dispatch-detail-items { margin-bottom: 12px; }
.dispatch-detail-customer dl { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 0; }
.dispatch-detail-customer dl > div { padding: 10px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 11px; }
.dispatch-detail-customer dt { color: var(--muted); font-size: .63rem; font-weight: 700; text-transform: uppercase; }
.dispatch-detail-customer dd { margin: 4px 0 0; color: var(--ink); font-size: .76rem; font-weight: 650; overflow-wrap: anywhere; }
.dispatch-detail-code { color: var(--blue) !important; }

@media (max-width: 1180px) {
  .dispatch-form-heading { align-items: flex-start; flex-direction: column; }
  .dispatch-form-actions { width: 100%; }
  .dispatch-general-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dispatch-items-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 900px) {
  .dispatch-detail-summary, .dispatch-detail-customer dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dispatch-code-row { align-items: stretch; flex-direction: column; }
  .dispatch-code-segment { width: 100%; min-width: 0; }
  .stamp-settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body[data-page="panel-dispatch-form"] .panel-content { padding-bottom: 88px; }
  .dispatch-form-title > span { display: none; }
  .dispatch-form-title h1 { font-size: 1.38rem; }
  .dispatch-form-title > div > p:last-child { display: none; }
  .dispatch-form-actions [data-dispatch-action="save"], .dispatch-form-actions [data-dispatch-action="download"] { display: none; }
  .dispatch-bottom-actions { display: none; }
  .dispatch-general-grid { grid-template-columns: 1fr; }
  .dispatch-item-tools { width: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .dispatch-item-tools .button { min-width: 0; padding: 0 7px; }
  .dispatch-code-segment label { grid-template-columns: 17px minmax(0,1fr) 15px; padding: 6px 8px; font-size: .65rem; }
  .dispatch-product-dialog, .dispatch-order-dialog { width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }
  .dispatch-dialog-content { height: 100%; padding: 16px 12px; }
  .dispatch-picker-list, .dispatch-order-list { max-height: none; flex: 1; }
  .dispatch-mobile-actions { position: fixed; z-index: 48; right: 9px; bottom: max(9px,env(safe-area-inset-bottom)); left: 9px; display: grid; grid-template-columns: repeat(4,1fr); overflow: hidden; padding: 6px; background: rgba(27,36,48,.96); border: 1px solid rgba(255,255,255,.13); border-radius: 16px; box-shadow: 0 16px 38px rgba(16,24,40,.3); backdrop-filter: blur(16px); }
  .dispatch-mobile-actions button { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 2px; color: rgba(255,255,255,.72); background: transparent; border: 0; border-radius: 11px; font-size: .59rem; font-weight: 650; }
  .dispatch-mobile-actions button.primary { color: #fff; background: var(--blue); }
  .dispatch-mobile-actions button:disabled { opacity: .4; }
  .dispatch-mobile-actions svg { width: 17px; }
  .dispatch-detail-heading { align-items: flex-start; }
  .dispatch-detail-actions { width: 100%; }
  .dispatch-detail-actions .button { flex: 1; }
  .dispatch-search-form { width: 100%; }
  .dispatch-search-form .orders-search { width: 100%; }
  .dispatch-list-heading { align-items: stretch; flex-direction: column; }
}

@media (max-width: 620px) {
  .dispatch-table-wrap, .dispatch-items-table-wrap { overflow: visible; border: 0; }
  .dispatch-table, .dispatch-items-table { display: block; table-layout: auto; }
  .dispatch-table thead, .dispatch-items-table thead { display: none; }
  .dispatch-table tbody, .dispatch-items-table tbody { display: flex; flex-direction: column; gap: 8px; }
  .dispatch-table tr, .dispatch-items-table tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-sm); }
  .dispatch-table td, .dispatch-items-table td { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; white-space: normal; }
  .dispatch-table td::before, .dispatch-items-table td::before { content: attr(data-label); color: var(--muted); font-size: .58rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
  .dispatch-table .actions-cell, .dispatch-items-table .actions-cell { grid-column: 1 / -1; padding-top: 9px; border-top: 1px solid var(--line); }
  .dispatch-row-actions, .dispatch-item-actions { justify-content: flex-start; }
  .dispatch-items-table td:nth-child(2) { grid-column: 1 / -1; }
  .dispatch-quantity-input { max-width: 100%; }
}

@media (max-width: 520px) {
  .dispatch-detail-summary, .dispatch-detail-customer dl { grid-template-columns: 1fr; }
  .dispatch-import-actions { grid-template-columns: 1fr; }
  .dispatch-import-actions button { min-height: 115px; }
  .dispatch-code-segment { grid-template-columns: 1fr; }
  .dispatch-item-tools { grid-template-columns: 1fr; }
  .dispatch-item-tools .button { width: 100%; }
  .dispatch-picker-row, .dispatch-order-list > button { grid-template-columns: 36px minmax(0,1fr) 22px; padding: 8px; }
  .dispatch-picker-icon { width: 34px; height: 34px; }
}

@media (max-width: 350px) {
  .product-grid, .summary-grid, .stat-grid { grid-template-columns: 1fr; }
  .summary-card.featured { grid-column: auto; }
}

@media (hover: none) {
  .product-card:hover { transform: none; box-shadow: 0 1px 3px rgba(16,24,40,.03); }
  .product-card:hover .product-media img { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .app-bar, .offer-toolbar, .sidebar, .mobile-action-bar, .sticky-save-bar, .auth-card, .toast, .confirm-card { background-color: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .mobile-action-bar, .toast { background-color: #1b2430; }
}

@media (prefers-contrast: more) {
  :root { --line: rgba(24,32,43,.28); --line-strong: rgba(24,32,43,.48); }
  .surface-card, .product-card, .offer-toolbar { border-color: var(--line); }
}

/* Order form module */
.order-create-dialog { width: min(calc(100% - 24px), 690px); }
.order-create-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.table-subline { display: block; max-width: 220px; overflow: hidden; color: var(--muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.count-badge { min-height: 27px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; color: #526071; background: #f0f3f7; border-radius: 8px; font-size: .68rem; font-weight: 700; white-space: nowrap; }
.payment-status { min-height: 26px; display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 8px; font-size: .68rem; font-weight: 700; }
.payment-status.paid { color: #08724d; background: #e9f8f1; }
.payment-status.waiting { color: #9a630c; background: #fff5dd; }
.dark-button { color: #fff; background: #1b2430; box-shadow: 0 4px 12px rgba(24,32,43,.17); }
.dark-button:hover:not(:disabled) { background: #273343; }

.order-form-heading { position: relative; z-index: 28; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.order-form-title { min-width: 0; display: flex; align-items: center; gap: 14px; }
.order-form-title > span { width: 50px; height: 50px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: var(--blue-soft); border: 1px solid color-mix(in srgb, var(--blue) 15%, transparent); border-radius: 15px; }
.order-form-title > span svg { width: 24px; }
.order-form-title > div { min-width: 0; }
.order-form-title .back-link { margin-bottom: 6px; }
.order-form-title h1 { max-width: 680px; margin: 0; overflow: hidden; font-size: clamp(1.35rem,2.1vw,2rem); line-height: 1.15; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.order-form-title > div > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: .82rem; }
.order-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.order-form-actions .button { min-height: 40px; padding: 0 11px; font-size: .78rem; }
.order-form-actions .button svg { width: 16px; }
.order-stock-filter { position: relative; }
.order-stock-filter > .button > svg:last-child { width: 14px; color: var(--muted); }
.order-stock-menu { position: absolute; z-index: 80; top: calc(100% + 7px); right: 0; width: min(300px,calc(100vw - 35px)); max-height: 320px; overflow-y: auto; padding: 6px; background: rgba(255,255,255,.99); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(16,24,40,.18); }
.order-stock-menu button { width: 100%; min-height: 50px; display: grid; grid-template-columns: 30px minmax(0,1fr) 16px; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; }
.order-stock-menu button:hover, .order-stock-menu button.active { background: var(--blue-soft); }
.order-stock-menu button > svg:first-child { width: 17px; color: var(--blue); }
.order-stock-menu button > svg:last-child { width: 15px; color: var(--blue); opacity: 0; }
.order-stock-menu button.active > svg:last-child { opacity: 1; }
.order-stock-menu button > span { min-width: 0; display: flex; flex-direction: column; }
.order-stock-menu strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.order-stock-menu small { color: var(--muted); font-size: .63rem; }
.order-customer-card { margin-bottom: 12px; }
.order-info-grid { display: grid; grid-template-columns: 1.3fr .8fr .7fr .78fr .78fr; gap: 10px; }
.order-address-field { grid-column: 1 / -1; }

.order-items-section { margin-bottom: 12px; }
.order-items-table { table-layout: fixed; min-width: 1030px; }
.order-items-table th:nth-child(1) { width: 42px; }
.order-items-table th:nth-child(2) { width: 88px; }
.order-items-table th:nth-child(3) { width: 110px; }
.order-items-table th:nth-child(4) { width: auto; }
.order-items-table th:nth-child(5) { width: 90px; }
.order-items-table th:nth-child(6) { width: 155px; }
.order-items-table th:nth-child(7) { width: 145px; }
.order-items-table th:nth-child(8) { width: 55px; }
.order-items-table td { height: 78px; white-space: normal; }
.order-items-table td:nth-child(2) img { width: 68px; height: 56px; object-fit: contain; background: #fff; border-radius: 9px; }
.order-item-image-placeholder { width: 68px; height: 56px; display: grid; place-items: center; color: #a0a7b2; background: #f2f4f7; border-radius: 9px; }
.order-item-image-placeholder svg { width: 20px; }
.drag-handle { width: 30px; height: 38px; display: grid; place-items: center; padding: 0; color: #9aa3af; background: transparent; border: 0; border-radius: 8px; cursor: grab; }
.drag-handle:active { cursor: grabbing; }
.drag-handle svg { width: 18px; }
.order-items-table tr.dragging { opacity: .55; }
.order-items-table tr.drag-over { box-shadow: inset 0 3px 0 var(--blue); }
.mobile-sort-actions { display: none; }
.order-item-stock { display: block; width: fit-content; margin-top: 4px; padding: 2px 6px; color: #08724d; background: #e9f8f1; border-radius: 6px; font-size: .64rem; font-weight: 700; }
.order-item-stock.empty { color: #a33831; background: #fff0ef; }
.order-inline-input { min-height: 38px; padding: 7px 8px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; outline: none; font-size: .78rem; font-weight: 650; }
.order-inline-input:focus { border-color: var(--blue-border); box-shadow: 0 0 0 3px var(--blue-focus); }
.order-inline-input.quantity { width: 65px; text-align: center; }
.order-price-input { min-height: 38px; display: flex; align-items: center; padding-left: 8px; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.order-price-input:focus-within { border-color: var(--blue-border); box-shadow: 0 0 0 3px var(--blue-focus); }
.order-price-input b { color: var(--muted); font-size: .78rem; }
.order-price-input .order-inline-input { min-width: 0; width: 100%; border: 0; box-shadow: none; }
.order-row-total strong { font-size: .84rem; }
.order-items-empty > div { display: flex; gap: 7px; }

.order-lower-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(350px,430px); align-items: start; gap: 12px; }
.order-notes-column { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.order-notes-card .section-heading { margin-bottom: 11px; }
.order-notes-card .section-heading > svg { width: 20px; color: var(--blue); }
.order-notes-card.internal .section-heading > svg { color: #7558ca; }
.order-notes-card textarea { width: 100%; min-height: 145px; padding: 12px; resize: vertical; color: var(--ink); background: #f8f9fb; border: 1px solid var(--line); border-radius: 12px; outline: none; font: inherit; font-size: .82rem; }
.order-notes-card textarea:focus { background: #fff; border-color: var(--blue-border); box-shadow: 0 0 0 4px var(--blue-focus); }
.order-stock-movements { grid-column: 1 / -1; padding: 0; overflow: hidden; }
.order-stock-movements summary { min-height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; cursor: pointer; list-style: none; }
.order-stock-movements summary::-webkit-details-marker { display: none; }
.order-stock-movements summary > span { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 0 9px; }
.order-stock-movements summary > span > svg { grid-row: 1 / span 2; width: 18px; color: var(--blue); }
.order-stock-movements summary strong { font-size: .8rem; }
.order-stock-movements summary small { color: var(--muted); font-size: .67rem; }
.order-stock-movements summary > svg { width: 17px; color: var(--muted); }
.order-stock-movements > div { padding: 0 14px 12px; }
.order-stock-movements article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.order-stock-movements article > span { min-width: 0; display: flex; flex-direction: column; }
.order-stock-movements article strong { font-size: .75rem; }
.order-stock-movements article small { overflow: hidden; color: var(--muted); font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.order-stock-movements article b { color: var(--blue); font-size: .75rem; white-space: nowrap; }

.order-totals-column { display: flex; flex-direction: column; gap: 10px; }
.order-adjustments-card { padding: 14px; }
.order-adjustments-card .section-heading { margin-bottom: 10px; }
.adjustment-labels { display: grid; grid-template-columns: minmax(0,1fr) 38px 38px 36px; gap: 6px; padding: 0 4px 5px; color: var(--muted); font-size: .57rem; font-weight: 700; letter-spacing: .04em; text-align: center; text-transform: uppercase; }
.adjustment-labels span:first-child { text-align: left; }
.adjustment-list { display: flex; flex-direction: column; gap: 7px; }
.adjustment-row { display: grid; grid-template-columns: minmax(0,1fr) 38px 38px 36px; align-items: center; gap: 6px; }
.adjustment-values { min-width: 0; display: grid; grid-template-columns: minmax(0,1.2fr) minmax(90px,.8fr); overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.adjustment-values > input { min-width: 0; width: 100%; height: 38px; padding: 0 8px; border: 0; outline: 0; background: #fff; font-size: .72rem; }
.adjustment-amount { min-width: 0; display: flex; align-items: center; border-left: 1px solid var(--line); }
.adjustment-amount b { padding-left: 7px; color: var(--muted); font-size: .7rem; }
.adjustment-amount input { min-width: 0; width: 100%; height: 38px; padding: 0 6px; border: 0; outline: 0; background: #fff; font-size: .7rem; }
.mini-toggle { position: relative; width: 34px; height: 25px; display: block; cursor: pointer; }
.mini-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mini-toggle span { width: 34px; height: 25px; display: grid; place-items: center; color: transparent; background: #e7eaf0; border-radius: 10px; transition: color 140ms ease, background 140ms ease; }
.mini-toggle svg { width: 14px; stroke-width: 3; }
.mini-toggle input:checked + span { color: #fff; background: var(--blue); }
.mini-toggle input:focus-visible + span { outline: 3px solid var(--blue-focus); outline-offset: 2px; }
.adjustment-row > .icon-button { width: 34px; height: 34px; }
.adjustment-empty { padding: 11px; color: var(--muted); background: #f8f9fb; border-radius: 9px; text-align: center; font-size: .68rem; }
.order-totals-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow-sm); }
.order-total-line, .order-payment-line { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.order-total-line span { color: var(--muted); font-size: .77rem; font-weight: 600; }
.order-total-line strong, .order-payment-line strong { font-size: .94rem; font-variant-numeric: tabular-nums; }
.order-total-line.grand { min-height: 65px; color: #fff; background: #1b2430; border: 0; }
.order-total-line.grand span { color: rgba(255,255,255,.7); font-size: .84rem; }
.order-total-line.grand strong { font-size: 1.16rem; }
.order-payment-line { margin: 9px; border: 0; border-radius: 12px; }
.order-payment-line > span:first-child { display: flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; }
.order-payment-line > span:first-child svg { width: 16px; }
.order-payment-line.paid { color: #08724d; background: #e9f8f1; }
.money-input { width: 145px; display: flex; align-items: center; overflow: hidden; background: rgba(255,255,255,.78); border: 1px solid rgba(8,114,77,.14); border-radius: 9px; }
.money-input b { padding-left: 9px; }
.money-input input { min-width: 0; width: 100%; height: 38px; padding: 0 8px; border: 0; outline: 0; color: #08724d; background: transparent; text-align: right; font-weight: 750; }
.order-payment-line.remaining { color: #a33831; background: #fff0ef; }
.order-payment-line.remaining.overpaid { color: #fff; background: var(--red); }

.order-product-dialog, .order-offer-dialog { width: min(calc(100% - 24px), 1120px); max-height: min(88dvh,850px); }
.order-large-dialog { display: flex; flex-direction: column; gap: 13px; padding: 20px; }
.dialog-search { width: 100%; }
.order-catalog-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; max-height: 65dvh; padding: 2px; overflow-y: auto; }
.order-catalog-card { min-width: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 15px; text-align: left; cursor: pointer; transition: transform 140ms ease, border-color 140ms ease, box-shadow 160ms ease; }
.order-catalog-card:hover { border-color: var(--blue-border); box-shadow: 0 9px 22px var(--blue-shadow); transform: translateY(-2px); }
.order-catalog-image { aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; background: #fff; border-bottom: 1px solid var(--line); }
.order-catalog-image img { width: 100%; height: 100%; object-fit: contain; }
.order-catalog-image > span { color: #9aa3af; }
.order-catalog-copy { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 10px; }
.order-catalog-copy > strong { width: 100%; min-height: 2.5em; display: -webkit-box; overflow: hidden; font-size: .78rem; line-height: 1.25; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.order-catalog-copy > small { margin-top: 3px; color: var(--blue); font-size: .65rem; font-weight: 700; }
.catalog-stock { min-height: 21px; display: inline-flex; align-items: center; gap: 3px; margin-top: 7px; padding: 2px 6px; color: #08724d; background: #e9f8f1; border-radius: 6px; font-size: .61rem; font-style: normal; font-weight: 650; }
.catalog-stock[hidden] { display: none; }
.catalog-stock.empty { color: #a33831; background: #fff0ef; }
.catalog-stock svg { width: 11px; }
.order-catalog-copy em { margin-top: 7px; color: var(--ink); font-size: .83rem; font-style: normal; font-weight: 750; }
.order-offer-list { display: flex; flex-direction: column; gap: 7px; max-height: 64dvh; padding: 2px; overflow-y: auto; }
.order-offer-row { width: 100%; display: grid; grid-template-columns: 42px minmax(0,1fr) auto 20px; align-items: center; gap: 11px; min-height: 72px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-align: left; cursor: pointer; }
.order-offer-row:hover { background: #fafcff; border-color: var(--blue-border); }
.order-offer-row.loading { opacity: .55; }
.offer-row-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 11px; }
.offer-row-icon svg { width: 19px; }
.offer-row-copy { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; column-gap: 12px; }
.offer-row-copy strong, .offer-row-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offer-row-copy strong { font-size: .8rem; }
.offer-row-copy small { grid-column: 1; color: var(--muted); font-size: .68rem; }
.offer-row-copy time { grid-column: 2; grid-row: 1 / span 2; color: var(--muted); font-size: .69rem; }
.order-offer-row > svg { width: 17px; color: var(--muted); }
.import-mode-dialog { width: min(calc(100% - 24px), 560px); }
.import-mode-content { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.import-mode-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.import-mode-actions > button { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 1px 9px; padding: 12px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 13px; text-align: left; cursor: pointer; }
.import-mode-actions > button:hover { background: var(--blue-soft); border-color: var(--blue-border); }
.import-mode-actions > button > span { grid-row: 1 / span 2; width: 36px; height: 36px; display: grid; place-items: center; color: var(--blue); background: #fff; border-radius: 10px; }
.import-mode-actions svg { width: 17px; }
.import-mode-actions strong { font-size: .76rem; }
.import-mode-actions small { color: var(--muted); font-size: .64rem; line-height: 1.35; }
.order-mobile-actions { display: none; }
.button.has-changes::after { content: ""; width: 6px; height: 6px; margin-left: -3px; background: #ffca57; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.45); }

@media (max-width: 1250px) {
  .order-form-heading { align-items: flex-start; flex-direction: column; }
  .order-form-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .order-info-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .order-lower-grid { grid-template-columns: minmax(0,1fr) minmax(330px,390px); }
  .order-notes-column { grid-template-columns: 1fr; }
  .order-stock-movements { grid-column: 1; }
  .order-catalog-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .order-lower-grid { grid-template-columns: 1fr; }
  .order-totals-column { display: grid; grid-template-columns: 1fr 1fr; }
  .order-catalog-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 720px) {
  body[data-page="panel-order-form"] .panel-content { padding-bottom: 92px; }
  .order-form-title > span { display: none; }
  .order-form-title h1 { max-width: calc(100vw - 24px); font-size: 1.35rem; }
  .order-form-title > div > p:last-child { display: none; }
  .order-form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .order-form-actions .button { width: 100%; }
  .order-form-actions > [data-order-action="save"], .order-form-actions > [data-order-action="download"] { display: none; }
  .order-stock-filter { grid-column: 1 / -1; }
  .order-stock-filter > .button { width: 100%; }
  .order-stock-menu { right: auto; left: 0; width: 100%; }
  .order-info-grid { grid-template-columns: 1fr 1fr; }
  .order-info-grid .field:first-child, .order-address-field { grid-column: 1 / -1; }
  .order-items-table-wrap { overflow: visible; border: 0; }
  .order-items-table { min-width: 0; display: block; }
  .order-items-table thead { display: none; }
  .order-items-table tbody { display: grid; gap: 9px; }
  .order-items-table tr { display: grid; grid-template-columns: 78px minmax(0,1fr) auto; gap: 9px 11px; padding: 11px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 15px; }
  .order-items-table td { height: auto; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0; border: 0; white-space: normal; }
  .order-items-table td::before { content: attr(data-label); color: var(--muted); font-size: .6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
  .order-items-table td:nth-child(1) { grid-column: 3; grid-row: 1; }
  .order-items-table td:nth-child(1)::before, .order-items-table td:nth-child(2)::before { display: none; }
  .order-items-table td:nth-child(2) { grid-column: 1; grid-row: 1 / span 2; }
  .order-items-table td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .order-items-table td:nth-child(4) { grid-column: 2 / -1; grid-row: 2; display: block; }
  .order-items-table td:nth-child(4)::before { display: none; }
  .order-items-table td:nth-child(5), .order-items-table td:nth-child(6), .order-items-table td:nth-child(7) { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--line); }
  .order-items-table td:nth-child(8) { grid-column: 1 / -1; justify-content: flex-end; }
  .order-items-table td:nth-child(2) img, .order-item-image-placeholder { width: 74px; height: 70px; }
  .drag-handle { display: none; }
  .mobile-sort-actions { display: flex; gap: 3px; }
  .mobile-sort-actions button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .mobile-sort-actions svg { width: 13px; }
  .order-inline-input.quantity { width: 90px; }
  .order-price-input { width: 155px; }
  .order-row-total strong { font-size: .9rem; }
  .order-totals-column { display: flex; }
  .order-product-dialog, .order-offer-dialog { width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }
  .order-large-dialog { height: 100%; padding: 16px 12px; }
  .order-catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); max-height: none; flex: 1; }
  .order-offer-list { max-height: none; flex: 1; }
  .offer-row-copy { display: flex; flex-direction: column; align-items: flex-start; }
  .offer-row-copy time { margin-top: 3px; }
  .order-mobile-actions { position: fixed; z-index: 48; right: 9px; bottom: max(9px,env(safe-area-inset-bottom)); left: 9px; display: grid; grid-template-columns: repeat(4,1fr); overflow: hidden; padding: 6px; background: rgba(27,36,48,.96); border: 1px solid rgba(255,255,255,.13); border-radius: 16px; box-shadow: 0 16px 38px rgba(16,24,40,.3); backdrop-filter: blur(16px); }
  .order-mobile-actions button { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 2px; color: rgba(255,255,255,.72); background: transparent; border: 0; border-radius: 11px; font-size: .59rem; font-weight: 650; }
  .order-mobile-actions button.primary { color: #fff; background: var(--blue); }
  .order-mobile-actions svg { width: 17px; }
}

@media (max-width: 520px) {
  .order-create-grid, .order-info-grid { grid-template-columns: 1fr; }
  .order-create-grid .span-two, .order-info-grid .field:first-child, .order-address-field { grid-column: 1; }
  .order-form-actions { grid-template-columns: 1fr; }
  .order-stock-filter { grid-column: 1; }
  .order-catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .order-catalog-copy { padding: 8px; }
  .order-offer-row { grid-template-columns: 38px minmax(0,1fr) 16px; }
  .order-offer-row > .count-badge { grid-column: 2; width: fit-content; }
  .order-offer-row > svg { grid-column: 3; grid-row: 1 / span 2; }
  .import-mode-actions { grid-template-columns: 1fr; }
  .adjustment-values { grid-template-columns: 1fr; }
  .adjustment-amount { border-top: 1px solid var(--line); border-left: 0; }
  .adjustment-labels { display: none; }
  .adjustment-row { grid-template-columns: minmax(0,1fr) 34px 34px 34px; align-items: end; }
}

@media (max-width: 360px) {
  .order-catalog-grid { grid-template-columns: 1fr; }
}

/* Sales contracts */
.contracts-heading { align-items: flex-end; }
.contracts-table { min-width: 1080px; }
.contracts-table th:first-child { min-width: 210px; }
.contract-buyer { display: flex; flex-direction: column; gap: 2px; }
.contract-buyer strong { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contract-buyer small { color: var(--blue); font-size: .65rem; font-weight: 700; letter-spacing: .025em; }
.contract-order-ref { display: inline-flex; align-items: center; gap: 6px; color: #4e5868; font-weight: 650; }
.contract-order-ref svg { width: 15px; color: var(--blue); }
.muted-dash { color: var(--muted-2); }
.contract-actions { justify-content: flex-end; flex-wrap: nowrap; }

.contract-form-heading { position: relative; z-index: 28; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.contract-form-title { min-width: 0; display: flex; align-items: center; gap: 13px; }
.contract-form-title > span { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: var(--blue-soft); border: 1px solid color-mix(in srgb,var(--blue) 14%,transparent); border-radius: 15px; }
.contract-form-title > span svg { width: 22px; }
.contract-form-title h1 { margin: 0; font-size: clamp(1.55rem,2.25vw,2rem); line-height: 1.1; letter-spacing: -.035em; }
.contract-form-title > div > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: .79rem; }
.contract-form-title .back-link { margin-bottom: 7px; }
.contract-form-actions, .contract-detail-actions { display: flex; align-items: center; gap: 7px; }
.contract-form-actions .button { min-height: 40px; padding: 0 11px; font-size: .78rem; }
.contract-form-actions .button svg { width: 16px; }

.contract-top-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 12px; }
.contract-party-section, .contract-payment-section, .contract-clauses-section, .contract-signatures-section, .contract-template-editor { margin-bottom: 12px; }
.contract-party-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.contract-party-grid .span-two { grid-column: span 2; }
.contract-source-meta { display: grid; grid-template-columns: minmax(0,.75fr) minmax(190px,1.25fr); align-items: end; gap: 10px; }
.contract-source-meta > div:first-child { min-width: 0; min-height: 67px; display: flex; flex-direction: column; justify-content: center; padding: 8px 11px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 12px; }
.contract-source-meta > div:first-child span, .contract-field-label { display: block; margin-bottom: 6px; padding-left: 2px; color: #3c4655; font-size: .78rem; font-weight: 600; }
.contract-source-meta > div:first-child strong { overflow: hidden; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.contract-source-meta > div:first-child small { color: var(--muted); font-size: .68rem; }
.contract-custom-select { position: relative; min-width: 0; }
.contract-custom-select > [data-select-toggle] { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 11px; text-align: left; font-size: .84rem; font-weight: 650; cursor: pointer; }
.contract-custom-select > [data-select-toggle]:focus-visible, .contract-custom-select > [data-select-toggle][aria-expanded="true"] { border-color: var(--blue-border); box-shadow: 0 0 0 4px var(--blue-focus); outline: 0; }
.contract-custom-select > [data-select-toggle] > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contract-custom-select > [data-select-toggle] svg { width: 15px; color: var(--muted); }
.contract-select-menu { position: absolute; z-index: 45; right: 0; left: 0; top: calc(100% + 6px); max-height: 280px; overflow-y: auto; padding: 6px; background: rgba(255,255,255,.98); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md); backdrop-filter: blur(18px); }
.contract-select-menu[hidden] { display: none; }
.contract-select-menu button { width: 100%; min-height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; color: #4e5868; background: transparent; border: 0; border-radius: 9px; text-align: left; cursor: pointer; }
.contract-select-menu button:hover, .contract-select-menu button.active { color: var(--ink); background: var(--blue-soft); }
.contract-select-menu button > span { min-width: 0; display: flex; flex-direction: column; }
.contract-select-menu button strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.contract-select-menu button small { color: var(--muted); font-size: .64rem; }
.contract-select-menu button > svg { width: 15px; color: var(--blue); opacity: 0; }
.contract-select-menu button.active > svg { opacity: 1; }

.contract-seller-snapshot { margin-top: 14px; overflow: hidden; background: #f8f9fb; border: 1px solid var(--line); border-radius: 14px; }
.contract-seller-snapshot summary { min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; cursor: pointer; list-style: none; }
.contract-seller-snapshot summary::-webkit-details-marker, .contract-clause-card summary::-webkit-details-marker { display: none; }
.contract-seller-snapshot summary > span { display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; column-gap: 9px; }
.contract-seller-snapshot summary > span > svg { grid-row: 1 / span 2; width: 17px; color: var(--blue); }
.contract-seller-snapshot summary strong { font-size: .78rem; }
.contract-seller-snapshot summary small { color: var(--muted); font-size: .66rem; }
.contract-seller-snapshot summary > svg { width: 16px; color: var(--muted); transition: transform 160ms ease; }
.contract-seller-snapshot[open] summary > svg { transform: rotate(180deg); }
.contract-seller-snapshot dl { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 0; padding: 0 12px 12px; }
.contract-seller-snapshot dl > div { padding: 9px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.contract-seller-snapshot dl .wide { grid-column: 1 / -1; }
.contract-seller-snapshot dt { color: var(--muted); font-size: .62rem; font-weight: 700; text-transform: uppercase; }
.contract-seller-snapshot dd { margin: 3px 0 0; color: var(--ink); font-size: .74rem; font-weight: 600; }

.contract-payment-head { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(240px,1.3fr); gap: 10px; align-items: end; }
.contract-money-input { min-height: 44px; display: flex; align-items: center; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.contract-money-input:focus-within { border-color: var(--blue-border); box-shadow: 0 0 0 4px var(--blue-focus); }
.contract-money-input b { padding-left: 12px; color: var(--blue); font-size: .9rem; }
.field .contract-money-input input, .contract-money-input input { min-width: 0; width: 100%; min-height: 42px; padding: 8px 10px; color: var(--ink); background: transparent; border: 0; border-radius: 0; box-shadow: none; outline: 0; font-size: .9rem; font-weight: 700; }
.contract-money-input.compact { min-height: 42px; }
.contract-money-input.compact b { padding-left: 9px; }
.contract-subheading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 10px; padding-top: 15px; border-top: 1px solid var(--line); }
.contract-subheading h3 { margin: 0; font-size: .9rem; letter-spacing: -.015em; }
.contract-subheading p { margin: 3px 0 0; color: var(--muted); font-size: .7rem; }
.contract-payment-list { display: flex; flex-direction: column; gap: 7px; }
.contract-payment-row { display: grid; grid-template-columns: 38px minmax(220px,1.5fr) minmax(145px,.7fr) minmax(155px,.7fr) 40px; align-items: end; gap: 8px; padding: 9px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 13px; }
.contract-payment-index { height: 42px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 10px; font-size: .69rem; font-weight: 750; }
.contract-payment-row > .icon-button { margin-bottom: 1px; }
.contract-inline-empty { padding: 18px; color: var(--muted); background: #f8f9fb; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; font-size: .76rem; }
.contract-inline-empty[hidden] { display: none; }

.contract-intro-field { margin-bottom: 10px; }
.contract-intro-field textarea { min-height: 118px; background: #fafbfc; }
.placeholder-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; padding: 9px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 12px; }
.placeholder-strip > span { margin-right: 3px; color: var(--muted); font-size: .64rem; font-weight: 700; }
.placeholder-strip button { min-height: 25px; padding: 2px 7px; color: var(--blue); background: #fff; border: 1px solid color-mix(in srgb,var(--blue) 17%,var(--line)); border-radius: 7px; font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size: .59rem; cursor: pointer; }
.placeholder-strip button:hover { background: var(--blue-soft); }
.contract-clause-list { display: flex; flex-direction: column; gap: 7px; }
.contract-clause-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 14px; transition: border-color 150ms ease, box-shadow 160ms ease; }
.contract-clause-card[open] { border-color: color-mix(in srgb,var(--blue) 30%,var(--line)); box-shadow: 0 6px 18px color-mix(in srgb,var(--blue) 7%,transparent); }
.contract-clause-card summary { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; cursor: pointer; list-style: none; }
.contract-clause-identity { min-width: 0; display: flex; align-items: center; gap: 10px; }
.contract-clause-identity > b { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: var(--blue-soft); border-radius: 11px; font-size: .72rem; }
.contract-clause-identity > span { min-width: 0; display: flex; flex-direction: column; }
.contract-clause-identity strong { overflow: hidden; font-size: .79rem; text-overflow: ellipsis; white-space: nowrap; }
.contract-clause-identity small { color: var(--muted); font-size: .64rem; }
.contract-clause-actions { display: flex; align-items: center; gap: 2px; }
.contract-clause-actions button { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.contract-clause-actions button:hover:not(:disabled) { color: var(--ink); background: #f0f2f5; }
.contract-clause-actions button.danger { color: var(--red); }
.contract-clause-actions button:disabled { opacity: .28; cursor: not-allowed; }
.contract-clause-actions svg { width: 15px; }
.contract-clause-actions > svg { width: 16px; margin-left: 3px; transition: transform 160ms ease; }
.contract-clause-card[open] .contract-clause-actions > svg { transform: rotate(180deg); }
.contract-clause-editor { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 9px; padding: 12px; background: #fafbfc; border-top: 1px solid var(--line); }
.contract-clause-editor .field:last-child { grid-column: 1 / -1; }
.contract-clause-editor textarea { min-height: 145px; }

.contract-signature-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.contract-signature-grid fieldset { min-width: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 0; padding: 14px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 15px; }
.contract-signature-grid legend { padding: 0 7px; color: var(--blue); font-size: .7rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.contract-signature-grid .field:first-of-type { grid-column: 1 / -1; }

.contract-order-dialog { width: min(calc(100% - 24px),760px); max-height: min(86dvh,760px); }
.contract-dialog-content { display: flex; flex-direction: column; gap: 13px; padding: 20px; }
.contract-order-list { display: flex; flex-direction: column; gap: 7px; max-height: 58dvh; padding: 2px; overflow-y: auto; }
.contract-order-list > button { width: 100%; min-height: 68px; display: grid; grid-template-columns: 40px minmax(0,1fr) 20px; align-items: center; gap: 10px; padding: 9px 11px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 13px; text-align: left; cursor: pointer; }
.contract-order-list > button:hover { background: var(--blue-soft); border-color: var(--blue-border); }
.contract-order-list > button:disabled { opacity: .48; }
.contract-order-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 10px; }
.contract-order-icon svg { width: 17px; }
.contract-order-list > button > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.contract-order-list strong, .contract-order-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contract-order-list strong { font-size: .78rem; }
.contract-order-list small { margin-top: 2px; color: var(--muted); font-size: .66rem; }
.contract-order-list > button > svg { width: 16px; color: var(--muted); }
.contract-mobile-actions { display: none; }

.contract-template-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.contract-template-card { display: flex; flex-direction: column; min-height: 218px; }
.contract-template-card.inactive { opacity: .66; }
.contract-template-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.contract-template-icon { width: 43px; height: 43px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 13px; }
.contract-template-icon svg { width: 20px; }
.contract-default-badge, .contract-inactive-badge { min-height: 25px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; color: #08724d; background: #e9f8f1; border-radius: 8px; font-size: .62rem; font-weight: 700; }
.contract-inactive-badge { color: var(--muted); background: #eef0f3; }
.contract-default-badge svg { width: 12px; }
.contract-template-card h2 { margin: 17px 0 3px; font-size: .96rem; letter-spacing: -.018em; }
.contract-template-card > p { margin: 0; color: var(--muted); font-size: .72rem; }
.contract-template-actions { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 17px; }
.contract-template-actions .icon-button { margin-left: auto; }
.contract-template-editor { display: flex; flex-direction: column; gap: 12px; }
.contract-settings-link { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 13px; margin-bottom: 12px; }
.contract-settings-link h2 { margin: 0; font-size: 1rem; letter-spacing: -.018em; }
.contract-settings-link p:last-child { margin: 4px 0 0; color: var(--muted); font-size: .75rem; }
.contract-settings-link .eyebrow { margin-bottom: 3px; }

.contract-detail-heading { align-items: flex-end; }
.contract-detail-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; margin-bottom: 12px; }
.contract-detail-summary article { min-width: 0; min-height: 84px; display: flex; align-items: center; gap: 10px; padding: 13px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow-sm); }
.contract-detail-summary article > span { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: var(--blue-soft); border-radius: 11px; }
.contract-detail-summary article > span svg { width: 18px; }
.contract-detail-summary article > div { min-width: 0; display: flex; flex-direction: column; }
.contract-detail-summary small { color: var(--muted); font-size: .65rem; font-weight: 650; }
.contract-detail-summary strong { overflow: hidden; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.contract-detail-summary article.total { color: #fff; background: #1b2430; border-color: #1b2430; }
.contract-detail-summary article.total > span { color: #fff; background: rgba(255,255,255,.12); }
.contract-detail-summary article.total small { color: rgba(255,255,255,.64); }
.contract-detail-intro, .contract-detail-payment, .contract-detail-clauses, .contract-detail-signatures { margin-bottom: 12px; }
.contract-detail-intro > p { margin: 0; color: #394455; font-size: .86rem; line-height: 1.7; white-space: pre-wrap; }
.contract-detail-parties { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 12px; }
.contract-detail-parties h2 { margin: 0 0 13px; font-size: 1rem; }
.contract-detail-parties dl { display: grid; gap: 8px; margin: 0; }
.contract-detail-parties dl > div { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.contract-detail-parties dt { color: var(--muted); font-size: .68rem; font-weight: 650; }
.contract-detail-parties dd { margin: 0; color: #3f4a59; font-size: .74rem; font-weight: 600; }
.contract-detail-term-list { display: flex; flex-direction: column; gap: 6px; }
.contract-detail-term-list article { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 49px; padding: 9px 12px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 11px; }
.contract-detail-term-list article > span { display: flex; flex-direction: column; }
.contract-detail-term-list strong, .contract-detail-term-list b { font-size: .76rem; }
.contract-detail-term-list small { color: var(--muted); font-size: .65rem; }
.contract-detail-clauses > div:last-child { display: flex; flex-direction: column; gap: 7px; }
.contract-detail-clauses article { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 10px; padding: 12px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 13px; }
.contract-detail-clauses article > span { width: 34px; height: 34px; display: grid; place-items: center; color: var(--blue); background: #fff; border-radius: 10px; font-size: .7rem; font-weight: 750; }
.contract-detail-clauses h3 { margin: 1px 0 5px; font-size: .8rem; }
.contract-detail-clauses p { margin: 0; color: #4b5665; font-size: .76rem; line-height: 1.65; white-space: pre-wrap; }
.contract-detail-signatures > div:last-child { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.contract-detail-signatures article { display: flex; flex-direction: column; gap: 5px; min-height: 125px; padding: 13px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 13px; }
.contract-detail-signatures article strong { font-size: .82rem; }
.contract-detail-signatures article span { color: var(--muted); font-size: .7rem; }

@media (max-width: 1180px) {
  .contract-form-heading { align-items: flex-start; flex-direction: column; }
  .contract-form-actions { width: 100%; flex-wrap: wrap; }
  .contract-party-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .contract-payment-row { grid-template-columns: 38px minmax(200px,1fr) minmax(135px,.65fr) minmax(150px,.65fr) 40px; }
  .contract-template-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .contract-top-grid, .contract-detail-parties { grid-template-columns: 1fr; }
  .contract-payment-row { grid-template-columns: 38px minmax(0,1fr) minmax(135px,.65fr) 40px; }
  .contract-payment-row > .field:nth-of-type(3) { grid-column: 2 / 4; }
  .contract-signature-grid { grid-template-columns: 1fr; }
  .contract-detail-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px) {
  body[data-page="panel-contract-form"] .panel-content { padding-bottom: 88px; }
  .contract-form-title > span { display: none; }
  .contract-form-title h1 { font-size: 1.38rem; }
  .contract-form-title > div > p:last-child { display: none; }
  .contract-form-actions { display: grid; grid-template-columns: 1fr; }
  .contract-form-actions > [data-contract-action="save"], .contract-form-actions > [data-contract-action="download"] { display: none; }
  .contract-party-grid, .contract-payment-head { grid-template-columns: 1fr; }
  .contract-party-grid .span-two { grid-column: 1; }
  .contract-source-meta { grid-template-columns: 1fr; }
  .contract-seller-snapshot dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .contract-payment-row { grid-template-columns: 34px minmax(0,1fr) 36px; }
  .contract-payment-row > .field { grid-column: 2; }
  .contract-payment-row > .field:nth-of-type(3) { grid-column: 2; }
  .contract-payment-row > .icon-button { grid-column: 3; grid-row: 1; }
  .contract-payment-index { grid-row: 1; }
  .contract-clause-editor { grid-template-columns: 80px minmax(0,1fr); }
  .contract-clause-actions button:nth-child(-n+2) { display: none; }
  .contract-signature-grid fieldset { grid-template-columns: 1fr; }
  .contract-signature-grid .field:first-of-type { grid-column: 1; }
  .contract-order-dialog { width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }
  .contract-dialog-content { height: 100%; padding: 16px 12px; }
  .contract-order-list { max-height: none; flex: 1; }
  .contract-mobile-actions { position: fixed; z-index: 48; right: 9px; bottom: max(9px,env(safe-area-inset-bottom)); left: 9px; display: grid; grid-template-columns: repeat(3,1fr); overflow: hidden; padding: 6px; background: rgba(27,36,48,.96); border: 1px solid rgba(255,255,255,.13); border-radius: 16px; box-shadow: 0 16px 38px rgba(16,24,40,.3); backdrop-filter: blur(16px); }
  .contract-mobile-actions button { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 2px; color: rgba(255,255,255,.72); background: transparent; border: 0; border-radius: 11px; font-size: .59rem; font-weight: 650; }
  .contract-mobile-actions button.primary { color: #fff; background: var(--blue); }
  .contract-mobile-actions button:disabled { opacity: .4; }
  .contract-mobile-actions svg { width: 17px; }
  .contract-template-grid { grid-template-columns: 1fr; }
  .contract-settings-link { grid-template-columns: 42px minmax(0,1fr); }
  .contract-settings-link > .button { grid-column: 1 / -1; width: 100%; }
  .contract-detail-heading { align-items: flex-start; }
  .contract-detail-actions { width: 100%; }
  .contract-detail-actions .button { flex: 1; }
}

@media (max-width: 520px) {
  .contract-seller-snapshot dl, .contract-detail-summary { grid-template-columns: 1fr; }
  .contract-clause-editor { grid-template-columns: 1fr; }
  .contract-clause-editor .field:last-child { grid-column: 1; }
  .contract-clause-identity small { display: none; }
  .contract-clause-identity > b { width: 34px; height: 34px; }
  .contract-clause-actions button.danger { display: grid; }
  .contract-subheading { align-items: flex-start; flex-direction: column; }
  .contract-subheading .button { width: 100%; }
  .contract-detail-parties dl > div { grid-template-columns: 1fr; gap: 2px; }
  .contract-detail-signatures > div:last-child { grid-template-columns: 1fr; }
  .contract-template-actions { flex-wrap: wrap; }
}

/* Cari Hesaplar */
.accounts-heading { align-items: flex-end; }
.accounts-heading-actions, .account-detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.account-dashboard { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; margin-bottom: 12px; }
.account-dashboard article, .account-detail-summary article { min-width: 0; min-height: 82px; display: flex; align-items: center; gap: 10px; padding: 13px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow-sm); }
.account-dashboard article > span, .account-detail-summary article > span { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: var(--blue-soft); border-radius: 12px; }
.account-dashboard article > span svg, .account-detail-summary article > span svg { width: 18px; }
.account-dashboard article > div, .account-detail-summary article > div { min-width: 0; display: flex; flex-direction: column; }
.account-dashboard small, .account-detail-summary small { color: var(--muted); font-size: .59rem; font-weight: 750; letter-spacing: .035em; }
.account-dashboard strong, .account-detail-summary strong { overflow: hidden; margin-top: 2px; font-size: .92rem; letter-spacing: -.018em; text-overflow: ellipsis; white-space: nowrap; }
.account-dashboard article.dark, .account-detail-summary article.dark { color: #fff; background: #1b2430; border-color: #1b2430; }
.account-dashboard article.dark > span, .account-detail-summary article.dark > span { color: #fff; background: rgba(255,255,255,.12); }
.account-dashboard article.dark small, .account-detail-summary article.dark small { color: rgba(255,255,255,.64); }
.account-dashboard article.warning > span, .account-detail-summary article.overdue > span { color: #b42318; background: #fff0ed; }
.account-dashboard article.warning strong, .account-detail-summary article.overdue strong { color: #b42318; }
.accounts-list-section, .account-ledger-section, .account-schedule-section { margin-bottom: 12px; }
.accounts-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.account-filters { display: flex; align-items: center; gap: 5px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.account-filters::-webkit-scrollbar { display: none; }
.account-filters a { min-height: 34px; display: inline-flex; align-items: center; flex: 0 0 auto; padding: 6px 10px; color: var(--muted); text-decoration: none; background: #f5f6f8; border: 1px solid transparent; border-radius: 10px; font-size: .63rem; font-weight: 700; }
.account-filters a.active { color: var(--blue); background: var(--blue-soft); border-color: var(--blue-border); }
.account-search-form { display: flex; align-items: center; flex: 0 0 auto; gap: 6px; }
.account-search-form .orders-search { width: min(330px,32vw); }
.accounts-table { min-width: 1220px; }
.accounts-table tr.paid td { color: #08724d; background: #f5fcf8; }
.accounts-table tr.cancelled { opacity: .58; }
.account-order-code { color: var(--blue); font-weight: 750; text-decoration: none; }
.account-overdue-inline { display: inline-flex; margin-left: 6px; padding: 3px 6px; color: #b42318; background: #fff0ed; border-radius: 7px; font-size: .56rem; font-weight: 750; }
.account-paid-value { color: #08724d; font-weight: 700; }
.account-remaining-value { font-weight: 750; }
.account-plan-badge, .schedule-status, .account-transaction-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 7px; color: #245f9d; background: #edf5ff; border-radius: 8px; font-size: .59rem; font-weight: 750; }
.account-plan-badge.mixed { color: #6b43c5; background: #f3efff; }
.account-due { display: flex; flex-direction: column; }
.account-due strong { font-size: .7rem; }
.account-due small { margin-top: 2px; color: var(--muted); font-size: .58rem; }
.account-due.overdue strong, .account-due.overdue small { color: #b42318; }
.account-create-dialog { width: min(calc(100% - 24px),720px); }
.account-create-content { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.account-order-list { max-height: 270px; display: flex; flex-direction: column; gap: 6px; overflow: auto; padding: 2px; }
.account-order-list > button { min-height: 59px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--ink); text-align: left; background: #f8f9fb; border: 1px solid var(--line); border-radius: 13px; }
.account-order-list > button > span { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.account-order-list strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.account-order-list small { margin-top: 3px; color: var(--muted); font-size: .63rem; }
.account-order-list svg { width: 17px; color: #a7afba; }
.account-order-list > button.selected { color: var(--blue); background: var(--blue-soft); border-color: var(--blue-border); }
.account-order-list > button.selected svg { color: var(--blue); }
.account-order-list > button.has-account { opacity: .72; }
.account-order-list em { color: #08724d; font-size: .58rem; font-style: normal; font-weight: 750; }
.account-manual-link { display: inline-flex; align-items: center; align-self: flex-start; gap: 5px; padding: 2px 0; color: var(--blue); background: transparent; border: 0; font-size: .68rem; font-weight: 700; }
.account-manual-link svg { width: 14px; }
.account-create-grid, .account-plan-fields, .account-note-fields, .account-note-common { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.account-create-grid { padding-top: 13px; border-top: 1px solid var(--line); }
.money-field { min-height: 44px; display: flex; align-items: center; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.money-field:focus-within { border-color: var(--blue-border); box-shadow: 0 0 0 4px var(--blue-soft); }
.money-field b { padding-left: 12px; color: var(--muted); font-size: .8rem; }
.money-field input { width: 100%; min-height: 42px; padding: 9px 11px 9px 6px; background: transparent; border: 0; outline: 0; font: inherit; font-weight: 650; }
.account-create-remaining { grid-column: 1 / -1; min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; color: #fff; background: #1b2430; border-radius: 14px; }
.account-create-remaining small { color: rgba(255,255,255,.62); font-size: .62rem; font-weight: 750; }
.account-create-remaining strong { font-size: 1.15rem; }
.account-create-remaining strong.negative { color: #ffb4ab; }
.button.danger-soft { color: #b42318; background: #fff0ed; border-color: #ffd7d1; }

.account-detail-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 17px; margin-bottom: 14px; }
.account-detail-title { display: flex; align-items: center; gap: 13px; min-width: 0; }
.account-detail-title > span { width: 49px; height: 49px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: var(--blue-soft); border-radius: 15px; }
.account-detail-title > span svg { width: 22px; }
.account-detail-title h1 { margin: 1px 0 2px; font-size: 1.45rem; letter-spacing: -.035em; }
.account-detail-title p:last-child { margin: 0; color: var(--muted); font-size: .73rem; }
.account-detail-actions .button { padding-inline: 10px; }
.account-cancelled-banner { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; padding: 12px 14px; color: #8a291f; background: #fff4f2; border: 1px solid #ffd7d1; border-radius: 15px; }
.account-cancelled-banner > svg { width: 21px; }
.account-cancelled-banner span { display: flex; flex-direction: column; }
.account-cancelled-banner strong { font-size: .78rem; }
.account-cancelled-banner small { margin-top: 2px; font-size: .65rem; }
.account-detail-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; margin-bottom: 12px; }
.account-detail-summary article.customer { grid-column: span 2; }
.account-detail-summary article.success > span { color: #08724d; background: #e9f8f1; }
.account-detail-summary article.success strong { color: #08724d; }
.account-detail-summary em { margin-top: 2px; color: var(--muted); font-size: .58rem; font-style: normal; }
.account-ledger-table { min-width: 970px; }
.account-ledger-table .numeric.credit { color: #08724d; font-weight: 750; }
.account-ledger-table .numeric.debt { color: #8a3d22; font-weight: 750; }
.account-transaction-badge.type-opening, .account-transaction-badge.type-debt { color: #8a3d22; background: #fff3ed; }
.account-transaction-badge.type-payment, .account-transaction-badge.type-installment_payment, .account-transaction-badge.type-note_payment { color: #08724d; background: #e9f8f1; }
.account-transaction-badge.type-return { color: #6b43c5; background: #f3efff; }
.account-transaction-badge.type-balance_adjustment { color: #245f9d; background: #edf5ff; }
.account-transaction-badge.type-cancellation { color: #b42318; background: #fff0ed; }
.account-schedule-table { min-width: 850px; }
.schedule-status.paid { color: #08724d; background: #e9f8f1; }
.schedule-status.partial { color: #8a5a00; background: #fff6d8; }
.schedule-status.overdue { color: #b42318; background: #fff0ed; }
.schedule-status.cancelled { color: var(--muted); background: #eef0f3; }
.account-schedule-table tr.status-overdue td { background: #fffafa; }
.account-section-empty { min-height: 92px; display: flex; align-items: center; justify-content: center; gap: 11px; padding: 16px; color: var(--muted); background: #fafbfc; border: 1px dashed var(--line); border-radius: 14px; }
.account-section-empty > svg { width: 24px; }
.account-section-empty span { display: flex; flex-direction: column; }
.account-section-empty strong { color: var(--ink); font-size: .75rem; }
.account-section-empty small { margin-top: 3px; font-size: .64rem; }
.order-account-summary { display: grid; grid-template-columns: 40px minmax(0,1fr) 18px; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.order-account-summary > span { width: 38px; height: 38px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 11px; }
.order-account-summary > span svg, .order-account-summary > svg { width: 17px; }
.order-account-summary > svg { color: var(--muted); }
.order-account-summary div { display: flex; flex-direction: column; }
.order-account-summary small { color: var(--muted); font-size: .58rem; font-weight: 750; }
.order-account-summary strong { margin-top: 2px; font-size: .8rem; }
.order-account-summary em { margin-top: 2px; color: #08724d; font-size: .63rem; font-style: normal; }
.order-payment-line.paid > span:first-child { display: flex; flex-direction: column; }
.order-payment-line.paid > span:first-child small { margin-left: 25px; color: rgba(255,255,255,.55); font-size: .55rem; }
.order-payment-line.paid input[readonly] { cursor: not-allowed; opacity: .72; }

.account-transaction-dialog, .account-payment-dialog { width: min(calc(100% - 24px),510px); }
.account-plan-dialog, .account-note-dialog { width: min(calc(100% - 24px),920px); }
.account-plan-content, .account-note-content { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.account-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.account-preview-heading > span { display: flex; flex-direction: column; }
.account-preview-heading strong { font-size: .76rem; }
.account-preview-heading small { margin-top: 2px; color: var(--muted); font-size: .62rem; }
.account-preview-heading > b { color: var(--blue); font-size: .78rem; }
.account-plan-preview { max-height: 340px; display: flex; flex-direction: column; gap: 6px; overflow: auto; padding: 2px; }
.account-preview-row { display: grid; grid-template-columns: 34px minmax(135px,.7fr) minmax(135px,.7fr) minmax(180px,1fr); align-items: end; gap: 7px; padding: 8px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 12px; }
.account-preview-row.note { grid-template-columns: 34px minmax(130px,.65fr) minmax(135px,.65fr) minmax(125px,.55fr) minmax(150px,1fr); }
.account-preview-row > b { width: 30px; height: 38px; display: grid; place-items: center; color: var(--blue); background: #fff; border-radius: 9px; font-size: .67rem; }
.account-preview-row label { display: flex; flex-direction: column; gap: 3px; }
.account-preview-row label span { color: var(--muted); font-size: .55rem; font-weight: 700; }
.account-preview-row input { width: 100%; min-height: 38px; padding: 7px 8px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: .69rem; outline: 0; }
.account-preview-row input:focus { border-color: var(--blue-border); box-shadow: 0 0 0 3px var(--blue-soft); }
.account-payment-info { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.account-payment-info > span { display: flex; flex-direction: column; padding: 9px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 11px; }
.account-payment-info small { color: var(--muted); font-size: .56rem; font-weight: 750; }
.account-payment-info strong { margin-top: 3px; font-size: .76rem; }
.account-note-mode { display: grid; grid-template-columns: repeat(2,1fr); padding: 4px; background: #eef0f3; border-radius: 12px; }
.account-note-mode button { min-height: 38px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font-size: .68rem; font-weight: 750; }
.account-note-mode button.active { color: var(--blue); background: #fff; box-shadow: var(--shadow-sm); }
.field span em { color: var(--muted); font-size: .55rem; font-style: normal; }
.account-method-select { position: relative; }
.account-method-select > [data-method-trigger] { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 9px 11px; color: var(--ink); text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 11px; font: inherit; font-size: .72rem; font-weight: 650; }
.account-method-select > [data-method-trigger] svg { width: 16px; color: var(--muted); }
.account-method-select > [data-method-menu] { position: absolute; z-index: 20; right: 0; bottom: calc(100% + 5px); left: 0; overflow: hidden; padding: 5px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 18px 45px rgba(16,24,40,.18); }
.account-method-select > [data-method-menu] button { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 7px 9px; color: var(--ink); text-align: left; background: transparent; border: 0; border-radius: 9px; font-size: .67rem; font-weight: 650; }
.account-method-select > [data-method-menu] button:hover, .account-method-select > [data-method-menu] button.selected { color: var(--blue); background: var(--blue-soft); }
.account-method-select > [data-method-menu] button svg { width: 14px; opacity: 0; }
.account-method-select > [data-method-menu] button.selected svg { opacity: 1; }
.account-mobile-actions { display: none; }
.account-mobile-actions > a:only-child { grid-column: 1 / -1; }

@media (max-width: 1240px) {
  .account-dashboard { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .account-detail-heading { align-items: flex-start; flex-direction: column; }
  .account-detail-actions { width: 100%; justify-content: flex-start; }
}
@media (max-width: 980px) {
  .accounts-toolbar { align-items: stretch; flex-direction: column; }
  .account-search-form .orders-search { width: 100%; }
  .account-detail-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .account-detail-summary article.customer { grid-column: span 2; }
}
@media (max-width: 760px) {
  body[data-page="panel-account-detail"] .panel-content { padding-bottom: 88px; }
  .accounts-heading { align-items: flex-start; flex-direction: column; }
  .accounts-heading-actions, .account-search-form { width: 100%; }
  .accounts-heading-actions .button { flex: 1; justify-content: center; }
  .account-dashboard { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .account-dashboard article:last-child { grid-column: 1 / -1; }
  .accounts-table { min-width: 0; }
  .accounts-table thead, .account-ledger-table thead, .account-schedule-table thead { display: none; }
  .accounts-table, .accounts-table tbody, .accounts-table tr, .account-ledger-table, .account-ledger-table tbody, .account-ledger-table tr, .account-schedule-table, .account-schedule-table tbody, .account-schedule-table tr { display: block; min-width: 0; }
  .accounts-table tr, .account-ledger-table tr, .account-schedule-table tr { margin-bottom: 9px; padding: 11px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
  .accounts-table td, .account-ledger-table td, .account-schedule-table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; text-align: right; border: 0; border-bottom: 1px solid var(--line); }
  .accounts-table td:last-child, .account-ledger-table td:last-child, .account-schedule-table td:last-child { border-bottom: 0; }
  .accounts-table td::before, .account-ledger-table td::before, .account-schedule-table td::before { content: attr(data-label); margin-right: auto; color: var(--muted); font-size: .57rem; font-weight: 750; text-align: left; text-transform: uppercase; }
  .account-detail-title > span { display: none; }
  .account-detail-title h1 { font-size: 1.3rem; }
  .account-detail-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .account-detail-actions .button { justify-content: center; }
  .account-detail-actions [data-transaction-type="PAYMENT"], .account-detail-actions [data-account-action="installment"], .account-detail-actions [data-account-action="note"], .account-detail-actions .dark-button { display: none; }
  .account-plan-dialog, .account-note-dialog { width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; }
  .account-plan-content, .account-note-content { height: 100%; overflow: auto; padding: 16px 12px; }
  .account-preview-row, .account-preview-row.note { grid-template-columns: 32px minmax(0,1fr); }
  .account-preview-row > label { grid-column: 2; }
  .account-mobile-actions { position: fixed; z-index: 48; right: 9px; bottom: max(9px,env(safe-area-inset-bottom)); left: 9px; display: grid; grid-template-columns: repeat(4,1fr); overflow: hidden; padding: 6px; background: rgba(27,36,48,.96); border: 1px solid rgba(255,255,255,.13); border-radius: 16px; box-shadow: 0 16px 38px rgba(16,24,40,.3); backdrop-filter: blur(16px); }
  .account-mobile-actions > * { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 2px; color: rgba(255,255,255,.75); text-decoration: none; background: transparent; border: 0; border-radius: 11px; font-size: .58rem; font-weight: 650; }
  .account-mobile-actions > *:first-child { color: #fff; background: var(--blue); }
  .account-mobile-actions svg { width: 17px; }
}
@media (max-width: 520px) {
  .account-dashboard, .account-detail-summary, .account-create-grid, .account-plan-fields, .account-note-fields, .account-note-common { grid-template-columns: 1fr; }
  .account-dashboard article:last-child, .account-detail-summary article.customer, .account-create-grid .span-two, .account-plan-fields .span-two, .account-note-fields .span-two { grid-column: 1; }
  .account-search-form { display: grid; grid-template-columns: minmax(0,1fr) auto auto; }
  .account-detail-actions { grid-template-columns: 1fr; }
  .account-payment-info { grid-template-columns: 1fr; }
}

/* Antetli belgeler ve Jodit editörü */
.letterhead-list-heading,
.letterhead-editor-heading,
.letterhead-preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.letterhead-editor-heading h1 { margin: 3px 0 4px; font-size: clamp(1.55rem,2.4vw,2.25rem); letter-spacing: -.04em; }
.letterhead-editor-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.letterhead-list-card { padding: 0; overflow: hidden; }
.letterhead-list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px; border-bottom: 1px solid var(--line); }
.letterhead-list-toolbar .account-search-form { width: min(100%,520px); }
.letterhead-list-table td:first-child strong { display: block; }
.letterhead-status { display: inline-flex; align-self: flex-start; margin-top: 4px; padding: 3px 7px; border-radius: 999px; color: #596579; background: #eef1f5; font-size: .55rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.letterhead-status.final { color: #08724d; background: #e8f7ef; }
.letterhead-status.archived { color: #7b5b14; background: #fff6d8; }
.new-letterhead-dialog { width: min(calc(100% - 24px),780px); }
.letterhead-template-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; max-height: min(64vh,580px); overflow: auto; padding: 4px 20px 22px; }
.letterhead-template-grid > a { min-height: 104px; display: grid; grid-template-columns: 46px minmax(0,1fr); grid-template-rows: auto auto; column-gap: 12px; align-content: center; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; transition: border-color 160ms ease,background-color 160ms ease,transform 100ms ease; }
.letterhead-template-grid > a:hover { background: var(--blue-soft); border-color: var(--blue-border); }
.letterhead-template-grid > a:active { transform: scale(.99); }
.letterhead-template-grid > a > span { width: 44px; height: 44px; grid-row: 1 / 3; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 13px; }
.letterhead-template-grid > a > span svg { width: 21px; }
.letterhead-template-grid strong { align-self: end; font-size: .8rem; }
.letterhead-template-grid small { align-self: start; color: var(--muted); font-size: .64rem; }

.letterhead-save-state { display: inline-flex; align-items: center; gap: 6px; color: #08724d; font-size: .68rem; font-weight: 700; }
.letterhead-save-state svg { width: 16px; }
.letterhead-save-state.dirty { color: #9a6700; }
.letterhead-save-state.saving { color: var(--blue); }
.letterhead-save-state.error { color: var(--red); }
.letterhead-meta-card { margin-bottom: 12px; padding: 18px; }
.form-grid .span-four { grid-column: 1 / -1; }
.field > span > small { margin-left: 5px; color: var(--muted); font-size: .56rem; font-weight: 600; }
.letterhead-segmented { min-height: 44px; display: flex; padding: 3px; background: #eef1f5; border: 1px solid var(--line); border-radius: 12px; }
.letterhead-segmented button { flex: 1; min-width: 0; padding: 7px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font-size: .67rem; font-weight: 750; }
.letterhead-segmented button.active { color: var(--blue); background: #fff; box-shadow: var(--shadow-sm); }
.letterhead-quick-tools { position: sticky; z-index: 35; top: calc(var(--app-bar-height) + 8px); display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 9px; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); backdrop-filter: blur(18px); }
.letterhead-quick-tools > div { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.letterhead-quick-tools .button { min-height: 38px; padding-inline: 11px; font-size: .71rem; }
.letterhead-variable-select { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .64rem; font-weight: 750; white-space: nowrap; }
.letterhead-variable-select select { min-height: 38px; padding: 7px 30px 7px 10px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; font: inherit; outline: 0; }
.letterhead-variable-select select:focus { border-color: var(--blue-border); box-shadow: 0 0 0 3px var(--blue-soft); }
.letterhead-workspace { margin: 0 -8px -24px; padding: 28px 12px 54px; overflow: auto; background: #e8ebf0; border-top: 1px solid rgba(24,32,43,.06); }
.letterhead-sheet { width: min(210mm,100%); min-height: 297mm; margin: 0 auto; overflow: hidden; background: #fff; border: 1px solid rgba(24,32,43,.08); border-radius: 2px; box-shadow: 0 22px 70px rgba(24,32,43,.16); }
.letterhead-sheet.background-mode { background-image: var(--letterhead-background); background-repeat: repeat-y; background-position: top center; background-size: 100% auto; }
.letterhead-sheet-header { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8mm 13mm 6mm; }
.letterhead-sheet-header > i { position: absolute; right: 13mm; bottom: 2mm; left: 13mm; height: 1.2px; border-radius: 999px; }
.letterhead-sheet-logo { width: 52mm; height: 24mm; display: flex; align-items: center; }
.letterhead-sheet-logo img { width: 100%; height: 100%; object-fit: contain; object-position: left center; }
.letterhead-sheet-logo strong { font-size: 1.15rem; }
.letterhead-sheet-company { min-width: 0; max-width: 108mm; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.letterhead-sheet-company strong { font-size: .73rem; }
.letterhead-sheet-company span,.letterhead-sheet-company small { color: var(--muted); font-size: .58rem; line-height: 1.35; }
.letterhead-sheet-content { padding: 5mm 18mm 8mm; }
.letterhead-sheet-footer { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 42mm; align-items: center; gap: 12mm; padding: 6mm 13mm 4mm; }
.letterhead-sheet-footer > i { position: absolute; top: 2mm; right: 13mm; left: 13mm; height: 1px; border-radius: 999px; }
.letterhead-sheet-footer > div { display: flex; flex-direction: column; gap: 4px; }
.letterhead-sheet-footer strong { font-size: .63rem; }
.letterhead-sheet-footer small { color: var(--muted); font-size: .52rem; }
.letterhead-sheet-footer img { width: 42mm; height: 17mm; object-fit: contain; object-position: right center; }

body[data-page="panel-letterhead-editor"] .jodit-container { overflow: visible; border: 0!important; border-radius: 0!important; background: transparent!important; box-shadow: none!important; }
body[data-page="panel-letterhead-editor"] .jodit-toolbar__box { border: 1px solid var(--line)!important; border-radius: 14px!important; background: #f7f8fa!important; box-shadow: 0 8px 24px rgba(24,32,43,.07); }
body[data-page="panel-letterhead-editor"] .jodit-toolbar-editor-collection { background: transparent!important; }
body[data-page="panel-letterhead-editor"] .jodit-toolbar-button__button { min-width: 34px!important; min-height: 34px!important; border-radius: 8px!important; }
body[data-page="panel-letterhead-editor"] .jodit-toolbar-button__button:hover { background: var(--blue-soft)!important; }
body[data-page="panel-letterhead-editor"] .jodit-workplace { min-height: 620px!important; border: 0!important; background: transparent!important; }
body[data-page="panel-letterhead-editor"] .jodit-wysiwyg { min-height: 620px!important; padding: 12mm 0 8mm!important; color: #18202b; background: transparent!important; font-family: "Google Sans Flex",Arial,sans-serif!important; font-size: 14px; line-height: 1.6; }
body[data-page="panel-letterhead-editor"] .jodit-wysiwyg img { max-width: 100%!important; height: auto; }
body[data-page="panel-letterhead-editor"] .jodit-wysiwyg table { width: 100%; max-width: 100%; table-layout: fixed; border-collapse: collapse; }
body[data-page="panel-letterhead-editor"] .jodit-wysiwyg th,body[data-page="panel-letterhead-editor"] .jodit-wysiwyg td { padding: 7px; border: 1px solid #cfd5df; overflow-wrap: anywhere; }
body[data-page="panel-letterhead-editor"] .jodit-wysiwyg .page-break { position: relative; height: 34px; margin: 18px 0; border-top: 2px dashed var(--blue-border); user-select: none; }
body[data-page="panel-letterhead-editor"] .jodit-wysiwyg .page-break span { position: absolute; top: -11px; left: 50%; padding: 2px 9px; color: var(--blue); background: #fff; border: 1px solid var(--blue-border); border-radius: 999px; font-size: 10px; font-weight: 750; transform: translateX(-50%); }
.letterhead-mobile-actions { display: none; }

.letterhead-pdf-preview { height: calc(100dvh - 175px); min-height: 620px; overflow: hidden; background: #30343a; border: 1px solid rgba(24,32,43,.14); border-radius: 18px; box-shadow: var(--shadow-md); }
.letterhead-pdf-preview iframe { width: 100%; height: 100%; border: 0; }

.letterhead-settings { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 26px; }
.letterhead-settings-switches { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; padding: 13px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 14px; }
.letterhead-settings-switches .proforma-check { margin: 0; }
.letterhead-mode-control { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.letterhead-mode-control label { position: relative; cursor: pointer; }
.letterhead-mode-control input { position: absolute; opacity: 0; pointer-events: none; }
.letterhead-mode-control label > span { min-height: 84px; display: grid; grid-template-columns: 36px minmax(0,1fr); grid-template-rows: auto auto; align-content: center; column-gap: 10px; padding: 13px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.letterhead-mode-control svg { width: 22px; grid-row: 1 / 3; align-self: center; color: var(--muted); }
.letterhead-mode-control b { align-self: end; font-size: .74rem; }
.letterhead-mode-control small { color: var(--muted); font-size: .61rem; }
.letterhead-mode-control input:checked + span { color: var(--blue); background: var(--blue-soft); border-color: var(--blue-border); box-shadow: 0 0 0 3px var(--blue-soft); }
.letterhead-mode-control input:checked + span svg { color: var(--blue); }
.letterhead-asset-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 16px 0; }
.letterhead-asset-card { display: flex; flex-direction: column; gap: 10px; padding: 13px; background: #fafbfc; border: 1px solid var(--line); border-radius: 15px; }
.letterhead-asset-card.background { grid-column: 1 / -1; }
.letterhead-asset-card > div { min-height: 90px; display: grid; place-items: center; overflow: hidden; background: #fff; border: 1px dashed var(--line-strong); border-radius: 11px; }
.letterhead-asset-card.background > div { min-height: 170px; }
.letterhead-asset-card img { width: 100%; max-height: 160px; object-fit: contain; }
.letterhead-asset-card > div > span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .67rem; font-weight: 700; }
.letterhead-asset-card > div > span svg { width: 18px; }
.letterhead-asset-card .button { align-self: flex-start; min-height: 36px; }

@media (max-width: 1100px) {
  .letterhead-editor-heading { flex-direction: column; }
  .letterhead-editor-actions { width: 100%; justify-content: flex-start; }
  .letterhead-quick-tools { align-items: stretch; flex-direction: column; }
  .letterhead-variable-select { justify-content: space-between; }
}
@media (max-width: 760px) {
  body[data-page="panel-letterhead-editor"] .panel-content { padding-bottom: 82px; }
  .letterhead-list-heading,.letterhead-preview-heading { flex-direction: column; }
  .letterhead-list-toolbar { display: grid; align-items: stretch; grid-template-columns: 1fr; }
  .letterhead-list-toolbar > .button { width: 100%; }
  .letterhead-list-toolbar .account-search-form { width: 100%; }
  .letterhead-list-table,.letterhead-list-table tbody,.letterhead-list-table tr { display: block; min-width: 0; }
  .letterhead-list-table thead { display: none; }
  .letterhead-list-table tr { margin-bottom: 9px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
  .letterhead-list-table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; text-align: right; border: 0; border-bottom: 1px solid var(--line); }
  .letterhead-list-table td:last-child { border: 0; }
  .letterhead-list-table td::before { content: attr(data-label); margin-right: auto; color: var(--muted); font-size: .57rem; font-weight: 750; text-align: left; text-transform: uppercase; }
  .letterhead-list-table td:first-child { align-items: flex-start; }
  .letterhead-list-table td:first-child a { max-width: 65%; }
  .letterhead-template-grid { grid-template-columns: 1fr; }
  .letterhead-editor-actions { display: none; }
  .letterhead-meta-card .form-grid.four { grid-template-columns: 1fr; }
  .form-grid .span-four { grid-column: 1; }
  .letterhead-quick-tools { position: static; }
  .letterhead-quick-tools > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .letterhead-quick-tools .button { white-space: normal; }
  .letterhead-workspace { margin-inline: -12px; padding: 10px 6px 28px; }
  .letterhead-sheet { width: 100%; min-height: auto; border-radius: 13px; }
  .letterhead-sheet-header { min-height: 110px; height: auto!important; padding: 16px; }
  .letterhead-sheet-logo { width: 35%; height: 60px; }
  .letterhead-sheet-company { max-width: 62%; }
  .letterhead-sheet-company span { display: none; }
  .letterhead-sheet-content { padding: 4px 16px 18px; }
  .letterhead-sheet-footer { min-height: 88px!important; padding: 20px 16px 12px; }
  body[data-page="panel-letterhead-editor"] .jodit-workplace,body[data-page="panel-letterhead-editor"] .jodit-wysiwyg { min-height: 520px!important; }
  body[data-page="panel-letterhead-editor"] .jodit-wysiwyg { padding: 24px 0!important; }
  .letterhead-mobile-actions { position: fixed; z-index: 48; right: 9px; bottom: max(9px,env(safe-area-inset-bottom)); left: 9px; display: grid; grid-template-columns: repeat(3,1fr); overflow: hidden; padding: 6px; background: rgba(27,36,48,.96); border: 1px solid rgba(255,255,255,.13); border-radius: 16px; box-shadow: 0 16px 38px rgba(16,24,40,.3); backdrop-filter: blur(16px); }
  .letterhead-mobile-actions button { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 2px; color: rgba(255,255,255,.75); background: transparent; border: 0; border-radius: 11px; font-size: .58rem; font-weight: 650; }
  .letterhead-mobile-actions button.primary { color: #fff; background: var(--blue); }
  .letterhead-mobile-actions svg { width: 17px; }
  .letterhead-pdf-preview { height: calc(100dvh - 230px); min-height: 500px; border-radius: 12px; }
  .letterhead-settings-switches { align-items: flex-start; flex-direction: column; }
  .letterhead-mode-control,.letterhead-asset-grid { grid-template-columns: 1fr; }
  .letterhead-asset-card.background { grid-column: 1; }
}
