:root {
  /* Tek tema: elektrik mavisi + beyaz — güneşte/sahada yüksek kontrast.
     Bu değerler eskiden [data-theme="light"] override'ıydı, artık tek
     gerçek yüzey. --text/--muted/--ok/--warn/--danger zaten AA-doğrulanmış
     eski aydınlık tema değerleri, aynen taşındı (yeniden ölçmeye gerek yok). */
  --bg: oklch(90% 0.025 264);
  --panel: #ffffff;
  --panel-strong: #ffffff;
  /* Katman sistemi: sayfa zemini (--bg) → beyaz kart (--panel) → kart içi
     yumuşak karo (--tile) → karo içinde tekrar beyaz. Ayrım çizgiyle değil
     ton farkıyla yapılır; çizgiler sadece giriş alanları ve satır ayırıcılarda. */
  --tile: oklch(97.2% 0.012 264);
  --tile-hover: oklch(95% 0.024 264);
  --line: rgba(29, 78, 216, 0.13);
  --line-soft: rgba(29, 78, 216, 0.07);
  --line-strong: rgba(29, 78, 216, 0.24);
  --text: #1e1b4b;
  --muted: #565d6b;
  --accent: #1D4ED8;
  --accent-dark: #1E40AF;
  --accent-light: #2563EB;
  --ok: oklch(39% 0.18 152);
  --warn: oklch(40% 0.14 63);
  --danger: oklch(39% 0.22 15);
  --shadow: 0 1px 2px rgba(30, 27, 75, 0.04), 0 8px 28px rgba(29, 78, 216, 0.09);
  --shadow-sm: 0 1px 2px rgba(30, 27, 75, 0.04), 0 3px 12px rgba(29, 78, 216, 0.07);
  --hover-glow-sm: 0 4px 14px rgba(29, 78, 216, 0.18);
  --hover-glow-md: 0 6px 18px rgba(29, 78, 216, 0.22);
  --hover-glow-lg: 0 14px 32px rgba(29, 78, 216, 0.18);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

/* Sınıflara verilen display değerleri (inline-flex vb.) hidden attribute'unu
   ezmesin — topbar'daki gizli rozetler bu yüzden görünüyordu. */
[hidden] {
  display: none !important;
}

/* clip, hidden'dan farklı olarak scroll container oluşturmaz → içerideki
   position: sticky öğeler (topbar, mobil kaydet butonu) çalışmaya devam eder. */
html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(29, 78, 216, 0.16), transparent 32%),
    radial-gradient(circle at bottom right, rgba(30, 64, 175, 0.1), transparent 32%),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

#transaction-dialog,
#collection-dialog {
  backdrop-filter: blur(16px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.stack,
.detail-column,
.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* .hero artık kendi kutusu olan bir kart değil, sayfa başlığı + içerik
   sarmalayıcısı. İçindeki kartlar tek katman olarak sayfa zemininde durur
   (kart içinde kart içinde kart yerine). */
.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.operations-hero {
  display: flex;
  flex-direction: column;
}

.operations-intro {
  padding: 2px 4px 0;
}

.operations-intro h2 {
  font-size: clamp(1.35rem, 1.05rem + 1vw, 1.8rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.operations-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  gap: 18px;
  width: 100%;
  align-items: stretch;
}

.operations-intro {
  max-width: 760px;
}

.quick-entry-card,
.daily-board-card {
  min-height: 100%;
}

.quick-entry-card {
  min-width: 0;
}

.daily-board-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.daily-board-card .section-head {
  margin-bottom: 12px;
}

/* Liste kartın kalan yüksekliğini doldurur (yandaki form kadar), fazlası
   kendi içinde kayar; .scroll-list'in 340px sınırı burada geçerli değil. */
.daily-board-card #daily-operations-list {
  flex: 1 1 0;
  min-height: 420px;
  max-height: none;
}

.hero-stats,
.overview-grid,
.ledger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.stat-card,
.overview-card {
  background: var(--tile);
  border-radius: 16px;
  padding: 16px;
  border: 0;
  min-width: 0;
}

.overview-card .amount {
  font-size: 1.15rem;
  line-height: 1.3;
  margin-top: 4px;
  overflow-wrap: break-word;
  font-variant-numeric: tabular-nums;
}

.stat-card .muted,
.overview-card .muted {
  font-size: 0.82rem;
  font-weight: 600;
}

/* Operasyon ekranının iki ana kartı: sayfa zemininde duran birinci katman. */
.quick-entry-card,
.daily-board-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.period-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.period-title {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.period-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.period-line strong {
  color: var(--text);
}

/* minmax(0, 1fr): sağ sütundaki yatay kaydırmalı paneller min-content'iyle
   sol listeyi en dar haline ezmesin. */
.content-grid {
  display: grid;
  grid-template-columns: minmax(300px, 350px) minmax(0, 1fr);
  gap: 20px;
}

.left-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.customer-list-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.customer-list,
.transaction-list,
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.customer-operation-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.customer-operation-track {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 4px 12px;
  scroll-padding: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(29, 78, 216, 0.3) transparent;
}

.customer-operation-slide {
  flex: 0 0 min(100%, 780px);
  max-width: 100%;
  min-width: 0;
  height: 560px;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.customer-operation-slide .transaction-list,
.customer-operation-slide .history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.customer-operation-slide .transaction-list.empty-state,
.customer-operation-slide .history-list.empty-state {
  min-height: 0;
}

.customer-operation-track::-webkit-scrollbar {
  height: 6px;
}

.customer-operation-track::-webkit-scrollbar-thumb {
  background: rgba(29, 78, 216, 0.3);
  border-radius: 999px;
}

.customer-operation-track::-webkit-scrollbar-track {
  background: transparent;
}

.ledger-detail-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  margin-top: 18px;
}

.ledger-detail-track {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0 4px 12px;
  scroll-padding: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(29, 78, 216, 0.3) transparent;
}

.ledger-detail-slide {
  flex: 0 0 min(100%, 680px);
  max-width: 100%;
  min-width: 0;
  height: 420px;
  padding: 16px;
  border: 0;
  border-radius: 18px;
  background: var(--tile);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.ledger-detail-slide .sub-head {
  margin-top: 0;
}

.ledger-detail-slide .history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.ledger-detail-slide .history-list.empty-state {
  min-height: 0;
}

/* Yumuşak karo içindeki öğeler tekrar beyaz — ton sırası korunur. */
.ledger-detail-slide .history-item,
.ledger-detail-slide .empty-state {
  background: var(--panel);
}

.ledger-detail-track::-webkit-scrollbar {
  height: 6px;
}

.ledger-detail-track::-webkit-scrollbar-thumb {
  background: rgba(29, 78, 216, 0.3);
  border-radius: 999px;
}

.ledger-detail-track::-webkit-scrollbar-track {
  background: transparent;
}

.track-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
}

.track-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--line-strong);
  cursor: pointer;
}

