/* =====================================================
   BOTLOG v3 — Modern Military Dark UI
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;700;900&display=swap');

/* ── Design Tokens ── */
:root {
  /* Core palette */
  --bg:        #0c0f07;
  --bg2:       #111507;
  --surface:   #181d0d;
  --surface2:  #1e2410;
  --surface3:  #242b14;

  /* Accent */
  --gold:      #c9960a;
  --gold-dim:  #8a6608;
  --gold-glow: rgba(201,150,10,.18);
  --green:     #3d5c1e;
  --green2:    #4d7026;
  --green-dim: rgba(77,112,38,.20);

  /* Text */
  --t1: #e8e0cc;
  --t2: #a09880;
  --t3: #635e50;

  /* Borders */
  --b1: rgba(255,255,255,.07);
  --b2: rgba(255,255,255,.12);
  --b3: rgba(201,150,10,.22);

  /* Shadows */
  --sh1: 0 2px 12px rgba(0,0,0,.40);
  --sh2: 0 8px 32px rgba(0,0,0,.55);
  --sh3: 0 20px 60px rgba(0,0,0,.70);

  /* Radius */
  --r1: 14px;
  --r2: 10px;
  --r3: 7px;

  /* Type scale */
  --t-xs:   11px;
  --t-sm:   13px;
  --t-base: 15px;
  --t-md:   17px;
  --t-lg:   21px;
  --t-xl:   26px;
  --t-2xl:  32px;

  /* Button */
  --btn-h: 50px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  min-height: 100%;
}
body {
  font-family: 'Heebo', 'Noto Sans Hebrew', sans-serif;
  font-size: var(--t-base);
  color: var(--t1);
  min-height: 100%;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(77,112,38,.12) 0%, transparent 60%),
    url('/static/gdud_shahar_bg.png');
  background-size: auto, cover;
  background-position: center, center;
  background-attachment: fixed;
  background-repeat: no-repeat, no-repeat;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle grain */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Dark overlay on bg image */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background: rgba(8,11,4,.82);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

/* ── App Frame ── */
.app-frame {
  position: relative; z-index: 1;
  width: 100%; max-width: 430px;
  margin: 0 auto;
  min-height: 100svh;
  padding-bottom: 100px;
}
@media (min-width: 431px) {
  .app-frame {
    box-shadow:
      0 0 0 1px rgba(255,255,255,.06),
      0 0 80px rgba(0,0,0,.8);
    background: rgba(12,15,7,.5);
  }
}

/* ── HEADER ── */
.app-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0);
  background: rgba(10,13,6,.85);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.header-inner {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 11px 14px 10px;
}
.header-brand {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.logo-line {
  display: flex; align-items: center; gap: 7px;
}
.logo-icon {
  font-size: 16px;
  filter: drop-shadow(0 0 5px rgba(201,150,10,.6));
}
.logo-text {
  font-size: 19px; font-weight: 900;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
}
.tagline {
  font-size: var(--t-xs);
  color: var(--t3);
  font-weight: 500;
  letter-spacing: .4px;
}
.clock {
  font-size: var(--t-xs);
  color: var(--gold-dim);
  font-weight: 600;
  letter-spacing: .3px;
  opacity: .9;
}

.header-btn {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--surface2);
  border: 1px solid var(--b2);
  font-size: 17px;
  color: var(--t2);
  position: relative;
  transition: background .15s, border-color .15s;
}
.header-btn:hover { background: var(--surface3); border-color: var(--b3); color: var(--t1); }

.badge {
  position: absolute; top: -5px; right: -5px;
  background: #c0392b; color: #fff;
  min-width: 17px; height: 17px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800;
  border: 2px solid var(--bg);
}

.header-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--b2) 30%, var(--b3) 50%, var(--b2) 70%, transparent);
}

/* ── CONTAINER ── */
.container { padding: 14px 13px 6px; }

/* ── ALERTS ── */
.alerts { display: grid; gap: 8px; margin-bottom: 14px; }
.alert {
  padding: 11px 36px 11px 14px;
  border-radius: var(--r2);
  border: 1px solid var(--b1);
  background: var(--surface);
  font-size: var(--t-sm);
  font-weight: 500;
  position: relative;
  animation: slide-down .3s ease;
}
.alert.success { background: rgba(61,92,30,.25); border-color: rgba(61,92,30,.5); color: #a8d870; }
.alert.error   { background: rgba(150,30,30,.20); border-color: rgba(180,60,60,.4); color: #ffaaaa; }
.alert-close {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: inherit;
  font-size: 13px; cursor: pointer; opacity: .5; padding: 4px;
}
.alert-close:hover { opacity: 1; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--b1);
  border-radius: var(--r1);
  padding: 18px 16px;
  box-shadow: var(--sh2);
  position: relative;
  overflow: hidden;
}
/* Gold top line */
.card::after {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--b3), transparent);
}

/* ── TYPOGRAPHY ── */
h1 {
  font-size: var(--t-xl); font-weight: 900; line-height: 1.18;
  color: var(--t1);
  letter-spacing: -.3px;
}
h2 { font-size: var(--t-lg); font-weight: 700; color: var(--t1); margin-bottom: 8px; }
.muted  { color: var(--t2); font-size: var(--t-sm); line-height: 1.6; margin-top: 4px; }
.lead   { color: var(--t2); font-size: var(--t-sm); line-height: 1.65; }

.section-title {
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 11px;
  opacity: .85;
}

/* ── HOME SCREEN ── */
.home-screen {
  display: grid; gap: 13px;
  padding-top: 4px;
}

/* Hero */
.home-hero {
  border-radius: var(--r1);
  padding: 28px 18px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(77,112,38,.14) 0%, transparent 70%),
    var(--surface);
  border: 1px solid var(--b1);
  box-shadow: var(--sh2);
  animation: hero-in .55s cubic-bezier(.22,.68,0,1.05) both;
}
.home-hero::after {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,150,10,.35), transparent);
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.emblem {
  font-size: 46px; line-height: 1;
  margin-bottom: 14px;
  display: block;
  filter: drop-shadow(0 0 16px rgba(201,150,10,.35));
  animation: emblem-pulse 4s ease-in-out infinite;
}
@keyframes emblem-pulse {
  0%,100% { filter: drop-shadow(0 0 14px rgba(201,150,10,.25)); }
  50%      { filter: drop-shadow(0 0 28px rgba(201,150,10,.55)); }
}
.home-hero h1 { margin-bottom: 8px; }

