* { box-sizing: border-box; }
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
body { font-family: system-ui, -apple-system, sans-serif; margin: 0; background: #f4f4f5; color: #18181b; line-height: 1.45; }
/* Giriş / şirket seçimi: okunaklı sütun; oturum açıkken tam genişlik (aşağıda) */
.wrap {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}
.header h1 { font-size: 1.35rem; margin: 0 0 0.25rem; }
.muted { color: #71717a; font-size: 0.9rem; }
.small { font-size: 0.85rem; }
.tiny { font-size: 0.75rem; line-height: 1.35; margin: 0.25rem 0 0; }
.ok { color: #166534; font-weight: 600; }
.settings-success-line {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

/* Kur girişi — masaüstündeki ayrı pencere (modal); panel içinde değil, her zaman en üstte */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(24, 24, 27, 0.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal-backdrop.hidden {
  display: none !important;
}
.modal-card {
  width: 100%;
  max-width: 40rem;
  max-height: min(90vh, 720px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 1rem 1.25rem 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
/* Başlık çubuğundan pencereyi taşı (POS / manuel / fiş önizleme) */
.modal-header-draggable {
  cursor: grab;
  user-select: none;
}
.modal-header-draggable:active {
  cursor: grabbing;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}
.modal-close-btn {
  flex-shrink: 0;
}
.kur-dialog-grid {
  grid-template-columns: minmax(11rem, 1fr);
  max-width: 22rem;
}
.subsection-title.kur-history-heading {
  margin-top: 1rem;
  font-size: 1rem;
}
.kur-history-table-wrap {
  margin-top: 0.5rem;
  max-height: min(40vh, 280px);
  overflow: auto;
}

.daily-mode-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.btn-daily-mode {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  background: #fafafa;
  cursor: pointer;
  font-size: 0.85rem;
}
.btn-daily-mode.active {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
  font-weight: 600;
}
.daily-actions-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.daily-triple {
  flex: 1;
  min-width: 4rem;
}

.modal-card-wide.report-dialog-card {
  max-width: min(72rem, 96vw);
  max-height: min(92vh, 860px);
}
.report-dialog-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 0.5rem;
  border-bottom: 1px solid #e4e4e7;
  padding-bottom: 0.35rem;
}
.report-tab {
  padding: 0.35rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 6px 6px 0 0;
  background: transparent;
  cursor: pointer;
  font-size: 0.88rem;
  color: #52525b;
}
.report-tab:hover {
  background: #fafafa;
  color: #18181b;
}
.report-tab.active {
  background: #fff;
  border-color: #e4e4e7;
  border-bottom-color: #fff;
  margin-bottom: -1px;
  font-weight: 600;
  color: #0f766e;
}
.report-tab-panel.hidden {
  display: none !important;
}
.report-table-wrap {
  max-height: min(60vh, 520px);
  overflow: auto;
  margin-top: 0.35rem;
}
.uyumsoft-preview-table-wrap {
  max-height: min(58vh, 480px);
  overflow: auto;
  margin-top: 0.5rem;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
}
.uyumsoft-preview-table-wrap .data-table {
  font-size: 0.78rem;
  white-space: nowrap;
}
.report-desktop-note {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
}
.report-dialog-pre {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  max-height: min(60vh, 480px);
  overflow: auto;
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Fatura şablonları — öneri satırı çift tıklama önizlemesi */
#tpl-suggestions-tbody tr {
  cursor: pointer;
}
.modal-header.tpl-preview-header {
  margin-bottom: 0.75rem;
}
.tpl-preview-card {
  max-width: min(40rem, 96vw);
  max-height: min(92vh, 820px);
}
.tpl-preview-body {
  font-size: 0.92rem;
  line-height: 1.45;
  overflow-y: auto;
  max-height: min(78vh, 700px);
}
.tpl-preview-group {
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  padding: 0.75rem 1rem 1rem;
  margin-bottom: 0.85rem;
  background: #fafafa;
}
.tpl-preview-group-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #18181b;
}
.tpl-preview-current {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}
.tpl-preview-label {
  display: block;
  margin: 0.35rem 0 0.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #3f3f46;
}
.tpl-preview-select {
  width: 100%;
  max-width: 100%;
  padding: 0.45rem 0.5rem;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  font-size: 0.92rem;
  background: #fff;
}
.tpl-preview-row-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  margin: 0.65rem 0 0;
  align-items: center;
}
.tpl-preview-info-text {
  width: 100%;
  min-height: 280px;
  max-height: 360px;
  padding: 0.6rem 0.75rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.88rem;
  line-height: 1.5;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  resize: vertical;
  background: #fff;
  color: #18181b;
}
.tpl-preview-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
}
.tpl-preview-next.btn-primary,
button.tpl-preview-next {
  background: #2196f3;
  color: #fff;
  font-weight: 700;
  border: 1px solid #1976d2;
}
.tpl-preview-next.btn-primary:hover,
button.tpl-preview-next:hover {
  background: #1e88e5;
}

.address-auto-add-pre {
  max-height: min(50vh, 420px);
  overflow: auto;
  font-size: 0.85rem;
  line-height: 1.45;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0 0;
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Fatura ayarları — şirket adı satırı (masaüstü: input + yeşil buton yan yana) */
.inv-company-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.75rem;
}
.inv-label-inline {
  flex: 1 1 18rem;
  min-width: 0;
  margin-bottom: 0;
}
.inv-label-inline input {
  display: block;
  width: 100%;
  max-width: none;
  margin-top: 0.25rem;
  padding: 0.4rem 0.5rem;
}
.inv-owners-hint {
  margin: 0 0 0.35rem;
}
.inv-owners-save-wrap {
  margin: 0.5rem 0 0;
}
.inv-btn-full {
  width: 100%;
  box-sizing: border-box;
}
.error { color: #b91c1c; margin-top: 0.5rem; }
.mono { font-family: ui-monospace, monospace; word-break: break-all; }
textarea.mono.wide {
  width: 100%;
  max-width: none;
  min-height: 12rem;
  padding: 0.5rem;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.card {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.company-preview-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.25rem 0 0.75rem;
  color: #18181b;
}
.company-back-row {
  margin-top: 0.75rem;
  margin-bottom: 0;
}
.panel { margin-top: 0.5rem; }
body.app-logged-in .panel {
  margin-top: 0;
  width: 100%;
  max-width: 100%;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.tab {
  padding: 0.45rem 0.9rem;
  border: 1px solid #d4d4d8;
  background: #fafafa;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 0.95rem;
}
.tab.active {
  background: #fff;
  border-bottom-color: #fff;
  font-weight: 600;
}
.tab-panel.hidden { display: none; }
.hidden { display: none !important; }

h2 { font-size: 1.05rem; margin: 0.75rem 0 0.5rem; }
h2:first-child { margin-top: 0; }

label { display: block; margin-bottom: 0.65rem; }
label.inline { display: flex; align-items: center; gap: 0.5rem; }
label.grow { flex: 1; min-width: 0; }
input[type="text"], input[type="password"], input[type="search"], input[type="number"], select {
  width: 100%;
  max-width: 28rem;
  padding: 0.4rem 0.55rem;
  margin-top: 0.2rem;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
}
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; margin-bottom: 0.75rem; }

button {
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #d4d4d8;
  background: #fff;
  font-size: 0.95rem;
}
.btn-primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  font-weight: 600;
}
.btn-secondary { background: #f4f4f5; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  max-height: 420px;
  overflow-y: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid #f4f4f5;
}
.data-table th {
  background: #fafafa;
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
}
.data-table tbody tr:hover { background: #fafafa; }

code { font-size: 0.88em; background: #f4f4f5; padding: 0.1rem 0.35rem; border-radius: 4px; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
}
.readonly-field {
  background: #f4f4f5;
  color: #52525b;
}

.address-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  align-items: end;
}
.address-form-grid label { margin-bottom: 0; }

.tab-address-panel .address-tab-header {
  margin: 0 0 0.75rem;
  padding-bottom: 0;
  border-bottom: none;
}
.address-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.tab-address-panel .address-tab-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex: 1;
  min-width: 8rem;
}
.address-editor-toggle {
  flex-shrink: 0;
  white-space: nowrap;
}
.address-editor-panel {
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #e4e4e7;
}
.address-editor-panel[hidden] {
  display: none !important;
}
.tab-address-panel .address-tab-lead {
  margin: 0 0 0.85rem;
  max-width: 42rem;
  line-height: 1.45;
}

.address-form-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.tab-address-panel .address-fieldset {
  margin: 0;
  padding: 0.75rem 1rem 1rem;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fafafa;
}
.tab-address-panel .address-fieldset-legend {
  padding: 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #52525b;
}
.address-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
}
.address-fields-grid-2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.address-toptan-row {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #e4e4e7;
}
.address-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  min-width: 0;
}
.address-field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #3f3f46;
  line-height: 1.2;
}
.address-field input[type="text"] {
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  font-size: 0.88rem;
  background: #fff;
}
.address-field input[type="text"]:focus {
  outline: none;
  border-color: #71717a;
  box-shadow: 0 0 0 2px rgba(113, 113, 122, 0.2);
}
.address-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: #27272a;
  cursor: pointer;
  user-select: none;
}
.address-check-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.address-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding-top: 0.15rem;
}
.address-list-section {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
}
.address-list-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #52525b;
}
.address-search-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.address-search-label input[type="search"] {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  font-size: 0.88rem;
}
.address-search-row {
  margin-top: 0;
  align-items: flex-end;
}
@media (max-width: 900px) {
  .address-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .address-fields-grid,
  .address-fields-grid-location {
    grid-template-columns: 1fr;
  }
}