/* Nokta 7px görünür ama parmakla basılabilsin diye görünmez geniş alan. */
.track-dot {
  position: relative;
}

.track-dot::after {
  content: "";
  position: absolute;
  inset: -12px -6px;
}

.track-dot:hover {
  background: rgba(29, 78, 216, 0.5);
}

.track-dot.active {
  background: var(--accent);
  transform: scale(1.25);
}

@media (hover: none) {
  .track-dot:hover {
    background: var(--line-strong);
  }
}

.customer-item,
.transaction-item,
.history-item {
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--tile);
}

.customer-item {
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out-quint), border-color 0.18s, background 0.18s, box-shadow 0.18s;
  animation: item-enter 0.22s var(--ease-out-quint) both;
  animation-delay: calc(var(--i, 0) * 30ms);
  width: 100%;
  text-align: left;
}

.customer-row-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.customer-row-main strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-row-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 3px;
}

.customer-meta-text {
  color: var(--muted);
  font-size: 0.8rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-balance {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.customer-balance--owed {
  color: var(--warn);
}

.customer-item:hover,
.customer-item.active {
  transform: translateY(-1px);
  border-color: rgba(29, 78, 216, 0.6);
  background: oklch(93% 0.05 264);
  box-shadow: var(--hover-glow-sm);
}

/* ── Customer list: satır deseni (nested card yerine) ── */
.customer-list-card .customer-item {
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.customer-list-card .customer-item:last-child {
  border-bottom: none;
}

.customer-list-card .customer-item:hover {
  background: var(--tile-hover);
  border-bottom-color: transparent;
  border-radius: 10px;
  transform: none;
  box-shadow: none;
}

.customer-list-card .customer-item.active {
  background: oklch(93% 0.05 264);
  box-shadow: none;
  border-bottom-color: transparent;
  border-radius: 10px;
  transform: none;
}

.section-head.compact {
  margin-bottom: 10px;
}

.product-picker .section-head.compact {
  align-items: center;
}

.transaction-item {
  padding: 16px;
}

.history-item {
  padding: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 1.22rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.section-head h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.005em;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: end;
}

.compact-actions {
  align-items: flex-start;
  position: relative;
}

.action-primary {
  min-width: 190px;
}

.section-head h2,
.hero h2 {
  margin: 0;
}

.sub-head {
  margin-top: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.section-hint {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}

.inline-field {
  min-width: 180px;
}

.action-field {
  min-width: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--panel);
  color: var(--text);
  transition: border-color 0.18s, box-shadow 0.18s;
}

input:hover:not(:focus):not(:disabled),
select:hover:not(:focus):not(:disabled),
textarea:hover:not(:focus):not(:disabled) {
  border-color: rgba(29, 78, 216, 0.4);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}

/* Otomatik hesaplanan toplam: düzenlenemez, sonuç gibi okunsun. */
#quick-amount,
#transaction-amount {
  background: var(--tile);
  border-color: transparent;
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

input::placeholder {
  color: var(--muted);
}

select option {
  background: #ffffff;
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 96px;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out-quint), opacity 0.18s, background 0.18s, box-shadow 0.18s, border-color 0.18s;
}

button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
.customer-item:focus-visible,
.watch-item:focus-visible,
[role="button"]:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

fieldset {
  margin: 0;
  min-width: 0;
  padding: 14px 16px 16px;
  border: 0;
  border-radius: 18px;
  background: var(--tile);
}

/* Çerçevesiz fieldset'te legend üst kenara yarı taşar; float ile normal
   akışa alınıp kutunun içinde başlık satırı olur. */
legend {
  float: left;
  padding: 0;
  line-height: 44px;
  font-weight: 800;
  color: var(--text);
}

fieldset > .section-head.compact {
  justify-content: flex-end;
  margin-bottom: 4px;
}

fieldset > .product-row-list {
  clear: both;
}

.primary {
  background: linear-gradient(180deg, #2563EB, #1D4ED8);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(30, 27, 75, 0.12), 0 6px 18px rgba(29, 78, 216, 0.26);
}

.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 4px rgba(30, 27, 75, 0.12), 0 10px 26px rgba(29, 78, 216, 0.34);
}

.danger {
  background: linear-gradient(180deg, #f43f5e, #e11d48);
  color: #fff;
}

/* Liste kartlarındaki silme butonu her kartta kırmızı bağırmasın:
   sakin kırmızı ton, üzerine gelince dolar. */
.transaction-item .danger,
.history-item .danger,
.watch-item .danger,
.catalog-brand .danger,
.catalog-product-item .danger {
  background: oklch(95.5% 0.03 15);
  color: var(--danger);
}

.transaction-item .danger:hover:not(:disabled),
.history-item .danger:hover:not(:disabled),
.watch-item .danger:hover:not(:disabled),
.catalog-brand .danger:hover:not(:disabled),
.catalog-product-item .danger:hover:not(:disabled) {
  background: linear-gradient(180deg, #f43f5e, #e11d48);
  color: #fff;
}

.ghost {
  background: rgba(29, 78, 216, 0.07);
  color: var(--accent-dark);
  border: 1px solid transparent;
}

.ghost:hover:not(:disabled) {
  background: rgba(29, 78, 216, 0.12);
  border-color: transparent;
  transform: translateY(-1px);
}

.primary:active:not(:disabled),
.ghost:active:not(:disabled),
.danger:active:not(:disabled) {
  transform: scale(0.96);
  transition-duration: 80ms;
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.pill {
  background: oklch(93% 0.05 264);
  color: oklch(40% 0.22 264);
}

.pill-closed {
  background: oklch(95% 0.05 152);
  color: var(--ok);
}

.status.pending {
  background: oklch(95% 0.05 65);
  color: var(--warn);
}

.status.due {
  background: oklch(95% 0.05 65);
  color: var(--warn);
}

.status.overdue {
  background: oklch(95% 0.04 15);
  color: var(--danger);
}

.status.scheduled {
  background: oklch(93% 0.05 264);
  color: oklch(40% 0.22 264);
}

.status.partial {
  background: oklch(95% 0.04 15);
  color: var(--danger);
}

.status.editing {
  background: oklch(93% 0.05 264);
  color: oklch(40% 0.22 264);
}

.status.delivered,
.status.closed {
  background: oklch(95% 0.05 152);
  color: var(--ok);
}

.amount {
  font-size: 1.5rem;
  font-weight: 800;
}

.meta-row,
.transaction-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
}

.transaction-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.history-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

/* Sağ üstteki durum etiketi tek satırda kalsın, sol başlık daralsın. */
.transaction-top > div,
.history-top > div {
  min-width: 0;
}

.transaction-top > .status,
.transaction-top > .pill,
.history-top > .status,
.history-top > .pill {
  flex-shrink: 0;
  white-space: nowrap;
}

.scroll-list {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 6px;
}

.customer-list-card .customer-list {
  max-height: 980px;
  overflow-y: auto;
  padding-right: 6px;
  gap: 6px;
}

.customer-toolbar {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
}

.customer-toolbar label > span {
  font-size: 0.82rem;
  color: var(--muted);
}

.customer-search-field {
  min-width: 0;
}

.customer-list-card .customer-list::-webkit-scrollbar,
.scroll-list::-webkit-scrollbar {
  width: 6px;
}

.customer-list-card .customer-list::-webkit-scrollbar-thumb,
.scroll-list::-webkit-scrollbar-thumb {
  background: rgba(29, 78, 216, 0.3);
  border-radius: 999px;
}

.customer-list-card .customer-list::-webkit-scrollbar-track,
.scroll-list::-webkit-scrollbar-track {
  background: transparent;
}

/* Segment kontrolü: tek zemin üstünde sekmeler, aktif olan beyaz yükselir. */
.history-filter-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 14px;
  background: var(--tile);
}

.history-filter-tabs .ghost {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.history-filter-tabs .ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  transform: none;
}

/* Ayarlar: her bölüm ayrı yumuşak kutu, geniş ekranda 2 sütun. */
.tools-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
}

.tools-panel > .device-isolation-notice {
  grid-column: 1 / -1;
}

.tool-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 16px;
  background: var(--tile);
}

.tool-block p {
  margin: 0 0 4px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.tool-block .ghost {
  background: var(--panel);
}

.tool-block .ghost:hover:not(:disabled) {
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 760px) {
  .tools-panel {
    grid-template-columns: 1fr;
  }
}

.tool-block h3 {
  margin: 0;
  font-size: 1rem;
}

.brand-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-logo-preview {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: var(--panel-strong);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.topbar-logo-img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 8px;
}

.recent-customers-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-customer-picker {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  border-radius: 14px;
  transition: outline 0.15s;
}

@keyframes shake-x {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  60% { transform: translateX(5px); }
  80% { transform: translateX(-3px); }
}

.quick-customer-picker.field-error input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18);
}