/* Hello banner */
.hello-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--green-dim);
  border: 1px solid rgba(61,92,30,.45);
  border-radius: var(--r2);
  padding: 11px 14px;
  font-size: var(--t-sm); font-weight: 600;
  color: #a8d870;
  margin-top: 14px;
  text-align: right;
}
.hi-icon { font-size: 18px; flex-shrink: 0; }

/* Actions card */
.actions-card {
  background: var(--surface);
  border: 1px solid var(--b1);
  border-radius: var(--r1);
  padding: 16px 14px;
  box-shadow: var(--sh1);
  animation: hero-in .55s .08s cubic-bezier(.22,.68,0,1.05) both;
}
.home-actions { display: grid; gap: 9px; }

/* Stock warning */
.stock-warning {
  display: flex; align-items: flex-start; gap: 9px;
  background: rgba(120,80,0,.12);
  border: 1px solid rgba(180,120,0,.20);
  border-radius: var(--r2);
  padding: 11px 13px;
  font-size: var(--t-xs); color: #c9a840; line-height: 1.55;
  animation: hero-in .55s .16s ease both;
}
.warn-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  border: 0; cursor: pointer; font-weight: 700;
  border-radius: var(--r2);
  min-height: var(--btn-h);
  padding: 12px 18px;
  font-size: var(--t-base);
  transition: transform .12s, filter .12s, box-shadow .12s;
  width: 100%;
  position: relative; overflow: hidden;
  letter-spacing: .2px;
}
.btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.07) 0%, transparent 50%);
  pointer-events: none;
}
.btn:active { transform: scale(.97); filter: brightness(.92); }

/* Primary — army green */
.primary {
  background: linear-gradient(180deg, #4d7026 0%, #344e19 100%);
  color: #d8eab8;
  border: 1px solid rgba(77,112,38,.6);
  box-shadow: 0 4px 16px rgba(52,78,25,.45), inset 0 1px 0 rgba(255,255,255,.12);
}
.primary:hover { filter: brightness(1.1); box-shadow: 0 6px 20px rgba(52,78,25,.55); }

/* Secondary — gold tint */
.secondary {
  background: linear-gradient(180deg, rgba(201,150,10,.18) 0%, rgba(201,150,10,.08) 100%);
  color: var(--gold);
  border: 1px solid rgba(201,150,10,.30);
  box-shadow: 0 2px 10px rgba(201,150,10,.08);
}
.secondary:hover { background: rgba(201,150,10,.24); }

/* Ghost */
.ghost {
  background: var(--surface2);
  border: 1px solid var(--b2);
  color: var(--t2);
}
.ghost:hover { background: var(--surface3); color: var(--t1); }

/* Danger */
.danger {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(150,30,30,.18);
  border: 1px solid rgba(180,60,60,.30);
  color: #ffaaaa;
  min-height: 36px; font-size: var(--t-sm);
  padding: 6px 14px; border-radius: var(--r3);
  cursor: pointer; transition: .15s; width: auto;
  font-family: inherit; font-weight: 700;
}
.danger:hover { background: rgba(180,50,50,.28); }

/* Small */
.small-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--b2);
  background: var(--surface2);
  color: var(--t2);
  border-radius: var(--r3);
  padding: 8px 13px;
  font-size: var(--t-sm); font-weight: 600;
  cursor: pointer; transition: .15s;
  white-space: nowrap; font-family: inherit;
}
.small-btn:hover { background: var(--surface3); color: var(--t1); }

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── CHOICE CARDS ── */
.choice-grid { display: grid; gap: 9px; margin-top: 12px; }

.choice-card {
  background: var(--surface2);
  border: 1px solid var(--b1);
  border-radius: var(--r2);
  padding: 15px 14px;
  text-align: right;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
  position: relative; overflow: hidden;
  display: block;
}
.choice-card::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 3px; height: 100%;
  background: var(--green2);
  opacity: 0; transition: opacity .15s;
  border-radius: 0 var(--r2) var(--r2) 0;
}
.choice-card:hover { background: var(--surface3); border-color: rgba(77,112,38,.35); }
.choice-card:hover::before { opacity: 1; }
.choice-card:active { transform: scale(.985); }
.choice-name { font-size: var(--t-base); font-weight: 700; color: var(--t1); display: block; }
.choice-sub  { font-size: var(--t-xs); color: var(--t3); margin-top: 3px; display: block; }

/* Item choice buttons */
.btn-choice {
  background: var(--surface2);
  border: 1px solid var(--b1);
  border-radius: var(--r2);
  padding: 14px 14px;
  text-align: right;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
  color: var(--t1);
  font-size: var(--t-base); font-weight: 700;
  width: 100%;
}
.btn-choice:hover { background: var(--surface3); border-color: rgba(77,112,38,.35); }
.btn-choice:active { transform: scale(.985); }

/* ── FORMS ── */
.form { display: grid; gap: 13px; margin-top: 14px; }
.form label {
  display: grid; gap: 6px;
  font-size: var(--t-xs); font-weight: 700;
  letter-spacing: .6px; color: var(--t3); text-transform: uppercase;
}
.form input, .form select, .form textarea, .filters select {
  width: 100%;
  border: 1px solid var(--b2);
  border-radius: var(--r2);
  background: rgba(232,224,204,.92);
  color: #111;
  padding: 13px 14px;
  font-size: var(--t-base); font-family: inherit; font-weight: 500;
  outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.form input:focus, .form select:focus, .form textarea:focus {
  border-color: var(--green2);
  box-shadow: 0 0 0 3px rgba(77,112,38,.22);
}
.form textarea { min-height: 90px; resize: vertical; }

/* ── QTY GRID ── */
.qty-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 9px; margin-top: 14px;
}
.qty-btn {
  aspect-ratio: 1.1;
  border-radius: var(--r1);
  border: 1px solid var(--b2);
  background: var(--surface2);
  color: var(--t1);
  font-size: 24px; font-weight: 900;
  cursor: pointer; transition: .15s;
}
.qty-btn:hover { background: var(--surface3); border-color: rgba(77,112,38,.4); transform: scale(1.04); }
.qty-btn:active { transform: scale(.97); }

/* ── STARS ── */
.stars-grid {
  display: grid; grid-template-columns: repeat(5,1fr);
  gap: 7px; margin-top: 8px;
}
.star-label {
  background: var(--surface2); border: 1px solid var(--b1);
  border-radius: var(--r2); padding: 11px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; transition: .15s;
  font-size: var(--t-xs); font-weight: 700; color: var(--t3);
}
.star-label input { display: none; }
.star-label:hover,
.star-label:has(input:checked) {
  background: rgba(201,150,10,.12);
  border-color: rgba(201,150,10,.35);
  color: var(--gold);
}
.star-label:has(input:checked) .star-emoji {
  filter: drop-shadow(0 0 4px rgba(201,150,10,.5));
}
.star-emoji { font-size: 18px; }

