:root {
  --cream: #f2ece0;
  --cream-2: #e8dfc8;
  --gold: #b59a6d;
  --gold-dark: #9a7f52;
  --gold-soft: #f4ead8;
  --bg: #efe6d4;
  --surface: #fffdf8;
  --surface-2: #f7f3ea;
  --ink: #1a2e26;
  --muted: #6a7168;
  --ink-soft: #5c6862;
  --line: #e4d9c4;
  --line-strong: #d4c8aa;
  --navy: #1a2e26;
  --navy-2: #243a31;
  --blue: #1a2e26;
  --blue-dark: #12201b;
  --blue-soft: #eef2e8;
  --ok: #3d6b4f;
  --ok-soft: #e8f0e6;
  --warn: #c4893a;
  --warn-soft: #f6efe0;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --info: #b59a6d;
  --info-soft: #f6efe0;
  --focus: #c4b48a;
  --focus-ring: rgba(181, 154, 109, 0.28);
  --on-dark: #f2ece0;
  --on-dark-muted: rgba(242, 236, 224, 0.72);
  --shadow: 0 1px 2px rgba(26, 46, 38, 0.05), 0 8px 24px rgba(26, 46, 38, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --content: min(1520px, calc(100% - 2rem));
  --space: 1rem;
  --space-sm: 0.75rem;
  --space-lg: 1.5rem;
  --grid-gap: 1rem;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

svg.btn-icon,
svg.btn-action-icon,
svg.mi,
svg.hint-icon,
svg.flash-toast-icon,
svg.checkout-meta-icon,
.btn > svg,
.btn-action > svg,
.app-logout > svg {
  width: 1.05em;
  height: 1.05em;
  max-width: 22px;
  max-height: 22px;
  flex-shrink: 0;
  display: block;
  overflow: visible;
}

.btn-action > svg,
svg.btn-action-icon {
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
}

.app-menu-item .mi,
svg.mi {
  width: 20px;
  height: 20px;
  max-width: 24px;
  max-height: 24px;
}

html {
  overflow-x: hidden;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }

a, button, input, select, textarea, label {
  -webkit-tap-highlight-color: rgba(26, 46, 38, 0.12);
}

.muted {
  color: var(--muted);
  font-size: 0.78rem;
}

/* Top bar */
.app-top {
  background: var(--navy);
  color: var(--on-dark);
  border-bottom: 1px solid rgba(242, 236, 224, 0.12);
  padding-top: env(safe-area-inset-top, 0px);
}

.app-top-inner {
  width: var(--content);
  margin: 0 auto;
  min-height: 64px;
  padding-block: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--on-dark);
  min-width: 0;
  flex-shrink: 0;
}

.app-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: block;
  object-fit: cover;
  flex-shrink: 0;
}

.app-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.app-logo-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.app-logo-tag {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}

.app-top-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-merchant {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  padding-right: 0.75rem;
  margin-right: 0.15rem;
  border-right: 1px solid rgba(242, 236, 224, 0.18);
}

.app-merchant-label {
  color: var(--on-dark-muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.app-merchant strong {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.app-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.app-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.app-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.app-user-meta strong {
  font-size: 0.8rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-user-meta small {
  color: var(--on-dark-muted);
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(242, 236, 224, 0.22);
  color: var(--cream);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  position: relative;
  flex-shrink: 0;
}

.app-logout .btn-icon {
  width: 16px;
  height: 16px;
}

.app-logout:hover {
  color: var(--on-dark);
  border-color: var(--gold);
}

/* Menu — forest bar, cream labels, gold active underline */
.app-menu {
  background: var(--navy);
  border-bottom: 1px solid rgba(242, 236, 224, 0.08);
}

.app-menu-inner {
  width: var(--content);
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.app-menu-inner::-webkit-scrollbar { display: none; }

.app-menu-item {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-sizing: border-box;
  flex: 0 0 6.5rem;
  width: 6.5rem;
  min-width: 6.5rem;
  max-width: 6.5rem;
  height: 68px;
  padding: 0.55rem 0.4rem 0.65rem;
  color: rgba(242, 236, 224, 0.58);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
  touch-action: manipulation;
}

.app-menu-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
  transition: background-color 0.15s ease;
  pointer-events: none;
}

.app-menu-item .mi-wrap {
  width: 24px;
  height: 24px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: transparent;
  color: inherit;
  flex-shrink: 0;
}

.app-menu-item .mi {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

.app-menu-item > span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-menu-item:hover {
  color: var(--cream);
}

.app-menu-item.is-active {
  color: var(--cream);
  background: rgba(242, 236, 224, 0.1);
  border-color: transparent;
  font-weight: 500;
}

.app-menu-item.is-active::after {
  background: var(--gold);
}

.app-menu-item.is-active .mi-wrap {
  background: transparent;
  color: var(--cream);
}

.app-menu-item.is-active:hover {
  color: var(--cream);
}

/* Main */
.app-main {
  width: var(--content);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 0.85rem 0 2.5rem;
  display: grid;
  gap: var(--grid-gap);
}

.app-main > * {
  min-width: 0;
  max-width: 100%;
}

.page-head {
  margin: 0;
}

.page-head h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

/* Compatibility aliases for existing pages */
.hero { display: none; }
.bg-mesh { display: none; }
.page { all: unset; }
.topbar, .nav, .brand { display: none; }

/* Stats — equal 4-column grid aligned with content */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--grid-gap);
  margin: 0;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space) var(--space);
  min-width: 0;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.3;
}

.stat strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  word-break: break-word;
}

.stat strong.stat-money {
  font-size: 1.1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space);
  margin: 0;
  min-width: 0;
  max-width: 100%;
}

.panel + .panel { margin-top: 0; }

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
  align-items: stretch;
}

.panel-grid .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-grid .panel .actions {
  margin-top: auto;
}

.panel-grid .result-grid {
  grid-template-columns: 1fr;
}

.panel h2 {
  margin: 0 0 var(--space);
  font-size: 1rem;
  font-weight: 600;
}

.panel-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--grid-gap);
  row-gap: var(--space-sm);
  margin: 0 0 var(--space);
  padding: 0 0 var(--space);
  border-bottom: 1px solid var(--line);
  min-height: 2.5rem;
}

.panel-toolbar .status-filters {
  margin: 0;
  min-width: 0;
}

