:root {
  --bg: #f3f4f6;
  --card: #fff;
  --ink: #15181d;
  --mut: #6b7280;
  --line: #e2e5e9;
  --pri: #0f766e;
  --pri2: #0b5e58;
  --pri-soft: #e6f4f2;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1215;
    --card: #191d22;
    --ink: #eceff3;
    --mut: #9aa3ae;
    --line: #2a3038;
    --pri: #14b8a6;
    --pri2: #0d9488;
    --pri-soft: #12302d;
    --ok: #34d399;
    --ok-soft: #10291f;
    --warn: #fbbf24;
    --warn-soft: #2e2410;
    --bad: #f87171;
    --bad-soft: #321616;
    --shadow: none;
  }
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px / 1.4 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px 120px;
}
.wrap.wide {
  max-width: 1200px;
}
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.top .in {
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.top.wide .in {
  max-width: 1200px;
}
.top h1 {
  font-size: 18px;
  margin: 0;
  flex: 1;
}
.top .sub {
  color: var(--mut);
  font-size: 13px;
  font-weight: 500;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  background: var(--pri);
  color: #fff;
  cursor: pointer;
}
.btn:active {
  background: var(--pri2);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn.block {
  display: flex;
  width: 100%;
}
.btn.big {
  padding: 16px;
  font-size: 18px;
}
.btn.sec {
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn.ok {
  background: var(--ok);
}
.btn.bad {
  background: var(--bad);
}
.btn.ghost {
  background: transparent;
  color: var(--mut);
  padding: 8px 10px;
  font-weight: 600;
}
.btn.sm {
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 10px;
}
.f {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 17px;
  background: var(--card);
  outline: none;
}
.f:focus {
  border-color: var(--pri);
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row > .grow {
  flex: 1;
  min-width: 0;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.muted {
  color: var(--mut);
  font-size: 14px;
}
.num {
  font-variant-numeric: tabular-nums;
}
.right {
  text-align: right;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--pri-soft);
  color: var(--pri);
  white-space: nowrap;
}
.badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.badge.mut {
  background: var(--bg);
  color: var(--mut);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  z-index: 50;
  max-width: calc(100% - 32px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.toast.ok {
  background: var(--ok);
}
.toast.bad {
  background: var(--bad);
}
.hidden {
  display: none !important;
}
.tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0;
  overflow-x: auto;
}
.tabs button {
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}
.tabs button.on {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
/* Giriş */
.login {
  max-width: 380px;
  margin: 10vh auto;
  padding: 24px 16px;
}
.login h1 {
  font-size: 26px;
  margin: 0 0 4px;
}
.login .f {
  margin-bottom: 10px;
}
.err {
  color: var(--bad);
  font-weight: 600;
  margin: 8px 0;
}
/* Sepet */
.addbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.item {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.item:first-child {
  border-top: 0;
  padding-top: 0;
}
.item .name {
  font-weight: 700;
}
.item .meta {
  color: var(--mut);
  font-size: 13px;
}
.item .ctl {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.stepper button {
  border: 0;
  background: var(--bg);
  width: 40px;
  height: 44px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}
.stepper input {
  width: 56px;
  border: 0;
  text-align: center;
  height: 44px;
  background: var(--card);
  font-weight: 700;
  outline: none;
}
.price {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0 10px;
  background: var(--card);
}
.price input {
  width: 100%;
  border: 0;
  height: 41px;
  text-align: right;
  font-weight: 700;
  background: transparent;
  outline: none;
}
.price.changed {
  border-color: var(--warn);
}
.lt {
  font-weight: 800;
  min-width: 90px;
  text-align: right;
}
.del {
  border: 0;
  background: transparent;
  color: var(--mut);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
}
.sendbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  z-index: 6;
}
.sendbar .in {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: center;
}
.sendbar .tot {
  flex: 1;
}
.sendbar .tot b {
  font-size: 22px;
}
.results .r {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.results .r:first-child {
  border-top: 0;
}
.results .r .n {
  flex: 1;
  min-width: 0;
}
/* Kamera */
.cam {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 30;
  display: flex;
  flex-direction: column;
}
.cam video {
  flex: 1;
  width: 100%;
  object-fit: cover;
  min-height: 0;
}
.cam .frame {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 30%;
  height: 22%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  pointer-events: none;
}
.cam .bar {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #111;
  color: #fff;
}
.cam .msg {
  font-weight: 600;
  margin-bottom: 10px;
  min-height: 22px;
}
dialog {
  border: 0;
  border-radius: 16px;
  padding: 18px;
  width: min(480px, calc(100% - 32px));
  background: var(--card);
  color: var(--ink);
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
dialog h2 {
  margin: 0 0 10px;
  font-size: 19px;
}
/* Yönetici */
table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.t th,
table.t td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
table.t th {
  color: var(--mut);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
table.t td.n,
table.t th.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.scroll {
  overflow-x: auto;
}
.sale .head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.sale .head .who {
  font-weight: 800;
  font-size: 17px;
}
.sale .head .amt {
  margin-left: auto;
  font-size: 20px;
  font-weight: 800;
}
.sale .acts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.sale.pending {
  border-left: 5px solid var(--warn);
}
.sale.done {
  border-left: 5px solid var(--ok);
}
.sale.void {
  border-left: 5px solid var(--line);
  opacity: 0.75;
}
.strike {
  text-decoration: line-through;
  color: var(--mut);
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.kpi .l {
  color: var(--mut);
  font-size: 13px;
}
.kpi .v {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.barcell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
}
.barcell .b {
  height: 10px;
  border-radius: 5px;
  background: var(--pri);
  min-width: 2px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}
.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--mut);
}
.filters .f {
  font-size: 15px;
  padding: 8px 10px;
}
.heat td.n {
  font-size: 13px;
}
.edit-in {
  width: 90px;
  padding: 6px 8px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  text-align: right;
  background: var(--card);
}
@media (max-width: 420px) {
  .item .ctl {
    grid-template-columns: auto 1fr;
  }
  .item .ctl .lt {
    grid-column: 1 / -1;
  }
}

/* Sade personel ekranı */
.lbl {
  font-weight: 800;
  margin-bottom: 8px;
}
.idx {
  color: var(--mut);
  font-weight: 700;
  min-width: 22px;
  align-self: flex-start;
}
.item .name {
  font-size: 15px;
}
.item .meta {
  font-size: 12px;
}
.item .ctl {
  margin-top: 6px;
}
.item .stepper button {
  width: 34px;
  height: 38px;
  font-size: 18px;
}
.item .stepper input {
  width: 46px;
  height: 38px;
}
.item .price input {
  height: 35px;
}
.item {
  padding: 10px 0;
}
.totrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 2px solid var(--ink);
  margin-top: 8px;
  padding: 12px 0;
  font-weight: 700;
}
.totrow b {
  font-size: 26px;
}
.wrap {
  padding-bottom: 40px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.split .btn {
  flex-direction: column;
  gap: 2px;
  font-size: 16px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
}
.split .btn small {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;
}
.split .btn.busy {
  opacity: 0.6;
  pointer-events: none;
}