/* ── TABLE ── */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--b1);
  border-radius: var(--r2); background: rgba(0,0,0,.25);
  -webkit-overflow-scrolling: touch;
}
.table-wrap.max-h { max-height: 460px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; min-width: 520px; }
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  text-align: right; font-size: var(--t-sm);
}
th {
  background: rgba(77,112,38,.15);
  color: var(--t2); font-weight: 700;
  font-size: var(--t-xs); letter-spacing: .5px; text-transform: uppercase;
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
td { color: var(--t2); }
tr:hover td { background: rgba(255,255,255,.025); color: var(--t1); }

/* ── CART ITEMS ── */
.cart-list { display: grid; gap: 8px; margin-top: 4px; }
.cart-item {
  background: var(--surface2); border: 1px solid var(--b1);
  border-radius: var(--r2); padding: 13px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 700; font-size: var(--t-base); color: var(--t1); }
.cart-item-meta { font-size: var(--t-xs); color: var(--t3); margin-top: 3px; }
.cart-item-actions { display: flex; gap: 7px; align-items: center; flex-shrink: 0; }
.cart-item-actions .small-btn, .cart-item-actions .danger { min-height: 44px; min-width: 44px; padding: 10px 14px; }

/* ── MISSING LIST ── */
.missing-list { display: grid; gap: 8px; margin-top: 10px; }
.missing-row {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface2); border: 1px solid var(--b1);
  border-radius: var(--r2); padding: 13px 14px;
  cursor: pointer; transition: background .15s;
}
.missing-row:hover { background: var(--surface3); }
.missing-row input[type=checkbox] {
  width: 18px; height: 18px; accent-color: var(--green2); cursor: pointer; flex-shrink: 0;
}
.missing-row span { font-size: var(--t-base); font-weight: 600; color: var(--t1); }

/* ── SUMMARY ── */
.summary-box {
  background: var(--surface2); border: 1px solid var(--b1);
  border-radius: var(--r2); padding: 13px 15px; margin-bottom: 12px;
}
.summary-row {
  display: flex; justify-content: space-between;
  font-size: var(--t-sm); color: var(--t2); margin-bottom: 5px;
}
.summary-row strong { color: var(--t1); font-weight: 600; }

/* ── SUCCESS ── */
.success-screen { text-align: center; padding: 10px 0; }
.success-icon { font-size: 54px; margin-bottom: 14px; animation: bounce-in .5s ease; display: block; }
@keyframes bounce-in {
  0%   { transform: scale(0); opacity: 0; }
  70%  { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

/* ── STATS ── */
.stats-row {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 9px; margin: 12px 0;
}
.stat-card {
  background: var(--surface2); border: 1px solid var(--b1);
  border-radius: var(--r2); padding: 13px 10px; text-align: center;
}
.stat-val   { font-size: var(--t-lg); font-weight: 900; color: var(--gold); line-height: 1; }
.stat-label { font-size: var(--t-xs); color: var(--t3); margin-top: 3px; font-weight: 600;
              text-transform: uppercase; letter-spacing: .5px; }

/* ── FILTERS ── */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.filters select {
  background: rgba(232,224,204,.90); color: #111;
  border: 1px solid var(--b2); border-radius: var(--r3);
  padding: 9px 12px; font-size: var(--t-sm); font-family: inherit;
  font-weight: 600; flex: 1; -webkit-appearance: none;
}
.search-input {
  flex: 2; background: rgba(232,224,204,.90); color: #111;
  border: 1px solid var(--b2); border-radius: var(--r3);
  padding: 9px 12px; font-size: var(--t-sm); font-family: inherit;
  font-weight: 500; outline: none; -webkit-appearance: none; min-width: 0;
}
.search-input:focus { box-shadow: 0 0 0 2px rgba(77,112,38,.25); }
.inline-check {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--t-sm); color: var(--t2); font-weight: 600;
}
.inline-check input { accent-color: var(--green2); width: 16px; height: 16px; }

/* ── ADMIN ACTIONS ── */
.admin-actions {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 7px; margin: 12px 0;
}

/* ── PAGE HEAD ── */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; margin-bottom: 16px;
}
.page-head .btn { width: auto; min-height: 38px; font-size: var(--t-sm); padding: 9px 14px; }

/* ── EMPTY ── */
.empty {
  text-align: center; padding: 26px 18px;
  border: 1px dashed var(--b2); border-radius: var(--r2);
  color: var(--t3); font-size: var(--t-base);
}

/* ── NOTICE BAR ── */
.notice-bar {
  display: flex; align-items: flex-start; gap: 9px;
  background: rgba(120,80,0,.12);
  border: 1px solid rgba(180,120,0,.20);
  border-radius: var(--r2); padding: 11px 13px;
  font-size: var(--t-xs); color: #c9a840; line-height: 1.55;
}

/* ── ACTIONS ── */
.actions { display: grid; gap: 9px; margin-top: 14px; }
.actions.row { grid-template-columns: 1fr 1fr; }

/* ── NARROW ── */
.narrow { max-width: 360px; margin-inline: auto; }

/* ── FOOTER ── */
.app-footer {
  position: fixed; left: 50%; bottom: 68px;
  transform: translateX(-50%);
  width: min(100%, 430px); z-index: 20;
  text-align: center; color: var(--t3);
  font-size: var(--t-xs); font-weight: 600;
  padding: 5px 16px; pointer-events: none; letter-spacing: .3px;
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 430px); height: 64px;
  background: rgba(10,13,6,.94);
  border-top: 1px solid var(--b2);
  z-index: 40;
  display: grid; grid-template-columns: repeat(4,1fr);
  align-items: center;
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--t3);
  font-size: 9px; font-weight: 700;
  letter-spacing: .4px; text-transform: uppercase;
  padding: 7px 4px; transition: color .15s;
  position: relative;
}
.bottom-nav a::before {
  content: '';
  position: absolute; top: 0; left: 22%; right: 22%;
  height: 2px; background: var(--gold); border-radius: 999px;
  opacity: 0; transition: opacity .15s; transform: scaleX(0); transform-origin: center;
  transition: opacity .2s, transform .2s;
}
.bottom-nav a.active { color: var(--gold); }
.bottom-nav a.active::before { opacity: 1; transform: scaleX(1); }
.bottom-nav a:hover { color: var(--t1); }
.nav-icon { font-size: 19px; line-height: 1; transition: transform .15s; }
.bottom-nav a.active .nav-icon { transform: scale(1.12); }