.quick-customer-picker.field-error {
  animation: shake-x 0.3s var(--ease-out-quint);
}

.quick-customer-picker input {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.quick-customer-open-button {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 48px;
  padding: 0 14px;
}

/* Müşteri alanı esnek, tarih sabit: seçici sıkışmasın. Kart darsa
   (ör. 1024px ekranda iki sütun yan yana) müşteri ve tarih alt alta geçer. */
.quick-entry-card {
  container-type: inline-size;
}

@container (min-width: 460px) {
  #quick-transaction-form > .two-col:first-child {
    grid-template-columns: minmax(0, 1fr) 168px;
  }
}

@container (max-width: 459px) {
  #quick-transaction-form > .two-col:first-child {
    grid-template-columns: 1fr;
  }
}

#customer-picker-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  background: #ffffff;
}

#customer-add-dialog,
#customer-editor-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  background: #ffffff;
}

#customer-add-dialog::backdrop,
#customer-editor-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

#customer-picker-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.customer-management-card {
  gap: 12px;
}

.customer-management-card .primary,
.customer-management-card .ghost {
  width: 100%;
}

.customer-picker-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(60vh, 560px);
  overflow-y: auto;
  padding: 4px;
}

.customer-picker-result {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  text-transform: uppercase;
}

.customer-picker-result:hover,
.customer-picker-result:focus-visible {
  border-color: rgba(29, 78, 216, 0.6);
  background: oklch(93% 0.05 264);
  transform: translateY(-1px) scale(1.015);
  box-shadow: var(--hover-glow-sm);
}

