:root {
  --ink: #17211b;
  --muted: #637066;
  --line: #dfe6df;
  --bg: #f7f9f6;
  --panel: #ffffff;
  --brand: #1f6f4a;
  --brand-dark: #164f36;
  --accent: #bd8b2f;
  --danger: #b42318;
  --info: #175cd3;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
}
a { color: var(--brand); text-decoration: none; }
.wrap { width: min(1120px, calc(100% - 28px)); margin: 0 auto; }
.center-page { min-height: 100svh; display: grid; place-items: center; padding: 24px 0; }
.brand-mark { font-size: clamp(54px, 9vw, 96px); line-height: 1; margin: 0 0 14px; color: var(--brand-dark); }
.tagline { color: var(--muted); font-size: clamp(19px, 2.4vw, 28px); margin: 0; line-height: 1.7; }
.hero { text-align: center; width: min(480px, 100%); }
.stack { display: grid; gap: 14px; }
.btn {
  border: 0;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  padding: 14px 18px;
  min-height: 50px;
  font-weight: 700;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #eef4ef; color: var(--brand-dark); }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 8px 12px; min-height: 36px; font-size: 14px; }
.panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.panel { box-shadow: 0 14px 34px rgba(23, 33, 27, .08); }
.field { display: grid; gap: 8px; margin-bottom: 14px; }
label { font-weight: 700; color: var(--ink); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
.radio-row, .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.alert { border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; border: 1px solid var(--line); background: #fff; }
.alert.success { border-color: #8bd4a8; color: #075e2b; }
.alert.danger { border-color: #f3afa8; color: var(--danger); }
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; gap: 12px; }
.nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-shell { display: grid; grid-template-columns: 220px minmax(0,1fr); min-height: 100svh; }
.sidebar { background: #15231b; color: #fff; padding: 18px; }
.sidebar a { color: #eaf4ed; display: block; padding: 10px; border-radius: 8px; }
.sidebar a:hover { background: rgba(255,255,255,.1); }
.content { padding: 20px; min-width: 0; }
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat b { display: block; font-size: 28px; color: var(--brand-dark); }
.filters { grid-template-columns: repeat(4, minmax(0,1fr)); align-items: end; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
th { background: #f0f5f1; white-space: nowrap; }
.badge { display: inline-block; border-radius: 999px; padding: 5px 9px; background: #eef4ef; color: var(--brand-dark); font-size: 13px; }
.media-thumb { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 30; }
.lightbox img { max-width: 96vw; max-height: 90vh; border-radius: 8px; background: #fff; }
.muted { color: var(--muted); }
.pagination { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.print-only { display: none; }

.home-screen {
  width: 100%;
  min-height: min(760px, calc(100svh - 48px));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 28px;
  padding: clamp(16px, 3vw, 34px);
  border: 1px solid rgba(31, 111, 74, .12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31,111,74,.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(31,111,74,.05) 1px, transparent 1px),
    #fbfcfa;
  background-size: 52px 52px;
  box-shadow: 0 24px 70px rgba(23, 33, 27, .08);
  overflow: hidden;
}
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.home-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--brand-dark);
  font-size: 20px;
}
.logo-symbol,
.choice-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: var(--brand-dark);
  color: #fff;
  font-weight: 800;
}
.home-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
}
.home-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: clamp(24px, 6vw, 72px);
  align-items: center;
}
.home-copy {
  max-width: 640px;
}
.home-kicker {
  display: inline-flex;
  align-items: center;
  margin: 0 0 18px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(189, 139, 47, .35);
  color: #806020;
  background: #fffaf0;
  font-weight: 800;
}
.home-actions {
  display: grid;
  gap: 14px;
}
.choice-card {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 12px 30px rgba(23, 33, 27, .06);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.choice-card:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 111, 74, .4);
  box-shadow: 0 18px 38px rgba(23, 33, 27, .1);
}
.choice-card strong {
  display: block;
  font-size: 24px;
  color: var(--brand-dark);
  margin-bottom: 7px;
}
.choice-card small {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.primary-choice {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.primary-choice .choice-icon {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.3);
}
.primary-choice strong,
.primary-choice small {
  color: #fff;
}
.employee-choice .choice-icon {
  background: #eef4ef;
  color: var(--brand-dark);
}

@media (max-width: 780px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .stats, .filters { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .panel, .card { padding: 14px; }
  .btn { width: 100%; }
  .actions .btn { width: auto; flex: 1 1 150px; }
  .center-page { padding: 12px 0; }
  .home-screen {
    min-height: calc(100svh - 24px);
    padding: 16px;
    gap: 18px;
  }
  .home-header {
    align-items: flex-start;
  }
  .home-main {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 28px;
  }
  .brand-mark {
    font-size: clamp(58px, 18vw, 82px);
  }
  .tagline {
    font-size: 20px;
  }
  .choice-card {
    min-height: 104px;
    padding: 16px;
  }
  .choice-card strong {
    font-size: 22px;
  }
}

@media print {
  .no-print, .sidebar, .topbar { display: none !important; }
  body { background: #fff; }
  .admin-shell { display: block; }
  .content { padding: 0; }
  .panel, .card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  .print-only { display: block; }
}

/* Modern public landing */
body:has(.home-v2) {
  background:
    radial-gradient(circle at 85% 18%, rgba(189, 139, 47, .14), transparent 30%),
    radial-gradient(circle at 18% 78%, rgba(31, 111, 74, .14), transparent 34%),
    linear-gradient(135deg, #fbfcfa 0%, #eef5ef 100%);
}
.center-page:has(.home-v2) {
  padding: clamp(14px, 2.5vw, 32px) 0;
  align-items: stretch;
}
.home-v2 {
  width: 100%;
  min-height: calc(100svh - 64px);
  display: grid;
  grid-template-columns: minmax(340px, 530px) minmax(320px, 1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 84px);
  padding: clamp(22px, 5vw, 62px);
  border: 1px solid rgba(31, 111, 74, .14);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 111, 74, .06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(31, 111, 74, .05) 1px, transparent 1px),
    rgba(255, 255, 255, .76);
  background-size: 44px 44px;
  box-shadow: 0 26px 80px rgba(23, 33, 27, .09);
  overflow: hidden;
}
.home-v2-copy {
  position: relative;
  z-index: 2;
}
.home-v2-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 34px;
  color: var(--brand-dark);
  font-weight: 900;
  font-size: 22px;
}
.home-v2-mark {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  box-shadow: 0 12px 26px rgba(31, 111, 74, .24);
}
.home-v2-kicker {
  width: fit-content;
  margin: 0 0 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff7e8;
  color: #8a621b;
  border: 1px solid rgba(189, 139, 47, .28);
  font-weight: 800;
}
.home-v2 h1 {
  margin: 0;
  max-width: 620px;
  color: #0f3d2c;
  font-size: clamp(44px, 6.5vw, 82px);
  line-height: 1.08;
  font-weight: 900;
}
.home-v2-subtitle {
  max-width: 550px;
  margin: 18px 0 30px;
  color: #5e6b63;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.75;
}
.home-v2-actions {
  display: grid;
  gap: 14px;
  max-width: 520px;
}
.home-v2-button {
  min-height: 94px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(31, 111, 74, .14);
  background: rgba(255, 255, 255, .86);
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(23, 33, 27, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.home-v2-button:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 111, 74, .38);
  box-shadow: 0 20px 44px rgba(23, 33, 27, .13);
}
.home-v2-button strong {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-dark);
  font-size: 24px;
  font-weight: 900;
}
.home-v2-button small {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.customer-button {
  background: linear-gradient(135deg, #1f6f4a, #12543a);
  color: #fff;
}
.customer-button strong,
.customer-button small {
  color: #fff;
}
.button-icon {
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #eef6f0;
  color: var(--brand-dark);
}
.customer-button .button-icon {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .3);
}
.button-icon svg {
  width: 27px;
  height: 27px;
  fill: currentColor;
}
.home-v2-visual {
  position: relative;
  min-height: 520px;
}
.visual-card {
  position: absolute;
  border: 1px solid rgba(31, 111, 74, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 24px 60px rgba(23, 33, 27, .12);
  backdrop-filter: blur(10px);
}
.main-ticket {
  inset: 72px 4% auto auto;
  width: min(460px, 92%);
  padding: 22px;
}
.ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.ticket-number {
  color: var(--brand-dark);
  font-weight: 900;
}
.ticket-status {
  padding: 7px 11px;
  border-radius: 999px;
  background: #eef6f0;
  color: var(--brand-dark);
  font-weight: 800;
}
.product-preview {
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 8px;
  background: #f6f8f5;
}
.product-preview span {
  width: 86px;
  aspect-ratio: 1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(189, 139, 47, .18), transparent),
    linear-gradient(145deg, #1a5a3f, #0f3024);
  box-shadow: inset 0 0 0 8px rgba(255,255,255,.1);
}
.product-preview b {
  display: block;
  margin-bottom: 7px;
  font-size: 20px;
  color: var(--ink);
}
.product-preview small {
  color: var(--muted);
}
.ticket-lines {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.ticket-lines i {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: #e8eee9;
}
.ticket-lines i:nth-child(2) { width: 78%; }
.ticket-lines i:nth-child(3) { width: 56%; }
.mini-card {
  width: 150px;
  min-height: 104px;
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 10px;
}
.mini-card b {
  color: var(--brand-dark);
  font-size: 18px;
}
.mini-card small {
  color: var(--muted);
  font-weight: 800;
}
.mini-card.one {
  top: 28px;
  left: 13%;
}
.mini-card.two {
  right: 0;
  bottom: 38px;
}
.mini-card.three {
  left: 5%;
  bottom: 88px;
}
.wave {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
}
.wave i {
  width: 7px;
  border-radius: 999px;
  background: var(--brand);
}
.wave i:nth-child(1) { height: 16px; }
.wave i:nth-child(2) { height: 28px; }
.wave i:nth-child(3) { height: 20px; }
.wave i:nth-child(4) { height: 32px; }
.image-glyph {
  width: 54px;
  height: 40px;
  border-radius: 8px;
  display: block;
  background:
    radial-gradient(circle at 70% 35%, #bd8b2f 0 5px, transparent 6px),
    linear-gradient(135deg, transparent 45%, rgba(31,111,74,.32) 46%),
    #eef6f0;
  border: 1px solid #d7e4d9;
}

@media (max-width: 900px) {
  body:has(.home-v2) {
    background: linear-gradient(180deg, #fbfcfa, #eef5ef);
  }
  .home-v2 {
    min-height: calc(100svh - 28px);
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 22px;
  }
  .home-v2-brand {
    margin-bottom: 28px;
  }
  .home-v2 h1 {
    font-size: clamp(38px, 12vw, 58px);
  }
  .home-v2-subtitle {
    margin-bottom: 22px;
    font-size: 18px;
  }
  .home-v2-button {
    min-height: 88px;
    padding: 15px;
  }
  .home-v2-visual {
    min-height: 250px;
    order: -1;
  }
  .main-ticket {
    inset: 22px 0 auto auto;
    width: 100%;
    padding: 16px;
  }
  .mini-card {
    display: none;
  }
  .product-preview {
    grid-template-columns: 64px 1fr;
  }
  .product-preview span {
    width: 64px;
  }
}