/* ── QR PAGE ── */
.qr-card { position: relative; text-align: center; padding: 26px 20px 22px; margin-top: 12px; }
.qr-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--surface2); border: 1px solid var(--b2);
  color: var(--t2); font-size: 15px;
  width: 32px; height: 32px; border-radius: 9px;
  cursor: pointer; display: grid; place-items: center; transition: .15s;
}
.qr-close:hover { background: var(--surface3); color: var(--t1); }
.qr-title { font-size: var(--t-lg); font-weight: 900; color: var(--green2); margin-bottom: 18px; margin-top: 6px; }
.qr-box {
  background: #fff; border-radius: 14px; padding: 14px;
  display: inline-block; box-shadow: 0 8px 28px rgba(0,0,0,.35); margin-bottom: 16px;
}
.qr-img { display: block; width: min(210px, 62vw); height: auto; border-radius: 3px; }
.qr-url-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--b2);
  border-radius: var(--r2); padding: 9px 13px; margin-bottom: 12px;
}
.qr-url { flex: 1; font-size: var(--t-xs); color: var(--t3); word-break: break-all; font-family: monospace; font-weight: 600; }
.qr-copy {
  background: var(--green-dim); border: 1px solid rgba(61,92,30,.4);
  color: #a8d870; font-size: var(--t-xs); font-weight: 700;
  padding: 5px 11px; border-radius: 7px; cursor: pointer; white-space: nowrap;
  transition: .15s; font-family: inherit;
}
.qr-copy:hover { background: rgba(77,112,38,.30); }
.qr-hint { font-size: var(--t-xs); color: var(--t3); line-height: 1.6; margin-bottom: 16px; }
.qr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.qr-btn svg { display: block; }

/* ── ANIMATIONS ── */
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── SMALL PHONES ── */
@media (max-width: 359px) {
  .header-inner { padding: 9px 11px 8px; }
  .container { padding: 11px 11px 5px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-row .stat-card:last-child { grid-column: span 2; }
  .admin-actions { grid-template-columns: 1fr; }
  .qty-grid { grid-template-columns: repeat(2,1fr); }
  .stars-grid { grid-template-columns: repeat(3,1fr); }
}

/* ── TABLET ── */
@media (min-width: 600px) {
  :root {
    --t-base: 16px; --t-md: 18px;
    --t-lg: 22px; --t-xl: 28px;
    --btn-h: 52px; --r1: 16px;
  }
}

/* ===== FAB — Status Button ===== */
.fab-status {
  position: fixed;
  left: 16px;
  bottom: 80px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: linear-gradient(180deg, #2e6e9e 0%, #1e4e72 100%);
  border: 1px solid rgba(46,110,158,.50);
  border-radius: 18px;
  padding: 10px 12px 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.50), 0 0 0 1px rgba(255,255,255,.08);
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
  animation: fab-in .5s .3s cubic-bezier(.22,.68,0,1.35) both;
}
.fab-status:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 30px rgba(0,0,0,.55), 0 0 16px rgba(46,110,158,.35);
}
.fab-status:active { transform: scale(.95); }

.fab-icon  { font-size: 22px; line-height: 1; }
.fab-label {
  font-size: 9px; font-weight: 800;
  letter-spacing: .5px; text-transform: uppercase;
  color: rgba(255,255,255,.80);
}

@keyframes fab-in {
  from { opacity: 0; transform: scale(0) translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* מסתיר את הFAB בדף my_orders עצמו */
body[data-page="my_orders"] .fab-status { display: none; }

/* ===== מצב שמש — Outdoor Mode ===== */
@media (prefers-color-scheme: light) and (min-width: 999999px) {
  :root {
    --bg:       #e8e4d8;
    --bg2:      #ddd9cc;
    --surface:  #f0ece0;
    --surface2: #e4e0d4;
    --surface3: #d8d4c8;
    --t1:       #1a1f0e;
    --t2:       #3a3f2e;
    --t3:       #6a6f5e;
    --b1:       rgba(0,0,0,.12);
    --b2:       rgba(0,0,0,.20);
    --b3:       rgba(100,80,0,.30);
    --gold:     #7a5a00;
    --gold-dim: #5a4200;
    --green:    #2a4a10;
    --green2:   #3a6a18;
    --sh1:      0 2px 8px rgba(0,0,0,.15);
    --sh2:      0 6px 24px rgba(0,0,0,.18);
    --sh3:      0 16px 48px rgba(0,0,0,.22);
  }

  body {
    background:
      radial-gradient(ellipse 80% 50% at 50% -10%, rgba(180,160,80,.15) 0%, transparent 60%),
      var(--bg);
  }

  body::after {
    background: none;
  }

  .app-header {
    background: rgba(230,225,210,.92);
  }

  .bottom-nav {
    background: rgba(220,215,200,.95);
  }

  .form input, .form select, .form textarea,
  .filters select, .search-input,
  .admin-filters select {
    background: rgba(255,255,255,.95);
    color: #1a1f0e;
    border-color: rgba(0,0,0,.25);
  }

  .btn.primary {
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.20);
  }

  .qr-title { color: var(--green2); }
  .logo-text { color: var(--gold); }
  .clock     { color: var(--gold-dim); }
  .section-title { color: var(--gold); }
  .a-stat-val    { color: var(--gold); }
}

/* כפתור החלפת מצב ידני */
.sun-btn {
  position: fixed;
  bottom: 80px; right: 14px;
  z-index: 45;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 1px solid var(--b2);
  display: grid; place-items: center;
  font-size: 20px;
  cursor: pointer;
  transition: .15s;
  backdrop-filter: blur(10px);
  box-shadow: var(--sh1);
}
.sun-btn:hover { transform: scale(1.1); }

body.sun-mode {
  --bg:       #f5f0e0;
  --bg2:      #ede8d8;
  --surface:  #faf8f0;
  --surface2: #f0ece0;
  --surface3: #e8e4d4;
  --t1:       #1a1f0e;
  --t2:       #3a3f2e;
  --t3:       #6a6f5e;
  --b1:       rgba(0,0,0,.10);
  --b2:       rgba(0,0,0,.18);
  --b3:       rgba(100,80,0,.25);
  --gold:     #7a5a00;
  --gold-dim: #5a4200;
  --green2:   #3a6a18;
  --sh2:      0 6px 24px rgba(0,0,0,.15);
}

body.sun-mode::after { background: none; }
body.sun-mode .app-header { background: rgba(240,235,220,.94); }
body.sun-mode .bottom-nav { background: rgba(235,230,215,.96); }
body.sun-mode .logo-text  { color: var(--gold); }
body.sun-mode .clock      { color: var(--gold-dim); }
body.sun-mode .section-title { color: var(--gold); }
body.sun-mode .form input,
body.sun-mode .form select,
body.sun-mode .filters select,
body.sun-mode .search-input,
body.sun-mode .admin-filters select { background: rgba(255,255,255,.95); color: #1a1f0e; }

/* =====================================================
   BOTLOG v4 — MODERN GLOW LAYER (enhancement overlay)
   ===================================================== */
:root {
  --accent:     #e0a800;
  --accent2:    #ffcf3f;
  --glow-gold:  rgba(224,168,0,.55);
  --glow-green: rgba(102,150,48,.45);
}

/* ── Animated aurora behind the app frame ── */
.app-frame::before {
  content: '';
  position: fixed;
  inset: -20% -30% auto -30%;
  height: 75vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 50% at 25% 20%, rgba(102,150,48,.30), transparent 70%),
    radial-gradient(45% 55% at 80% 10%, rgba(224,168,0,.26), transparent 70%),
    radial-gradient(50% 60% at 55% 40%, rgba(46,110,158,.18), transparent 75%);
  filter: blur(20px);
  opacity: .9;
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(-3%,2%,0) scale(1.08); }
  100% { transform: translate3d(4%,-2%,0) scale(1.04); }
}
.app-header, .container { position: relative; z-index: 1; }