.customer-picker-result.active {
  border-color: rgba(29, 78, 216, 0.45);
  background: oklch(91% 0.07 264);
}

.customer-picker-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.recent-title {
  font-size: 0.82rem;
  font-weight: 700;
}

.recent-customer-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.recent-customer-chip {
  padding: 10px 12px;
  border-radius: 999px;
}

.action-menu-trigger {
  min-width: 170px;
}

.action-menu-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  width: 100%;
}

.action-menu-kicker {
  font-size: 0.74rem;
  letter-spacing: 0;
  opacity: 0.75;
}

.history-group-title {
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2563EB;
  margin-top: 4px;
  margin-bottom: 2px;
}

.history-filter-tabs .ghost.active {
  background: var(--panel);
  color: var(--accent-dark);
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(30, 27, 75, 0.08), 0 2px 8px rgba(29, 78, 216, 0.1);
}

.compact-summary-card {
  padding-top: 16px;
}

.compact-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.command-center-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-command-center {
  padding-top: 0;
}

.command-center-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.command-list-card {
  padding: 20px;
}

/* Kontrol istatistikleri sayfa zemininde duruyor → beyaz kart. Durum tonu
   çerçeveyle değil sadece değerin rengiyle verilir. */
.command-stat {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.command-stat .amount {
  margin-top: 6px;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-value--overdue {
  color: var(--danger);
}

.stat-value--warning {
  color: var(--warn);
}

.stat-value--normal {
  color: var(--text);
}

.watch-item {
  border: 0;
  border-radius: 16px;
  background: var(--tile);
  padding: 16px;
}

.watch-item strong {
  display: block;
  margin-bottom: 6px;
}

.watch-item .meta-row {
  margin-top: 8px;
}

.watch-item .action-row {
  margin-top: 12px;
}

.watch-item.overdue {
  background: oklch(97% 0.018 15);
}

.watch-item .meta-row {
  font-size: 0.88rem;
  gap: 6px 14px;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.dialog-actions {
  display: flex;
  gap: 10px;
}

.dialog-actions.stacked {
  flex-direction: column;
}

.dialog-actions button {
  width: 100%;
}

.product-picker {
  background: var(--tile);
}

.product-row-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px 12px;
  align-items: end;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.product-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.product-row > label:first-child {
  grid-column: 1 / -1;
}

.product-row .remove-product-row {
  align-self: end;
}

/* ── Hızlı işlem: gelişmiş seçenekler (katlanır) ── */
.quick-advanced-options summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 7px;
  min-height: 44px;
  font-weight: 700;
  color: var(--accent);
  padding: 6px 0;
}

.quick-advanced-options summary::-webkit-details-marker {
  display: none;
}

.quick-advanced-options summary::before {
  content: '▸';
  display: inline-block;
  font-size: 0.8em;
  transition: transform 0.2s var(--ease-out-quint);
}

.quick-advanced-options[open] summary::before {
  transform: rotate(90deg);
}

.quick-advanced-options summary .muted {
  font-size: 0.85rem;
  font-weight: 500;
}

.quick-advanced-options > .stack {
  padding-top: 12px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.nested-card {
  padding: 18px;
  border-radius: 20px;
  border: 0;
  box-shadow: none;
  background: var(--tile);
}

.catalog-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.catalog-list {
  min-height: 260px;
}

.catalog-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 0;
  background: var(--tile);
}

.catalog-product-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.catalog-product-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 0;
}

.product-row label {
  margin: 0;
}

.product-select,
.product-price,
.product-qty {
  width: 100%;
  min-width: 0;
}

.small-button {
  padding: 13px 12px;
  font-size: 0.9rem;
  min-height: 44px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.empty-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background: var(--tile);
  border-radius: 16px;
  padding: 24px 20px;
}

/* makeEmptyState() kendi .empty-state kutusunu, zaten .empty-state olan
   listenin içine basıyor → içteki ikinci çerçeve/zemin kapatılır. */
.empty-state .empty-state {
  min-height: 0;
  padding: 0;
  background: none;
  border-radius: 0;
}

.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 auto 12px;
  color: var(--accent);
  opacity: 0.6;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes item-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-title {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.empty-hint {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  max-width: 240px;
  margin: 0 auto;
}

.device-isolation-notice[hidden] {
  display: none;
}

.device-isolation-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(29, 78, 216, 0.06);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.device-isolation-notice strong {
  color: var(--text);
}

.device-isolation-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Dialogs ── */
/* Native <dialog> metin rengini miras almaz → UA varsayılanı SİYAH'a düşer
   ve koyu zeminde görünmez olur. Tüm dialog'lar --text kullansın
   (koyu temada açık, aydınlık temada koyu — ikisinde de doğru). */
dialog {
  color: var(--text);
}

dialog fieldset {
  background: oklch(97% 0.015 264);
  border-color: rgba(29, 78, 216, 0.15);
}

#transaction-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(640px, calc(100vw - 32px));
  max-height: min(92vh, calc(100svh - 2rem));
  overflow-y: auto;
  padding: 0;
  background: #ffffff;
}

#collection-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(520px, calc(100vw - 32px));
  max-height: min(92vh, calc(100svh - 2rem));
  overflow-y: auto;
  padding: 0;
  background: #ffffff;
}

