/* ============ قرطاسية ألوان — Demo design system ============ */
:root {
  --ink: #1e2a4a;          /* deep ink navy */
  --ink-soft: #44507a;
  --paper: #faf7f0;        /* warm cream */
  --card: #ffffff;
  --amber: #f5a623;        /* pencil yellow */
  --amber-dark: #d98c0a;
  --coral: #e85d4c;
  --teal: #2a9d8f;
  --line: #e9e2d4;
  --shadow: 0 6px 24px rgba(30, 42, 74, 0.08);
  --shadow-lg: 0 16px 48px rgba(30, 42, 74, 0.16);
  --radius: 14px;
  --font: "Tajawal", -apple-system, "Segoe UI", tahoma, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 1rem; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- demo ribbon ---------- */
.demo-ribbon {
  background: var(--ink);
  color: #fff;
  text-align: center;
  font-size: 0.8rem;
  padding: 6px 12px;
  letter-spacing: 0.2px;
}
.demo-ribbon b { color: var(--amber); }

/* ---------- header ---------- */
header.site {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250, 247, 240, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--amber), var(--coral));
  display: grid; place-items: center;
  font-size: 22px;
  box-shadow: var(--shadow);
}
.logo-text { font-weight: 800; font-size: 1.25rem; line-height: 1.1; }
.logo-text small { display: block; font-weight: 400; font-size: 0.68rem; color: var(--ink-soft); }

.search-wrap { flex: 1; position: relative; max-width: 520px; }
.search-wrap input {
  width: 100%; padding: 10px 42px 10px 14px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-wrap input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.15); }
.search-wrap .search-ico {
  position: absolute; inset-inline-start: 14px; top: 50%;
  transform: translateY(-50%); opacity: 0.45; pointer-events: none; font-size: 0.95rem;
}

.cart-btn {
  position: relative; display: flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  transition: transform 0.15s, background 0.2s;
  margin-inline-start: auto;
}
.cart-btn:hover { background: var(--ink-soft); }
.cart-btn.bounce { animation: bounce 0.45s; }
@keyframes bounce { 30% { transform: scale(1.12); } 60% { transform: scale(0.96); } }
.cart-count {
  position: absolute; top: -6px; inset-inline-start: -6px;
  background: var(--coral); color: #fff;
  min-width: 22px; height: 22px; border-radius: 999px;
  display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 800;
  border: 2px solid var(--paper);
}

/* ---------- hero ---------- */
.hero { padding: 40px 0 26px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: center;
}
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.7rem); font-weight: 800; line-height: 1.35; }
.hero h1 .hl { color: var(--amber-dark); position: relative; white-space: nowrap; }
.hero p.sub { color: var(--ink-soft); margin: 14px 0 22px; font-size: 1.05rem; max-width: 46ch; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px;
  font-weight: 700; font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--amber); color: var(--ink); box-shadow: 0 6px 18px rgba(245, 166, 35, 0.4); }