/* ── Frosted glass cards with gradient hairline ── */
.card, .actions-card, .home-hero, .stat-card, .choice-card, .summary-box {
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012)),
    var(--surface);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  border: 1px solid transparent;
  background-clip: padding-box;
  box-shadow: var(--sh2), inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .25s cubic-bezier(.22,.68,0,1.1), box-shadow .25s, border-color .25s;
}
.card:hover, .actions-card:hover, .home-hero:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh3), 0 0 0 1px var(--b3), inset 0 1px 0 rgba(255,255,255,.07);
}

/* Glowing gradient top accent on hero & cards */
.home-hero::after, .card::after {
  height: 2px !important;
  left: 8% !important; right: 8% !important;
  background: linear-gradient(90deg, transparent, var(--accent2), var(--green2), transparent) !important;
  box-shadow: 0 0 14px var(--glow-gold);
}

/* ── Hero: animated gradient title + bigger glow ── */
.home-hero {
  background:
    radial-gradient(ellipse 75% 65% at 50% 0%, rgba(102,150,48,.20) 0%, transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.01)),
    var(--surface);
}
.home-hero h1 {
  background: linear-gradient(100deg, var(--t1) 20%, var(--accent2) 55%, var(--green2) 90%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: title-shine 6s linear infinite;
}
@keyframes title-shine { to { background-position: 200% center; } }
.emblem { filter: drop-shadow(0 0 22px var(--glow-gold)); }

/* ── Buttons: gloss + glow + shimmer sweep ── */
.btn { letter-spacing: .3px; }
.btn.primary {
  background: linear-gradient(180deg, #5e8a2e 0%, #3a571c 100%);
  box-shadow: 0 6px 22px rgba(60,90,28,.55), 0 0 0 1px rgba(255,255,255,.08), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn.primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 10px 30px rgba(90,140,40,.6), 0 0 22px var(--glow-green);
}
.btn.secondary {
  box-shadow: 0 4px 18px rgba(224,168,0,.14), inset 0 1px 0 rgba(255,255,255,.10);
}
.btn.secondary:hover { box-shadow: 0 6px 24px var(--glow-gold); filter: brightness(1.08); }
.btn::after {
  content: '';
  position: absolute; top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.22), transparent);
  transform: skewX(-18deg);
  transition: left .55s ease;
  pointer-events: none;
}
.btn:hover::after { left: 130%; }

/* ── Choice cards: accent bar + smoother hover ── */
.choice-card::before, .btn-choice { transition: all .2s ease; }
.choice-card:hover { transform: translateY(-2px) scale(1.005); box-shadow: 0 8px 24px rgba(0,0,0,.35); }

/* ── Section titles: glowing dot ── */
.section-title { display: inline-flex; align-items: center; gap: 8px; }
.section-title::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent2); box-shadow: 0 0 10px var(--glow-gold);
  animation: dot-pulse 2.4s ease-in-out infinite;
}
@keyframes dot-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Floating glass bottom nav ── */
.bottom-nav {
  width: min(100% - 20px, 410px);
  bottom: 10px;
  height: 62px;
  border-radius: 22px;
  border: 1px solid var(--b2);
  background: rgba(14,18,8,.72);
  box-shadow: 0 12px 40px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(26px) saturate(1.6);
  -webkit-backdrop-filter: blur(26px) saturate(1.6);
}
.bottom-nav a.active {
  color: var(--accent2);
}
.bottom-nav a.active .nav-icon {
  filter: drop-shadow(0 0 10px var(--glow-gold));
  transform: scale(1.18) translateY(-1px);
}
.bottom-nav a::before {
  top: auto; bottom: 6px;
  height: 3px; left: 30%; right: 30%;
  background: var(--accent2);
  box-shadow: 0 0 10px var(--glow-gold);
}
.app-footer { bottom: 80px; }

/* ── Stat cards: glowing value ── */
.stat-val { text-shadow: 0 0 18px var(--glow-gold); }

/* ── FAB: stronger depth ── */
.fab-status {
  bottom: 90px;
  box-shadow: 0 10px 30px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08), 0 0 18px rgba(46,110,158,.3);
}
.sun-btn { bottom: 90px; }

/* ── Respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .app-frame::before, .home-hero h1, .section-title::before, .emblem { animation: none; }
}

/* ── Tone down glow in light / sun mode ── */
@media (prefers-color-scheme: light) and (min-width: 999999px) {
  .app-frame::before { opacity: .5; }
  .home-hero h1 { -webkit-text-fill-color: initial; background: none; color: var(--t1); }
  .stat-val { text-shadow: none; }
}
body.sun-mode .app-frame::before { opacity: .5; }
body.sun-mode .home-hero h1 { -webkit-text-fill-color: initial; background: none; color: var(--t1); }
body.sun-mode .stat-val { text-shadow: none; }

/* =====================================================
   BOTLOG v4 — Header button consolidation
   ===================================================== */