#catalog-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(980px, calc(100vw - 32px));
  max-height: min(92vh, calc(100svh - 2rem));
  overflow-y: auto;
  padding: 0;
  background: #ffffff;
}

#settings-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  background: #ffffff;
}

dialog[open] {
  animation: dialog-enter 0.28s var(--ease-out-quint) both;
}

@keyframes dialog-enter {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#customer-actions-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  background: #ffffff;
}

#rollover-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(560px, calc(100vw - 32px));
  max-height: min(92vh, calc(100svh - 2rem));
  overflow-y: auto;
  padding: 0;
  background: #ffffff;
}

#rollover-collection-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(520px, calc(100vw - 32px));
  max-height: min(92vh, calc(100svh - 2rem));
  overflow-y: auto;
  padding: 0;
  background: #ffffff;
}

#islem-menu-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(400px, calc(100vw - 32px));
  max-height: min(92vh, calc(100svh - 2rem));
  overflow-y: auto;
  padding: 0;
  background: #ffffff;
}

#tahsilat-dialog {
  border: 1px solid var(--line);
  border-radius: 26px;
  width: min(480px, calc(100vw - 32px));
  max-height: min(92vh, calc(100svh - 2rem));
  overflow-y: auto;
  padding: 0;
  background: #ffffff;
}

#confirm-dialog {
  border: 1px solid var(--line);
  border-radius: 24px;
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(30, 27, 75, 0.25);
}

.confirm-dialog-form {
  gap: 10px;
}

.confirm-dialog-message {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: break-word;
}

#confirm-dialog::backdrop,
#transaction-dialog::backdrop,
#collection-dialog::backdrop,
#catalog-dialog::backdrop,
#rollover-dialog::backdrop,
#rollover-collection-dialog::backdrop,
#settings-dialog::backdrop,
#customer-actions-dialog::backdrop,
#islem-menu-dialog::backdrop,
#tahsilat-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.dialog-form {
  padding: 24px;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.12);
  color: #2563EB;
  padding: 8px 12px;
  font-weight: 700;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  width: 100%;
  border-radius: 14px;
  background: rgba(29, 78, 216, 0.10);
  border: 1px solid rgba(29, 78, 216, 0.2);
  color: #2563EB;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.92rem;
}

