/* Honey Bag — light B2B / SaaS theme */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e8ecf2;
  --border-strong: #d8dee8;
  --text: #1a2744;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: rgba(37, 99, 235, 0.08);
  --accent-ring: rgba(37, 99, 235, 0.22);
  --success: #059669;
  --success-hover: #047857;
  --success-subtle: rgba(5, 150, 105, 0.1);
  --danger: #dc2626;
  --warning: #d97706;
  --warning-subtle: rgba(217, 119, 6, 0.1);
  --whatsapp: #25d366;
  --whatsapp-hover: #1da851;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(26, 39, 68, 0.04), 0 1px 3px rgba(26, 39, 68, 0.06);
  --shadow: 0 4px 16px rgba(26, 39, 68, 0.08), 0 2px 6px rgba(26, 39, 68, 0.04);
  --shadow-lg: 0 12px 40px rgba(26, 39, 68, 0.1);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout — POS */
.pos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  gap: 1rem;
  flex-wrap: wrap;
}

.pos-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pos-header h1 span {
  color: var(--accent);
  font-weight: 600;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.customer-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.customer-field label {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.pos-header-phone-block {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
}

.pos-header-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.pos-quick-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2, #f8fafc);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.pos-quick-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

.pos-quick-link-logout {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.25);
  background: #fef2f2;
}

.customer-field input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  min-width: 180px;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.customer-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.customer-field--autocomplete {
  flex-direction: column;
  align-items: stretch;
  position: relative;
}

.customer-field--autocomplete label {
  align-self: flex-start;
}

.customer-input-wrap {
  position: relative;
  width: 100%;
}

.customer-field--autocomplete input {
  width: 100%;
  min-width: 0;
}

.cari-suggest-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 200;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.cari-suggest-dropdown li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.cari-suggest-dropdown li:last-child {
  border-bottom: none;
}

.cari-suggest-dropdown li:hover,
.cari-suggest-dropdown li.is-active {
  background: var(--accent-soft, rgba(59, 130, 246, 0.08));
}

.cari-suggest-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}

.cari-suggest-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.customer-field--autocomplete .cari-balance-hint {
  margin-top: 0.15rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.98);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2), 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2), 0 2px 8px rgba(5, 150, 105, 0.2);
}

.btn-success:hover {
  background: var(--success-hover);
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #fff;
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
}

.btn-whatsapp:hover {
  background: var(--whatsapp-hover);
}

.btn-whatsapp:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-danger-sm {
  background: transparent;
  color: var(--danger);
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.btn-danger-sm:hover {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.06);
  border-radius: 4px;
}

.btn-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}

/* Main split */
.pos-main {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: calc(100vh - 65px);
  overflow: hidden;
}

@media (max-width: 900px) {
  .pos-main {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    height: auto;
    min-height: 0;
  }
}

/* Desktop: body grid — arama + ürünler sol, sepet sağ */
@media (min-width: 901px) {
  body {
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "head head"
      "search cart"
      "prod cart";
    height: 100vh;
    overflow: hidden;
  }

  .pos-header {
    grid-area: head;
  }

  .product-search-bar {
    grid-area: search;
    align-self: start;
    margin: 0 0 0 1.25rem;
    padding-right: 0.75rem;
    z-index: 15;
  }

  .pos-main {
    display: contents;
    height: auto;
    overflow: visible;
  }

  .products-panel {
    grid-area: prod;
    min-height: 0;
    overflow-y: auto;
    border-right: 1px solid var(--border);
  }

  .cart-panel {
    grid-area: cart;
    min-height: 0;
    overflow: hidden;
  }
}

/* Products panel */
.products-panel {
  padding: 1.25rem;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.products-panel-top {
  margin-bottom: 0.75rem;
}

.products-panel-top h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.products-panel-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.product-search-bar {
  margin-bottom: 0;
  padding: 0.75rem 1rem 0.5rem;
  background: var(--bg);
}

@media (max-width: 900px) {
  .product-search-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    margin: 0;
    padding: 0.65rem 1rem 0.55rem;
    padding-top: max(0.65rem, env(safe-area-inset-top));
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(26, 39, 68, 0.1);
  }

  .product-search-bar .product-search-label {
    margin-bottom: 0.35rem;
  }

  /* Ürün listesi kaydırılırken arama hep üstte kalır */
  .products-panel {
    padding-top: 0.5rem;
  }

  .products-panel-top {
    display: none;
  }
}