.panel-toolbar .btn {
  justify-self: end;
  align-self: center;
}

.panel-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.panel-toolbar-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

.autofill-trap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.paytr-settings-form {
  position: relative;
}

@keyframes ck-on-autofill {
  from { opacity: 0.99; }
  to { opacity: 1; }
}

.paytr-settings-form input:-webkit-autofill {
  animation-name: ck-on-autofill;
}

.secret-input {
  -webkit-text-security: disc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}

.secret-input:focus {
  -webkit-text-security: none;
  letter-spacing: normal;
}

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

.field.full { grid-column: 1 / -1; }

.field label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 0.7rem 0.85rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.segmented label {
  position: relative;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.segmented input:checked + span {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.hint {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.hint a,
.flash a,
.empty a {
  color: var(--blue);
  font-weight: 600;
}

.hint a:hover,
.flash a:hover,
.empty a:hover {
  text-decoration: underline;
}

.panel > p.hint {
  margin: -0.55rem 0 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background 0.15s ease;
  touch-action: manipulation;
}

.btn-icon {
  width: 1.05em;
  height: 1.05em;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--blue);
  color: var(--cream);
  box-shadow: 0 4px 12px rgba(26, 46, 38, 0.22);
}

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

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.btn-secondary:hover { border-color: var(--gold); }

.btn-ghost {
  background: transparent;
  color: var(--blue);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  border-radius: var(--radius);
  box-shadow: none;
}

.btn-primary.btn-sm {
  box-shadow: 0 2px 8px rgba(26, 46, 38, 0.18);
}

.flash {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.86rem;
  font-weight: 500;
}

.flash-toast {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  left: auto;
  bottom: auto;
  z-index: 10050;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  width: max-content;
  min-width: 260px;
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.9rem 1.1rem 1rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(26, 46, 38, 0.16), 0 2px 8px rgba(26, 46, 38, 0.06);
  animation: toast-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
  overflow: hidden;
}

.flash-toast-mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
}

.flash-toast-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.flash-toast-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--ink);
}

.flash-toast-close {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0 0 0 0.1rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font: inherit;
  line-height: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.flash-toast-close svg {
  width: 14px;
  height: 14px;
  display: block;
  pointer-events: none;
}

.flash-toast-close:hover {
  background: #f0eae0;
  color: #374151;
}

.flash-toast-close:active {
  background: var(--line);
  color: var(--ink);
}

.flash-toast-close:focus {
  outline: none;
}

.flash-toast-close:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.flash-toast.is-hiding {
  animation: toast-out 0.28s ease-in forwards;
  pointer-events: none;
}

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

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) translateX(12px) scale(0.98);
  }
}

.flash-success {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid #a7f3d0;
}

.flash-toast.flash-success {
  background: #fff;
  border-color: #86efac;
  color: var(--ink);
}

.flash-toast.flash-success .flash-toast-mark {
  background: var(--ok-soft);
  color: var(--ok);
}

.flash-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.flash-toast.flash-error {
  background: #fff;
  border-color: #fca5a5;
  color: var(--ink);
}

.flash-toast.flash-error .flash-toast-mark {
  background: var(--danger-soft);
  color: var(--danger);
}

.flash-info {
  background: var(--blue-soft);
  color: var(--blue-dark);
  border: 1px solid #d5ddd0;
}

.flash-toast.flash-info {
  background: #fff;
  border-color: var(--focus);
  color: var(--ink);
}

.flash-toast.flash-info .flash-toast-mark {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.flash-toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--line);
  transform-origin: left center;
  animation: toast-progress var(--toast-ms, 3500ms) linear forwards;
}