.quick-collect-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.quick-collect-button {
  font-weight: 700;
}

/* ── Müşteri ismi ve ürün vurgusu ── */
.cust-name,
#detail-name,
.customer-item strong,
.recent-customer-chip,
.watch-item strong {
  color: var(--accent-light);
  text-transform: uppercase;
  font-weight: 700;
}

/* .customer-picker-result kasıtlı olarak yukarıdaki grupta DEĞİL — bu seçici
   tarihsel olarak (eski [data-theme="light"] override'ı yüzünden) marka
   rengini değil düz metin rengini kullanıyordu; kendi kural bloğunda
   (yukarıda, ~satır 926) zaten text-transform/font-weight/color tanımlı. */

#detail-name {
  font-size: 1.5rem;
}

.customer-item strong {
  font-size: 1.08rem;
  font-weight: 800;
}

.prod-name {
  color: var(--accent-light);
  font-weight: 700;
}

/* ── Auth Overlay (sadece hosting modunda görünür) ── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-overlay[hidden] {
  display: none;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 15, 26, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-card {
  position: relative;
  z-index: 1;
  background: var(--surface-2, var(--panel));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
}

.auth-feedback {
  font-size: 0.88rem;
  min-height: 1.2em;
  transition: color 0.2s;
}

.auth-feedback.error { color: var(--danger); }
.auth-feedback.success { color: var(--ok); }

.app-shell.app-locked {
  pointer-events: none;
  user-select: none;
  filter: blur(3px);
  transform: scale(0.995);
  transition: filter 0.2s, transform 0.2s;
}

.small-button {
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 8px;
  height: auto;
  min-height: 44px;
}

/* ── Sekme (view) navigasyon ── */
.app-shell {
  display: block;
  grid-template-columns: none;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px 104px;
  gap: 0;
  transition: none;
}

/* ── Top Bar Handle (mobil tetikleyici) ── */
.topbar-handle {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 18px;
  z-index: 601;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
}

.topbar-handle-pill {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(29, 78, 216, 0.45);
  transition: background 0.2s;
}

.topbar-handle:hover .topbar-handle-pill,
.topbar-handle:active .topbar-handle-pill {
  background: rgba(29, 78, 216, 0.65);
}

/* ── Top Bar ── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 600;
  transform: translateY(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.topbar.open {
  transform: translateY(0);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 20px;
  padding-top: calc(13px + env(safe-area-inset-top, 0px));
}

.topbar-logo {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--accent-dark);
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-enter 0.22s var(--ease-out-quint) both;
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 4px;
}

.view-action-row .primary,
.view-action-row .ghost {
  flex: 1 1 auto;
}

.kontrol-hero {
  margin-bottom: 16px;
}

.view-kontrol .command-center-card {
  margin-bottom: 18px;
}

.view-kontrol .command-center-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.view-kontrol .card {
  margin-bottom: 16px;
}

/* ── Alt sekme çubuğu ── */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1500;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid var(--line-soft);
  box-shadow: 0 -6px 24px rgba(29, 78, 216, 0.08);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  padding: 7px 2px;
  border-radius: 14px;
  transition: color 0.15s ease, background 0.15s ease;
}

.bottom-nav-item:hover {
  background: rgba(29, 78, 216, 0.1);
  color: #2563EB;
}

.bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.bottom-nav-label {
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-size: 10.5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-nav-item.active {
  color: var(--accent);
  background: rgba(29, 78, 216, 0.08);
}

.bottom-nav-item.active .bottom-nav-label {
  font-weight: 800;
}

.bottom-nav-item.active .bottom-nav-icon {
  animation: nav-pop 0.22s var(--ease-out-quint);
}

@keyframes nav-pop {
  0% { transform: scale(0.82); }
  100% { transform: scale(1); }
}

/* ── Genel Özet tablosu ── */
.ozet-search-field {
  display: block;
  margin-bottom: 12px;
}

.ozet-table-wrap {
  border-radius: 14px;
  overflow: auto;
  max-height: 68vh;
}

.ozet-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ozet-table th,
.ozet-table td {
  padding: 11px 10px;
  vertical-align: middle;
  overflow: hidden;
}

.ozet-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--tile);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.ozet-table thead th:first-child {
  border-radius: 12px 0 0 12px;
}

.ozet-table thead th:last-child {
  border-radius: 0 12px 12px 0;
}

.ozet-table tbody tr + tr {
  border-top: 1px solid var(--line-soft);
}

.ozet-table tbody tr {
  transition: background 0.15s;
}

.ozet-table tbody tr:hover {
  background: var(--tile);
}

.ozet-col-name { width: 38%; }
.ozet-col-num  { width: 21%; }
.ozet-col-action { width: 20%; }

.ozet-table .ozet-col-name { text-align: left; }
.ozet-table .ozet-col-num  { text-align: right; }
.ozet-table .ozet-col-action { text-align: center; }