.uyumsoft-download-status {
  margin: 0.35rem 0 0.5rem;
  min-height: 1.25rem;
  font-weight: 500;
  color: #3f3f46;
}

/* —— Masaüstü benzeri ana kabuk (Faz 1) —— */
body.app-logged-in .wrap {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
/* Ana panel açıkken tam genişlik + üst tanıtımı gizle (:has ile JS’e ek güvence) */
main.wrap:has(#panel-section:not([hidden])) {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
main.wrap:has(#panel-section:not([hidden])) .header {
  display: none;
}
.desktop-shell-wrap {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
}
.desktop-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: #e4e4e7;
}
.desktop-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 1rem;
  background: #18181b;
  color: #fafafa;
  border-bottom: 1px solid #27272a;
}
.desktop-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
  min-width: 0;
}
.shell-status { font-size: 0.85rem; }
.desktop-split {
  display: flex;
  flex: 1;
  align-items: stretch;
  min-height: 0;
  width: 100%;
  max-width: 100%;
}
.left-rail {
  width: 300px;
  min-width: 260px;
  max-width: 100%;
  background: #fafafa;
  border-right: 1px solid #d4d4d8;
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
}
.lr-section {
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  padding: 0 0.5rem;
}
.lr-section summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.5rem 0.25rem;
  list-style: none;
}
.lr-section summary::-webkit-details-marker { display: none; }
.lr-body {
  padding: 0.35rem 0.25rem 0.65rem;
  font-size: 0.88rem;
}
.lr-file input[type="file"] {
  max-width: 100%;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}