.header-inner { grid-template-columns: auto 1fr auto; }
.header-actions { display: flex; align-items: center; gap: 7px; }

/* Sun toggle now lives in the header — reset its old fixed/floating styles */
.sun-btn {
  position: static;
  inset: auto;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--surface2);
  border: 1px solid var(--b2);
  box-shadow: none;
  backdrop-filter: none;
  font-size: 17px;
  color: var(--t2);
}
.sun-btn:hover { transform: none; background: var(--surface3); border-color: var(--b3); color: var(--t1); }

/* Old floating FAB removed from markup — hide defensively if cached */
.fab-status { display: none !important; }

/* Footer no longer needs to clear the floating FAB */
.app-footer { bottom: 78px; }

/* =====================================================
   BOTLOG v4 — SUN / DAYLIGHT MODE OVERHAUL
   Crisp contrast, real depth, readable accents.
   ===================================================== */
.sun-v4-tokens,
body.sun-mode {
  --bg:       #eceadf;
  --bg2:      #e3e0d2;
  --surface:  #ffffff;
  --surface2: #f4f1e8;
  --surface3: #e9e5d8;
  --t1:       #15180c;
  --t2:       #44483a;
  --t3:       #6c7060;
  --b1:       rgba(20,24,10,.14);
  --b2:       rgba(20,24,10,.22);
  --b3:       rgba(120,90,0,.40);
  --gold:     #8a6300;
  --gold-dim: #6a4c00;
  --green:    #2f5212;
  --green2:   #3f6e18;
  --glow-gold:  rgba(138,99,0,.25);
  --glow-green: rgba(63,110,24,.22);
  --sh1: 0 1px 4px rgba(20,24,10,.10);
  --sh2: 0 4px 16px rgba(20,24,10,.14);
  --sh3: 0 14px 36px rgba(20,24,10,.20);
}

.sun-mode-styles,
body.sun-mode {
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(120,140,70,.18) 0%, transparent 60%),
    var(--bg);
}
body.sun-mode::after { background: none; }
body.sun-mode .app-frame::before { opacity: .35; filter: blur(26px); }

/* Solid, separated cards — no white-on-white glass wash */
body.sun-mode .card,
body.sun-mode .actions-card,
body.sun-mode .home-hero,
body.sun-mode .stat-card,
body.sun-mode .choice-card,
body.sun-mode .summary-box,
body.sun-mode .cart-item,
body.sun-mode .missing-row {
  background: var(--surface);
  border: 1px solid var(--b1);
  box-shadow: var(--sh2);
  backdrop-filter: none;
}
body.sun-mode .choice-card,
body.sun-mode .cart-item,
body.sun-mode .missing-row,
body.sun-mode .btn-choice,
body.sun-mode .qty-btn,
body.sun-mode .star-label { background: var(--surface2); }