.flash-toast.flash-success .flash-toast-progress { background: #34d399; }
.flash-toast.flash-error .flash-toast-progress { background: #f87171; }
.flash-toast.flash-info .flash-toast-progress { background: var(--gold); }

@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}


.table-wrap {
  overflow-x: auto;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.table-wrap:has(.table-payments),
.table-wrap:has(.table-grid):not(.table-rates-wrap) {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th, td {
  text-align: left;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Grid tables — visible column/row lines (payments, users, …) */
.table-payments,
.table-grid {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

.table-payments col.col-payment { width: 16%; }
.table-payments col.col-customer { width: 18%; }
.table-payments col.col-user { width: 16%; }
.table-payments col.col-amount { width: 12%; }
.table-payments col.col-status { width: 10%; }
.table-payments col.col-actions { width: 28%; }

.table-users col.col-name { width: 24%; }
.table-users col.col-store { width: 18%; }
.table-users col.col-role { width: 16%; }
.table-users col.col-status { width: 12%; }
.table-users col.col-actions { width: 30%; }

.table-users .cell-stack strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1100px) {
  .table-users th,
  .table-users td {
    white-space: normal;
  }
}

.table-stores {
  table-layout: auto;
}

.table-stores th,
.table-stores td {
  white-space: normal;
}

.table-stores .row-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-grid col.col-date { width: 36%; }
.table-grid col.col-event { width: 28%; }
.table-grid col.col-ip { width: 36%; }

.table-payments th,
.table-payments td,
.table-grid th,
.table-grid td {
  padding: 0.55rem 0.75rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-top: 0;
  border-left: 0;
  vertical-align: middle;
  white-space: nowrap;
}

.table-payments td:has(.cell-stack),
.table-grid td:has(.cell-stack) {
  white-space: normal;
}

.table-payments .cell-stack,
.table-grid .cell-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  line-height: 1.35;
  min-width: 0;
}

.table-payments .cell-stack strong,
.table-grid .cell-stack strong {
  font-weight: 600;
  color: var(--ink);
}

.table-payments .cell-sub,
.table-grid .cell-sub {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-payments td:nth-child(2) .cell-sub,
.table-payments td:nth-child(3) .cell-sub {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.table-payments .cell-stack code.cell-sub,
.table-grid .cell-stack code.cell-sub {
  font-size: 0.72rem;
  color: var(--muted);
  background: transparent;
  padding: 0;
}

.table-payments th:last-child,
.table-payments td:last-child,
.table-grid th:last-child,
.table-grid td:last-child {
  border-right: 0;
}

.table-payments tbody tr:last-child td,
.table-grid tbody tr:last-child td {
  border-bottom: 0;
}

.table-payments thead th,
.table-grid thead th {
  background: #f7f3ea;
  color: var(--muted);
  font-weight: 600;
}

.table-payments tbody tr:nth-child(even) td,
.table-grid tbody tr:nth-child(even) td {
  background: #faf7f0;
}

.table-payments tbody tr:hover td,
.table-grid tbody tr:hover td {
  background: #f7f3ea;
}

.table-payments th.col-actions,
.table-payments td.col-actions,
.table-grid th.col-actions,
.table-grid td.col-actions {
  text-align: right;
  white-space: normal;
  overflow: hidden;
}

.table-payments td code,
.table-grid td code {
  white-space: nowrap;
  word-break: normal;
}

.table-payments .row-actions,
.table-grid .row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: stretch;
  gap: 0.3rem;
  max-width: 100%;
}

.table-grid .row-actions > form {
  display: contents;
}

.btn-action {
  appearance: none;
  box-sizing: border-box;
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  height: 48px;
  min-height: 48px;
  padding: 0.3rem 0.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  flex: 0 0 52px;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-action:hover {
  background: #f7f3ea;
}

.btn-action span {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.btn-action-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-action-go {
  color: var(--blue);
  border-color: #d5ddd0;
  background: var(--blue-soft);
}

.btn-action-go:hover {
  background: #e8efe6;
}

.btn-action-copy {
  color: var(--blue);
  border-color: #d5ddd0;
  background: #fff;
}

.btn-action-copy:hover {
  background: var(--blue-soft);
}

.btn-action-go.is-pft-locked,
.btn-action-copy.is-pft-locked {
  color: #92400e;
  border-color: #fde68a;
  background: #fffbeb;
}

.btn-action-go.is-pft-locked:hover,
.btn-action-copy.is-pft-locked:hover {
  background: #fef3c7;
}

.btn-action-edit {
  color: var(--blue);
  border-color: #d5ddd0;
  background: #fff;
}

.btn-action-edit:hover {
  background: var(--blue-soft);
}

.btn-action-passive {
  color: #92400e;
  border-color: #fde68a;
  background: #fffbeb;
}

.btn-action-passive:hover {
  background: #fef3c7;
}

.btn-action-active {
  color: var(--ok);
  border-color: #a7f3d0;
  background: var(--ok-soft);
}

.btn-action-active:hover {
  background: #d1fae5;
}

.btn-action-delete {
  color: var(--danger);
  border-color: #fecaca;
  background: #fff;
}

.btn-action-delete:hover {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.btn-action-refund {
  color: var(--info);
  border-color: #d5ddd0;
  background: #fff;
}

.btn-action-refund:hover {
  color: var(--cream);
  border-color: var(--info);
  background: var(--info);
}

.btn-action-dekont {
  color: #0f766e;
  border-color: #99f6e4;
  background: #fff;
}

.btn-action-dekont:hover {
  color: #fff;
  border-color: #0f766e;
  background: #0f766e;
}

.btn-action:disabled,
.btn-action-edit:disabled,
.btn-action-delete:disabled,
.btn-action-refund:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  color: var(--muted);
  border-color: var(--line);
  background: #f7f3ea;
}

.btn-action:disabled:hover,
.btn-action-edit:disabled:hover,
.btn-action-delete:disabled:hover,
.btn-action-refund:disabled:hover {
  color: var(--muted);
  border-color: var(--line);
  background: #f7f3ea;
}

.btn-action-refund.is-refund-pending {
  color: #c2410c;
  border-color: #fdba74;
  background: #fff7ed;
}

.btn-action-refund.is-refund-pending:hover {
  color: #9a3412;
  border-color: #fb923c;
  background: #ffedd5;
}

.modal.modal-wide {
  width: min(680px, 100%);
}

.modal.modal-log {
  width: min(760px, 100%);
}

.log-empty {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding: 1.35rem 0.5rem 1.1rem;
  text-align: center;
}

.log-empty p {
  margin: 0;
  color: var(--muted);
}

.log-empty-meta,
.log-summary {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.table-logs .cell-sub {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal.modal-user {
  width: min(680px, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
}

.modal.modal-user .modal-card {
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 820px);
}

.modal-user .modal-head,
.modal-user .modal-foot {
  flex-shrink: 0;
}

.modal-user .modal-body {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.link-owner-hint {
  margin: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f3ea;
}

.user-form {
  gap: 1rem 1.1rem;
}

.store-pick {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f3ea;
  overflow: visible;
}

.store-pick-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.store-pick-item:hover {
  border-color: #d5ddd0;
}

.store-pick-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.store-pick-check {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  color: transparent;
  background: #fff;
  transition: all 0.15s ease;
}

.store-pick-check svg {
  width: 12px;
  height: 12px;
}

.store-pick-body {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.store-pick-body strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.store-pick-body em {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius);
  background: #f0eae0;
  color: var(--muted);
}

.store-pick-item.is-inactive {
  opacity: 0.72;
}

.store-pick-item:has(input:checked),
.store-pick-item.is-selected {
  border-color: var(--focus);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(181, 154, 109, 0.08);
}

.store-pick-item:has(input:checked) .store-pick-check,
.store-pick-item.is-selected .store-pick-check {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--cream);
}

.role-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.role-pick-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.role-pick-item:hover {
  border-color: var(--focus);
}

.role-pick-item input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.role-pick-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #f0eae0;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.role-pick-icon svg {
  width: 18px;
  height: 18px;
}

.role-pick-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.role-pick-text strong {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.role-pick-text small {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.25;
}

.role-pick-item:has(input:checked),
.role-pick-item.is-selected {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(181, 154, 109, 0.1);
}

.role-pick-item:has(input:checked) .role-pick-icon,
.role-pick-item.is-selected .role-pick-icon {
  background: #e8efe6;
  color: var(--blue-dark);
}

.role-pick-item:has(input:checked) .role-pick-text strong,
.role-pick-item.is-selected .role-pick-text strong {
  color: var(--blue-dark);
}

.role-pick-locked {
  pointer-events: none;
}

.status-segmented {
  max-width: 280px;
}

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

.modal-detail {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.detail-block[hidden] {
  display: none !important;
}

.detail-block .link-box {
  margin: 0;
  padding: 0.75rem 0.9rem 0.85rem;
}

.detail-block h3 {
  margin: 0;
  padding: 0.55rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f7f3ea;
  border-bottom: 1px solid var(--line);
}

.detail-block .modal-detail-grid,
.detail-block .result-grid {
  margin: 0;
  padding: 0 0.9rem;
}

.modal-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5rem;
  row-gap: 0;
}

.modal-detail-grid .full {
  grid-column: 1 / -1;
}

.modal-detail-grid > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  min-width: 0;
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--line);
}

.modal-detail-grid > div[hidden] {
  display: none;
}

.modal-detail-grid > div:last-child,
.modal-detail-grid > div:nth-last-child(2):not(:has(+ .full)) {
  border-bottom: 0;
}

.detail-block .result-grid > div:last-child,
.detail-block .result-grid > div:nth-last-child(2):not(:has(+ .full)) {
  border-bottom: 0;
}

.modal-detail-grid span {
  flex: 0 0 auto;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.modal-detail-grid strong {
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.modal-link-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem 0.85rem;
}

.modal-link-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  background: #f7f3ea;
}

@media (max-width: 520px) {
  .modal-detail-grid,
  .detail-block .result-grid {
    grid-template-columns: 1fr;
  }

  .modal-detail-grid > div:nth-last-child(2):not(:has(+ .full)),
  .detail-block .result-grid > div:nth-last-child(2):not(:has(+ .full)) {
    border-bottom: 1px solid var(--line);
  }

  .modal-link-row,
  .detail-block .link-box {
    flex-wrap: wrap;
  }

  .modal-link-row input,
  .detail-block .link-box input {
    flex: 1 1 100%;
  }
}

td code,
.result-grid code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84em;
  letter-spacing: 0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-beklemede {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-odendi {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-iade {
  background: var(--info-soft);
  color: var(--info);
}

.badge-basarisiz,
.badge-iptal {
  background: var(--danger-soft);
  color: var(--danger);
}

.link-box {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-top: 0.75rem;
}

.link-box-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: stretch;
}

.link-box-actions .btn {
  white-space: nowrap;
}

.link-box input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  font: inherit;
  background: #f7f3ea;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5rem;
  row-gap: 0;
  margin-top: 0.35rem;
}

.result-grid > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  min-width: 0;
}

.result-grid > div.full {
  grid-column: 1 / -1;
}

.result-grid span { color: var(--muted); }

.result-grid strong {
  text-align: right;
  word-break: break-word;
}

.filter-row,
.status-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 var(--space);
}

.management-subnav {
  margin: 0;
}

/* Mağaza: dikey kart — ikon / başlık / sayaç */
.store-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.4rem;
  margin: 0 0 var(--space);
  padding: 0;
  background: transparent;
  border: none;
}

.store-filters a {
  display: inline-flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 5.5rem;
  min-height: 4.5rem;
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.store-filters a:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.store-filters a.is-active {
  background: #fff;
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 600;
  box-shadow: none;
}

.store-filters-icon {
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  color: inherit;
}

.store-filters-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.store-filters-name {
  display: block;
  width: 100%;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.2;
}

.store-filters .count {
  font-style: normal;
  min-width: 0;
  background: #f0eae0;
  border-radius: var(--radius);
  padding: 0.05rem 0.38rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
}

.store-filters a.is-active .store-filters-icon {
  color: var(--ink);
}

.store-filters a.is-active .count {
  background: var(--line);
  color: var(--ink);
}

/* Durum: mavi pill chip */
.filter-chip,
.status-filters a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
}

.filter-chip.is-active,
.status-filters a.is-active {
  background: var(--blue-soft);
  border-color: var(--focus);
  color: var(--blue-dark);
  font-weight: 600;
}

.filter-chip em,
.status-filters .count {
  font-style: normal;
  background: #f0eae0;
  border-radius: var(--radius);
  padding: 0.05rem 0.38rem;
  font-size: 0.7rem;
  font-weight: 600;
}

.filter-chip.is-active em,
.status-filters a.is-active .count {
  background: #e8efe6;
}

.row-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: stretch;
  gap: 0.3rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--grid-gap);
  margin: 0;
}

.chart-panel h2 {
  margin-bottom: 0.75rem;
}

.chart-wrap {
  position: relative;
  height: 220px;
}

.chart-wrap-tall {
  height: 260px;
}

.live-users-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}