.ozet-table td.ozet-col-name {
  white-space: normal;
  overflow-wrap: anywhere;
}

.ozet-name-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase;
  text-decoration: none;
  text-underline-offset: 3px;
  cursor: pointer;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  width: 100%;
  min-height: 0;
  box-shadow: none;
}

.ozet-name-link:hover,
.ozet-name-link:focus-visible {
  color: var(--accent-dark);
  text-decoration: underline;
}

.ozet-table td.ozet-col-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

/* Her satırda dolu mavi buton tabloyu bağırtıyordu → sakin yumuşak buton. */
.ozet-islem-button,
.ozet-islem-button.primary {
  padding: 6px 8px;
  min-height: 40px;
  font-size: 0.8rem;
  line-height: 1.1;
  white-space: normal;
  text-align: center;
  width: 100%;
  border-radius: 10px;
  background: rgba(29, 78, 216, 0.08);
  color: var(--accent-dark);
  box-shadow: none;
}

.ozet-islem-button.primary:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
  transform: none;
}

.ozet-empty {
  text-align: center;
  color: var(--muted);
  padding: 18px 12px;
}

.brand-lock-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ── Responsive ── */
@media (max-width: 980px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-x: clip;
  }

  .hero,
  .card,
  .view,
  .content-grid,
  .operations-grid,
  .detail-column,
  .left-column,
  .customer-operation-panel,
  .ledger-detail-panel,
  .hero-stats,
  .overview-grid,
  .ledger-grid,
  .ozet-card,
  .ozet-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .main-content {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .stat-card,
  .period-card,
  .command-stat {
    min-width: 0;
  }

  .period-line {
    gap: 8px;
  }

  .period-line strong {
    white-space: nowrap;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
  }

  .operations-grid {
    grid-template-columns: 1fr;
  }

  .customer-operation-track {
    gap: 12px;
    padding: 0 0 12px;
  }

  .customer-operation-slide {
    flex-basis: 100%;
    height: 520px;
  }

  .ledger-detail-track {
    gap: 12px;
    padding: 0 0 12px;
  }

  .ledger-detail-slide {
    flex-basis: 100%;
    height: 380px;
  }

  .command-center-grid {
    grid-template-columns: 1fr;
  }

  .compact-actions {
    width: 100%;
    justify-content: stretch;
  }

  .action-primary,
  .action-menu-trigger {
    flex: 1 1 220px;
  }


  .recent-customer-chip {
    width: 100%;
  }

  .quick-customer-results {
    max-height: 260px;
  }

  .customer-list-card .customer-list {
    max-height: min(56vh, 460px);
  }
}

@media (max-width: 760px) {
  .view-kontrol .command-center-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px 14px 104px;
  }

  .card,
  .quick-entry-card,
  .daily-board-card,
  .customer-operation-slide {
    border-radius: 18px;
    padding: 18px 16px;
  }

  .ledger-detail-slide {
    border-radius: 16px;
    padding: 14px;
  }

  .hero {
    gap: 14px;
  }

  /* ── Telefon: tek elle kullanım ── */

  /* Uzun hızlı-işlem formunda kaydet butonu alt menünün hemen üstünde
     yapışık kalır; kaydırmadan her an basılabilir. */
  #quick-transaction-form > button[type="submit"] {
    position: sticky;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    z-index: 5;
    min-height: 52px;
    font-size: 1rem;
  }

  .history-filter-tabs {
    display: flex;
    width: 100%;
  }

  .history-filter-tabs .ghost {
    flex: 1;
    min-height: 40px;
    padding: 8px 6px;
  }

  .hero-stats,
  .overview-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Rakam karoları dar ekranda etiket solda, değer sağda satırlara dönüşür:
     daha az dikey alan, para tutarları taşmaz. */
  .ledger-grid,
  #control-center-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ledger-grid .overview-card,
  #control-center-stats .command-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
  }

  .ledger-grid .overview-card .amount,
  #control-center-stats .command-stat .amount {
    margin: 0;
    max-width: 65%;
    font-size: 1.05rem;
    text-align: right;
  }

  .ledger-grid .overview-card .muted,
  #control-center-stats .command-stat .muted {
    flex: 1 1 auto;
    min-width: 0;
  }

  .period-card {
    gap: 8px;
    padding: 14px 16px;
  }

  /* Müşteri detayındaki Gün/Haftalık/Yıl kartları alt alta tüm ekranı
     kaplıyordu → yana kaydırılan şerit; sonraki kartın ucu görünür. */
  #detail-overview {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px;
    scroll-padding: 0 16px;
  }

  #detail-overview::-webkit-scrollbar {
    display: none;
  }

  #detail-overview > .period-card {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }

  .command-list-card {
    padding: 18px 16px;
  }

  .operations-intro h2 {
    font-size: 1.2rem;
    line-height: 1.25;
  }

  .customer-operation-slide {
    height: 560px;
  }

  .customer-operation-slide .transaction-list,
  .customer-operation-slide .history-list {
    min-height: 0;
  }

  .action-row button {
    width: 100%;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions button {
    width: 100%;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .detail-column > .card > .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .detail-column > .card > .section-head .header-actions {
    width: 100%;
  }

  #detail-name {
    font-size: 1.15rem;
    line-height: 1.25;
  }

  .quick-collect-grid {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .ozet-table th,
  .ozet-table td {
    padding: 9px 6px;
    font-size: 0.86rem;
  }
}

@media (min-width: 981px) {
  .topbar-handle {
    display: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    transform: none;
    transition: none;
    border-radius: 0 0 18px 18px;
    margin-bottom: 12px;
  }

  .app-shell {
    padding-top: 16px;
    padding-bottom: 104px;
  }
}

/* ── Demo chip ── */
.demo-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  /* 9.6px'te kalın metin bile 4.5:1 AA eşiğini gerektiriyor. --accent-light
     (#2563EB) burada kendi kompozit zemine göre sadece 4.03:1 veriyordu —
     ölçülüp bulundu, var(--accent-dark) (#1E40AF) aynı zeminde 6.81:1 verir. */
  color: var(--accent-dark);
  background: rgba(29, 78, 216, 0.12);
  border: 1px solid rgba(29, 78, 216, 0.25);
  border-radius: 5px;
  padding: 2px 6px;
  vertical-align: middle;
  margin-left: 6px;
  position: relative;
  top: -1px;
}

