/* Öykü Tekel Kasa — temalar. Varsayılan: Bira Yeşili (PMS 369) */
:root, :root[data-theme="yesil"] {
  --brand: #64A70B;          /* PMS 369, baskın renk */
  --bar: #58970B;
  --brand-deep: #4E8A0A;
  --brand-glow: #7DBE24;
  --action: #4E8A0A;
  --on-action: #FFFFFF;
  --on-brand: #FFFFFF;
  --on-brand-soft: #F1F8E4;
  --text: #1F3507;
  --muted: #5B6B4C;
  --bg: #F3F8EC;
  --paper: #FFFFFF;
  --mint: #E9F3DA;
  --mint-2: #F5F9EF;
  --line: #D4E4BC;
  --leaf: #3F7A08;
  --gold: #D4AF37;
  --gold-soft: #F7EDC6;
  --on-gold: #1F3507;
  --solid: #1F3507;
  --on-solid: #FFFFFF;
  --vf-bg: #0F1D05;
  --red: #B83227;
  --red-soft: #FBE9E7;
  --amber: #8A5A0C;
  color-scheme: light;

  /* bar, LED frames and total panel; plain themes keep these quiet */
  --bar-pattern: none;
  --on-bar: #FFFFFF;
  --on-bar-soft: var(--on-brand-soft);
  --bar-active-bg: var(--brand-deep);
  --bar-active-text: #FFFFFF;
  --bar-btn: rgba(255, 255, 255, .14);
  --bar-chip: transparent;
  --frame: transparent;
  --frame-glow: transparent;
  --frame-2: var(--frame);
  --frame-2-glow: var(--frame-glow);
  --total-text: var(--on-brand);
  --total-glow: transparent;
  --card-btn-bg: #FFFFFF;
  --card-btn-text: var(--brand-deep);
  --cash-btn-bg: var(--gold);
  --cash-btn-text: var(--on-gold);
  --bar-rule: var(--gold);
  --total-rule: var(--gold);
  --tick-bg: var(--gold);
  --tick-fg: var(--on-gold);
  --focus: var(--gold);
  --login-text: var(--on-brand);
  --login-soft: var(--on-brand-soft);
  --key-bg: rgba(255, 255, 255, .1);
  --key-bg-active: rgba(255, 255, 255, .25);
  --key-text: #FFFFFF;
  --tile-bg: rgba(255, 255, 255, .08);
  --tile-border: rgba(255, 255, 255, .25);
  --tile-text: #FFFFFF;
}