.live-users-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-users-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 700;
}

.live-users-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #059669;
  font-size: 0.75rem;
  font-weight: 600;
}

.live-users-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: live-users-pulse 1.6s ease-out infinite;
}

@keyframes live-users-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.live-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.65rem;
}

.live-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f3ea;
}

.live-user.is-self {
  background: var(--blue-soft);
  border-color: #d5ddd0;
}

.live-user.is-leaving {
  opacity: 0.55;
  background: #f7f3ea;
}

.live-user.is-leaving .live-user-bars span {
  animation: none;
  opacity: 0.35;
}

.live-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.live-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.live-user-meta strong {
  font-size: 0.84rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-user-meta em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--blue-dark);
  background: #e8efe6;
  border-radius: 999px;
  padding: 0.05rem 0.38rem;
  margin-left: 0.15rem;
  vertical-align: 1px;
}

.live-user-meta small {
  color: var(--muted);
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-user-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.live-user-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}

.live-user-bars span {
  display: block;
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: #22c55e;
  transform-origin: bottom;
  animation: live-user-bar 0.85s ease-in-out infinite;
}

.live-user-bars span:nth-child(1) {
  animation-delay: 0s;
}

.live-user-bars span:nth-child(2) {
  animation-delay: 0.18s;
}

.live-user-bars span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes live-user-bar {
  0%, 100% {
    transform: scaleY(0.35);
  }
  50% {
    transform: scaleY(1);
  }
}

.live-users-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  grid-column: 1 / -1;
}

.banner-info {
  background: linear-gradient(135deg, #1a2e26, #243a31);
  color: var(--cream);
  border-radius: var(--radius);
  padding: var(--space);
  margin: 0;
  box-shadow: var(--shadow);
}

.banner-info h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.banner-info p {
  margin: 0;
  opacity: 0.92;
  font-size: 0.86rem;
  line-height: 1.45;
}

/* Auth */
.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 90% 46% at 50% -8%, rgba(26, 46, 38, 0.14), transparent 58%),
    var(--bg);
}