.lr-full {
  width: 100%;
  margin-top: 0.35rem;
}
.lr-dosya-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.lr-flex {
  flex: 1;
  min-width: 7rem;
}
.lr-placeholder {
  padding: 0.4rem 0;
}
.lr-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.lr-logout {
  margin-top: auto;
}
.right-stack {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  overflow: hidden;
}
.main-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid #d4d4d8;
  padding-bottom: 0.35rem;
  background: #e4e4e7;
  margin: -0.5rem -0.5rem 0;
  padding: 0.5rem 0.5rem 0.35rem;
}
.main-tabs .tab {
  border-radius: 8px 8px 0 0;
  margin-bottom: -1px;
}
.right-stack .tab-panel.card {
  margin-bottom: 0;
  flex: 1;
  min-height: 12rem;
  overflow: auto;
}
@media (max-width: 900px) {
  .desktop-split {
    flex-direction: column;
  }
  .left-rail {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid #d4d4d8;
  }
}

/* Faz 2 — işlem filtresi + tablo */
.filter-block {
  font-size: 0.85rem;
}
.filter-block .filter-label {
  display: block;
  margin: 0.4rem 0 0.15rem;
}
.filter-block .filter-label input[type="date"],
.filter-block .filter-multiselect {
  width: 100%;
  max-width: 100%;
  margin-top: 0.2rem;
}
.filter-multiselect {
  font-size: 0.8rem;
  padding: 0.25rem;
}
.filter-date-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.filter-type-row {
  margin: 0.35rem 0;
}
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.subsection-title {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e4e4e7;
}
.tx-pager {
  align-items: center;
  margin-bottom: 0.5rem;
}
.tx-table-wrap {
  max-height: min(55vh, 520px);
}