/* ---- Öykü Tekel: the shop sign. Sun-yellow board, hand-drawn rings, graphite wordmark, grey wall */
:root[data-theme="oyku"] {
  --sign-art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 500' preserveAspectRatio='xMidYMid slice'%3E%3Cpath d='M744 500 C936 275 1080 125 1200 60 L1200 500 Z' fill='%23F3A51D' fill-opacity='.55'/%3E%3Cpath d='M960 0 C1032 150 1116 300 1200 350 L1200 0 Z' fill='%23EC9120' fill-opacity='.25'/%3E%3Cpath d='M0 390 C360 310 720 330 1200 200 L1200 500 L0 500 Z' fill='%23F3A51D' fill-opacity='.22'/%3E%3Cellipse cx='387.4' cy='210.6' rx='21.0' ry='21.4' transform='rotate%28-6.7 387.4 210.6%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='394.7' cy='203.1' rx='43.8' ry='39.6' transform='rotate%28-20.5 394.7 203.1%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='390.5' cy='212.0' rx='76.1' ry='67.0' transform='rotate%2822.4 390.5 212.0%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='386.9' cy='215.7' rx='98.9' ry='101.8' transform='rotate%28-10.5 386.9 215.7%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='402.3' cy='204.9' rx='114.5' ry='112.4' transform='rotate%284.1 402.3 204.9%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='387.3' cy='203.0' rx='148.7' ry='145.8' transform='rotate%28-14.7 387.3 203.0%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='397.7' cy='209.3' rx='175.0' ry='165.6' transform='rotate%28-10.0 397.7 209.3%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='397.5' cy='210.4' rx='207.8' ry='188.6' transform='rotate%2818.8 397.5 210.4%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='388.4' cy='208.7' rx='221.5' ry='231.3' transform='rotate%2812.9 388.4 208.7%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='399.4' cy='214.2' rx='245.1' ry='222.0' transform='rotate%283.7 399.4 214.2%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='397.9' cy='211.3' rx='272.9' ry='274.5' transform='rotate%28-2.2 397.9 211.3%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='399.3' cy='203.0' rx='320.0' ry='290.7' transform='rotate%2810.1 399.3 203.0%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='391.7' cy='208.2' rx='345.9' ry='326.1' transform='rotate%288.4 391.7 208.2%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='388.3' cy='202.9' rx='342.6' ry='316.7' transform='rotate%2813.4 388.3 202.9%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='403.4' cy='203.3' rx='359.3' ry='350.8' transform='rotate%28-2.5 403.4 203.3%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Cellipse cx='403.3' cy='206.5' rx='419.0' ry='399.9' transform='rotate%28-4.2 403.3 206.5%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.85' stroke-width='1.8'/%3E%3Ccircle cx='396' cy='250' r='475' fill='none' stroke='%23EC9120' stroke-opacity='0.7' stroke-width='4'/%3E%3Ccircle cx='396' cy='250' r='560' fill='none' stroke='%23EC9120' stroke-opacity='0.5' stroke-width='4'/%3E%3Ccircle cx='840' cy='300' r='500' fill='none' stroke='%23EC9120' stroke-opacity='0.55' stroke-width='4'/%3E%3Ccircle cx='1020' cy='150' r='450' fill='none' stroke='%23EC9120' stroke-opacity='0.4' stroke-width='4'/%3E%3Cellipse cx='737.0' cy='244.8' rx='312.1' ry='302.8' transform='rotate%28-13.4 737.0 244.8%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.6' stroke-width='1.6'/%3E%3Cellipse cx='739.3' cy='242.1' rx='371.1' ry='360.9' transform='rotate%28-4.1 739.3 242.1%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.6' stroke-width='1.6'/%3E%3Cellipse cx='747.8' cy='250.2' rx='452.0' ry='454.9' transform='rotate%285.9 747.8 250.2%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.6' stroke-width='1.6'/%3E%3Cellipse cx='749.6' cy='256.0' rx='498.9' ry='531.3' transform='rotate%2814.9 749.6 256.0%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.6' stroke-width='1.6'/%3E%3Cellipse cx='746.7' cy='243.0' rx='591.5' ry='546.3' transform='rotate%28-21.6 746.7 243.0%29' fill='none' stroke='%23FFE36B' stroke-opacity='0.6' stroke-width='1.6'/%3E%3C/svg%3E");
  --sign-bg: var(--sign-art) center / cover no-repeat, linear-gradient(100deg, #F9C922 0%, #F8C423 48%, #F3A51D 100%);
  --brand: #F9C922; --bar: #F9C922; --brand-deep: #383833; --brand-glow: #FFE36B;
  --action: #383833; --on-action: #F9C922;
  --on-brand: #383833; --on-brand-soft: #5B4A16;
  --text: #383833; --muted: #6C6A60; --bg: #EEEDE9; --paper: #FFFFFF;
  --mint: #FBF1CC; --mint-2: #F8F7F3; --line: #E3E0D4; --leaf: #3E7B13;
  --gold: #F9C922; --gold-soft: #FFF3C4; --on-gold: #383833; --solid: #383833; --on-solid: #F9C922;
  --vf-bg: #262622; --amber: #9A5B08;
  --bar-bg: var(--sign-bg); --on-bar: #383833; --on-bar-soft: #4A493F;
  --bar-active-bg: #383833; --bar-active-text: #F9C922; --bar-btn: rgba(56, 56, 51, .1); --bar-rule: #EC9120;
  --total-text: #383833; --total-rule: #383833;
  --cash-btn-bg: #FFFFFF; --cash-btn-text: #383833; --card-btn-bg: #383833; --card-btn-text: #F9C922;
  --tick-bg: #383833; --tick-fg: #F9C922; --focus: #EC9120;
  --login-bg: #E6E5E1; --login-text: #383833; --login-soft: #6C6A60;
  --key-bg: #FFFFFF; --key-bg-active: #F3EFE0; --key-text: #383833;
  --tile-bg: #FFFFFF; --tile-border: #DAD7CC; --tile-text: #383833;
  color-scheme: light;
}
:root[data-theme="sise"] {
  --brand: #00693A; --bar: #00693A; --brand-deep: #004A28; --brand-glow: #0B8048;
  --action: #00693A; --on-action: #FFFFFF; --on-brand: #FFFFFF; --on-brand-soft: #F5EAC4;
  --text: #0E2E1C; --muted: #5B7265; --bg: #F4F8F5; --paper: #FFFFFF;
  --mint: #E8F2EB; --mint-2: #F4F8F5; --line: #D3E3D8; --leaf: #0A8F4E;
  --gold: #C9A43A; --gold-soft: #F5EAC4; --on-gold: #0E2E1C; --solid: #0E2E1C; --on-solid: #FFFFFF;
  --vf-bg: #06190E;
}
:root[data-theme="kehribar"] {
  --brand: #C47A12; --bar: #B06C0E; --brand-deep: #8C540A; --brand-glow: #DB9530;
  --action: #94590A; --on-action: #FFFFFF; --on-brand: #FFFFFF; --on-brand-soft: #FFF1DA;
  --text: #3A2508; --muted: #776350; --bg: #FBF6EE; --paper: #FFFFFF;
  --mint: #F6EBD9; --mint-2: #FBF5EC; --line: #EAD9BF; --leaf: #4E8A0A;
  --gold: #64A70B; --gold-soft: #EEF5E0; --on-gold: #FFFFFF; --solid: #3A2508; --on-solid: #FFFFFF;
  --vf-bg: #1E1407;
}
:root[data-theme="lacivert"] {
  --brand: #1F4E8C; --bar: #1A4479; --brand-deep: #133760; --brand-glow: #2C65AE;
  --action: #1F4E8C; --on-action: #FFFFFF; --on-brand: #FFFFFF; --on-brand-soft: #DCE8F7;
  --text: #0F2340; --muted: #586A82; --bg: #F2F5FA; --paper: #FFFFFF;
  --mint: #E3EBF6; --mint-2: #F3F6FB; --line: #CFDBEA; --leaf: #2F7D32;
  --gold: #D4AF37; --gold-soft: #F7EDC6; --on-gold: #0F2340; --solid: #0F2340; --on-solid: #FFFFFF;
  --vf-bg: #07111F;
}
:root[data-theme="gece"] {
  --brand: #4E8A0A; --bar: #1C2B10; --brand-deep: #3B6B08; --brand-glow: #64A70B;
  --action: #7CC51A; --on-action: #10200A; --on-brand: #FFFFFF; --on-brand-soft: #E3F0CF;
  --text: #E7F0DC; --muted: #9DB08B; --bg: #0D1408; --paper: #172210;
  --mint: #223218; --mint-2: #1B2913; --line: #33482A; --leaf: #8FD13A;
  --gold: #D4AF37; --gold-soft: #3A3416; --on-gold: #1A1606; --solid: #E7F0DC; --on-solid: #10200A;
  --vf-bg: #050A02; --red: #D9483B; --red-soft: #3A1712; --amber: #E0A64A;
  color-scheme: dark;
}
/* ---- shop-light themes: dark room, LED-framed fridge doors, mustard banner with beer line-art */
:root[data-theme="dukkan"], :root[data-theme="sari"], :root[data-theme="mavi"] {
  --zfis-top: var(--frame);
  --bg: #0E0C0A; --paper: #1A1714; --mint: #27221C; --mint-2: #201C17; --line: #3A3229;
  --text: #F4EBDD; --muted: #B4A692; --leaf: #A5E05F;
  --brand: #15110C; --brand-deep: #1A1206; --brand-glow: #3B2A0E;
  --on-brand: #FFFFFF; --on-brand-soft: #FFD666;
  --action: #FFC21A; --on-action: #1A1206;
  --gold: #FFC21A; --on-gold: #1A1206; --gold-soft: #3A2D10;
  --solid: #F4EBDD; --on-solid: #14110D;
  --vf-bg: #000000; --red: #E5533F; --red-soft: #3A1712; --amber: #FFC21A;
  --bar-chip: #E0A82E;
  --bar: #E0A82E; --bar-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='64' viewBox='0 0 300 64'%3E%3Cg fill='none' stroke='%231A1206' stroke-opacity='.42' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%0A%3Crect x='8' y='20' width='40' height='26' rx='12'/%3E%3Cpath d='M20 20v26M36 20v26M48 33h5v4'/%3E%0A%3Cpath d='M72 10h6v9l4 6v25a3 3 0 0 1-3 3h-8a3 3 0 0 1-3-3V25l4-6z'/%3E%3Cpath d='M68 32h14'/%3E%0A%3Cpath d='M98 14h16l-1 11a7 7 0 0 1-14 0z'/%3E%3Cpath d='M106 32v14M100 47h12'/%3E%0A%3Cpath d='M128 15h18l-2.5 34h-13z'/%3E%3Cpath d='M128.5 22h17'/%3E%0A%3Cpath d='M160 20h18v29h-18z'/%3E%3Cpath d='M178 26h4a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4h-4'/%3E%3Cpath d='M160 20c2-5 7-5 9-2 2-3 7-3 9 2'/%3E%0A%3Cpath d='M204 46c-9-3-10-21 3-21 7 0 8 7 8 11s1 10 7 10c12 0 11-18 2-21-6-2-11 3-13 8-2 5-6 11-12 13'/%3E%0A%3Cpath d='M246 10h6v9l4 6v25a3 3 0 0 1-3 3h-8a3 3 0 0 1-3-3V25l4-6z'/%3E%3Ccircle cx='249' cy='38' r='4'/%3E%0A%3Cpath d='M270 14h16l-1 11a7 7 0 0 1-14 0z'/%3E%3Cpath d='M278 32v14M272 47h12'/%3E%3C/g%3E%3C/svg%3E");
  --on-bar: #1A1206; --on-bar-soft: #3A2A0E; --bar-active-bg: #1A1206; --bar-active-text: #FFD34D; --bar-btn: rgba(26, 18, 6, .14);
  --frame: #FFC21A; --frame-glow: rgba(255, 194, 26, .38);
  --frame-2: #FFC21A; --frame-2-glow: rgba(255, 194, 26, .38);
  --total-text: #FFD34D; --total-glow: rgba(255, 196, 30, .55);
  --card-btn-bg: #FFFFFF; --card-btn-text: #1A1206;
  color-scheme: dark;
}
:root[data-theme="dukkan"] {
  --frame-2: #2F7BFF; --frame-2-glow: rgba(47, 123, 255, .45);
  --card-btn-bg: #2F7BFF; --card-btn-text: #FFFFFF;
}
:root[data-theme="mavi"] {
  --bg: #090B10; --paper: #13161E; --mint: #1C2130; --mint-2: #171B26; --line: #2A3247;
  --text: #E6ECF8; --muted: #93A0BA;
  --brand: #0C0F17; --brand-deep: #0A1A3A; --brand-glow: #12244A; --on-brand-soft: #9CC2FF;
  --action: #3D86FF; --on-action: #FFFFFF; --gold: #3D86FF; --on-gold: #FFFFFF; --gold-soft: #15264A;
  --amber: #8DB8FF;
  --bar-chip: #0B1430;
  --bar: #0B1430; --bar-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='64' viewBox='0 0 300 64'%3E%3Cg fill='none' stroke='%235B9BFF' stroke-opacity='.35' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%0A%3Crect x='8' y='20' width='40' height='26' rx='12'/%3E%3Cpath d='M20 20v26M36 20v26M48 33h5v4'/%3E%0A%3Cpath d='M72 10h6v9l4 6v25a3 3 0 0 1-3 3h-8a3 3 0 0 1-3-3V25l4-6z'/%3E%3Cpath d='M68 32h14'/%3E%0A%3Cpath d='M98 14h16l-1 11a7 7 0 0 1-14 0z'/%3E%3Cpath d='M106 32v14M100 47h12'/%3E%0A%3Cpath d='M128 15h18l-2.5 34h-13z'/%3E%3Cpath d='M128.5 22h17'/%3E%0A%3Cpath d='M160 20h18v29h-18z'/%3E%3Cpath d='M178 26h4a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4h-4'/%3E%3Cpath d='M160 20c2-5 7-5 9-2 2-3 7-3 9 2'/%3E%0A%3Cpath d='M204 46c-9-3-10-21 3-21 7 0 8 7 8 11s1 10 7 10c12 0 11-18 2-21-6-2-11 3-13 8-2 5-6 11-12 13'/%3E%0A%3Cpath d='M246 10h6v9l4 6v25a3 3 0 0 1-3 3h-8a3 3 0 0 1-3-3V25l4-6z'/%3E%3Ccircle cx='249' cy='38' r='4'/%3E%0A%3Cpath d='M270 14h16l-1 11a7 7 0 0 1-14 0z'/%3E%3Cpath d='M278 32v14M272 47h12'/%3E%3C/g%3E%3C/svg%3E");
  --on-bar: #FFFFFF; --on-bar-soft: #B9D2FF; --bar-active-bg: #2F7BFF; --bar-active-text: #FFFFFF; --bar-btn: rgba(255, 255, 255, .12);
  --frame: #2F7BFF; --frame-glow: rgba(47, 123, 255, .45);
  --frame-2: #2F7BFF; --frame-2-glow: rgba(47, 123, 255, .45);
  --total-text: #8DB8FF; --total-glow: rgba(61, 134, 255, .6);
  --card-btn-bg: #FFFFFF; --card-btn-text: #0A1A3A;
}
:root {
  --amber-soft: #FCF1DC;

  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-num: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --tap: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px;
  border: 0; border-radius: var(--r-md);
  background: var(--action); color: var(--on-action);
  font-weight: 600; font-size: 17px;
  transition: background .12s, transform .06s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.secondary { background: var(--paper); color: var(--action); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost { background: transparent; color: var(--action); }
.btn.gold { background: var(--gold); color: var(--on-gold); }
.btn.danger { background: var(--red); }
.btn.danger.secondary { background: var(--paper); color: var(--red); box-shadow: inset 0 0 0 2px #EBC5C0; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; border-radius: var(--r-sm); }
.btn.block { width: 100%; }
.btn svg { width: 22px; height: 22px; flex: none; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--muted); }
.input {
  width: 100%; min-height: var(--tap); padding: 0 14px;
  border: 2px solid var(--line); border-radius: var(--r-md);
  background: var(--paper); font-size: 18px;
}
.input:focus { border-color: var(--action); outline: none; }
.input.money { font-family: var(--font-num); font-size: 24px; font-weight: 600; }
.row { display: flex; gap: 12px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- login */
.login {
  min-height: var(--app-h, 100vh); display: grid; place-items: center; padding: 24px 16px;
  background: var(--login-bg, radial-gradient(circle at 50% -20%, var(--brand-glow) 0, transparent 60%), var(--brand));
  color: var(--login-text);
}
.login-card {
  width: min(460px, 100%); text-align: center; padding: 28px 20px; border-radius: 24px;
  box-shadow: 0 0 0 2px var(--frame), 0 0 40px var(--frame-glow);
}
.login h1 { text-shadow: 0 0 26px var(--total-glow); }
.login h1 {
  font-family: var(--font-num); font-weight: 800; font-size: 56px; line-height: .95;
  letter-spacing: .5px; margin: 0;
}
.login .sub { font-family: var(--font); font-size: 18px; font-weight: 600; color: var(--login-soft); margin: 14px 0 26px; }
.login-logo { display: block; width: min(400px, 100%); height: auto; margin: 0 auto; filter: drop-shadow(0 10px 18px rgba(40, 36, 20, .22)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.login-rule { height: 0; border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold); padding-top: 3px; width: 120px; margin: 0 auto 28px; }
.user-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.user-tile {
  min-height: 84px; border: 2px solid var(--tile-border); border-radius: var(--r-lg);
  background: var(--tile-bg); color: var(--tile-text); font-size: 20px; font-weight: 600;
  display: grid; place-content: center; gap: 2px;
}
.user-tile small { font-size: 13px; font-weight: 500; color: var(--login-soft); }
.user-tile:active { background: var(--key-bg-active); }
.pin-who { font-size: 20px; font-weight: 600; margin-bottom: 14px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; height: 22px; margin-bottom: 22px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--login-soft); }
.pin-dots i.on { background: var(--tick-bg); border-color: var(--tick-bg); }
.pin-dots.shake { animation: shake .35s; }
@media (max-height: 860px) {
  .login { padding: 12px 16px; }
  .login-card { padding: 18px 20px; }
  .login-logo { width: min(330px, 100%); }
  .login h1 { font-size: 46px; }
  .login .sub { margin-bottom: 16px; }
  .login-rule { margin-bottom: 16px; }
  .key { height: 60px; }
  .keypad { gap: 10px; }
}
@keyframes shake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 340px; margin: 0 auto; }
.key {
  height: 72px; border: 0; border-radius: 50%/48%;
  background: var(--key-bg); color: var(--key-text);
  font-family: var(--font-num); font-size: 34px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
.key:active { background: var(--key-bg-active); }
.key.ok { background: var(--tick-bg); color: var(--tick-fg); }
.key.fn { font-family: var(--font); font-size: 16px; }
.login-error { min-height: 24px; margin-top: 14px; color: #FFD6CF; font-weight: 600; }
.login-back { margin-top: 18px; background: none; border: 0; color: var(--login-soft); font-size: 16px; padding: 10px; }

/* ---------- shell */
.shell { min-height: var(--app-h, 100vh); display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); overflow-x: clip; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--bar-bg, var(--bar-pattern) center / auto 100% repeat-x, var(--bar)); color: var(--on-bar);
  border-bottom: 3px solid var(--bar-rule);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo { display: block; height: 42px; width: auto; border-radius: 8px; box-shadow: 0 0 0 1px rgba(56, 56, 51, .18); }
.brand { flex: none; }
.nav a { background-color: var(--bar-chip); }
.who { background: var(--bar-chip); border-radius: 14px; padding-left: 10px; }
.brand b { font-family: var(--font-num); font-weight: 800; font-size: 26px; letter-spacing: .3px; line-height: 1; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 16px; border-radius: var(--r-md);
  color: var(--on-bar-soft); text-decoration: none; font-weight: 600;
}
.nav a svg { width: 22px; height: 22px; }
.nav a.active { background: var(--bar-active-bg); color: var(--bar-active-text); box-shadow: inset 0 -3px 0 var(--gold); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.who button { background: var(--bar-btn); border: 0; color: var(--on-bar); min-height: 42px; padding: 0 14px; border-radius: var(--r-sm); }
.offline-pill { background: var(--red); color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 99px; font-weight: 700; }

@media (max-width: 860px) {
  .brand b { display: none; }
  .nav { margin-left: 0; }
  .nav a { padding: 0 12px; }
  .nav a span { display: none; }
  .who .who-name { display: none; }
}

main { min-width: 0; }
.page { padding: 16px; max-width: 1280px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.page-head h2 { font-family: var(--font-num); font-size: 32px; font-weight: 700; margin: 0 auto 0 0; }

/* ---------- POS */
.pos {
  display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; gap: 16px;
  padding: 16px; height: calc(var(--app-h, 100vh) - 63px);
}
.pos-scan, .pos-cart { min-height: 0; display: flex; flex-direction: column; gap: 12px; }

.viewfinder {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: var(--vf-bg); aspect-ratio: 4 / 3; flex: none;
  box-shadow: 0 0 0 2px var(--frame), 0 0 22px var(--frame-glow);
}
.viewfinder #reader { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; }
.viewfinder #reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
.viewfinder #qr-shaded-region { display: none !important; }
.vf-idle {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; display: grid; place-content: center; gap: 14px; text-align: center;
  color: #CFE6D7; padding: 16px;
}
.vf-idle p { margin: 0; max-width: 300px; }
.vf-badge {
  position: absolute; left: 12px; top: 12px; z-index: 3;
  background: rgba(0,0,0,.45); color: #fff; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.vf-badge i { width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; }
.vf-badge small { display: block; font-size: 11px; font-weight: 500; opacity: .8; }
.vf-badge small:empty { display: none; }
.vf-ctrls { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: flex; gap: 6px; }
.vf-ctrls button {
  min-width: 46px; height: 46px; padding: 0 10px; border: 0; border-radius: 99px;
  background: rgba(0, 0, 0, .5); color: #FFFFFF; font-weight: 700; font-size: 16px; display: grid; place-items: center;
}
.vf-ctrls button svg { width: 22px; height: 22px; }
.vf-ctrls button[data-flip] { display: flex; gap: 6px; padding: 0 14px; }
.vf-ctrls button small { font-size: 14px; font-weight: 700; }
.vf-ctrls button.on { background: var(--gold); color: var(--on-gold); }
.vf-guide {
  position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; z-index: 2; pointer-events: none;
  background: var(--gold); box-shadow: 0 0 12px 2px rgba(201, 164, 58, .8);
}
.vf-guide::before, .vf-guide::after {
  content: ''; position: absolute; top: -48px; width: 28px; height: 98px; border: 3px solid rgba(255,255,255,.85);
}
.vf-guide::before { left: -6px; border-right: 0; border-radius: 10px 0 0 10px; }
.vf-guide::after { right: -6px; border-left: 0; border-radius: 0 10px 10px 0; }
.vf-flash { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 4; pointer-events: none; box-shadow: inset 0 0 0 6px var(--gold); opacity: 0; transition: opacity .3s; }
.vf-flash.on { opacity: 1; transition: none; }

.scan-tools { display: flex; gap: 8px; }
.scan-tools form { flex: 1; display: flex; gap: 8px; position: relative; }
.icon-btn {
  width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center;
  border: 0; border-radius: var(--r-md); background: var(--paper); color: var(--action);
  box-shadow: inset 0 0 0 2px var(--line);
}
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.on { background: var(--action); color: var(--on-action); box-shadow: none; }

.search-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 15;
  background: var(--paper); border-radius: var(--r-md); box-shadow: 0 12px 32px rgba(14,46,28,.22);
  max-height: 50vh; overflow: auto; border: 1px solid var(--line);
}
.search-pop button {
  display: flex; width: 100%; align-items: center; gap: 12px; text-align: left;
  border: 0; background: none; padding: 12px 14px; border-bottom: 1px solid var(--mint);
}
.search-pop button:active, .search-pop button:hover { background: var(--mint); }
.search-pop .price { margin-left: auto; font-family: var(--font-num); font-weight: 700; font-size: 20px; }
.search-pop .empty { padding: 14px; color: var(--muted); }

.last-scan {
  background: var(--paper); border-radius: var(--r-lg); padding: 14px 16px; min-height: 104px;
  display: flex; gap: 14px; align-items: center; border: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--frame), 0 0 18px var(--frame-glow);
}
.last-scan.fresh { border-color: var(--gold); animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.98); } }
.last-scan .thumb { width: 72px; height: 72px; }
.last-scan .ls-name { font-weight: 600; font-size: 18px; line-height: 1.25; }
.last-scan .ls-price { font-family: var(--font-num); font-weight: 800; font-size: 44px; line-height: 1; margin-left: auto; color: var(--action); white-space: nowrap; }
.last-scan.empty { color: var(--muted); justify-content: center; text-align: center; }

.thumb {
  flex: none; width: 48px; height: 48px; border-radius: var(--r-sm); background: var(--mint);
  object-fit: contain; display: grid; place-items: center; color: var(--action); font-family: var(--font-num); font-weight: 700;
}

.pos-cart { background: var(--paper); border-radius: var(--r-lg); overflow: hidden; gap: 0; box-shadow: 0 0 0 2px var(--frame-2), 0 0 26px var(--frame-2-glow); }
.cart-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--mint); }
.cart-head h3 { margin: 0; font-family: var(--font-num); font-size: 24px; font-weight: 700; }
.cart-head .count { color: var(--muted); font-weight: 600; }
.cart-head .btn { margin-left: auto; }
.cart-list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; min-height: 80px; }
.cart-empty { height: 100%; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 24px; gap: 6px; }
.cart-empty b { color: var(--text); font-size: 19px; }
.cart-item {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px 14px; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--mint);
}
.cart-item.flash { animation: rowflash 1s ease-out; }
@keyframes rowflash { from { background: var(--gold-soft); } }
.ci-main { min-width: 0; border: 0; background: none; text-align: left; padding: 4px 0; }
.ci-name { font-weight: 600; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.ci-unit { color: var(--muted); font-size: 14px; }
.ci-unit.changed { color: var(--amber); font-weight: 600; }
.qty { display: flex; align-items: center; background: var(--mint); border-radius: var(--r-md); }
.qty button { width: 46px; height: 46px; border: 0; background: none; font-size: 26px; font-weight: 600; color: var(--action); display: grid; place-items: center; }
.qty button svg { width: 20px; height: 20px; }
.qty b { min-width: 30px; text-align: center; font-family: var(--font-num); font-size: 24px; }
.ci-total { font-family: var(--font-num); font-weight: 700; font-size: 24px; min-width: 96px; text-align: right; }

/* the label: the one loud thing */
.total-label {
  background: var(--sign-bg, var(--brand)); color: var(--on-brand);
  padding: 14px 18px calc(16px + var(--safe-b));
  border-top: 3px double var(--total-rule);
}
.total-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 6px; }
.total-row span { font-family: var(--font-num); font-size: 26px; font-weight: 600; color: var(--on-brand-soft); }
.total-row strong { color: var(--total-text); text-shadow: 0 0 22px var(--total-glow); font-family: var(--font-num); font-weight: 800; font-size: clamp(54px, 7vw, 84px); line-height: 1; letter-spacing: -.5px; }
.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.pay-row .btn { min-height: 66px; font-size: 22px; border-radius: var(--r-md); }
.pay-row .btn.gold { background: var(--cash-btn-bg); color: var(--cash-btn-text); }
.pay-row .btn.card { background: var(--card-btn-bg); color: var(--card-btn-text); }