.auth-card {
  width: min(420px, 100%);
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card .field input {
  border-radius: 10px;
}

.auth-card .btn {
  border-radius: 12px;
  width: 100%;
}

.auth-footer {
  width: min(420px, 100%);
  margin: 0;
}

.auth-footer .app-footer-icons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  flex-wrap: unset;
  gap: 0.28rem;
  max-width: none;
}

.auth-footer .app-footer-icon {
  flex: unset;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  padding: 0.25rem 0.3rem;
}

.auth-footer .app-footer-icon img {
  max-height: 16px;
}

.auth-paytr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  width: 100%;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  text-align: center;
}

.auth-paytr img {
  display: block;
  width: auto;
  height: 20px;
  max-width: 118px;
  object-fit: contain;
}

.auth-paytr span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.auth-card .auth-brand,
.status-page .auth-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--line);
}

.auth-card .auth-brand-logo {
  display: block;
  width: auto;
  height: 36px;
  max-height: 36px;
  max-width: min(240px, 58%);
  object-fit: contain;
  object-position: left center;
  flex-shrink: 1;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.3rem 0.28rem 0.7rem;
  background: var(--blue-soft);
  border: 1px solid #d5ddd0;
  border-radius: 999px;
  flex-shrink: 0;
}

.brand-lockup-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.08rem;
  line-height: 1.1;
}