/* Faz 3 — Fatura şablonları araç çubuğu */
.tpl-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #e4e4e7;
}
.ledger-toolbar .ledger-toolbar-spacer {
  flex: 1;
  min-width: 0.5rem;
}
#ledger-pos-table tr.selected {
  background: #eef2ff;
}
.tpl-search {
  min-width: 8rem;
  max-width: 12rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  font-size: 0.88rem;
}
.tpl-table-wrap {
  max-height: min(60vh, 560px);
}
.data-table .col-sel {
  width: 2rem;
  text-align: center;
}
.tpl-action-col {
  width: 5.5rem;
  text-align: center;
}
.tpl-action-cell {
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}
button.tpl-row-fix-btn {
  padding: 0.2rem 0.45rem;
  font-size: 0.8rem;
  line-height: 1.2;
}

/* Fatura ayarları (masaüstü sekmesi ile aynı gruplar) */
.invoice-settings-scroll {
  max-height: min(72vh, 920px);
  overflow-y: auto;
  padding-right: 0.35rem;
  margin-bottom: 0.5rem;
}
.inv-fieldset {
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 0.75rem 1rem 1rem;
  margin: 1rem 0;
  background: #fafafa;
}
.inv-fieldset legend {
  font-weight: 600;
  padding: 0 0.35rem;
}
.inv-label-block input {
  width: 100%;
  max-width: 36rem;
  padding: 0.4rem 0.5rem;
  margin-top: 0.25rem;
}
#inv-company-owners {
  width: 100%;
  max-width: 36rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
}
.inv-sales-purchase-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}
.inv-sales-purchase-row > .inv-fieldset {
  flex: 1 1 320px;
  margin-top: 0.5rem;
}
.inv-grid {
  display: grid;
  grid-template-columns: minmax(9rem, auto) minmax(6.5rem, 9rem) minmax(8rem, 1fr);
  gap: 0.45rem 0.65rem;
  align-items: center;
}
.inv-grid .inv-span-2 {
  grid-column: 2 / 4;
}
.inv-grid label {
  margin-bottom: 0;
}
.inv-grid label input {
  width: 100%;
  max-width: 14rem;
  padding: 0.35rem 0.45rem;
}
.inv-inline-num input {
  width: 6.5rem;
  max-width: 100%;
  padding: 0.35rem 0.45rem;
}
.inv-grid-purchase {
  grid-template-columns: minmax(11rem, 42%) 1fr;
}
.inv-grid-purchase label {
  margin-bottom: 0;
}
.inv-grid-purchase label input {
  max-width: none;
  width: 100%;
}
.inv-banks-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  background: #fff;
}
.inv-bank-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
  font-size: 0.92rem;
  cursor: pointer;
}
.inv-bank-row input {
  margin: 0;
}
.inv-bank-actions label.grow input {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.35rem 0.45rem;
}
.inv-footer-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e4e4e7;
}