.product-search-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.product-search-inner {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 52px;
}

.product-search-inner:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow);
}

.btn-product-search {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-product-search:hover {
  background: var(--accent-hover);
}

.btn-product-search:active {
  transform: scale(0.97);
}

.product-search-inner input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 0.5rem;
}

.product-search-inner input:focus {
  outline: none;
}

.product-search-inner input::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

.btn-search-clear {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin-right: 0.25rem;
  border: none;
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.btn-search-clear:hover {
  background: var(--border);
  color: var(--text);
}

.product-search-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  padding-left: 0.15rem;
}

.product-search-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .product-search-inner {
    min-height: 56px;
    box-shadow: var(--shadow);
  }

  .btn-product-search {
    width: 56px;
    height: 56px;
  }

  .product-search-inner input {
    font-size: 1.05rem;
  }
}

@media (min-width: 901px) {
  .product-search-bar {
    position: sticky;
    top: 0;
    padding-bottom: 1rem;
    background: linear-gradient(var(--bg) 85%, transparent);
  }
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-align: center;
}

.product-card:hover {
  border-color: var(--accent-ring);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.product-card:active {
  transform: translateY(0);
}

.product-card .thumb {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.product-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card .thumb .placeholder {
  font-size: 2rem;
  opacity: 0.25;
}

.product-card .name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .price {
  font-size: 0.9rem;
  color: var(--success);
  font-weight: 700;
}

.product-card .stock {
  font-size: 0.7rem;
  color: var(--success);
  font-weight: 500;
  margin-top: 0.2rem;
  opacity: 0.85;
}

/* Cart panel */
.cart-panel {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -4px 0 24px rgba(26, 39, 68, 0.04);
}

.cart-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.cart-panel-header-text {
  flex: 1;
  min-width: 0;
}

.cart-sheet-close {
  display: none;
}

.cart-panel-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.cart-panel-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1.25rem;
}

.cart-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
  font-size: 0.9rem;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.cart-row:last-child {
  border-bottom: none;
}

.cart-row .item-name {
  font-weight: 600;
}

.cart-row .qty-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cart-row .qty-controls button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}

.cart-row .qty-controls button:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.cart-row .qty-controls span {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 600;
}

.cart-row .line-total {
  font-weight: 700;
  color: var(--success);
  min-width: 4.5rem;
  text-align: right;
}

.cart-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.cart-totals {
  margin-bottom: 1rem;
}

.cart-totals .row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.cart-totals .row.grand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cart-actions .btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* Toast / notice */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  font-size: 0.9rem;
  max-width: 90vw;
  color: var(--text);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--success);
  background: var(--surface);
}

