:root {
  color-scheme: dark;
  --bg: #0f141b;
  --surface: #18202b;
  --surface-2: #1f2937;
  --line: #2a3442;
  --text: #e6e9ee;
  --muted: #9aa4b2;
  --accent: #4f8fe6;
  --accent-2: #e8344e;
  --ok: #3ecf8e;
  --danger: #f05252;
  --nav: #1b2a40;
  --radius: 8px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.5 'Segoe UI',
    system-ui,
    -apple-system,
    sans-serif;
  min-height: 100vh;
}
a {
  color: var(--accent);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
.loading {
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

/* ---------- role picker ---------- */
body.picker {
  background: radial-gradient(120% 70% at 50% 0%, #3a1820 0%, #1d1418 55%, #141014 100%);
}
.picker-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 48px 16px 32px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.helmet {
  align-self: center;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 70%);
  margin-bottom: 28px;
}
.picker h1 {
  text-align: center;
  font-size: 30px;
  margin: 0 0 4px;
}
.picker .sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 17px;
}
.role {
  display: grid;
  grid-template-columns: 64px 1fr 56px;
  gap: 16px;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  background: #221d24;
  border: 1.5px solid;
  border-radius: 26px;
  padding: 16px 18px;
  margin-bottom: 16px;
  transition:
    transform 0.12s ease,
    background 0.12s;
}
.role:hover,
.role:focus-visible {
  transform: translateY(-2px);
  background: #2a242c;
  outline: none;
}
.role-admin {
  border-color: #24365e;
}
.role-shop {
  border-color: #5c2232;
}
.role-courier {
  border-color: #6b5023;
}
.role-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #2c2830;
  display: grid;
  place-items: center;
}
.role-text strong {
  display: block;
  font-size: 22px;
}
.role-text small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  display: block;
}
.role-go {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: #fff;
}
.role-admin .role-go {
  background: #1747a6;
}
.role-shop .role-go {
  background: #e3264a;
}
.role-courier .role-go {
  background: #f2a516;
}

/* ---------- login ---------- */
.login {
  max-width: 400px;
  margin: 10vh auto 0;
  padding: 0 16px;
}
.login .card {
  padding: 28px;
}
.login h1 {
  font-size: 22px;
  margin: 0 0 4px;
}
.login .back {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--muted);
  text-decoration: none;
}
.login .hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
}
.code-input {
  letter-spacing: 0.5em;
  font-size: 22px;
  text-align: center;
}

/* ---------- shell ---------- */
.topbar {
  background: var(--nav);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  min-height: 48px;
  position: sticky;
  top: 0;
  z-index: 5;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-inline-end: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--accent-2);
  display: inline-block;
}
.menu-btn {
  width: 38px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}