/* POS / Manuel işlem — masaüstü diyaloglarına yakın kompakt düzen */
.pos-manual-modal-card {
  max-width: min(44rem, 96vw);
  min-width: 280px;
  min-height: 200px;
  max-height: min(92vh, 840px);
  display: flex;
  flex-direction: column;
  overflow: auto;
  resize: both;
}
.pos-manual-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
.pos-manual-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.75rem;
  align-items: center;
  overflow-y: auto;
  max-height: min(58vh, 520px);
  padding-right: 0.35rem;
  font-size: 0.88rem;
}
.pos-manual-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.pos-manual-form-grid input,
.pos-manual-form-grid select {
  font-size: 0.88rem;
  padding: 0.35rem 0.45rem;
  min-height: 2rem;
}
.pos-manual-actions {
  flex-shrink: 0;
  margin-top: 0.5rem;
}
@media (max-width: 640px) {
  .pos-manual-form-grid {
    grid-template-columns: 1fr;
  }
}
.entry-preview-panel {
  margin-bottom: 0.45rem;
  min-height: 0;
}
.entry-preview-img {
  display: block;
  max-width: 100%;
  max-height: min(22vh, 280px);
  object-fit: contain;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  background: #fafafa;
}
.entry-preview-embed {
  width: 100%;
  height: min(28vh, 320px);
  border: 1px solid #e4e4e7;
  border-radius: 6px;
}
.entry-preview-filename {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #52525b;
}