/* ========== ADMIN ========== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.admin-brand {
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.admin-brand h1 {
  font-size: 1.1rem;
}

.admin-brand p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.admin-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.admin-nav a.active {
  background: var(--accent-subtle);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.admin-nav .icon {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
}

.admin-sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.admin-content {
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-topbar h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card .value {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 0.35rem;
}

.stat-card .value.success {
  color: var(--success);
}

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

.stat-card .stat-delta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.stat-card .stat-delta.up {
  color: var(--success);
}

.stat-card .stat-delta.down {
  color: #dc2626;
}

.stat-card .stat-delta.flat {
  color: var(--text-muted);
}

.dashboard-compare-card .card-header-hint {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dashboard-compare-chart {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  min-height: 200px;
}

.dashboard-compare-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
}

.compare-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(30, 58, 95, 0.03) 0%, transparent 100%);
}

.compare-metric-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.compare-delta {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.compare-delta.up {
  color: #15803d;
  background: rgba(22, 163, 74, 0.12);
}

.compare-delta.down {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.1);
}

.compare-delta.flat {
  color: var(--text-muted);
  background: var(--bg);
}

.compare-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  height: 140px;
  padding: 0 0.5rem;
}

.compare-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 72px;
  height: 100%;
}

.compare-bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.compare-bar-fill {
  width: 100%;
  max-width: 48px;
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
  transition: height 0.45s ease;
}

.compare-bar-fill.yesterday {
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
  opacity: 0.85;
}

.compare-bar-fill.today {
  background: linear-gradient(180deg, var(--accent) 0%, #1e40af 100%);
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

.compare-bar-period {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.compare-bar-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 0.15rem;
  line-height: 1.2;
}

.dashboard-compare-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dashboard-compare-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-swatch.legend-yesterday {
  background: #94a3b8;
}

.legend-swatch.legend-today {
  background: var(--accent);
}

@media (max-width: 900px) {
  .dashboard-compare-chart {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .compare-bars {
    height: 120px;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.card-body {
  padding: 1.25rem;
}

.table-wrap {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.data-table th,
table.data-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

table.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
}

table.data-table tr:hover td {
  background: var(--accent-subtle);
}

table.data-table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-success {
  background: var(--success-subtle);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-subtle);
  color: var(--warning);
}

.badge-muted {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.form-group.full {
  grid-column: 1 / -1;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  max-width: 320px;
}

.search-bar input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.product-thumb-admin {
  width: 40px;
  height: 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.api-note {
  background: var(--accent-subtle);
  border: 1px solid var(--accent-ring);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.api-note strong {
  color: var(--text);
}

.api-note code {
  color: var(--accent);
  font-size: 0.8rem;
  background: var(--surface);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Müşteri indirimi (Honey Bag) */
.cart-totals .row.discount {
  color: #b45309;
  font-weight: 600;
}

.cart-totals .row.discount span:last-child {
  color: #059669;
  font-weight: 700;
}

.badge-honey {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #fcd34d;
}

.badge-debt {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.cari-balance-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.cari-balance-hint.has-debt {
  color: #dc2626;
  font-weight: 600;
}

.payment-status-block {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.payment-status-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.payment-select-wrap {
  position: relative;
}

.payment-select-wrap::after {
  content: "";
  position: absolute;
  right: 0.85rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.payment-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 2.25rem 0.65rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.payment-select:hover:not(:disabled) {
  border-color: var(--border-strong);
}

.payment-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.payment-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.payment-select option {
  font-weight: 500;
}

.partial-payment-wrap {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.partial-payment-wrap label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.partial-payment-input-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.partial-payment-input-row input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  box-shadow: var(--shadow-sm);
}

.partial-payment-input-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.partial-currency {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
}

.partial-payment-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.partial-payment-hint strong {
  color: var(--accent);
  font-weight: 700;
}

.badge-paid {
  background: var(--success-subtle);
  color: var(--success);
}

.cari-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.btn-whatsapp.btn-sm {
  width: auto;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.92);
  font-weight: 600;
  color: var(--text-muted);
}

.app-loading-error {
  flex-direction: column;
  padding: 1.5rem;
  text-align: center;
  line-height: 1.6;
}

.app-loading-error a {
  color: var(--accent);
}

.user-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.35rem 0.65rem;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  min-width: 5rem;
}

.user-pill-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.user-pill-role {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent, #2563eb);
}

.user-pill-admin {
  margin-top: 0.75rem;
  width: 100%;
}

.admin-topbar-user {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-header-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.25rem;
}

.stock-movement-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.stock-filter-select {
  min-width: 160px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--surface);
}

.stock-qty-input {
  width: 4.5rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
}

.stock-note-input {
  width: 100%;
  min-width: 100px;
  max-width: 180px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.stock-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  white-space: nowrap;
}