@media (max-width: 900px), (orientation: portrait) {
  .pos { grid-template-columns: 1fr; height: auto; min-height: calc(var(--app-h, 100vh) - 63px); padding: 12px; gap: 12px; }
  .viewfinder { aspect-ratio: auto; height: 30vh; min-height: 200px; }
  .last-scan { min-height: 84px; }
  .last-scan .ls-price { font-size: 36px; }
  .pos-cart { min-height: 50vh; }
  .cart-list { flex: 1 1 auto; }
  .total-label { position: sticky; bottom: 0; }
}

/* ---------- lists & tables */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .input { flex: 1 1 260px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  min-height: 42px; padding: 0 16px; border-radius: 99px; border: 2px solid var(--line);
  background: var(--paper); font-weight: 600; color: var(--text);
}
.chip.on { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }

.panel { background: var(--paper); border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 0 0 1px var(--frame), 0 0 14px var(--frame-glow); }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--mint); }
.panel-head h3 { margin: 0; font-family: var(--font-num); font-size: 22px; font-weight: 700; }
.panel-body { padding: 16px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--mint-2); position: sticky; top: 0; }
.table td { padding: 12px; border-bottom: 1px solid var(--mint); vertical-align: middle; }
.table .r { text-align: right; }
.table td.r { font-family: var(--font-num); font-size: 19px; font-weight: 600; white-space: nowrap; }
.table tr.click { cursor: pointer; }
.table tr.click:active td, .table tr.click:hover td { background: var(--mint-2); }
.table tr.void td { color: var(--muted); text-decoration: line-through; }
.p-name { font-weight: 600; }
.p-codes { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.stock-low { color: var(--red); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--mint); color: var(--action); }
.badge.kart { background: #E6EEF9; color: #234E8C; }
.badge.iptal { background: var(--red-soft); color: var(--red); }
.badge.admin { background: var(--gold-soft); color: var(--amber); }
.list-foot { padding: 12px 16px; color: var(--muted); font-size: 14px; }
.empty-state { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty-state b { display: block; color: var(--text); font-size: 19px; margin-bottom: 4px; }

@media (max-width: 700px) {
  .table .hide-sm { display: none; }
  .table td, .table th { padding: 10px 8px; }
}

/* ---------- report */
.report { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .report { grid-template-columns: 1fr; } }
.zfis {
  background: var(--paper); border-radius: var(--r-lg); padding: 22px 22px 26px; position: relative;
  border-top: 8px solid var(--zfis-top, var(--brand));
  box-shadow: 0 0 0 2px var(--frame), 0 0 22px var(--frame-glow);
}
.zfis header { text-align: center; padding-bottom: 14px; border-bottom: 2px dashed var(--line); margin-bottom: 12px; }
.zfis-logo { display: block; width: 190px; height: auto; margin: 0 auto 8px; border-radius: 6px; }
.zfis header h3 { margin: 4px 0 0; font-family: var(--font-num); font-size: 28px; font-weight: 800; }
.zfis header p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.zline { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 16px; }
.zline b { font-family: var(--font-num); font-size: 21px; font-weight: 700; white-space: nowrap; }
.zline.sep { border-top: 2px dashed var(--line); margin-top: 6px; padding-top: 12px; }
.zline.grand { align-items: baseline; }
.zline.grand span { font-weight: 700; }
.zline.grand b { font-size: 42px; font-weight: 800; color: var(--action); }
.zline.profit b { color: var(--leaf); }
.zline.void b { color: var(--red); }
.zfoot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 14px; }
.report-side { display: grid; gap: 16px; min-width: 0; }
.date-inputs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.date-inputs .input { width: auto; min-height: 44px; font-size: 16px; }

/* ---------- modals */
.modal-wrap {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(8, 30, 17, .55); padding: 16px; animation: fade .15s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--paper); border-radius: var(--r-lg); box-shadow: 0 24px 60px rgba(0,0,0,.3);
  animation: rise .18s ease-out;
}
.modal.wide { width: min(760px, 100%); }
@keyframes rise { from { transform: translateY(16px); opacity: .6; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--mint); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.modal-head h3 { margin: 0; font-family: var(--font-num); font-size: 26px; font-weight: 700; line-height: 1.1; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 18px; display: grid; gap: 14px; }
.modal-foot { position: sticky; bottom: 0; background: var(--paper); z-index: 2; padding: 14px 18px 18px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--mint); }
.modal-foot .btn { flex: 1 1 160px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--mint); border-radius: var(--r-md); padding: 4px; gap: 4px; }
.tabs button { min-height: 48px; border: 0; border-radius: 9px; background: none; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--paper); color: var(--action); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.code-strip { display: flex; align-items: center; gap: 10px; background: var(--mint-2); border-radius: var(--r-md); padding: 10px 14px; }
.code-strip svg { width: 28px; height: 28px; color: var(--action); flex: none; }
.code-strip b { font-family: var(--font-num); font-size: 24px; letter-spacing: 1px; }