.brand-lockup-text strong {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.brand-lockup-text span {
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-lockup-mark {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(26, 46, 38, 0.18);
}

.auth-card h1 {
  margin: 0 0 1.1rem;
  font-size: 1.35rem;
}

.status-page {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem 1rem;
}

.status-page h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.status-page p {
  margin: 0;
  color: var(--muted);
  max-width: 28rem;
}

.app-footer,
.footer {
  margin: var(--space-sm) 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.app-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.app-footer-icons {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0.1rem 0 0.15rem;
}

.app-footer-icon {
  display: grid;
  place-items: center;
  flex: 1 1 0;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 0.3rem 0.25rem;
  border: 1px solid #e4d9c4;
  border-radius: var(--radius-sm);
  background: #fff;
  box-sizing: border-box;
  overflow: hidden;
}

.app-footer-icon img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 18px;
  object-fit: contain;
  object-position: center;
}

@media (max-width: 900px) {
  .app-footer-icons {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    flex-wrap: unset;
    gap: 0.28rem;
    max-width: 480px;
  }

  .app-footer-icon {
    flex: unset;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    padding: 0.25rem 0.3rem;
  }

  .app-footer-icon img {
    max-height: 16px;
  }
}

@media (max-width: 640px) {
  .app-footer-icons {
    gap: 0.25rem;
  }

  .app-footer-icon {
    height: 30px;
    min-height: 30px;
    max-height: 30px;
  }

  .app-footer-icon img {
    max-height: 14px;
  }
}

.hidden { display: none !important; }

.empty {
  padding: 2rem 1rem;
  color: var(--muted);
  text-align: center;
}

.empty strong {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.empty p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.lock-note {
  margin: 1rem 0 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.84rem;
  font-weight: 500;
}

.refund-form {
  padding: 0.85rem 0.9rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.refund-form .result-grid {
  padding: 0;
  margin: 0;
}

.refund-form .actions {
  margin-top: 0.15rem;
}

.inline-create .form-grid {
  align-items: end;
}

.inline-create .btn {
  min-height: 44px;
}

/* Modal */
.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: calc(100% - 2rem);
  width: min(520px, 100%);
}

.modal::backdrop {
  background: rgba(26, 46, 38, 0.45);
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.modal-close {
  appearance: none;
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-body {
  padding: 1.25rem;
}

.modal-confirm .modal-body p + .field {
  margin-top: 0.85rem;
}

.modal-wide .modal-body {
  max-height: min(72vh, 740px);
  overflow: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
  background: #fafafa;
}

.modal-pft-auth .modal-foot {
  flex-wrap: wrap;
}

.btn-whatsapp {
  background: #16a34a;
  border-color: #15803d;
  color: #fff;
}

.btn-whatsapp:hover {
  background: #15803d;
  color: #fff;
}

.link-box.is-pft-locked {
  flex-wrap: wrap;
}

.link-box.is-pft-locked input,
.modal-link-row.is-pft-locked input {
  color: var(--muted);
  font-style: italic;
  flex: 1 1 100%;
}

.pft-lock-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  background: #fffbeb;
  color: #92400e;
  font-size: 0.82rem;
  line-height: 1.5;
}

.panel > p.pft-lock-hint,
.detail-block .pft-lock-hint {
  margin: 0.75rem 0 0;
}

.detail-block .pft-lock-hint {
  margin: 0 0.9rem 0.9rem;
}

.pft-lock-hint .hint-icon {
  width: 16px;
  height: 16px;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.modal.modal-payment-call {
  width: min(440px, 100%);
}

.payment-call-card {
  overflow: hidden;
}

.payment-call-card [data-payment-call-open] {
  cursor: pointer;
}

.payment-call-body {
  text-align: center;
}

.payment-call-pulse {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0.15rem auto 1rem;
  display: grid;
  place-items: center;
  color: var(--ok);
}

.payment-call-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--ok-soft);
  border: 1px solid #a7f3d0;
  animation: payment-call-pulse 1.4s ease-out infinite;
}

.payment-call-icon {
  position: relative;
  z-index: 1;
}

.payment-call-lead {
  margin: 0 0 1rem;
  font-weight: 600;
  color: var(--ink);
}

.payment-call-meta {
  display: grid;
  gap: 0.65rem;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f3ea;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.payment-call-card:hover .payment-call-meta {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.payment-call-meta > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.payment-call-meta span {
  color: var(--muted);
  font-size: 0.82rem;
}

.payment-call-meta strong {
  font-size: 0.95rem;
  text-align: right;
  word-break: break-word;
}

.payment-call-foot {
  justify-content: stretch;
}

.payment-call-foot .btn {
  flex: 1;
}

.voice-preview {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f3ea;
}

.voice-preview-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.voice-preview-meta span {
  color: var(--muted);
  font-size: 0.82rem;
}

.voice-preview-meta strong {
  font-size: 0.9rem;
  text-align: right;
  word-break: break-all;
}

.voice-preview audio {
  width: 100%;
  height: 40px;
}

.voice-preview .actions form {
  margin: 0;
}

.field input[type="file"] {
  padding: 0.45rem 0.55rem;
  background: #fff;
}

@keyframes payment-call-pulse {
  0% {
    transform: scale(0.92);
    opacity: 0.95;
  }
  70% {
    transform: scale(1.12);
    opacity: 0.35;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .app-user-meta { display: none; }
  .app-merchant-label { display: none; }

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

  .chart-wrap,
  .chart-wrap-tall {
    height: 220px;
  }

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

  .panel-toolbar {
    grid-template-columns: 1fr;
  }

  .panel-toolbar .btn,
  .panel-toolbar-actions {
    justify-self: stretch;
    width: 100%;
  }

  .panel-toolbar .btn,
  .panel-toolbar-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 44px;
  }
}

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

  .panel-toolbar .btn,
  .panel-toolbar-actions {
    justify-self: stretch;
  }

  .panel-toolbar-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
  .link-box { flex-direction: column; }
  .link-box-actions {
    width: 100%;
  }
  .link-box-actions .btn {
    flex: 1;
  }
  .store-pick { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.2rem; }
  .stat {
    min-height: 76px;
    padding: 0.8rem 0.75rem;
  }
  .stat strong { font-size: 1.15rem; }
  .stat strong.stat-money { font-size: 0.95rem; }
  .panel {
    padding: var(--space-sm);
  }
}

.rates-toolbar {
  align-items: end;
}

.rates-amount-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem;
  min-width: 0;
}

.rates-amount-form label {
  display: block;
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.rates-amount-form input {
  width: 11.5rem;
  max-width: 100%;
  min-height: 38px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  font-size: 0.88rem;
}

.rates-amount-form input:focus {
  outline: 2px solid rgba(181, 154, 109, 0.28);
  outline-offset: 1px;
  border-color: var(--blue);
}

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

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

.table-rates {
  table-layout: auto;
  min-width: 920px;
}

.table-rates th,
.table-rates td {
  text-align: center;
  white-space: nowrap;
  padding: 0.55rem 0.45rem;
}

.table-rates thead th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.72rem;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.table-rates thead th:first-child,
.table-rates tbody th {
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 1;
  width: 7.5rem;
  min-width: 7.5rem;
  max-width: 7.5rem;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
  background: #f7f3ea;
  font-weight: 600;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.78rem;
}

.table-rates thead th:first-child {
  z-index: 2;
}

.table-rates tbody th {
  background: #fff;
}

.table-rates tbody tr:last-child th {
  border-bottom: 0;
}

.rate-n {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}

.rate-n-unit {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rate-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(26, 46, 38, 0.04);
}

.rate-brand img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 24px;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.rate-brand--text {
  border: 0;
  box-shadow: none;
  background: transparent;
  min-height: 0;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.table-rates tbody tr:nth-child(even) th {
  background: #faf7f0;
}

.table-rates tbody tr:hover th,
.table-rates tbody tr:hover td {
  background: #f7f3ea;
}

.rate-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
}

.rate-pct {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

.rate-money {
  display: block;
  margin-top: 0.12rem;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.rate-total {
  display: block;
  margin-top: 0.02rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.panel > p.hint.rates-legend {
  margin: 1rem 0 0;
}

.panel > p.hint.rates-intro {
  margin: 0 0 1rem;
}

@media (max-width: 960px) {
  .table-wrap.table-rates-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    border-radius: 0;
    margin-inline: 0;
  }

  .table-rates {
    min-width: 0;
    width: 100%;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
  }

  .table-rates thead {
    display: none;
  }

  .table-rates,
  .table-rates tbody {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .table-rates tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    margin: 0;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow);
  }

  .table-rates tbody th {
    grid-column: 1 / -1;
    position: static;
    z-index: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0 0 0.15rem;
    padding: 0 0 0.7rem;
    border-bottom: 1px solid var(--line);
    background: transparent;
    text-align: left;
  }

  .table-rates tbody tr:nth-child(even) th,
  .table-rates tbody tr:hover th,
  .table-rates tbody tr:hover td,
  .table-rates tbody tr:last-child th,
  .table-rates tbody tr:last-child td,
  .table-grid.table-rates tbody tr:last-child td {
    background: transparent;
    border-bottom: 0;
  }

  .table-rates tbody th .rate-brand {
    width: auto;
    min-width: 7.5rem;
    max-width: 11rem;
    min-height: 36px;
    padding: 0.3rem 0.55rem;
  }

  .table-rates tbody td.is-empty {
    display: none;
  }

  .table-rates tbody td.has-rate {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.2rem;
    min-width: 0;
    width: auto;
    max-width: none;
    padding: 0.55rem 0.6rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f7f3ea;
    text-align: left;
    white-space: normal;
  }

  .table-rates tbody td.has-rate::before {
    content: attr(data-label);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.2;
  }

  .table-rates tbody td.has-rate .rate-cell {
    align-items: flex-start;
    width: 100%;
  }

  .table-rates tbody td.has-rate .rate-pct {
    font-size: 0.92rem;
  }

  .table-rates tbody td.has-rate .rate-money {
    margin-top: 0.18rem;
    font-size: 0.8rem;
    word-break: break-word;
  }

  .table-rates tbody td.has-rate .rate-money::after {
    content: " / ay";
    font-weight: 500;
    color: var(--muted);
    font-size: 0.68rem;
  }

  .table-rates tbody td.has-rate .rate-total {
    font-size: 0.68rem;
    word-break: break-word;
  }

  .table-rates tbody td.has-rate .rate-total::before {
    content: "Toplam ";
  }
}

@media (max-width: 720px) {
  .rates-toolbar {
    grid-template-columns: 1fr;
  }

  .rates-toolbar > form {
    width: 100%;
  }

  .rates-amount-form,
  .rates-amount-form input,
  .rates-toolbar .btn {
    width: 100%;
  }

  .rates-amount-form {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .rates-amount-form .btn,
  .rates-toolbar .btn {
    min-height: 44px;
    justify-content: center;
  }

  .panel > p.hint.rates-intro {
    font-size: 0.78rem;
    line-height: 1.45;
  }
}

@media (max-width: 480px) {
  .table-rates tbody tr {
    padding: 0.75rem;
    gap: 0.4rem;
  }

  .table-rates tbody td.has-rate {
    padding: 0.5rem 0.5rem 0.55rem;
  }
}

/* ========== Mobil tutarlılık ========== */
@media (max-width: 900px) {
  .app-top-inner {
    min-height: 60px;
    padding-block: 0.65rem;
    gap: 0.55rem;
  }

  .app-merchant {
    padding-right: 0.55rem;
  }

  .app-merchant strong {
    font-size: 0.74rem;
  }

  .app-logout {
    min-height: 36px;
    padding: 0 0.7rem;
  }

  .store-filters {
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 0.85rem;
    padding-bottom: 0.15rem;
    scroll-snap-type: x proximity;
  }

  .store-filters::-webkit-scrollbar { display: none; }

  .store-filters a {
    flex: 1 0 5.25rem;
    width: auto;
    min-width: 5.25rem;
    max-width: 7.25rem;
    min-height: 4.2rem;
    padding: 0.45rem 0.4rem;
    scroll-snap-align: start;
  }

  .status-filters,
  .filter-row {
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.1rem;
  }

  .status-filters::-webkit-scrollbar,
  .filter-row::-webkit-scrollbar { display: none; }

  .status-filters a,
  .filter-chip {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 36px;
  }

  .management-subnav {
    flex-wrap: wrap;
    overflow: visible;
  }

  .management-subnav a {
    flex: 1 1 0;
    justify-content: center;
  }

  .table-wrap:has(.table-payments),
  .table-wrap:has(.table-users),
  .table-wrap:has(.table-stores),
  .table-wrap:has(.table-logs) {
    overflow: visible;
    border: 0;
    background: transparent;
    border-radius: 0;
  }

  .table-payments thead,
  .table-users thead,
  .table-stores thead,
  .table-logs thead {
    display: none;
  }

  .table-payments,
  .table-users,
  .table-stores,
  .table-logs,
  .table-payments tbody,
  .table-users tbody,
  .table-stores tbody,
  .table-logs tbody {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
  }

  .table-payments tbody,
  .table-users tbody,
  .table-stores tbody,
  .table-logs tbody {
    gap: 0.7rem;
  }

  .table-payments colgroup,
  .table-users colgroup,
  .table-logs colgroup,
  .table-payments col,
  .table-users col,
  .table-logs col {
    display: none;
  }

  .table-payments tbody tr,
  .table-users tbody tr,
  .table-stores tbody tr,
  .table-logs tbody tr {
    display: grid;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 0.35rem 0.7rem;
    margin: 0;
    padding: 0.85rem 0.9rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow);
  }

  .table-payments td,
  .table-users td,
  .table-stores td,
  .table-logs td,
  .table-payments tbody tr:nth-child(even) td,
  .table-users tbody tr:nth-child(even) td,
  .table-stores tbody tr:nth-child(even) td,
  .table-logs tbody tr:nth-child(even) td,
  .table-payments tbody tr:hover td,
  .table-users tbody tr:hover td,
  .table-stores tbody tr:hover td,
  .table-logs tbody tr:hover td {
    display: block;
    width: auto;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    white-space: normal;
  }

  .table-payments tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "payment status"
      "customer amount"
      "user user"
      "actions actions";
    align-items: start;
  }

  .table-payments td:nth-child(1) { grid-area: payment; }
  .table-payments td:nth-child(2) { grid-area: customer; }
  .table-payments td:nth-child(3) { grid-area: user; }
  .table-payments td:nth-child(4) { grid-area: amount; text-align: right; }
  .table-payments td:nth-child(4) .cell-stack { align-items: flex-end; }
  .table-payments td:nth-child(5) { grid-area: status; justify-self: end; align-self: start; }
  .table-payments .cell-stack {
    max-width: 100%;
  }
  .table-payments .cell-stack strong {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .table-payments .cell-sub {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .table-payments td code,
  .table-payments td code.cell-sub {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .table-payments td:nth-child(6),
  .table-users td:nth-child(5),
  .table-stores td:nth-child(4) {
    padding-top: 0.65rem !important;
    margin-top: 0.2rem;
    border-top: 1px solid var(--line) !important;
  }

  .table-payments td:nth-child(6) { grid-area: actions; }

  .table-payments td:nth-child(4) strong {
    font-size: 0.95rem;
  }

  .table-users tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name status"
      "store store"
      "role role"
      "actions actions";
    align-items: start;
  }

  .table-users td:nth-child(1) {
    grid-area: name;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .table-users td:nth-child(2),
  .table-users td:nth-child(3) {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem;
    color: var(--ink);
    font-size: 0.84rem;
    text-align: left;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .table-users td:nth-child(2) { grid-area: store; }
  .table-users td:nth-child(3) { grid-area: role; }
  .table-users td:nth-child(4) { grid-area: status; justify-self: end; }
  .table-users td:nth-child(5) { grid-area: actions; }

  .table-users td:nth-child(2)::before,
  .table-users td:nth-child(3)::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex: 0 0 auto;
  }

  .table-stores tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name status"
      "users users"
      "actions actions";
    align-items: start;
  }

  .table-stores td:nth-child(1) { grid-area: name; }
  .table-stores td:nth-child(2) { grid-area: users; color: var(--muted); font-size: 0.82rem; }
  .table-stores td:nth-child(2)::before { content: "Kullanıcı: "; }
  .table-stores td:nth-child(3) { grid-area: status; justify-self: end; }
  .table-stores td:nth-child(4) { grid-area: actions; }

  .table-logs tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "date event"
      "ip ip";
    align-items: center;
  }

  .table-logs td:nth-child(1) { grid-area: date; font-size: 0.82rem; }
  .table-logs td:nth-child(2) { grid-area: event; justify-self: end; }
  .table-logs td:nth-child(3) {
    grid-area: ip;
    color: var(--muted);
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .table-logs .cell-sub {
    max-width: 100%;
    white-space: normal;
  }

  .table-logs td code {
    white-space: normal;
    word-break: break-word;
  }

  .table-payments .row-actions,
  .table-users .row-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    justify-content: stretch;
    align-items: stretch;
    gap: 0.35rem;
    width: 100%;
    max-width: none;
  }

  .table-users .row-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .table-payments .row-actions > form,
  .table-users .row-actions > form,
  .table-grid .row-actions > form {
    display: block;
    min-width: 0;
  }

  .table-payments .btn-action,
  .table-users .btn-action,
  .table-grid .btn-action {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 48px;
    min-height: 48px;
    flex: unset;
    flex-basis: auto;
    padding: 0.25rem 0.1rem;
    gap: 0.15rem;
    overflow: hidden;
  }

  .table-payments .btn-action span,
  .table-users .btn-action span,
  .table-grid .btn-action span {
    display: block;
    font-size: 0.68rem;
  }

  .table-stores .row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 0.4rem;
    width: 100%;
  }

  .table-stores .row-actions > .btn,
  .table-stores .row-actions > form {
    flex: 1 1 calc(50% - 0.4rem);
    min-width: 0;
  }

  .table-stores .row-actions .btn {
    width: 100%;
    min-height: 42px;
  }

  .modal {
    width: min(520px, calc(100% - 1rem));
    max-width: calc(100% - 1rem);
    max-height: calc(100% - 1rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }

  .modal.modal-wide,
  .modal.modal-user {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
  }

  .modal.modal-wide.modal-log {
    width: min(760px, calc(100% - 1rem));
    max-width: calc(100% - 1rem);
    height: auto;
    max-height: calc(100% - 1rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    margin: auto;
  }

  .modal.modal-wide .modal-card,
  .modal.modal-user .modal-card {
    border-radius: 0;
    height: 100%;
    min-height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .modal.modal-wide.modal-log .modal-card {
    border-radius: var(--radius-lg);
    height: auto;
    min-height: 0;
    max-height: min(90dvh, 820px);
  }

  .modal-wide .modal-body,
  .modal-user .modal-body {
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .modal-user .user-form,
  .modal-user .role-pick,
  .modal-user .store-pick {
    grid-template-columns: 1fr;
  }

  .modal-user .status-segmented {
    max-width: none;
  }

  .modal-head,
  .modal-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .modal-foot {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  }

  .modal-foot .btn {
    flex: 1 1 8rem;
    min-height: 44px;
  }

  .flash-toast {
    top: calc(0.75rem + env(safe-area-inset-top, 0px));
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .app-menu-inner {
    justify-content: stretch;
  }

  .app-menu-item {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
    height: 62px;
    padding: 0.4rem 0.12rem 0.5rem;
    font-size: 0.66rem;
    letter-spacing: -0.02em;
    white-space: normal;
    gap: 0.22rem;
  }

  .app-menu-item > span:last-child {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: unset;
    line-height: 1.15;
    max-height: 2.4em;
  }

  .app-menu-item .mi,
  .app-menu-item .mi-wrap {
    width: 22px;
    height: 22px;
    max-width: 22px;
    max-height: 22px;
  }

  .inline-create .form-grid > .field {
    grid-column: 1 / -1 !important;
  }

  .inline-create .btn {
    width: 100%;
  }

  .actions {
    gap: 0.5rem;
  }

  .panel > form > .actions,
  .panel > .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .panel > form > .actions .btn,
  .panel > .actions .btn,
  .panel > form > .actions a.btn,
  .panel > .actions a.btn {
    width: 100%;
    min-height: 44px;
  }

  .voice-preview-meta,
  .payment-call-meta > div {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  :root {
    --content: calc(100% - 1.5rem);
    --space: 0.85rem;
    --space-lg: 1.1rem;
    --grid-gap: 0.75rem;
  }

  .app-main {
    padding: 1rem 0 calc(1.35rem + env(safe-area-inset-bottom, 0px));
  }

  .app-top-inner {
    min-height: 60px;
    padding-block: 0.7rem;
  }

  .app-logo-tag {
    display: block;
    font-size: 0.56rem;
    letter-spacing: 0.04em;
  }

  .app-merchant {
    display: none;
  }

  .app-logo-mark,
  .app-avatar,
  .app-logout {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    max-width: 36px;
    max-height: 36px;
  }

  .app-logout-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .app-logout {
    padding: 0;
    justify-content: center;
    overflow: hidden;
  }

  .app-logout .btn-icon {
    width: 18px;
    height: 18px;
  }

  .page-head p {
    font-size: 0.82rem;
  }

  .field input,
  .field select,
  .field textarea,
  .link-box input,
  .modal-link-row input,
  .rates-amount-form input {
    font-size: 16px;
    min-height: 44px;
  }

  .field textarea {
    min-height: 88px;
  }

  .segmented span {
    min-height: 44px;
  }

  .btn {
    min-height: 44px;
  }

  .btn-sm {
    min-height: 40px;
  }

  .auth-shell {
    justify-content: flex-start;
    padding: calc(1.15rem + env(safe-area-inset-top, 0px)) 0.9rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
  }

  .auth-card {
    padding: 1.15rem 1rem 1.25rem;
    border-radius: 16px;
  }

  .auth-card h1 {
    font-size: 1.2rem;
    margin-bottom: 0.95rem;
  }

  .auth-card .auth-brand-logo {
    height: 30px;
    max-width: min(200px, 56%);
  }

  .brand-lockup {
    gap: 0.4rem;
    padding: 0.22rem 0.24rem 0.22rem 0.58rem;
  }

  .brand-lockup-text strong {
    font-size: 0.62rem;
  }

  .brand-lockup-text span {
    font-size: 0.52rem;
  }

  .brand-lockup-mark {
    width: 24px;
    height: 24px;
    border-radius: 7px;
  }

  .status-page {
    padding: 1.25rem 0.9rem;
    min-height: 60vh;
  }
}

@media (max-width: 480px) {
  :root {
    --content: calc(100% - 1.25rem);
  }

  .app-logo-name {
    font-size: 0.82rem;
  }

  .app-menu-item {
    height: 58px;
    font-size: 0.6rem;
  }

  .table-payments tbody tr,
  .table-users tbody tr,
  .table-stores tbody tr,
  .table-logs tbody tr {
    padding: 0.75rem 0.75rem 0.7rem;
  }

  .table-payments .row-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .table-payments .btn-action {
    height: 46px;
    min-height: 46px;
  }

  .table-payments .btn-action span {
    font-size: 0.62rem;
  }

  .stat strong.stat-money {
    font-size: 0.88rem;
  }

  .modal-detail-grid > div,
  .result-grid > div {
    gap: 0.5rem;
  }
}