.stock-adjust-table .stock-current {
  font-weight: 700;
  font-size: 1rem;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Ürün ekleme — model + renk */
.card-product-bulk .card-body {
  padding: 1.25rem 1.5rem;
}

.product-bulk-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.product-bulk-fields .form-group input[type="text"],
.product-bulk-fields .form-group input[type="number"] {
  width: 100%;
}

.bulk-model-meta.is-custom-model {
  color: var(--accent, #2563eb);
  font-weight: 600;
}

.model-quick-picks-wrap {
  margin: 0.75rem 0 1rem;
}

.model-quick-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.model-quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.model-quick-chip {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2, #f8fafc);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.model-quick-chip:hover {
  border-color: var(--accent);
  background: var(--accent-subtle, #eff6ff);
}

.product-bulk-colors-panel {
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  padding: 1rem;
  min-height: 280px;
}

.product-bulk-colors-panel .color-picker-grid {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.color-picker-summary {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.color-picker-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.product-bulk-submit {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn-lg {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
}

.color-chip {
  position: relative;
}

.color-chip-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.color-swatch--siyah { background: #1a1a1a; }
.color-swatch--beyaz { background: #f8fafc; border-color: #cbd5e1; }
.color-swatch--krem { background: #f5f0e6; }
.color-swatch--vizon { background: #9d8b7a; }
.color-swatch--koyu-vizon { background: #6b5d52; }
.color-swatch--taba { background: #8b5a2b; }
.color-swatch--kahverengi { background: #5c4033; }
.color-swatch--bordo { background: #722f37; }
.color-swatch--sari { background: #f4d03f; }
.color-swatch--pembe { background: #f8b4c4; }
.color-swatch--leopar {
  background: linear-gradient(135deg, #c4a35a 25%, #1a1a1a 25%, #1a1a1a 50%, #c4a35a 50%, #c4a35a 75%, #1a1a1a 75%);
  background-size: 8px 8px;
}
.color-swatch--lacivert { background: #1e3a5f; }
.color-swatch--pudra { background: #e8d4d0; }
.color-swatch--haki { background: #8b8f6a; }
.color-swatch--gri { background: #94a3b8; }
.color-swatch--lila { background: #c4b5fd; }
.color-swatch--turkuaz { background: #5eead4; }
.color-swatch--fume { background: #64748b; }

@media (max-width: 900px) {
  .product-bulk-layout {
    grid-template-columns: 1fr;
  }

  .product-bulk-colors-panel .color-picker-grid {
    max-height: none;
  }
}

/* Kasa — stok satırı gizli */
.product-card .stock {
  display: none !important;
}

.color-picker-block {
  margin: 1.25rem 0;
}

.color-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.color-picker-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.color-picker-actions {
  display: flex;
  gap: 0.35rem;
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}

.color-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.55rem 0.4rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  min-height: 56px;
}

.color-chip:hover:not(:disabled) {
  border-color: var(--accent);
}

.color-chip.is-selected {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 2px var(--accent-ring);
}

.color-chip.is-exists {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--surface-2);
}

.color-chip-name {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

.color-chip-price {
  font-size: 0.68rem;
  color: var(--success);
  font-weight: 600;
}

.color-chip-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.product-edit-preview-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.product-image-preview {
  width: 140px;
  height: 140px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-preview .placeholder,
.product-thumb-emoji {
  font-size: 2.5rem;
  opacity: 0.35;
}

.product-thumb-admin {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-thumb-admin .product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.products-list-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.products-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.btn-danger-text {
  color: #dc2626;
}

.btn-danger-text:hover {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
}

.products-table .col-check {
  width: 40px;
  text-align: center;
}

.product-thumb-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: inherit;
  transition: box-shadow 0.15s, transform 0.1s;
}

.product-thumb-upload-btn:hover {
  box-shadow: 0 0 0 2px var(--accent);
}

.product-thumb-upload-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.product-thumb-admin .product-thumb-upload-btn .product-thumb-img,
.product-thumb-admin .product-thumb-upload-btn .product-thumb-emoji {
  pointer-events: none;
}

.product-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 768px) {
  .stock-note-input {
    max-width: none;
  }

  .stock-actions-cell {
    flex-direction: column;
  }

  .stock-actions-cell .btn {
    width: 100%;
  }

  .stock-adjust-table {
    min-width: 640px;
  }
}

/* ========== RESPONSIVE — mobil & tablet ========== */

/* Dokunmatik hedefler */
@media (pointer: coarse) {
  .btn,
  .btn-product-search,
  .btn-search-clear,
  .product-card,
  .admin-bottom-nav a,
  .admin-nav a {
    min-height: 44px;
  }

  .cart-row .qty-controls button {
    width: 36px;
    height: 36px;
  }
}

/* ——— Mobil mini sepet + çekmece (sadece telefon, body.pos-mobile-cart) ——— */
.cart-mobile-bar,
.cart-sheet-backdrop {
  display: none !important;
}

@media (min-width: 769px) {
  .cart-mobile-bar,
  .cart-sheet-backdrop {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.cart-sheet-open:not(.pos-mobile-cart) {
    overflow: auto !important;
  }

  .cart-panel {
    position: relative !important;
    transform: none !important;
    visibility: visible !important;
    max-height: none !important;
    width: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    border-radius: 0 !important;
  }

  .cart-sheet-close {
    display: none !important;
  }

  .cart-panel-header::before {
    display: none !important;
  }

  .products-panel {
    padding-bottom: 1.25rem !important;
  }
}

@media (max-width: 768px) {
  body.pos-mobile-cart .cart-mobile-bar {
    display: flex !important;
    align-items: center;
    gap: 0.65rem;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    margin: 0;
    padding: 0.65rem 1rem;
    padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
    border: none;
    border-top: 1px solid var(--border);
    background: var(--surface, #fff);
    box-shadow: 0 -6px 28px rgba(26, 39, 68, 0.12);
    cursor: pointer;
    font: inherit;
    text-align: left;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
  }

  body.pos-mobile-cart .cart-mobile-bar:active {
    background: var(--surface-2, #f8fafc);
  }

  body.pos-mobile-cart .cart-mobile-bar.has-items .cart-mobile-summary {
    font-weight: 700;
    color: var(--primary, #2563eb);
  }

  body.pos-mobile-cart .cart-mobile-icon {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
  }

  body.pos-mobile-cart .cart-mobile-summary {
    flex: 1;
    font-size: 0.95rem;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.pos-mobile-cart .cart-mobile-cta {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary, #2563eb);
    background: #eff6ff;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
  }

  body.pos-mobile-cart .cart-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 180;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  body.pos-mobile-cart.cart-sheet-open .cart-sheet-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.pos-mobile-cart.cart-sheet-open {
    overflow: hidden;
  }

  body.pos-mobile-cart .pos-main {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  body.pos-mobile-cart .products-panel {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
    border-right: none;
    min-height: 40vh;
  }

  body.page-kasa.pos-mobile-cart .products-panel {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }

  body.has-app-mobile-nav.pos-mobile-cart:not(.page-kasa) .products-panel {
    padding-bottom: calc(7.5rem + env(safe-area-inset-bottom));
  }

  body.pos-mobile-cart .cart-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    width: 100%;
    max-height: min(90vh, 100dvh);
    margin: 0;
    border-top: none;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -12px 40px rgba(26, 39, 68, 0.18);
    transform: translateY(105%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    visibility: hidden;
  }

  body.pos-mobile-cart.cart-sheet-open .cart-panel {
    transform: translateY(0);
    visibility: visible;
  }

  body.pos-mobile-cart.cart-sheet-open .cart-mobile-bar {
    display: none !important;
  }

  body.pos-mobile-cart .cart-sheet-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: var(--surface-2, #f1f5f9);
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
  }

  body.pos-mobile-cart .cart-panel-header::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border, #cbd5e1);
    margin: 0 auto 0.65rem;
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
  }

  body.pos-mobile-cart .cart-panel-header {
    position: relative;
    padding-top: 1.25rem;
  }

  body.pos-mobile-cart .cart-items {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.pos-mobile-cart .cart-footer {
    position: relative;
    flex-shrink: 0;
    box-shadow: none;
  }

  body.pos-mobile-cart .toast {
    bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }

  body.pos-mobile-cart.cart-sheet-open .toast {
    bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
}

/* ——— Kasa (POS) mobil ——— */
@media (max-width: 900px) {
  .pos-header {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem;
    padding-top: max(0.75rem, env(safe-area-inset-top));
    gap: 0.65rem;
  }

  .pos-header h1 {
    font-size: 1.2rem;
    text-align: center;
  }

  .header-meta {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.5rem;
  }

  .pos-header-phone-block {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.5rem;
  }

  .customer-field-phone {
    width: 100%;
  }

  .pos-header-quick-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 0.4rem;
  }

  .pos-quick-link {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
  }

  .customer-field {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.25rem;
  }

  .customer-field label {
    font-size: 0.75rem;
  }

  .customer-field input {
    min-width: 0;
    width: 100%;
    font-size: 16px; /* iOS zoom önleme */
  }

  .user-pill {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.65rem;
  }

  .product-card {
    padding: 0.55rem;
  }

  .product-card .name {
    font-size: 0.75rem;
  }

  .cart-items {
    padding: 0.5rem 1rem;
  }

  .cart-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
  }

  .cart-row .item-name {
    width: 100%;
    font-size: 0.85rem;
  }

  .cart-row .qty-controls {
    flex: 1;
  }

  .cart-row .line-total {
    font-size: 0.95rem;
  }

  .cart-row .btn-danger-sm {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cart-footer {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .cart-actions .btn-row {
    grid-template-columns: 1fr;
  }

  .cart-actions .btn-row .btn {
    min-height: 48px;
  }

  .btn-whatsapp {
    min-height: 48px;
  }

  .toast {
    bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ——— Mobil alt menü (Kasa) ——— */
.app-mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  .app-mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    z-index: 210;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(26, 39, 68, 0.12);
    padding: 0.35rem 0.5rem;
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
    justify-content: space-around;
    gap: 0.25rem;
  }

  .app-mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 0.35rem 0.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    -webkit-tap-highlight-color: transparent;
  }

  .app-mobile-nav a .nav-icon {
    font-size: 1.2rem;
    line-height: 1.2;
  }

  .app-mobile-nav a .nav-label {
    margin-top: 0.1rem;
    white-space: nowrap;
  }

  .app-mobile-nav a.active {
    color: var(--accent);
    background: var(--accent-subtle, rgba(37, 99, 235, 0.1));
  }

  .app-mobile-nav a.app-nav-logout {
    color: #b91c1c;
  }

  body.has-app-mobile-nav:not(.page-kasa) {
    padding-bottom: calc(3.75rem + env(safe-area-inset-bottom));
  }

  /* Kasa: üstte menü yok; Kasa/Admin/Çıkış altta, sepet onun üstünde */
  body.page-kasa .app-mobile-nav {
    display: none !important;
  }

  body.page-kasa.pos-mobile-cart .cart-mobile-bar {
    bottom: 0;
    z-index: 205;
  }

  body.page-kasa.pos-mobile-cart .products-panel {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }

  body.page-kasa.pos-mobile-cart .toast {
    bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }

  body.page-kasa.pos-mobile-cart.cart-sheet-open .cart-panel {
    bottom: 0;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    max-height: min(92vh, 100dvh);
  }

  body.page-kasa.pos-mobile-cart.cart-sheet-open .toast {
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  body.has-app-mobile-nav.pos-mobile-cart.cart-sheet-open .cart-panel {
    bottom: 0;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    max-height: min(92vh, 100dvh);
  }

  body.has-app-mobile-nav.pos-mobile-cart.cart-sheet-open .toast {
    bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* ——— Admin mobil ——— */
.admin-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .admin-layout {
    display: block;
    grid-template-columns: 1fr;
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom));
  }

  .admin-sidebar,
  #admin-sidebar {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .admin-content {
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top));
  }

  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 1rem;
  }

  .admin-topbar h2 {
    font-size: 1.25rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .stat-card {
    padding: 0.85rem;
  }

  .stat-card .value {
    font-size: 1.35rem;
  }

  .card-body {
    padding: 0.85rem;
  }

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

  .search-bar {
    max-width: none;
    width: 100%;
  }

  .table-wrap {
    margin: 0 -0.85rem;
    padding: 0 0.85rem;
    -webkit-overflow-scrolling: touch;
  }

  table.data-table {
    font-size: 0.8rem;
    min-width: 520px;
  }

  table.data-table th,
  table.data-table td {
    padding: 0.55rem 0.65rem;
  }

  .cari-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cari-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .admin-bottom-nav {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    max-height: none;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(26, 39, 68, 0.1);
    padding: 0.35rem 0.25rem;
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
    gap: 0.15rem;
  }

  .admin-bottom-nav-scroll {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.1rem;
    align-items: stretch;
  }

  .admin-bottom-nav-scroll::-webkit-scrollbar {
    display: none;
  }

  .admin-bottom-nav-external {
    flex: 0 0 auto;
    min-width: 52px;
    max-width: 64px;
  }

  .admin-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 52px;
    min-height: 48px;
    padding: 0.35rem 0.35rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
  }

  .admin-bottom-nav-scroll a {
    flex: 0 0 auto;
  }

  .admin-bottom-nav a.app-nav-logout {
    color: #b91c1c;
  }

  .admin-bottom-nav a .nav-icon {
    font-size: 1.15rem;
    line-height: 1.2;
  }

  .admin-bottom-nav a .nav-label {
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .admin-bottom-nav a.active {
    color: var(--accent);
    background: var(--accent-subtle);
  }

  .admin-bottom-nav a:hover {
    text-decoration: none;
  }

  .toast {
    bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-bottom-nav a .nav-label {
    font-size: 0.58rem;
  }
}

/* ——— Admin masaüstü ——— */
@media (min-width: 769px) {
  .admin-bottom-nav {
    display: none !important;
  }
}

/* ——— Geniş ekran iyileştirmeleri ——— */
@media (min-width: 1200px) {
  .admin-content {
    padding: 1.75rem 2.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* ——— Kullanıcı yönetimi ——— */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.user-mgmt-form .form-actions {
  margin-top: 1rem;
}

.form-field-checkbox {
  display: flex;
  align-items: flex-end;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.admin-topbar-hint {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  font-weight: normal;
}

.field-hint {
  font-weight: normal;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}

.card-footer.user-role-legend {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border, #e2e8f0);
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
}

.card-footer.user-role-legend p {
  margin: 0;
}

.badge-role-admin {
  background: #dbeafe;
  color: #1e40af;
}

.badge-role-root {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.badge-role-super {
  background: #fef3c7;
  color: #92400e;
}

.badge-critical {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.stat-card .value.critical {
  color: #dc2626;
}

.critical-stock-banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: var(--radius);
  color: #991b1b;
  font-size: 0.9rem;
  line-height: 1.45;
}

.critical-stock-banner[hidden] {
  display: none !important;
}

.row-stock-critical {
  background: rgba(220, 38, 38, 0.06);
}

.row-stock-critical td {
  border-color: rgba(220, 38, 38, 0.12);
}

.row-stock-low {
  background: rgba(217, 119, 6, 0.05);
}

.critical-stock-table .badge-critical {
  font-weight: 700;
}

.top-sellers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.top-sellers-col h4 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--text);
}

.top-sellers-table {
  min-width: 280px;
}

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 0.65rem 1rem;
  padding-top: max(0.65rem, env(safe-area-inset-top));
  background: #991b1b;
  color: #fff;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.offline-banner[hidden] {
  display: none !important;
}

body:has(.offline-banner:not([hidden])) {
  padding-top: 2.75rem;
}

@media (max-width: 768px) {
  .top-sellers-grid {
    grid-template-columns: 1fr;
  }
}

.badge-role-kasa {
  background: #e2e8f0;
  color: #334155;
}

.badge-muted {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.7rem;
}

.table-actions {
  white-space: nowrap;
}

.admin-layout-users-only .admin-content .admin-section {
  display: block;
}

.users-table code {
  font-size: 0.85rem;
}

.permissions-matrix {
  overflow-x: auto;
}

.permissions-table th,
.permissions-table td {
  vertical-align: middle;
}

.perm-check-cell {
  text-align: center;
  width: 6rem;
}

.perm-check-cell input {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

.perm-group-row td {
  background: var(--surface-2, #f8fafc);
  font-size: 0.8rem;
  padding-top: 0.65rem;
  padding-bottom: 0.35rem;
}

.perm-intro {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
}