.online { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r-md); background: var(--gold-soft); }
.online.none { background: var(--mint-2); color: var(--muted); }
.online img { width: 64px; height: 64px; object-fit: contain; border-radius: var(--r-sm); background: #fff; flex: none; }
.online small { display: block; color: var(--amber); font-weight: 600; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--action); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.pick-list { display: grid; gap: 6px; max-height: 40vh; overflow: auto; }
.pick-list button { display: flex; gap: 12px; align-items: center; text-align: left; padding: 10px 12px; border: 2px solid var(--mint); border-radius: var(--r-md); background: var(--paper); }
.pick-list button:active, .pick-list button:hover { border-color: var(--action); }
.pick-list .price { margin-left: auto; font-family: var(--font-num); font-size: 20px; font-weight: 700; }

.barcode-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.barcode-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--mint); border-radius: 99px; padding: 4px 4px 4px 12px; font-family: var(--font-num); font-size: 18px; }
.barcode-chip button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; color: var(--red); font-size: 20px; }
.margin-hint { font-size: 14px; color: var(--muted); }
.margin-hint b { color: var(--leaf); }
.margin-hint.neg b { color: var(--red); }

.pay-total { text-align: center; padding: 8px 0; }
.pay-total span { color: var(--muted); font-weight: 600; }
.pay-total b { display: block; font-family: var(--font-num); font-size: 64px; font-weight: 800; color: var(--action); line-height: 1; }
.quick-cash { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.quick-cash button { min-height: 58px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--paper); font-family: var(--font-num); font-size: 24px; font-weight: 700; }
.quick-cash button.on { border-color: var(--action); background: var(--mint); }
.change { color: var(--text); display: flex; justify-content: space-between; align-items: baseline; background: var(--gold-soft); border-radius: var(--r-md); padding: 12px 16px; }
.change span { font-weight: 700; }
.change b { font-family: var(--font-num); font-size: 40px; font-weight: 800; }
.change.short { background: var(--red-soft); color: var(--red); }