/* ── Sync status (production/API mode only) ── */
.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.08);
}

.sync-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ok);
  flex-shrink: 0;
}

.sync-status[data-sync-state="syncing"] .sync-status-dot {
  background: var(--warn);
}

.sync-status[data-sync-state="error"] .sync-status-dot {
  background: var(--danger);
}

/* ── Demo banner ── */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: rgba(29, 78, 216, 0.06);
  border-bottom: 1px solid rgba(29, 78, 216, 0.12);
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 1;
  transition: opacity 0.25s var(--ease-out-quint);
}

.demo-banner--out {
  opacity: 0;
  pointer-events: none;
}

.demo-banner-icon {
  display: flex;
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.8;
}

.demo-banner-text {
  flex: 1;
  line-height: 1.4;
}

.demo-banner-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
  padding: 0;
}

.demo-banner-dismiss:hover {
  opacity: 1;
  background: rgba(29, 78, 216, 0.1);
}

/* ── Toast bildirimleri ── */
#toast-container {
  position: fixed;
  bottom: calc(68px + env(safe-area-inset-bottom, 0px) + 12px);
  left: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2500;
  pointer-events: none;
  max-width: 480px;
  margin: 0 auto;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  width: 100%;
  animation: toast-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.toast.toast-out {
  animation: toast-out 0.18s ease forwards;
}

.toast-icon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
  font-style: normal;
}

.toast-message {
  flex: 1;
  word-break: break-word;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.55;
  padding: 0;
  color: inherit;
  line-height: 1;
  flex-shrink: 0;
  font-family: inherit;
}

.toast-close:hover { opacity: 1; }

.toast--success {
  background: rgba(236, 253, 245, 0.97);
  border-color: rgba(16, 185, 129, 0.4);
  color: #065f46;
}

.toast--error {
  background: rgba(255, 241, 242, 0.97);
  border-color: rgba(244, 63, 94, 0.4);
  color: #9f1239;
}

.toast--warning {
  background: rgba(255, 251, 235, 0.97);
  border-color: rgba(245, 158, 11, 0.4);
  color: #92400e;
}

.toast--info {
  background: rgba(238, 242, 255, 0.97);
  border-color: rgba(29, 78, 216, 0.4);
  color: #3730a3;
}

@keyframes toast-in {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes toast-out {
  from { transform: translateY(0);   opacity: 1; }
  to   { transform: translateY(6px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .toast, .toast.toast-out { opacity: 1; transform: none !important; }
}

/* ── Touch: disable hover-only transforms ── */
@media (hover: none) {
  .primary:hover:not(:disabled),
  .customer-item:hover {
    transform: none;
  }
}

/* ── Landscape mobile: side safe-area padding ── */
@media (max-width: 980px) and (orientation: landscape) {
  .main-content {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  .bottom-nav {
    padding-left: calc(6px + env(safe-area-inset-left, 0px));
    padding-right: calc(6px + env(safe-area-inset-right, 0px));
  }
}

/* ── Masaüstü: alt menü tam genişlik şerit yerine ortada yüzen bir dock ── */
@media (min-width: 981px) {
  .bottom-nav {
    left: 50%;
    right: auto;
    bottom: 16px;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 32px));
    padding: 6px;
    border: 1px solid var(--line-soft);
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(30, 27, 75, 0.06), 0 14px 36px rgba(29, 78, 216, 0.16);
  }

  .bottom-nav-item:hover:not(.active) {
    background: rgba(29, 78, 216, 0.06);
  }
}