/* Fatura şablonları öneri tablosu — sütun genişliği (masaüstü gibi) */
.tpl-resizable-table {
  table-layout: fixed;
}
.tpl-resizable-table thead th {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-resizer {
  position: absolute;
  right: 0;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 2;
}
.col-resizer:hover {
  background: rgba(15, 118, 110, 0.25);
}

/* Galeri fiş/PDF — POS üstünde; karartma yok (form görünür), kart yeniden boyutlanabilir */
.gallery-viewer-overlay {
  z-index: 10100;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0.75rem;
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  pointer-events: none;
}
.gallery-viewer-overlay > .modal-card {
  pointer-events: auto;
  resize: both;
  min-width: 280px;
  min-height: 200px;
  max-width: min(96vw, 1200px);
  max-height: min(94vh, 900px);
}
.gallery-viewer-card {
  max-width: min(96vw, 1200px);
  width: min(92vw, 900px);
  max-height: min(94vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gallery-viewer-hint {
  margin: 0 0 0.35rem;
  flex-shrink: 0;
}
.gallery-viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}
.gallery-viewer-zoom-label {
  font-size: 0.85rem;
  color: #52525b;
  min-width: 3.5rem;
  text-align: center;
}
.gallery-viewer-viewport {
  position: relative;
  flex: 1;
  min-height: min(72vh, 640px);
  background: #18181b;
  border-radius: 8px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.gallery-viewer-viewport.is-dragging {
  cursor: grabbing;
}
.gallery-viewer-viewport img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
}

.gallery-pdf-viewer-card {
  max-width: min(96vw, 1100px);
  width: 100%;
  max-height: min(94vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gallery-pdf-tab-link {
  margin-left: 0.35rem;
}
.gallery-pdf-embed-wrap {
  flex: 1;
  min-height: min(70vh, 720px);
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  overflow: hidden;
  background: #52525b;
}
.gallery-pdf-embed {
  width: 100%;
  height: min(70vh, 720px);
  border: none;
}

/* Müşteri tanı formları — panel + önizleme */
.identity-static-qr-block {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 1rem;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
}
.identity-static-qr-title {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}
.identity-qr-url-line {
  word-break: break-all;
  user-select: all;
}
.identity-qr-modal-card {
  max-width: min(28rem, 96vw);
}
.identity-qr-modal-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
}
.identity-qr-modal-wrap img {
  display: block;
  max-width: 100%;
  height: auto;
}
.identity-qr-modal-url {
  margin-top: 0.75rem;
  word-break: break-all;
  user-select: all;
}
.identity-qr-modal-actions {
  margin-top: 0.75rem;
}
.identity-records-search-row {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}
.identity-records-search-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #52525b;
  flex: 1;
  min-width: 180px;
}
.identity-records-search-input {
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 1px solid #d4d4d8;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}

.identity-records-toolbar {
  margin: 0.5rem 0 0.75rem;
  align-items: center;
}
.identity-address-book-line {
  margin: 0.25rem 0 0.5rem;
  padding: 0.5rem 0.65rem;
  background: #f4f4f5;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
}
.identity-record-modal-card {
  max-width: min(56rem, 96vw);
  max-height: min(92vh, 900px);
}
.identity-record-actions {
  margin: 0.5rem 0 0.75rem;
}
.identity-record-view {
  margin-top: 0.5rem;
}
/* Önizleme: iOS QueryView.swift ile aynı sınıf yapısı (ekranda okunaklı ölçek) */
.identity-print-preview {
  overflow: auto;
  max-height: min(58vh, 560px);
  padding: 0.5rem 0.35rem;
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
}
.identity-print-preview .container {
  width: 100%;
  padding: 8px 10px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 6px;
}
.identity-print-preview .header {
  text-align: center;
  margin-bottom: 6px;
}
.identity-print-preview .header h1 {
  font-size: 15px;
  font-weight: bold;
  margin: 0;
  color: #333;
}
.identity-print-preview .images {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
  width: 100%;
}
.identity-print-preview .image-container {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 50%;
}
.identity-print-preview .image-container img {
  max-width: 100%;
  height: auto;
  display: block;
}
.identity-print-preview .image-label {
  font-size: 9px;
  margin-top: 4px;
  font-weight: 600;
  color: #555;
}
.identity-print-preview .form-container {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background-color: #fff;
}
.identity-print-preview .form-row {
  display: flex;
  margin-bottom: 5px;
  align-items: flex-start;
  min-height: 22px;
  width: 100%;
  border-bottom: 1px solid #f5f5f5;
  padding-bottom: 3px;
}
.identity-print-preview .form-label {
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 3px 10px 3px 0;
  text-align: left;
  width: 110px;
  box-sizing: border-box;
  color: #333;
  font-size: 10px;
}
.identity-print-preview .form-label::after {
  content: ":";
  margin-left: 1px;
}
.identity-print-preview .form-value {
  flex: 1;
  padding: 3px 0;
  min-height: 20px;
  display: flex;
  align-items: flex-start;
  word-break: break-word;
  color: #000;
  font-size: 10px;
}
.identity-print-preview .footer {
  margin-top: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.identity-print-preview .date-label {
  font-weight: bold;
  margin-bottom: 2px;
  font-size: 9px;
}
.identity-print-preview .date-value {
  font-weight: bold;
  text-decoration: underline;
  font-size: 11px;
}
.identity-print-preview .legal-text {
  font-size: 9px;
  color: #000;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #333;
  font-weight: bold;
  text-align: center;
  line-height: 1.25;
}
.identity-print-preview .legal-text .legal-body {
  white-space: pre-wrap;
  text-align: left;
  font-weight: normal;
  margin-top: 4px;
}
/* Düzenleme: iOS IDFormView düzeni */
.identity-edit-form-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  text-align: center;
}
.identity-record-edit-form {
  margin-top: 0.5rem;
  padding: 0.75rem 0.5rem 1rem;
  background: #f4f4f5;
  border-radius: 10px;
  border: 1px solid #e4e4e7;
}
.identity-edit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 520px) {
  .identity-edit-row {
    grid-template-columns: 1fr;
  }
}
.identity-edit-field,
.identity-edit-field-block {
  margin-bottom: 0.65rem;
}
.identity-edit-caption {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #52525b;
  margin-bottom: 0.25rem;
}
.identity-edit-input,
.identity-edit-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #d4d4d8;
  background: #fff;
  font-size: 0.9rem;
  font-weight: normal;
}
.identity-edit-textarea {
  resize: vertical;
  min-height: 5rem;
  line-height: 1.35;
}
.identity-edit-menulike {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.4rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #d4d4d8;
  background: #fafafa;
  cursor: pointer;
  font-size: 0.9rem;
}
.identity-edit-menulike input {
  margin: 0;
}
.identity-edit-form-err {
  margin-top: 0.75rem;
}
.identity-edit-field-hint {
  font-size: 0.72rem;
  font-weight: 400;
  color: #b45309;
  margin: 0.25rem 0 0;
}
.identity-edit-phone-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #d4d4d8;
  background: #fff;
  font-size: 0.9rem;
}
.identity-edit-phone-prefix {
  user-select: none;
  color: #52525b;
  font-weight: 600;
  flex-shrink: 0;
  pointer-events: none;
}
.identity-edit-phone-wrap .identity-edit-input {
  width: auto;
  flex: 1;
  min-width: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
}