.done-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 200; display: grid; place-content: center; text-align: center; gap: 8px;
  background: var(--sign-bg, var(--brand)); color: var(--on-brand); animation: fade .2s;
}
.done-overlay .tick { width: 96px; height: 96px; margin: 0 auto 8px; border-radius: 50%; background: var(--tick-bg); color: var(--tick-fg); display: grid; place-items: center; }
.done-overlay .tick svg { width: 56px; height: 56px; }
.done-overlay h2 { font-family: var(--font-num); font-size: 44px; margin: 0; }
.done-overlay p { margin: 0; font-size: 20px; color: var(--on-brand-soft); }
.done-overlay .big { font-family: var(--font-num); font-size: 72px; font-weight: 800; color: var(--total-text); text-shadow: 0 0 26px var(--total-glow); }

/* ---------- toasts */
#toasts { position: fixed; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: min(520px, calc(100% - 32px)); }
.toast { padding: 14px 18px; border-radius: var(--r-md); background: var(--solid); color: var(--on-solid); font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: rise .2s; }
.toast.error { background: var(--red); }
.toast.warn { background: var(--amber); }

/* ---------- settings */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.theme-opt {
  display: grid; gap: 8px; padding: 10px; text-align: left; border-radius: var(--r-md);
  border: 2px solid var(--line); background: var(--paper); font-weight: 600;
}
.theme-opt.on { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); }
.theme-swatch { display: flex; height: 44px; border-radius: var(--r-sm); overflow: hidden; }
.theme-swatch i { flex: 1; }
.theme-swatch i:first-child { flex: 2.4; }
.theme-opt small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }

.settings { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.switch-row + .switch-row { border-top: 1px solid var(--mint); }
.switch { position: relative; width: 58px; height: 34px; flex: none; }
.switch input { position: absolute; opacity: 0; top: 0; right: 0; bottom: 0; left: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; }
.switch i::after { content: ''; position: absolute; left: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--action); }
.switch input:checked + i::after { transform: translateX(24px); }
.switch input:focus-visible + i { outline: 3px solid var(--gold); outline-offset: 2px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--mint); }
.user-row .name { font-weight: 600; }
.user-row .btn { margin-left: auto; }
.user-row.off .name { color: var(--muted); text-decoration: line-through; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- print (gün sonu) */
@media print {
  body { background: #fff; font-size: 12px; }
  .topbar, .no-print, #toasts, #modals { display: none !important; }
  .page { padding: 0; }
  .report { display: block; }
  .zfis, .panel, .pos-cart { box-shadow: none !important; }
  .zfis { border: 0; padding: 0; max-width: 80mm; margin: 0 auto 8mm; }
  .zline b { font-size: 14px; }
  .zline.grand b { font-size: 24px; }
  .panel { border-radius: 0; }
  .table td, .table th { padding: 3px 4px; font-size: 11px; }
  .table td.r { font-size: 12px; }
  .print-hide { display: none !important; }
}

/* old browsers without aspect-ratio (e.g. Chrome 80 tablets) */
@supports not (aspect-ratio: 1 / 1) {
  .viewfinder::before { content: ''; display: block; padding-top: 75%; }
}

/* ---------- on-screen numpad */
.input.np-active { border-color: var(--action); box-shadow: 0 0 0 3px var(--gold); }
input[data-numpad] { cursor: pointer; caret-color: transparent; }
.numpad {
  position: fixed; z-index: 260; right: 12px; top: 50%; transform: translateY(-50%);
  width: 300px; max-height: calc(100% - 24px); overflow: auto;
  display: grid; grid-gap: 8px; padding: 12px;
  background: var(--paper); color: var(--text); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: 0 18px 50px rgba(0, 0, 0, .32);
}
.numpad.hidden { display: none; }
.np-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 15px; color: var(--muted); }
.np-head .np-label { padding-left: 4px; }
.np-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--mint); color: var(--text); display: grid; place-items: center; }
.np-x svg { width: 20px; height: 20px; }
.np-display {
  min-height: 56px; padding: 6px 12px; border-radius: 12px; background: var(--mint-2);
  font-family: var(--font-num); font-size: 38px; font-weight: 700; text-align: right; line-height: 44px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.np-display.empty { color: var(--muted); font-weight: 500; }
.np-keys { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 8px; }
.np-keys button, .np-actions button {
  height: 58px; border: 0; border-radius: 12px; background: var(--mint); color: var(--text);
  font-family: var(--font-num); font-size: 30px; font-weight: 700; touch-action: manipulation;
}
.np-keys button:active, .np-actions button:active { filter: brightness(.92); }
.np-actions { display: grid; grid-template-columns: auto 1fr 1.5fr; grid-gap: 8px; }
.np-actions button { font-family: var(--font); font-size: 17px; padding: 0 14px; display: flex; align-items: center; justify-content: center; }
.np-actions button svg { width: 20px; height: 20px; margin-right: 6px; }
.np-actions .np-abc.hidden { display: none; }
.np-actions .np-abc.hidden ~ button:first-of-type { grid-column: 1 / 3; }
.np-ok { background: var(--action) !important; color: var(--on-action) !important; }
body.np-open .modal-wrap { padding-right: 328px; }
@media (max-width: 760px), (orientation: portrait) {
  .numpad {
    left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; max-height: 60%;
    border-radius: 20px 20px 0 0; padding-bottom: calc(12px + var(--safe-b));
  }
  .np-keys button, .np-actions button { height: 52px; }
  body.np-open .modal-wrap { padding-right: 16px; padding-bottom: 430px; align-items: start; }
  body.np-open .modal { max-height: calc(var(--app-h, 100vh) - 450px); min-height: 200px; }
  body.np-open .pos { padding-bottom: 430px; }
}

/* old browsers without flexbox gap (e.g. Chrome 80): same spacing with margins */
.no-flexgap .btn > * + * { margin-left: 8px; }
.no-flexgap .row > * + * { margin-left: 12px; }
.no-flexgap .pin-dots > * + * { margin-left: 14px; }
.no-flexgap .topbar > * + * { margin-left: 14px; }
.no-flexgap .brand > * + * { margin-left: 10px; }
.no-flexgap .nav > * + * { margin-left: 4px; }
.no-flexgap .nav a > * + * { margin-left: 8px; }
.no-flexgap .who > * + * { margin-left: 10px; }
.no-flexgap .page-head > * + * { margin-left: 12px; }
.no-flexgap .pos-scan > * + * { margin-top: 12px; }
.no-flexgap .vf-badge > * + * { margin-left: 6px; }
.no-flexgap .vf-ctrls > * + * { margin-left: 6px; }
.no-flexgap .vf-ctrls button[data-flip] > * + * { margin-left: 6px; }
.no-flexgap .scan-tools > * + * { margin-left: 8px; }
.no-flexgap .scan-tools form > * + * { margin-left: 8px; }
.no-flexgap .search-pop button > * + * { margin-left: 12px; }
.no-flexgap .last-scan > * + * { margin-left: 14px; }
.no-flexgap .cart-head > * + * { margin-left: 10px; }
.no-flexgap .total-row > * + * { margin-left: 12px; }
.no-flexgap .toolbar > * + * { margin-left: 10px; }
.no-flexgap .chips > * + * { margin-left: 6px; }
.no-flexgap .panel-head > * + * { margin-left: 10px; }
.no-flexgap .zline > * + * { margin-left: 12px; }
.no-flexgap .date-inputs > * + * { margin-left: 8px; }
.no-flexgap .modal-head > * + * { margin-left: 12px; }
.no-flexgap .modal-foot > * + * { margin-left: 10px; }
.no-flexgap .code-strip > * + * { margin-left: 10px; }
.no-flexgap .online > * + * { margin-left: 12px; }
.no-flexgap .pick-list button > * + * { margin-left: 12px; }
.no-flexgap .barcode-chips > * + * { margin-left: 8px; }
.no-flexgap .barcode-chip > * + * { margin-left: 4px; }
.no-flexgap .switch-row > * + * { margin-left: 12px; }
.no-flexgap .user-row > * + * { margin-left: 10px; }
.no-flexgap .btn > svg:not(:last-child), .no-flexgap .np-actions button > svg { margin-right: 8px; }
.no-flexgap .code-strip > svg { margin-right: 10px; }

/* keep right-aligned items right-aligned when the gap fallback adds margins */
.no-flexgap .who, .no-flexgap .search-pop .price, .no-flexgap .last-scan .ls-price, .no-flexgap .cart-head .btn, .no-flexgap .modal-head .x, .no-flexgap .pick-list .price, .no-flexgap .user-row .btn { margin-left: auto; }

/* ---------- phones: two-row header, nothing wider than the screen */
html, body { max-width: 100%; overflow-x: hidden; }
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; gap: 6px 8px; padding: 6px 10px 0; padding-top: max(6px, env(safe-area-inset-top)); }
  .brand-logo { height: 34px; }
  .who { margin-left: auto; }
  .who button { min-height: 38px; padding: 0 12px; }
  .nav { order: 3; flex: 1 0 100%; margin: 0 -10px; padding: 0 6px; gap: 2px; }
  .nav a { flex: 1 1 0; justify-content: center; min-width: 0; min-height: 44px; padding: 0 4px; border-radius: 10px 10px 0 0; }
  .no-flexgap .nav > * + * { margin-left: 2px; }
  .no-flexgap .topbar > .nav { margin-left: -10px; margin-top: 6px; }
  .no-flexgap .topbar > .who { margin-left: auto; }
  .pos { padding: 10px; gap: 10px; }
  .page { padding: 12px 10px; }
  .page-head h2 { font-size: 28px; }
  .modal-wrap { padding: 8px; }
  .modal-body { padding: 14px; }
  .modal-foot { padding: 12px 14px 14px; }
  .modal-foot .btn { flex: 1 1 120px; }
  .cart-item { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 10px 12px; }
  .cart-item .ci-total { grid-column: 2; grid-row: 1; min-width: 0; font-size: 21px; }
  .cart-item .qty { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .ci-main { grid-column: 1; grid-row: 1; }
  .last-scan { gap: 10px; padding: 12px; }
  .last-scan .thumb { width: 52px; height: 52px; }
  .last-scan .ls-price { font-size: 30px; }
  .total-row strong { font-size: 52px; }
  .pay-row .btn { min-height: 58px; font-size: 20px; }
  .toolbar .input { flex: 1 1 100%; }
  .date-inputs { width: 100%; }
  .date-inputs .input { flex: 1 1 0; min-width: 0; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .report { grid-template-columns: minmax(0, 1fr); }
  .quick-cash { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pay-total b { font-size: 52px; }
  .change b { font-size: 32px; }
  .zfis { padding: 18px 16px 20px; }
  .table td, .table th { padding: 10px 6px; }
  .table td.r { font-size: 17px; }
  .np-display { font-size: 34px; }
}