.menu-btn:hover,
.menu-btn[aria-expanded='true'] {
  background: var(--surface-2);
}
/* three lines (☰) drawn with one bar and two shadows */
.menu-lines {
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  box-shadow:
    0 -6px 0 currentColor,
    0 6px 0 currentColor;
}
.current-tab {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.current-tab:not(:empty)::before {
  content: '/';
  margin-inline-end: 8px;
  opacity: 0.5;
}
.topbar-gap {
  flex: 1;
}
.menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-start: 12px;
  min-width: 230px;
  max-height: 70vh;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  z-index: 20;
}
.menu-panel.open {
  display: flex;
}
.tab {
  color: var(--text);
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 8px;
  white-space: nowrap;
}
.tab:hover,
.tab:focus-visible {
  background: var(--surface-2);
  outline: none;
}
.tab[aria-current='page'] {
  background: var(--surface-2);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent-2);
}
[dir='rtl'] .tab[aria-current='page'] {
  box-shadow: inset -3px 0 0 var(--accent-2);
}
.brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: block;
}
.who {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
/* Phones: brand + status/controls on top, the section tabs on their own full-width row
   (scrollable sideways), so nothing is squeezed to nothing or overlaps. */
@media (max-width: 760px) {
  .topbar {
    padding: 6px 12px 0;
    gap: 6px 8px;
  }
  .who {
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar .lang-select,
  .topbar .theme-select,
  .topbar .btn-sm {
    font-size: 12px;
  }
}
.content {
  max-width: 900px;
  margin: 16px auto;
  padding: 0 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.card h2 {
  font-size: 15px;
  margin: 0 0 12px;
  color: #c9d1dc;
}
.muted {
  color: var(--muted);
}
.note {
  color: var(--muted);
  font-size: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: start;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
td.actions {
  text-align: end;
  white-space: nowrap;
}
@media (max-width: 640px) {
  table.responsive thead {
    display: none;
  }
  table.responsive tr {
    display: block;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }
  table.responsive td {
    display: flex;
    justify-content: space-between;
    border: 0;
    padding: 4px 0;
  }
  table.responsive td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
  }
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
input,
select {
  width: 100%;
  color: var(--text);
  background: #0f141b;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
}
input:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.field {
  margin-bottom: 12px;
}

a.btn {
  text-decoration: none;
  display: inline-block;
}
.btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
}
.btn:hover {
  filter: brightness(1.15);
}
.btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn-sm {
  padding: 3px 9px;
  font-size: 13px;
}
.btn-link {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--accent);
}
.btn-danger {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--danger);
}
.btn-block {
  width: 100%;
}

.alert {
  border-radius: 6px;
  padding: 9px 12px;
  margin: 10px 0;
  font-size: 14px;
}
.alert-error {
  background: rgba(240, 82, 82, 0.12);
  color: #ff9b9b;
  border: 1px solid rgba(240, 82, 82, 0.35);
}
.alert-ok {
  background: rgba(62, 207, 142, 0.1);
  color: #8ee6bd;
  border: 1px solid rgba(62, 207, 142, 0.3);
}
.hidden {
  display: none !important;
}

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 16px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  width: min(420px, 100%);
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ---------- phase 3 ---------- */
input,
select {
  font-size: 15px;
  color: var(--text);
}
.small {
  font-size: 13px;
}
.strong {
  font-weight: 600;
}
.right {
  text-align: end;
}
.row-gap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--text);
  margin: 4px 0 12px;
}
.check input {
  width: auto;
}
.btn-ok {
  background: #1f8a5c;
  border-color: #1f8a5c;
  color: #fff;
}
.btn-lg {
  padding: 13px 16px;
  font-size: 17px;
  font-weight: 600;
  margin-top: 10px;
}
.tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
}
.tag-test {
  background: #6b4b00;
  color: #ffd27a;
}
.badge {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 10px;
  margin-inline-start: auto;
  white-space: nowrap;
}
.badge-pending_approval {
  background: #5c3b00;
  color: #ffcc66;
}
.badge-awaiting_courier {
  background: #3b2a5c;
  color: #c9b0ff;
}
.badge-assigned {
  background: #1d3a66;
  color: #9cc3ff;
}
.badge-picked_up {
  background: #12485a;
  color: #8fe0f5;
}
.badge-delivered {
  background: #174d36;
  color: #8ee6bd;
}
.badge-cancelled,
.badge-rejected {
  background: #4d1a1a;
  color: #ff9b9b;
}
.badge-late {
  outline: 1px solid var(--danger);
}
/* ---- order progress track ---- */
.track {
  --track-ok: var(--ok);
  --track-cur: var(--accent);
  --track-wait: #f5a524;
  display: flex;
  align-items: flex-start;
  margin: 12px 4px 12px;
}
.track-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: none;
  width: 92px;
  margin: 0 -26px;
  position: relative;
  z-index: 1;
}
.track-step:first-child {
  margin-inline-start: -20px;
}
.track-step:last-child {
  margin-inline-end: -20px;
}
.track-dot {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 2px solid var(--line);
}
.track-ico {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
}
.track-label {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.2;
  text-align: center;
  color: var(--muted);
}
.track-bar {
  flex: 1;
  height: 4px;
  margin-top: 16px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.track-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--track-ok), var(--track-cur));
  transition: width 0.6s ease;
}
[dir='rtl'] .track-bar i {
  background: linear-gradient(270deg, var(--track-ok), var(--track-cur));
}
.track-bar .track-fill-half {
  width: 50%;
}
.track-bar .track-fill-full {
  width: 100%;
}
.track-todo {
  opacity: 0.45;
}
.track-done .track-dot {
  border-color: var(--track-ok);
  background: color-mix(in srgb, var(--track-ok) 18%, var(--surface));
}
.track-done .track-ico {
  stroke: var(--text);
}
.track-done .track-label {
  color: var(--text);
}
.track-ok {
  position: absolute;
  top: -5px;
  inset-inline-end: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--track-ok);
  display: grid;
  place-items: center;
}
.track-ok-ico {
  width: 11px;
  height: 11px;
  stroke: #fff;
  stroke-width: 4;
}
.track-cur .track-dot,
.track-wait .track-dot,
.track-late .track-dot {
  border-color: var(--c);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 20%, transparent);
  animation: track-pulse 2s ease-in-out infinite;
}
.track-cur,
.track-wait,
.track-late,
.track-x {
  --c: var(--track-cur);
}
.track-wait {
  --c: var(--track-wait);
}
.track-late,
.track-x {
  --c: var(--danger);
}
.track-cur .track-ico,
.track-wait .track-ico,
.track-late .track-ico,
.track-x .track-ico {
  stroke: var(--c);
}
.track-cur .track-label,
.track-wait .track-label,
.track-late .track-label,
.track-x .track-label {
  color: var(--c);
  font-weight: 700;
}
.track-x .track-dot {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
}
@keyframes track-pulse {
  50% {
    box-shadow: 0 0 0 9px color-mix(in srgb, var(--c) 8%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .track-dot {
    animation: none !important;
  }
  .track-bar i {
    transition: none;
  }
}
@media (max-width: 560px) {
  .track-step {
    width: 72px;
    margin: 0 -18px;
  }
  .track-step:first-child {
    margin-inline-start: -16px;
  }
  .track-step:last-child {
    margin-inline-end: -16px;
  }
  /* Only the step the order is at keeps its name on a phone. */
  .track-done .track-label,
  .track-todo .track-label {
    visibility: hidden;
  }
}
.order-list {
  display: grid;
  gap: 10px;
}
.order,
.delivery {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #151c26;
  margin-bottom: 10px;
}
.order-late {
  border-color: rgba(240, 82, 82, 0.6);
}
.order-test {
  border-style: dashed;
}
.order-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.order-body {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.order-meta {
  margin-top: 6px;
}
.order-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  align-items: center;
}
.order-actions select {
  width: auto;
  min-width: 180px;
  padding: 4px 8px;
  font-size: 13px;
}
.courier-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.free {
  color: var(--ok);
}
.busy {
  color: #f5a524;
}
.off {
  color: var(--muted);
}
.courier-off {
  opacity: 0.6;
}
.courier-asking {
  border: 1px solid #f5a524;
  border-radius: 8px;
  padding: 8px 10px;
  background: color-mix(in srgb, #f5a524 10%, transparent);
  animation: ask-pulse 1.6s ease-in-out infinite;
}
@keyframes ask-pulse {
  50% {
    box-shadow: 0 0 0 4px color-mix(in srgb, #f5a524 25%, transparent);
  }
}
.ask {
  color: #f5a524;
  font-weight: 600;
  margin-top: 4px;
}
.ask-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
/* courier app: shift box */
.shift {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.shift-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  flex: 1 1 200px;
}
.shift-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  background: var(--ok);
}
.shift-wait {
  border-color: #f5a524;
}
.shift-wait .shift-dot {
  background: #f5a524;
}
.shift-off .shift-dot {
  background: var(--muted);
}
.shift-note {
  flex-basis: 100%;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
}
@media (prefers-reduced-motion: reduce) {
  .courier-asking {
    animation: none;
  }
}
.card-alert {
  border-color: #8a6100;
  box-shadow: 0 0 0 1px #8a6100 inset;
}
.thumb {
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  margin-top: 4px;
  display: block;
}
td select {
  width: auto;
  padding: 4px 8px;
  font-size: 13px;
}
.modal h2 {
  font-size: 16px;
  margin: 0 0 12px;
}
.modal input {
  margin-top: 8px;
}

/* courier app */
.area-kurye .content {
  max-width: 520px;
}
.stop {
  border-inline-start: 3px solid var(--line);
  padding-block: 2px;
  padding-inline: 10px 0;
  margin: 10px 0;
  display: grid;
  gap: 3px;
  justify-items: start;
}
.stop-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.collect {
  margin: 10px 0 4px;
  padding: 10px;
  border-radius: 6px;
  background: rgba(245, 165, 36, 0.12);
  color: #ffc46b;
  font-weight: 600;
}
.collect-paid {
  background: rgba(62, 207, 142, 0.1);
  color: #8ee6bd;
  font-weight: 500;
}

/* ---------- phase 4 ---------- */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.summary-grid > .card {
  margin-bottom: 14px;
}
@media (max-width: 760px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}
.caps {
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  margin-bottom: 8px;
}
.stats-sm {
  margin-top: 12px;
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
}
.stat-value {
  font-size: 24px;
  font-weight: 600;
}
.stat-value small {
  font-size: 12px;
  font-weight: 600;
}
.stats-sm .stat-value {
  font-size: 20px;
}
.pill {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
}
.pill-ok {
  background: rgba(62, 207, 142, 0.12);
  color: #8ee6bd;
}
.pill-bad {
  background: rgba(240, 82, 82, 0.12);
  color: #ff9b9b;
}
.period {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-inline-end: auto;
}
.period select {
  width: auto;
}
.toolbar {
  gap: 8px;
}
.neg {
  color: #ffc46b;
}
.field.inline {
  margin: 0;
}
.field.inline input {
  width: auto;
}
@media print {
  .topbar,
  .no-print,
  .toolbar {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card {
    background: #fff;
    border-color: #ccc;
    break-inside: avoid;
  }
  .muted,
  .note,
  th,
  .stat-label {
    color: #444;
  }
}
.btn-icon {
  padding: 4px 8px;
  line-height: 0;
  color: var(--accent);
  background: transparent;
}
.btn-icon[aria-pressed='true'] {
  color: #ffc46b;
  border-color: #8a6100;
}
.idnum.revealed {
  color: #ffc46b;
  font-variant-numeric: tabular-nums;
}
.nowrap {
  white-space: nowrap;
}
td.warn {
  color: #ffc46b;
}
table.audit td {
  font-size: 14px;
}

/* ---------- phase 5 ---------- */
.sound-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 30;
  background: #5c3b00;
  color: #ffd27a;
  border: 1px solid #8a6100;
  border-radius: 22px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  max-width: calc(100% - 32px);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
  display: inline-block;
}
.live-dot.on {
  background: var(--ok);
}
.live-dot.reconnecting {
  background: #f5a524;
}
.order-escalated {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger) inset;
}
.wait {
  color: #ff9b9b;
  font-weight: 600;
}
.keybox {
  font-family: ui-monospace, Consolas, monospace;
  background: #0f141b;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  word-break: break-all;
}
.keybox-new {
  border-color: #8a6100;
  color: #ffd27a;
}
pre.code {
  font:
    12.5px/1.5 ui-monospace,
    Consolas,
    monospace;
  background: #0f141b;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  white-space: pre;
  color: #c9d1dc;
}
.grow {
  flex: 1;
  min-width: 0;
}
.mt {
  margin-top: 12px;
}

.tag-repeat {
  background: rgba(62, 207, 142, 0.15);
  color: var(--ok);
}

/* ---------- theme selector + light theme ---------- */
.theme-select,
.lang-select {
  width: auto;
  padding: 4px 6px;
  font-size: 13px;
  min-height: 0;
}
.login-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.login-top .back {
  margin-bottom: 0;
}
.theme-corner {
  position: fixed;
  top: 12px;
  inset-inline-end: 12px;
  display: flex;
  gap: 6px;
}
.login-controls {
  display: flex;
  gap: 6px;
}

/* ---------- right-to-left (العربية) ---------- */
/* Phone numbers, codes and maps stay left-to-right. */
[dir='rtl'] input[type='tel'],
[dir='rtl'] input[inputmode='numeric'],
[dir='rtl'] .map-box {
  direction: ltr;
}
[dir='rtl'] input[type='tel'],
[dir='rtl'] input[inputmode='numeric'] {
  text-align: right;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --line: #d8dde5;
  --text: #18202c;
  --muted: #5b6676;
  --accent: #2563c9;
  --accent-2: #d42a44;
  --ok: #13804f;
  --danger: #c93333;
  --nav: #ffffff;
}
:root[data-theme='light'] .topbar {
  border-bottom: 1px solid var(--line);
}
:root[data-theme='light'] body.picker {
  background: radial-gradient(120% 70% at 50% 0%, #fde7ea 0%, #f7eef0 55%, #f3f5f8 100%);
}
:root[data-theme='light'] .helmet {
  background: radial-gradient(circle, rgba(226, 59, 46, 0.12), rgba(226, 59, 46, 0) 70%);
}
:root[data-theme='light'] .role {
  background: #ffffff;
}
:root[data-theme='light'] .role:hover,
:root[data-theme='light'] .role:focus-visible {
  background: #f7f8fa;
}
:root[data-theme='light'] .role-icon {
  background: #f1eef2;
}
:root[data-theme='light'] .card h2 {
  color: #2b3442;
}
:root[data-theme='light'] input,
:root[data-theme='light'] select,
:root[data-theme='light'] .keybox,
:root[data-theme='light'] pre.code {
  background: #f8f9fb;
  color: var(--text);
}
:root[data-theme='light'] .order,
:root[data-theme='light'] .delivery {
  background: #ffffff;
}
:root[data-theme='light'] .modal-back {
  background: rgba(20, 28, 40, 0.35);
}
:root[data-theme='light'] .alert-error,
:root[data-theme='light'] .pill-bad,
:root[data-theme='light'] .wait {
  color: #b42323;
}
:root[data-theme='light'] .alert-ok,
:root[data-theme='light'] .pill-ok,
:root[data-theme='light'] .collect-paid,
:root[data-theme='light'] .tag-repeat {
  color: #0f6b42;
}
:root[data-theme='light'] .collect,
:root[data-theme='light'] .neg,
:root[data-theme='light'] td.warn,
:root[data-theme='light'] .idnum.revealed,
:root[data-theme='light'] .btn-icon[aria-pressed='true'],
:root[data-theme='light'] .busy {
  color: #9a5b00;
}
:root[data-theme='light'] .tag-test,
:root[data-theme='light'] .sound-bar,
:root[data-theme='light'] .keybox-new,
:root[data-theme='light'] .badge-pending_approval {
  background: #fff1d6;
  color: #7a4a00;
}
:root[data-theme='light'] .sound-bar {
  border-color: #e3b45c;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
:root[data-theme='light'] .badge-awaiting_courier {
  background: #ece5fb;
  color: #4f2f9a;
}
:root[data-theme='light'] .badge-assigned {
  background: #e1ecfd;
  color: #1d4f9e;
}
:root[data-theme='light'] .badge-picked_up {
  background: #def3f8;
  color: #0d5b6e;
}
:root[data-theme='light'] .badge-delivered {
  background: #dcf3e7;
  color: #11683f;
}
:root[data-theme='light'] .badge-cancelled,
:root[data-theme='light'] .badge-rejected {
  background: #fde2e2;
  color: #9b1c1c;
}

/* courier location sharing line */
.tracker {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: var(--surface-2);
  color: var(--muted);
}
.tracker-on {
  color: var(--ok);
}
.tracker-denied,
.tracker-error,
.tracker-unsupported {
  color: #f5a524;
}
:root[data-theme='light'] .tracker-denied,
:root[data-theme='light'] .tracker-error,
:root[data-theme='light'] .tracker-unsupported {
  color: #9a5b00;
}

/* dispatch map */
.map-box-sm {
  height: 260px !important;
}
.map-box {
  height: 360px;
  border-radius: 8px;
  overflow: hidden;
  /* Leaflet's panes use z-index 400+; keep them inside the box so the sticky top bar and the
     ☰ menu stay above the map when scrolling. */
  position: relative;
  z-index: 0;
  isolation: isolate;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  background: var(--surface-2);
}
@media (max-width: 640px) {
  .map-box {
    height: 280px;
  }
}
.map-shop {
  background: #e23b2e;
  border: 2px solid #fff;
  border-radius: 3px;
}
.leaflet-tooltip.map-label {
  font-size: 12px;
  padding: 2px 6px;
}

/* restaurant form: returning customer */
.known-customer {
  margin: -4px 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--ok) 50%, var(--line));
  background: color-mix(in srgb, var(--ok) 10%, transparent);
  color: var(--ok);
}
.addr-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.addr {
  text-align: start;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.addr.on {
  border-color: var(--ok);
}
.distance-box {
  margin: 4px 0 8px 26px;
}
[dir='rtl'] .distance-box {
  margin: 4px 26px 8px 0;
}

/* ---- top bar: bell + user menu (owner's choice, option 3) ---- */
.ico {
  width: 20px;
  height: 20px;
  flex: none;
}
.ib {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.ib:hover {
  border-color: var(--muted);
}
.ib-off {
  color: var(--muted);
}
.user-wrap {
  position: relative;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #f0503e, #b81e28);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.avatar:focus-visible,
.ib:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: 250px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  padding: 6px;
  z-index: 50;
}
.user-menu.open {
  display: block;
}
.um-head {
  display: flex;
  flex-direction: column;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.um-head span {
  color: var(--muted);
  font-size: 12px;
}
.um-row,
.um-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: start;
}
.um-row .ico {
  color: var(--muted);
}
.um-row:hover,
.um-choice:hover,
.um-row.expanded {
  background: var(--surface-2);
}
.um-val {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 13px;
}
.um-chev {
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}
[dir='rtl'] .um-chev {
  transform: scaleX(-1);
}
.um-row.expanded .um-chev {
  transform: rotate(90deg);
}
.um-choices {
  padding: 2px 0 4px 30px;
}
[dir='rtl'] .um-choices {
  padding: 2px 30px 4px 0;
}
.um-choice {
  padding: 7px 10px;
  font-size: 13px;
}
.um-choice .ico {
  margin-inline-start: auto;
  width: 16px;
  height: 16px;
  color: var(--accent-2);
}
.um-choice.on {
  font-weight: 700;
}
.um-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 6px;
}
.um-row.danger,
.um-row.danger .ico {
  color: var(--danger);
}
@media (max-width: 640px) {
  .topbar .who {
    display: none;
  }
  /* Phones: the menu opens full width under the top bar, never off screen. */
  .user-menu {
    position: fixed;
    top: auto;
    margin-top: 8px;
    inset-inline: 12px;
    width: auto;
  }
}

/* ---- phones: one-line top bar (logo, section, bell, initials) ---- */
@media (max-width: 640px) {
  .topbar {
    flex-wrap: nowrap;
    padding: 8px 12px;
  }
  .topbar .brand-text {
    display: none;
  }
  .current-tab {
    min-width: 0;
    flex: 0 1 auto;
    color: var(--text);
    font-weight: 800;
  }
  .current-tab:not(:empty)::before {
    content: none;
  }
}

/* ---- courier app: delivery card (owner's choice: design 1 + slide to deliver) ---- */
.cd-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.08);
}
.cd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border-bottom: 1px solid var(--line);
}
.cd-late .cd-head {
  background: color-mix(in srgb, #f59e0b 14%, var(--surface));
}
.cd-no {
  font-size: 20px;
  font-weight: 800;
}
.cd-due {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}
.cd-late .cd-due {
  color: #d97706;
}
.cd-status {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  white-space: nowrap;
}
.cd-steps {
  padding: 12px 16px 2px;
}
.cd-bars {
  display: flex;
  gap: 6px;
}
.cd-bars span {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.cd-bars .on {
  background: var(--ok);
}
.cd-bars .cur {
  background: #f59e0b;
}
.cd-step-names {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.cd-step-names .cur {
  color: #d97706;
  font-weight: 700;
}
.cd-route {
  padding: 8px 16px 2px;
}
.cd-stop {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}
.cd-pickup::after {
  content: '';
  position: absolute;
  inset-inline-start: 14px;
  top: 44px;
  bottom: -10px;
  border-inline-start: 2px dashed var(--line);
}
.cd-pin {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
}
.cd-pin .ico {
  width: 16px;
  height: 16px;
}
.cd-pickup .cd-pin {
  background: #e23b2e;
}
.cd-drop .cd-pin {
  background: #13a05f;
}
.cd-stop-body {
  min-width: 0;
}
.cd-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.cd-name {
  font-weight: 700;
  font-size: 16px;
  margin: 1px 0;
}
.cd-addr {
  font-size: 13px;
  color: var(--muted);
}
.cd-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.cd-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 10px;
  padding: 8px 12px;
  text-decoration: none;
}
.cd-act .ico {
  width: 15px;
  height: 15px;
}
.cd-note {
  margin: 4px 16px 0;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
}
.cd-pay {
  margin: 10px 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
}
.cd-pay small {
  display: block;
  font-weight: 500;
  font-size: 12px;
  opacity: 0.85;
}
.cd-pay strong {
  margin-inline-start: auto;
  font-size: 17px;
  white-space: nowrap;
}
.cd-collect {
  color: #d97706;
  background: color-mix(in srgb, #f59e0b 14%, transparent);
}
.cd-actions {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}
.cd-arrived {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ok);
  font-weight: 600;
}
/* slide to deliver */
.cd-slide {
  position: relative;
  margin: 14px 16px 16px;
  height: 60px;
  border-radius: 30px;
  background: color-mix(in srgb, #13a05f 22%, var(--surface-2));
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
}
.cd-fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 0;
  background: #13a05f;
  border-radius: 30px;
}
.cd-slide-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-inline: 64px 14px; /* keep the text clear of the knob */
  text-align: center;
  line-height: 1.15;
  font-weight: 800;
  font-size: 16px;
  color: var(--text);
  pointer-events: none;
}
.cd-knob {
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #13a05f;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(19, 160, 95, 0.4);
  cursor: grab;
  touch-action: none;
}
.cd-slide:not(.cd-drag) .cd-knob,
.cd-slide:not(.cd-drag) .cd-fill {
  transition:
    transform 0.25s ease,
    width 0.25s ease;
}
[dir='rtl'] .cd-knob .ico {
  transform: scaleX(-1);
}
.cd-done .cd-slide-text {
  color: #fff;
}
.cd-summary {
  display: flex;
  gap: 8px;
}
.cd-tile {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}
.cd-tile b {
  display: block;
  font-size: 20px;
}
.cd-tile span {
  font-size: 12px;
  color: var(--muted);
}
.cd-empty {
  text-align: center;
  padding: 20px 10px 10px;
  color: var(--muted);
}

/* Automatic assignment offer on the courier card */
.cd-offer {
  border: 2px solid #f5a524;
  border-radius: 14px;
  padding: 12px;
  margin: 12px 14px 4px;
  background: color-mix(in srgb, #f5a524 10%, transparent);
}
.cd-offer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
}
.cd-offer-time {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.4rem;
}
.cd-offer-time.urgent {
  color: var(--danger);
}
.cd-offer small {
  display: block;
  color: var(--muted);
  margin: 2px 0 10px;
}
.cd-offer-btns {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 8px;
}
.cd-offer-btns .btn {
  margin: 0;
}
/* Office: automatic assignment switch */
.auto-assign {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.auto-assign select {
  width: auto;
  min-width: 170px;
}
.auto-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
}
.auto-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.auto-dot.on {
  color: var(--ok);
}
.auto-dot.on::before {
  background: var(--ok);
}
.offer-pill {
  display: inline-block;
  margin-inline-start: 6px;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 99px;
  background: color-mix(in srgb, #f5a524 18%, transparent);
  font-variant-numeric: tabular-nums;
}
.test-line {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.test-line span + span {
  margin-inline-start: 6px;
}
.cd-tile .cd-test {
  margin-inline-start: 4px;
  color: var(--muted);
  font-size: 0.75rem;
}

/* Courier: "Konum kapalı" — covers the page while on duty without location */
.loc-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 20, 27, 0.6);
  backdrop-filter: blur(3px);
}
.loc-gate.hidden {
  display: none;
}
body.loc-gate-open {
  overflow: hidden;
}
.loc-gate-box {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  color: var(--text);
  border-radius: 22px;
  padding: 26px 22px 18px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.loc-gate-ico {
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
}
.loc-gate-ico .ico {
  width: 44px;
  height: 44px;
}
.loc-gate-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 99px;
  padding: 3px 10px;
  margin-bottom: 12px;
}
.loc-gate-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}
.loc-gate-box h3 {
  margin: 0 0 8px;
  font-size: 20px;
}
.loc-gate-box p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}
.loc-gate-main {
  display: block;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 14px;
  background: var(--accent-2);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.loc-gate-alt {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.loc-gate-hint,
.loc-gate-wait {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.loc-gate-wait {
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-2);
}
.courier-pill .noloc {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--danger);
}

/* Food money between courier and restaurant */
.cash-card h2 {
  font-size: 1rem;
  margin: 0 0 6px;
}
.cash-card h2 + .cash-row,
.cash-card h2 + .cash-item {
  border-top: 0;
}
.cash-card .cash-row + h2,
.cash-card .cash-item + h2 {
  margin-top: 14px;
}
.cash-item {
  border-top: 1px solid var(--line);
  padding-bottom: 10px;
}
.cash-item .cash-row {
  border-top: 0;
}
.cash-item .cd-slide {
  margin: 2px 0 0;
}
.cash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.cash-row b {
  font-size: 1.02rem;
}
.cash-row small {
  display: block;
  color: var(--muted);
}
.cash-row .btn {
  margin: 0;
  flex-shrink: 0;
}
.cash-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.cash-wait {
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 99px;
  background: color-mix(in srgb, #f5a524 18%, transparent);
  white-space: nowrap;
}
.cash-wait-block {
  display: block;
  text-align: center;
  padding: 10px;
  border-radius: 12px;
  white-space: normal;
}

/* Restaurant: finished orders as compact lines */
.done-list {
  display: flex;
  flex-direction: column;
}
.done-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-top: 1px solid var(--line);
}
.done-row:first-child {
  border-top: 0;
}
.done-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--ok);
}
.done-late .done-dot {
  background: #f5a524;
}
.done-cancel .done-dot,
.done-bad .done-dot {
  background: var(--danger);
}
.done-main {
  flex: 1;
  min-width: 0;
}
.done-top {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.done-src {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 99px;
  padding: 1px 8px;
}
.done-sub span {
  white-space: nowrap;
}
.done-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}
.done-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.done-chip {
  font-size: 0.75rem;
  border-radius: 99px;
  padding: 2px 9px;
  white-space: nowrap;
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 14%, transparent);
}
.done-chip-late {
  color: #b54708;
  background: color-mix(in srgb, #f5a524 18%, transparent);
}
.done-chip-cancel,
.done-chip-bad {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

/* Notes that stay until closed */
.shift-note,
.sticky-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.shift-note > span,
.sticky-note > span {
  flex: 1;
}
.note-x {
  border: 0;
  background: none;
  color: inherit;
  opacity: 0.7;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
}

/* ---- Thermal receipt (restaurant) ---- */
#print-area {
  display: none;
}
@page receipt {
  margin: 0;
}
@media print {
  body.printing > *:not(#print-area) {
    display: none !important;
  }
  body.printing {
    background: #fff !important;
  }
  body.printing #print-area {
    display: block;
  }
}
.rc-sheet {
  page: receipt;
  break-after: page;
}
.rc-sheet:last-child {
  break-after: auto;
}
.rc {
  width: 72mm;
  padding: 2mm 3mm 6mm;
  color: #000;
  background: #fff;
  font-family: 'Courier New', 'DejaVu Sans Mono', monospace;
  font-size: 12px;
  line-height: 1.35;
}
.rc-w58 .rc {
  width: 48mm;
  font-size: 11px;
}
.rc-large .rc {
  font-size: 14px;
}
.rc-w58.rc-large .rc {
  font-size: 12.5px;
}
.rc-logo {
  display: block;
  width: 16mm;
  height: 16mm;
  margin: 0 auto 1mm;
  filter: grayscale(1) brightness(0.6) contrast(3);
}
.rc-brand {
  text-align: center;
  font-size: 1.5em;
  font-weight: 800;
  letter-spacing: 1px;
}
.rc-c {
  text-align: center;
}
.rc-b {
  font-weight: 700;
}
.rc-sm {
  font-size: 0.85em;
}
.rc-hr {
  border-top: 1px dashed #000;
  margin: 2mm 0;
}
.rc-row {
  display: flex;
  justify-content: space-between;
  gap: 2mm;
}
.rc-row > span:last-child {
  text-align: right;
  white-space: nowrap;
}
.rc-no {
  font-size: 1.6em;
  font-weight: 800;
}
.rc-tag {
  align-self: center;
  border: 2px solid #000;
  padding: 0 2mm;
  font-weight: 800;
}
.rc-total {
  font-size: 1.5em;
  font-weight: 800;
}