.btn-primary:hover { background: var(--amber-dark); color: #fff; }
.btn-ghost { background: transparent; border: 1.5px solid var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.hero-img-wrap { position: relative; }
.hero-img-wrap img {
  border-radius: 24px; box-shadow: var(--shadow-lg);
  aspect-ratio: 3 / 2; object-fit: cover; width: 100%;
  background: #f0ead9;
}
.hero-chip {
  position: absolute; bottom: 16px; inset-inline-start: 16px;
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px);
  padding: 10px 16px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 8px;
}
.hero-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- categories ---------- */
.cats { display: flex; gap: 10px; overflow-x: auto; padding: 18px 0 6px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  background: var(--card); border: 1.5px solid var(--line);
  font-weight: 700; font-size: 0.92rem; color: var(--ink);
  white-space: nowrap; transition: all 0.2s;
}
.cat-chip:hover { border-color: var(--amber); }
.cat-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- product grid ---------- */
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 16px; }
.section-title h2 { font-size: 1.45rem; font-weight: 800; }
.section-title .count { color: var(--ink-soft); font-size: 0.9rem; }
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  padding-bottom: 30px;
}
.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden; position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .img-wrap { position: relative; cursor: pointer; background: #f6f1e6; }
.card .img-wrap img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.badge {
  position: absolute; top: 10px; inset-inline-start: 10px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 800; color: #fff;
  background: var(--teal);
}
.badge.sale { background: var(--coral); }
.badge.new { background: var(--amber-dark); }
.badge.out { background: #8a8a8a; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { font-size: 0.98rem; font-weight: 700; line-height: 1.45; cursor: pointer; }
.card-body .desc { font-size: 0.8rem; color: var(--ink-soft); line-height: 1.55; flex: 1; }
.price-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.price { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.price small { font-weight: 500; font-size: 0.72rem; color: var(--ink-soft); }
.old-price { text-decoration: line-through; color: #b0a68f; font-size: 0.82rem; }
.stock-note { font-size: 0.74rem; font-weight: 700; }
.stock-note.low { color: var(--coral); }
.stock-note.out { color: #8a8a8a; }
.add-btn {
  width: 100%; padding: 9px; border-radius: 10px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.2s;
}
.add-btn:hover { background: var(--amber-dark); }
.add-btn:disabled { background: #cfc8b8; cursor: not-allowed; }
.qty-stepper {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper); border: 1.5px solid var(--amber); border-radius: 10px;
  overflow: hidden;
}
.qty-stepper button {
  width: 38px; height: 38px; font-size: 1.15rem; font-weight: 800; color: var(--ink);
  transition: background 0.15s;
}
.qty-stepper button:hover { background: var(--amber); }
.qty-stepper .q { font-weight: 800; }

.empty-state { text-align: center; padding: 50px 0; color: var(--ink-soft); }
.empty-state .big { font-size: 2.4rem; }

/* ---------- school list section ---------- */
.school-banner {
  background: linear-gradient(135deg, var(--ink) 0%, #2c3c69 100%);
  border-radius: 22px; color: #fff;
  padding: 34px 30px; margin: 14px 0 34px;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center;
  position: relative; overflow: hidden;
}
.school-banner::after {
  content: "📋✏️📚"; position: absolute; inset-inline-end: -12px; bottom: -18px;
  font-size: 6rem; opacity: 0.12; transform: rotate(-12deg);
}
.school-banner h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.school-banner p { opacity: 0.85; font-size: 0.95rem; max-width: 52ch; }
.school-banner .btn-primary { justify-self: start; }

/* ---------- features strip ---------- */
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin: 6px 0 40px;
}
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; gap: 12px; align-items: flex-start;
}
.feature .ico { font-size: 1.6rem; }
.feature b { display: block; font-size: 0.95rem; }
.feature span { font-size: 0.8rem; color: var(--ink-soft); line-height: 1.5; }

/* ---------- footer ---------- */
footer.site {
  background: var(--ink); color: rgba(255, 255, 255, 0.85);
  padding: 40px 0 26px; margin-top: 20px; font-size: 0.9rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
footer.site h4 { color: #fff; font-size: 1.02rem; margin-bottom: 10px; }
footer.site li { list-style: none; margin-bottom: 7px; }
footer.site a:hover { color: var(--amber); }
.footer-note {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: 26px; padding-top: 16px;
  font-size: 0.78rem; opacity: 0.7; text-align: center; line-height: 1.9;
}

/* ---------- drawer (cart) ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(20, 26, 46, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 80;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  /* physical LEFT edge (inline-end in RTL) — slides in from the left, matching the cart button side */
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0;
  width: min(430px, 94vw); background: var(--paper); z-index: 90;
  transform: translateX(-105%);
  visibility: hidden; /* keep the closed drawer out of the paint canvas + tab order */
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.25, 1), visibility 0s 0.3s;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.open { transform: translateX(0); visibility: visible; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.25, 1), visibility 0s 0s; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--card);
}
.drawer-head h3 { font-size: 1.15rem; font-weight: 800; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-size: 1.1rem; color: var(--ink); background: var(--paper); transition: background 0.2s;
}
.icon-btn:hover { background: var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-item {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px;
  padding: 12px 0; border-bottom: 1px dashed var(--line); align-items: center;
}
.cart-item img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #f6f1e6; }
.cart-item .nm { font-size: 0.88rem; font-weight: 700; line-height: 1.4; }
.cart-item .pr { font-size: 0.8rem; color: var(--ink-soft); }
.cart-item .mini-stepper { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.cart-item .mini-stepper button {
  width: 26px; height: 26px; border-radius: 8px; background: var(--card);
  border: 1px solid var(--line); font-weight: 800; font-size: 0.95rem;
}
.cart-item .rm { color: var(--coral); font-size: 0.78rem; font-weight: 700; }
.free-ship {
  background: var(--card); border: 1px dashed var(--amber);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 0.82rem;
}
.free-ship .bar { height: 7px; background: var(--line); border-radius: 99px; margin-top: 7px; overflow: hidden; }
.free-ship .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--coral)); border-radius: 99px; transition: width 0.4s; }
.drawer-foot { padding: 16px 20px; border-top: 1px solid var(--line); background: var(--card); }
.total-row { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 6px; color: var(--ink-soft); }
.total-row.grand { font-size: 1.1rem; font-weight: 800; color: var(--ink); margin: 8px 0 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- checkout ---------- */
.form-grid { display: grid; gap: 12px; }
.form-grid label { font-size: 0.85rem; font-weight: 700; display: block; margin-bottom: 4px; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--ink);
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  outline: none; border-color: var(--amber); box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.13);
}
.form-grid .err { border-color: var(--coral) !important; }
.err-msg { color: var(--coral); font-size: 0.76rem; margin-top: 3px; display: none; }
.pay-options { display: grid; gap: 8px; }
.pay-opt {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 14px;
  background: var(--card); cursor: pointer; font-size: 0.9rem; font-weight: 700;
}
.pay-opt:has(input:checked) { border-color: var(--amber); background: rgba(245, 166, 35, 0.07); }

/* ---------- modals ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: 18px; opacity: 0; pointer-events: none; transition: opacity 0.22s;
}
.modal-wrap.show { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--paper); border-radius: 20px; box-shadow: var(--shadow-lg);
  width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  transform: translateY(14px); transition: transform 0.22s; position: relative; z-index: 101;
}
.modal-wrap.show .modal { transform: translateY(0); }
.modal-close { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 2; }
.qv-grid { display: grid; grid-template-columns: 1fr 1fr; }
.qv-grid img { width: 100%; height: 100%; object-fit: cover; background: #f6f1e6; }
.qv-body { padding: 26px 22px; display: flex; flex-direction: column; gap: 10px; }
.qv-body h3 { font-size: 1.25rem; font-weight: 800; line-height: 1.4; }

.confirm-body { padding: 34px 28px; text-align: center; }
.confirm-body .check {
  width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 50%;
  background: rgba(42, 157, 143, 0.14); display: grid; place-items: center; font-size: 2.1rem;
}
.confirm-body h3 { font-size: 1.35rem; font-weight: 800; margin-bottom: 6px; }
.order-no {
  display: inline-block; background: var(--ink); color: var(--amber);
  padding: 7px 20px; border-radius: 999px; font-weight: 800; letter-spacing: 1px; margin: 8px 0 14px;
}
.confirm-note { font-size: 0.87rem; color: var(--ink-soft); line-height: 1.8; margin-bottom: 18px; }
.wa-preview {
  text-align: start; background: #e7f6e9; border: 1px solid #bfe3c5;
  border-radius: 14px; padding: 14px 16px; font-size: 0.8rem;
  white-space: pre-wrap; line-height: 1.8; margin-bottom: 16px; max-height: 200px; overflow-y: auto;
}

/* ---------- chat widget ---------- */
.chat-fab {
  position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 70;
  width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--coral));
  color: #fff; font-size: 1.7rem;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(232, 93, 76, 0.45);
  transition: transform 0.2s;
}
.chat-fab:hover { transform: scale(1.07); }
.chat-fab .pulse-dot {
  position: absolute; top: 2px; inset-inline-end: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--teal); border: 2.5px solid #fff;
}
.chat-tip {
  position: fixed; bottom: 36px; inset-inline-end: 96px; z-index: 70;
  background: var(--ink); color: #fff; font-size: 0.82rem; font-weight: 700;
  padding: 9px 16px; border-radius: 999px; box-shadow: var(--shadow-lg);
  animation: tipfloat 3s ease-in-out infinite;
}
@keyframes tipfloat { 50% { transform: translateY(-5px); } }