body.sun-mode .home-hero { background: linear-gradient(180deg, #fff, #f7f4ea); }
body.sun-mode .home-hero h1 { -webkit-text-fill-color: initial; background: none; color: var(--t1); }
body.sun-mode .emblem { filter: drop-shadow(0 2px 6px rgba(120,90,0,.30)); }
body.sun-mode .stat-val { text-shadow: none; color: var(--gold); }

/* Header & floating nav: bright frosted with clear edge */
body.sun-mode .app-header { background: rgba(248,246,238,.92); }
body.sun-mode .header-divider { background: linear-gradient(90deg, transparent, var(--b2) 30%, var(--b3) 50%, var(--b2) 70%, transparent); }
body.sun-mode .header-btn,
body.sun-mode .sun-btn { background: #fff; border-color: var(--b2); color: var(--t2); box-shadow: var(--sh1); }
body.sun-mode .bottom-nav {
  background: rgba(252,250,244,.88);
  border: 1px solid var(--b2);
  box-shadow: 0 10px 30px rgba(20,24,10,.18);
}
body.sun-mode .bottom-nav a { color: var(--t3); }
body.sun-mode .bottom-nav a.active { color: var(--gold); }

/* Buttons: strong, legible */
body.sun-mode .btn.primary {
  background: linear-gradient(180deg, #4a7d1f 0%, #356017 100%);
  color: #fff;
  border: 1px solid rgba(47,82,18,.55);
  box-shadow: 0 4px 14px rgba(47,82,18,.30), inset 0 1px 0 rgba(255,255,255,.22);
}
body.sun-mode .btn.secondary {
  background: linear-gradient(180deg, rgba(138,99,0,.16), rgba(138,99,0,.08));
  color: var(--gold);
  border: 1px solid rgba(138,99,0,.35);
  box-shadow: var(--sh1);
}
body.sun-mode .btn.ghost { background: var(--surface2); border-color: var(--b2); color: var(--t2); }

/* Inputs: clean white with clear focus */
body.sun-mode .form input,
body.sun-mode .form select,
body.sun-mode .form textarea,
body.sun-mode .filters select,
body.sun-mode .search-input {
  background: #fff; color: #15180c; border-color: var(--b2);
}
body.sun-mode .section-title { color: var(--gold); }
body.sun-mode .muted, body.sun-mode .lead { color: var(--t2); }

/* Mirror the whole overhaul for users whose OS is in light mode (auto) */
@media (prefers-color-scheme: light) and (min-width: 999999px) {
  :root:not(.force-dark) {
    --bg: #eceadf; --bg2: #e3e0d2;
    --surface: #ffffff; --surface2: #f4f1e8; --surface3: #e9e5d8;
    --t1: #15180c; --t2: #44483a; --t3: #6c7060;
    --b1: rgba(20,24,10,.14); --b2: rgba(20,24,10,.22); --b3: rgba(120,90,0,.40);
    --gold: #8a6300; --gold-dim: #6a4c00; --green: #2f5212; --green2: #3f6e18;
    --glow-gold: rgba(138,99,0,.25); --glow-green: rgba(63,110,24,.22);
    --sh1: 0 1px 4px rgba(20,24,10,.10); --sh2: 0 4px 16px rgba(20,24,10,.14); --sh3: 0 14px 36px rgba(20,24,10,.20);
  }
  .card, .actions-card, .home-hero, .stat-card, .choice-card, .summary-box, .cart-item, .missing-row {
    background: var(--surface); border: 1px solid var(--b1); box-shadow: var(--sh2); backdrop-filter: none;
  }
  .choice-card, .cart-item, .missing-row, .btn-choice, .qty-btn, .star-label { background: var(--surface2); }
  .home-hero { background: linear-gradient(180deg, #fff, #f7f4ea); }
  .emblem { filter: drop-shadow(0 2px 6px rgba(120,90,0,.30)); }
  .stat-val { color: var(--gold); }
  .app-header { background: rgba(248,246,238,.92); }
  .header-btn, .sun-btn { background: #fff; border-color: var(--b2); color: var(--t2); box-shadow: var(--sh1); }
  .bottom-nav { background: rgba(252,250,244,.88); border: 1px solid var(--b2); box-shadow: 0 10px 30px rgba(20,24,10,.18); }
  .bottom-nav a.active { color: var(--gold); }
  .btn.primary { background: linear-gradient(180deg, #4a7d1f 0%, #356017 100%); color: #fff; border: 1px solid rgba(47,82,18,.55); box-shadow: 0 4px 14px rgba(47,82,18,.30), inset 0 1px 0 rgba(255,255,255,.22); }
  .btn.secondary { background: linear-gradient(180deg, rgba(138,99,0,.16), rgba(138,99,0,.08)); color: var(--gold); border: 1px solid rgba(138,99,0,.35); }
  .form input, .form select, .form textarea, .filters select, .search-input { background: #fff; color: #15180c; border-color: var(--b2); }
}

/* =====================================================
   BOTLOG v4 — Tap loading feedback + nav progress bar
   ===================================================== */
.is-loading { opacity: .65; pointer-events: none; transition: opacity .15s; }
.tap-spinner {
  display: inline-block; width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.30); border-top-color: #fff;
  border-radius: 50%; animation: spin .6s linear infinite;
  margin-inline-start: 8px; vertical-align: middle; flex-shrink: 0;
}
body.sun-mode .tap-spinner { border-color: rgba(0,0,0,.25); border-top-color: var(--green2); }

/* Top navigation progress bar */
#nav-progress {
  position: fixed; top: 0; right: 0; left: auto;
  height: 3px; width: 0;
  background: linear-gradient(90deg, var(--green2), var(--accent2));
  box-shadow: 0 0 10px var(--glow-gold);
  z-index: 9999; opacity: 0;
  transition: width .25s ease, opacity .3s ease;
}
#nav-progress.go { opacity: 1; }

/* =====================================================
   BOTLOG v4 — Accessibility & touch targets
   ===================================================== */
/* Brighter muted text for readable contrast on dark */
:root { --t3: #8f897a; }

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
.btn:focus-visible, .header-btn:focus-visible, .choice-card:focus-visible,
.item-btn:focus-visible, .size-btn:focus-visible, .qty-btn:focus-visible,
.cat-card:focus-visible, .bottom-nav a:focus-visible {
  outline: 3px solid var(--accent2);
  outline-offset: 2px;
  border-radius: var(--r3);
}

/* Minimum 44px touch targets for small controls */
.small-btn, .danger { min-height: 44px; }
.alert-close { min-width: 40px; min-height: 40px; }
.qr-copy { min-height: 36px; }
.filters select, .search-input { min-height: 44px; }
.header-btn, .sun-btn { min-width: 38px; min-height: 38px; }

/* Honor reduced-motion for the heavier effects */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  #nav-progress { transition: none; }
}

/* =====================================================
   BOTLOG v4 — Skip link & screen-reader utility
   ===================================================== */
.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; right: 50%; transform: translateX(50%) translateY(-200%);
  z-index: 10000;
  background: var(--green2); color: #fff;
  padding: 10px 18px; border-radius: var(--r2);
  font-weight: 700; font-size: var(--t-sm);
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
  transition: transform .2s ease;
}
.skip-link:focus-visible {
  transform: translateX(50%) translateY(0);
  outline: 3px solid var(--accent2); outline-offset: 2px;
}

/* =====================================================
   BOTLOG v4 — Admin dashboard: sun/light mode coverage
   ===================================================== */
body.sun-mode .a-stat,
body.sun-mode .admin-section {
  background: var(--surface);
  border: 1px solid var(--b1);
  box-shadow: var(--sh2);
}
body.sun-mode .dl-btn { background: var(--surface2); border: 1px solid var(--b1); color: var(--t2); }
body.sun-mode .dl-btn:hover { background: var(--surface3); color: var(--gold); }
body.sun-mode .reset-gray { background: var(--surface2); border-color: var(--b2); color: var(--t2); }
body.sun-mode .reset-gray:hover { background: var(--surface3); color: var(--t1); }
body.sun-mode .a-stat-val { color: var(--gold); }
body.sun-mode .a-stat-val.top-item { color: var(--t1); }
body.sun-mode .table-wrap { background: rgba(0,0,0,.03); border-color: var(--b1); }
body.sun-mode th { background: rgba(63,110,24,.14); color: var(--t2); }
body.sun-mode td { color: var(--t2); }
body.sun-mode tr:hover td { background: rgba(0,0,0,.03); color: var(--t1); }
body.sun-mode .admin-filters select { background: #fff; color: #15180c; border-color: var(--b2); }

/* Admin table: focus-visible on interactive supply/reset controls already covered globally */

/* =====================================================
   BOTLOG v4 — Sun mode: badge & status contrast
   (light-on-light fixes for my_orders / admin / qr)
   ===================================================== */
body.sun-mode .tag {
  background: rgba(63,110,24,.16); border-color: rgba(63,110,24,.40); color: #2f5212;
}
body.sun-mode .missing-dot {
  background: rgba(160,30,30,.12); border-color: rgba(160,30,30,.35); color: #8a1f1f;
}
body.sun-mode .status-badge[class*="התקבל"] { background: rgba(63,110,24,.14); border-color: rgba(63,110,24,.40); color: #2f5212; }
body.sun-mode .status-badge[class*="בהכנה"] { background: rgba(138,99,0,.14);  border-color: rgba(138,99,0,.40);  color: #6a4c00; }
body.sun-mode .status-badge[class*="יצא"]    { background: rgba(30,90,150,.14); border-color: rgba(30,90,150,.40); color: #134a78; }
body.sun-mode .s-badge.recv     { background: rgba(63,110,24,.14); border-color: rgba(63,110,24,.40); color: #2f5212; }
body.sun-mode .s-badge.prep     { background: rgba(138,99,0,.14);  border-color: rgba(138,99,0,.40);  color: #6a4c00; }
body.sun-mode .s-badge.shipped  { background: rgba(30,90,150,.14); border-color: rgba(30,90,150,.40); color: #134a78; }
body.sun-mode .s-badge.supplied { background: rgba(110,50,160,.14);border-color: rgba(110,50,160,.40);color: #5a1f8a; }
body.sun-mode .a-stat-val.warn  { color: #b3261e; }
body.sun-mode .hello-banner { background: rgba(63,110,24,.12); border-color: rgba(63,110,24,.35); color: #2f5212; }
body.sun-mode .stock-warning, body.sun-mode .notice-bar { background: rgba(160,110,0,.10); border-color: rgba(160,110,0,.30); color: #6a4c00; }
body.sun-mode .supply-week strong { color: var(--t2); }
body.sun-mode .qr-title { color: #2f5212; }
body.sun-mode .progress-fill { background: linear-gradient(90deg, #3f6e18, #8a6300); }
body.sun-mode .week-strip .active { color: #fff; }
body.sun-mode .alert.success { background: rgba(63,110,24,.12); border-color: rgba(63,110,24,.4); color: #2f5212; }
body.sun-mode .alert.error   { background: rgba(160,30,30,.10); border-color: rgba(160,30,30,.4); color: #8a1f1f; }
body.sun-mode .empty { border-color: var(--b2); color: var(--t2); }

/* =====================================================
   BOTLOG v4 — FIX (v2): kill horizontal overflow on mobile
   מתקן סופית: עמודה ממורכזת, בלי גלישה אופקית, מתאים לנייד
   ===================================================== */
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}
html { scrollbar-gutter: stable; }

/* מסגרת האפליקציה — ממלאת את הנייד, ממורכזת בדסקטופ */
.app-frame {
  width: 100%;
  max-width: 430px;
  margin-inline: auto !important;
  overflow-x: clip;            /* גוזם כל חריגה אופקית בלי לשבור sticky */
}

/* האורורה: כלואה בדיוק לרוחב המסך, בלי תזוזה צידית שיוצרת גלישה */
.app-frame::before {
  inset: 0 0 auto 0 !important;   /* top:0 right:0 bottom:auto left:0 = רוחב מסך מלא */
  width: auto !important;
  transform: none !important;
  animation: none !important;     /* בלי הנפשה צידית שחורגת מהמסך */
  height: 60vh;
}

/* ביטחון: שום אלמנט בתוך המסגרת לא יחרוג לרוחב */
.container, .home-screen, .app-header, .app-footer, .bottom-nav { max-width: 100%; }

/* =====================================================
   BOTLOG — Credits: modals, order action buttons
   ===================================================== */
.credit-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,.72);
  display: grid; place-items: center; padding: 18px;
  backdrop-filter: blur(4px); animation: fade-in .25s ease;
}
.credit-modal {
  width: min(380px, 100%);
  background: var(--surface); border: 1px solid var(--b2);
  border-radius: var(--r1); padding: 26px 22px; text-align: center;
  box-shadow: var(--sh3); display: grid; gap: 12px;
  animation: pop-in .35s cubic-bezier(.22,.68,0,1.3);
}
.credit-burst { font-size: 48px; line-height: 1; }
.credit-modal h2 { font-size: var(--t-xl); font-weight: 900; color: var(--gold); }
.credit-modal p { color: var(--t2); font-size: var(--t-sm); }
.credit-total strong { color: var(--gold); font-size: 1.25em; }
.credit-prize-won {
  background: rgba(201,150,10,.15); border: 1px solid rgba(201,150,10,.40);
  color: var(--gold); border-radius: var(--r2); padding: 10px; font-weight: 800;
}
.prize-list { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 7px; text-align: right; }
.prize-list li {
  background: var(--surface2); border: 1px solid var(--b1);
  border-radius: var(--r2); padding: 9px 12px; font-size: var(--t-sm); font-weight: 700; color: var(--t1);
}
.credit-foot { font-size: var(--t-xs); color: var(--t3); }
@keyframes pop-in { from { opacity:0; transform: scale(.85) translateY(10px); } to { opacity:1; transform:none; } }

/* Order action buttons (my_orders) */
.confirm-order-btn, .cancel-order-btn {
  width: 100%; border-radius: var(--r2); cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: var(--t-sm);
  min-height: 46px; transition: .15s; border: 1px solid;
}
.confirm-order-btn {
  background: linear-gradient(180deg, #4d7026 0%, #344e19 100%);
  color: #d8eab8; border-color: rgba(77,112,38,.6);
  box-shadow: 0 4px 14px rgba(52,78,25,.4);
}
.confirm-order-btn:hover { filter: brightness(1.1); }
.cancel-order-btn {
  background: rgba(150,30,30,.16); color: #ffaaaa; border-color: rgba(180,60,60,.32);
}
.cancel-order-btn:hover { background: rgba(180,50,50,.26); }
body.sun-mode .confirm-order-btn { color: #fff; }
body.sun-mode .cancel-order-btn { background: rgba(160,30,30,.10); color: #8a1f1f; border-color: rgba(160,30,30,.35); }

/* Admin credits section */
.cred-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface2); border: 1px solid var(--b1);
  border-radius: var(--r2); padding: 11px 13px;
}
.cred-name { font-weight: 800; color: var(--t1); font-size: var(--t-sm); }
.cred-pluga { font-size: var(--t-xs); color: var(--t3); }
.cred-total { margin-inline-start: auto; font-weight: 900; color: var(--gold); font-size: var(--t-md); }
.cred-prizes { display: flex; gap: 5px; flex-wrap: wrap; width: 100%; }
.cred-prize-chip {
  font-size: 11px; font-weight: 800; border-radius: 999px; padding: 4px 9px;
  border: 1px solid var(--b2); color: var(--t3); background: var(--surface);
}
.cred-prize-chip.reached { color: var(--gold); border-color: rgba(201,150,10,.4); background: rgba(201,150,10,.12); }
.cred-prize-chip.given { color: #a8d870; border-color: rgba(77,112,38,.45); background: rgba(77,112,38,.16); }
.cred-give-btn {
  font-size: 11px; font-weight: 800; border-radius: 999px; padding: 4px 9px; cursor: pointer;
  border: 1px solid rgba(201,150,10,.4); background: rgba(201,150,10,.12); color: var(--gold); font-family: inherit;
}

/* Fix: respect the hidden attribute on credit overlays (welcome popup) */
.credit-overlay[hidden] { display: none !important; }

/* Admin credits — give/reset controls */
.cred-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cred-give-form { display: flex; gap: 5px; align-items: center; margin: 0; }
.cred-amount {
  width: 58px; min-height: 34px; text-align: center;
  background: var(--surface2); color: var(--t1);
  border: 1px solid var(--b2); border-radius: 8px;
  font-family: inherit; font-weight: 700; font-size: var(--t-sm); -webkit-appearance: none;
}
body.sun-mode .cred-amount { background: #fff; color: #15180c; }