.print-btn {
  padding: 2px 8px;
  line-height: 1.2;
}
.order-head .print-btn {
  margin-inline-start: 6px;
}
.items-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}
.item-row {
  display: grid;
  grid-template-columns: 64px 1fr 96px auto;
  gap: 6px;
  align-items: center;
}
.item-row .btn {
  margin: 0;
}
input[readonly] {
  opacity: 0.8;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0 12px;
}

.rc-hr-solid {
  border-top: 2px solid #000;
}
.rc-xs {
  font-size: 0.72em;
}
.rc-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2mm;
  margin-bottom: 1.5mm;
}
.rc-ico {
  width: 9mm;
  height: 9mm;
}
.rc-pill {
  border: 1.5px solid #000;
  border-radius: 99px;
  padding: 0.5mm 2.5mm;
  font-size: 0.8em;
  font-weight: 700;
}
.rc-time {
  font-size: 1.9em;
  font-weight: 800;
  line-height: 1.1;
}
.rc-qr {
  width: 34mm;
  margin: 1mm auto;
}
.rc-w58 .rc-qr {
  width: 28mm;
}
.rc-qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.rc-head {
  display: flex;
  gap: 3mm;
  align-items: flex-start;
}
.rc-head .rc-no {
  font-size: 2em;
  line-height: 1;
  flex-shrink: 0;
}
.rc-cust {
  min-width: 0;
}
.rc-addr {
  font-size: 1.05em;
  font-weight: 700;
}
.rc-note {
  font-weight: 800;
  font-size: 1.1em;
}
.rc-pay {
  font-size: 1.05em;
}
.rc-item {
  display: grid;
  grid-template-columns: 5mm 1fr auto;
  gap: 1.5mm;
  margin: 1mm 0;
}
.rc-price {
  white-space: nowrap;
}
.rc-paym {
  font-weight: 800;
  font-size: 1.1em;
}
.rc-right {
  text-align: right;
}
[dir='rtl'] .rc-right {
  text-align: left;
}
.rc[dir='rtl'] .rc-row > span:last-child {
  text-align: left;
}
.rc[lang='ar'] {
  font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
}
.print-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 3000;
  max-width: min(92vw, 520px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.rc-test-title {
  text-align: center;
  font-size: 1.6em;
  font-weight: 800;
  border: 2px solid #000;
  margin: 1mm 0;
  padding: 1mm 0;
}
.rc-ruler {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 3px solid #000;
  border-bottom: 3px solid #000;
  padding: 0.5mm 0;
  font-weight: 800;
}
.rc-qr-sm {
  width: 22mm;
}
.rc-w58 .rc-qr-sm {
  width: 20mm;
}

/* ---- login password + Şifreler page ---- */
.pw-wrap {
  position: relative;
}
.pw-wrap input {
  width: 100%;
  padding-inline-end: 46px;
}
.pw-toggle {
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 8px;
  opacity: 0.7;
}
.pw-search {
  width: 100%;
}
.pw-list {
  display: flex;
  flex-direction: column;
}
.pw-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.pw-row:first-child {
  border-top: 0;
}
.pw-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pw-who strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pw-state {
  font-size: 13px;
  white-space: nowrap;
}
.pw-state.ok {
  color: var(--ok);
}
.pw-state.no {
  color: var(--danger);
}
.pw-missing {
  margin-inline-start: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}
@media (max-width: 560px) {
  .pw-row {
    flex-wrap: wrap;
  }
  .pw-row .btn {
    width: 100%;
  }
}