.chat-panel {
  position: fixed; bottom: 96px; inset-inline-end: 22px; z-index: 95;
  width: min(392px, calc(100vw - 32px));
  height: min(600px, calc(100dvh - 130px));
  background: var(--paper); border-radius: 22px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(18px) scale(0.97); opacity: 0; pointer-events: none;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.25, 1);
  border: 1px solid var(--line);
}
.chat-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.chat-head {
  background: var(--ink); color: #fff; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
}
.chat-head .avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--coral));
  display: grid; place-items: center; font-size: 1.25rem;
}
.chat-head b { font-size: 0.98rem; display: block; }
.chat-head small { font-size: 0.72rem; opacity: 0.75; display: flex; align-items: center; gap: 5px; }
.chat-head small .on { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; }
.chat-head .icon-btn { margin-inline-start: auto; background: rgba(255, 255, 255, 0.12); color: #fff; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 84%; padding: 10px 14px; border-radius: 16px; font-size: 0.88rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: break-word; }
.msg.bot { background: var(--card); border: 1px solid var(--line); border-start-end-radius: 4px; align-self: flex-start; }
.msg.user { background: var(--ink); color: #fff; border-start-start-radius: 4px; align-self: flex-end; }
.msg.typing { display: flex; gap: 5px; align-items: center; padding: 14px 18px; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); animation: blink 1.2s infinite; }
.msg.typing i:nth-child(2) { animation-delay: 0.18s; }
.msg.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink { 40% { opacity: 0.25; } }

.chat-prod {
  align-self: flex-start; width: 84%;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; display: grid; grid-template-columns: 84px 1fr; gap: 0;
}
.chat-prod img { width: 84px; height: 100%; object-fit: cover; background: #f6f1e6; }
.chat-prod .cp-body { padding: 10px 12px; }
.chat-prod .cp-body b { font-size: 0.82rem; line-height: 1.4; display: block; }
.chat-prod .cp-body .cp-price { font-size: 0.85rem; font-weight: 800; color: var(--amber-dark); margin: 3px 0 6px; }
.chat-prod .cp-add {
  font-size: 0.75rem; font-weight: 800; color: #fff; background: var(--ink);
  padding: 5px 13px; border-radius: 999px;
}
.chat-prod .cp-add:disabled { background: #cfc8b8; }

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; align-self: flex-start; max-width: 95%; }
.chat-chip {
  background: var(--card); border: 1.5px solid var(--amber);
  color: var(--ink); font-size: 0.78rem; font-weight: 700;
  padding: 7px 14px; border-radius: 999px; transition: all 0.15s;
}
.chat-chip:hover { background: var(--amber); }

.chat-foot { padding: 10px 12px; background: var(--card); border-top: 1px solid var(--line); }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row textarea {
  flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 10px 14px; max-height: 110px; background: var(--paper); font-size: 0.9rem;
}
.chat-input-row textarea:focus { outline: none; border-color: var(--amber); }
.chat-send {
  width: 44px; height: 44px; border-radius: 14px; align-self: flex-end;
  background: var(--amber); color: var(--ink); font-size: 1.15rem; font-weight: 800;
  display: grid; place-items: center; transition: background 0.2s;
}
.chat-send:hover { background: var(--amber-dark); color: #fff; }
.chat-demo-note { font-size: 0.66rem; color: var(--ink-soft); text-align: center; margin-top: 6px; opacity: 0.8; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; bottom: 100px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
[dir="rtl"] .toast-wrap { transform: translateX(50%); }
.toast {
  background: var(--ink); color: #fff; padding: 11px 22px; border-radius: 999px;
  font-size: 0.86rem; font-weight: 700; box-shadow: var(--shadow-lg);
  animation: toastin 0.3s;
  display: flex; gap: 8px; align-items: center;
}
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

/* ---------- admin ---------- */
.admin-hero { background: var(--ink); color: #fff; padding: 26px 0; }
.admin-hero h1 { font-size: 1.45rem; }
.admin-hero p { opacity: 0.75; font-size: 0.86rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: -22px 0 26px; }
.stat {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.stat .num { font-size: 1.55rem; font-weight: 800; }
.stat .lbl { font-size: 0.8rem; color: var(--ink-soft); }
.orders-table { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; margin-bottom: 40px; }
.orders-table .o-head, .order-row .o-main {
  display: grid; grid-template-columns: 110px 1.2fr 1fr 0.7fr 0.9fr 130px 40px;
  gap: 10px; align-items: center; padding: 13px 18px;
}
.orders-table .o-head { background: var(--paper); font-size: 0.78rem; font-weight: 800; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.order-row { border-bottom: 1px solid var(--line); font-size: 0.87rem; }
.order-row:last-child { border-bottom: none; }
.order-row .o-main { cursor: pointer; transition: background 0.15s; }
.order-row .o-main:hover { background: rgba(245, 166, 35, 0.05); }
.order-row .oid { font-weight: 800; color: var(--amber-dark); }
.status-pill { padding: 4px 12px; border-radius: 999px; font-size: 0.74rem; font-weight: 800; text-align: center; border: none; cursor: pointer; }
.status-pill.new { background: rgba(245, 166, 35, 0.18); color: var(--amber-dark); }
.status-pill.prep { background: rgba(42, 157, 143, 0.15); color: var(--teal); }
.status-pill.done { background: rgba(30, 42, 74, 0.1); color: var(--ink); }
.status-pill.cancel { background: rgba(232, 93, 76, 0.13); color: var(--coral); }
.o-detail { display: none; padding: 4px 18px 16px; background: rgba(250, 247, 240, 0.6); font-size: 0.83rem; }
.o-detail.show { display: block; }
.o-detail table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.o-detail td { padding: 6px 8px; border-bottom: 1px dashed var(--line); }
.back-link { display: inline-flex; gap: 6px; align-items: center; color: var(--amber); font-weight: 700; font-size: 0.88rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 22px; }
  .hero { padding: 24px 0 12px; }
  .school-banner { grid-template-columns: 1fr; padding: 26px 22px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .qv-grid { grid-template-columns: 1fr; }
  .qv-grid img { max-height: 260px; }
  .orders-table .o-head { display: none; }
  .order-row .o-main { grid-template-columns: 1fr 1fr; gap: 6px; }
}
@media (max-width: 560px) {
  .header-row { flex-wrap: wrap; }
  .search-wrap { order: 3; max-width: none; flex-basis: 100%; }
  .logo-text { font-size: 1.05rem; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 11px; }
  .card-body { padding: 10px 11px 12px; }
  .card-body h3 { font-size: 0.86rem; }
  .card-body .desc { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .chat-tip { display: none; }
  .features { grid-template-columns: 1fr 1fr; }
  .btn { padding: 11px 18px; font-size: 0.92rem; }
}
