/* =========================================================
   Baghal Market — owner panel
   ========================================================= */
.admin-body {
  background:
    radial-gradient(ellipse 640px 380px at 100% -4%, #efe6ff 0%, rgba(239, 230, 255, 0) 70%),
    #f8f5fd;
  min-height: 100vh;
}
.admin-body .toast-stack { z-index: 300; }

/* ---------- login ---------- */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.login-visual {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
  padding: 52px; color: #fff;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 151, 62, .3), transparent 42%),
    radial-gradient(circle at 85% 90%, rgba(122, 87, 238, .5), transparent 50%),
    linear-gradient(135deg, #1d103f 0%, #351b78 58%, #5b32d6 100%);
}
.login-visual::before { content: ''; position: absolute; top: -160px; left: -140px; width: 420px; height: 420px; border: 70px solid rgba(255, 255, 255, .05); border-radius: 50%; }
.login-visual::after { content: ''; position: absolute; bottom: -120px; right: -80px; width: 320px; height: 320px; border: 50px solid rgba(255, 255, 255, .05); border-radius: 50%; }
.login-visual-inner { position: relative; z-index: 1; max-width: 470px; }
.login-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; padding: 6px 14px; font-size: 11px; font-weight: 700; color: #ffe6b0; }
.login-badge .ic { width: 15px; height: 15px; }
.login-visual h1 { font-size: clamp(32px, 3.6vw, 46px); font-weight: 900; line-height: 1.5; letter-spacing: -1.2px; margin: 20px 0 12px; }
.login-visual p { font-size: 13px; line-height: 2; color: #d7caf6; max-width: 390px; }
.login-points { display: flex; flex-direction: column; gap: 11px; margin: 26px 0; }
.login-points li { display: flex; align-items: center; gap: 9px; font-size: 12px; color: #eee7ff; }
.login-points .ic { width: 18px; height: 18px; color: #7ee0a9; }
.login-visual-cards { display: flex; gap: 12px; margin-top: 30px; }
.login-mini { display: flex; flex-direction: column; gap: 1px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; padding: 12px 15px; min-width: 150px; backdrop-filter: blur(8px); position: relative; }
.login-mini b { font-size: 14px; font-weight: 900; }
.login-mini small { font-size: 9.5px; color: #cfc2ed; }
.login-mini .ic { position: absolute; top: 12px; left: 12px; width: 17px; height: 17px; color: #ffc984; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.login-card { width: min(370px, 100%); }
.login-brand { margin-bottom: 26px; }
.login-card h2 { font-size: 24px; font-weight: 900; letter-spacing: -.5px; margin-bottom: 4px; }
.login-sub { font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.login-card .field { margin-bottom: 12px; }
.login-card .field input { min-height: 52px; font-size: 18px; letter-spacing: 6px; text-align: center; }
.login-error { background: var(--red-bg); border: 1px solid #f6d0d7; color: #a52a3c; border-radius: 11px; padding: 9px 12px; font-size: 11px; font-weight: 600; margin-bottom: 10px; }
.login-hint { font-size: 10.5px; color: var(--muted); text-align: center; margin-top: 16px; background: var(--surface-2); border-radius: 10px; padding: 8px; }
.login-hint b { color: var(--brand); font-size: 13px; letter-spacing: 2px; }
.login-back { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin-top: 12px; font-size: 11px; color: var(--muted); }
.login-back .ic { width: 14px; height: 14px; }
.shake { animation: shake .4s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- shell ---------- */
.admin-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 50;
  display: flex; flex-direction: column; gap: 12px;
  background: #fff; border-left: 1px solid var(--line);
  padding: 18px 13px 14px; overflow-y: auto;
}
.admin-brand { padding: 4px 8px 8px; }
.admin-brand .brand-text strong { font-size: 23px; }
.admin-brand .brand-text small { font-size: 9px; }
.side-store { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 10px; }
.side-store-orb { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 12px; background: linear-gradient(145deg, var(--brand), #7b58ee); color: #fff; display: grid; place-items: center; }
.side-store-orb .ic { width: 19px; height: 19px; }
.side-store b { display: block; font-size: 11.5px; font-weight: 900; line-height: 1.5; }
.side-store small { font-size: 9px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 42px; padding: 8px 11px; border-radius: 12px; font-size: 12px; font-weight: 700; color: var(--text); text-align: right; transition: background .18s, color .18s; position: relative; }
.side-link .ic { width: 20px; height: 20px; color: var(--muted); transition: color .18s; }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link.is-active { background: linear-gradient(120deg, #f0eaff, #f8f4ff); color: var(--brand); font-weight: 800; }
.side-link.is-active .ic { color: var(--brand); }
.side-link.is-active::before { content: ''; position: absolute; right: -13px; top: 10px; bottom: 10px; width: 3px; border-radius: 4px; background: var(--brand); }
.side-badge { margin-right: auto; background: var(--accent-2); color: #fff; border-radius: 999px; min-width: 19px; height: 19px; display: inline-grid; place-items: center; font-size: 9px; font-weight: 900; padding: 0 5px; font-style: normal; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line-2); padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.side-version { font-size: 9px; color: var(--muted-2); text-align: center; padding-top: 6px; }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 26px; background: rgba(250, 248, 255, .9); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.admin-title { min-width: 0; }
.admin-title h1 { font-size: 21px; font-weight: 900; letter-spacing: -.4px; line-height: 1.4; }
.admin-title p { font-size: 10.5px; color: var(--muted); }
.admin-top-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.admin-status { display: flex; align-items: center; gap: 8px; background: var(--green-bg); border: 1px solid #cdeeda; border-radius: 12px; padding: 7px 11px; min-width: 144px; }
.admin-status .status-dot { width: 8px; height: 8px; box-shadow: 0 0 0 3px rgba(24, 165, 108, .14); animation: none; }
.admin-status b { display: block; font-size: 10.5px; font-weight: 900; color: #0d6d47; line-height: 1.5; }
.admin-status small { display: block; font-size: 8.5px; color: #3f7d61; line-height: 1.5; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-status.is-closed { background: var(--warn-bg); border-color: #f3e2c1; }
.admin-status.is-closed .status-dot { background: #d19427; box-shadow: 0 0 0 3px rgba(209, 148, 39, .14); }
.admin-status.is-closed b { color: #8a5d0e; }
.admin-status.is-closed small { color: #9a7229; }
.admin-status.is-paused { background: #f1edf8; border-color: #e3dcef; }
.admin-status.is-paused .status-dot { background: #8b819d; box-shadow: 0 0 0 3px rgba(139, 129, 157, .14); }
.admin-status.is-paused b { color: #5d5273; }
.admin-status.is-paused small { color: #7a6f8e; }
#pauseBtn.is-paused { color: var(--green); border-color: #cdeeda; background: var(--green-bg); }
.admin-content { width: 100%; max-width: 1440px; margin-inline: auto; padding: 22px 26px 60px; }

/* ---------- views ---------- */
.view { animation: viewIn .28s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; font-weight: 900; letter-spacing: -.4px; }
.page-head p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 14px; font-weight: 900; line-height: 1.5; }
.card-head p { font-size: 9.5px; color: var(--muted); line-height: 1.7; margin-top: 1px; }
.card-tag { flex: 0 0 auto; font-size: 9.5px; font-weight: 800; color: var(--brand); background: var(--brand-3); border-radius: 999px; padding: 4px 9px; }

/* ---------- dashboard ---------- */
.dash-hello { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.dash-hello h2 { font-size: 22px; font-weight: 900; letter-spacing: -.5px; }
.dash-hello p { font-size: 11px; color: var(--muted); }
.dash-quick { display: flex; gap: 7px; flex-wrap: wrap; }
.quick-chip { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 10.5px; font-weight: 700; color: var(--text); box-shadow: var(--shadow-sm); transition: .18s; }
.quick-chip:hover { border-color: #d5c8f0; color: var(--brand); transform: translateY(-1px); }
.quick-chip .ic { width: 15px; height: 15px; color: var(--brand); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 19px; padding: 15px 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; min-width: 0; }
.stat-card::after { content: ''; position: absolute; left: -36px; bottom: -48px; width: 110px; height: 110px; border-radius: 50%; background: var(--surface-2); opacity: .7; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; position: relative; z-index: 1; }
.stat-icon { width: 36px; height: 36px; border-radius: 12px; background: var(--brand-3); color: var(--brand); display: grid; place-items: center; }
.stat-icon .ic { width: 19px; height: 19px; }
.stat-card.accent .stat-icon { background: var(--accent-soft); color: #e96a25; }
.stat-card.success .stat-icon { background: var(--green-bg); color: var(--green); }
.stat-card.danger .stat-icon { background: var(--red-bg); color: var(--red); }
.stat-card.warn .stat-icon { background: var(--warn-bg); color: var(--warn); }
.stat-tag { font-size: 8.5px; font-weight: 800; color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: 2px 7px; }
.stat-card.accent .stat-tag { color: #c2601b; background: var(--accent-soft); }
.stat-value { display: block; font-size: clamp(21px, 2.2vw, 27px); font-weight: 900; letter-spacing: -.7px; line-height: 1.3; position: relative; z-index: 1; }
.stat-label { display: block; font-size: 10.5px; font-weight: 700; color: var(--text); }
.stat-foot { display: block; font-size: 9px; color: var(--muted); margin-top: 3px; position: relative; z-index: 1; }
.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; margin-top: 14px; }
.dash-grid.equal { grid-template-columns: 1fr 1fr; }

.bars { display: flex; align-items: flex-end; gap: 7px; height: 196px; padding-top: 22px; }
.bars.tall { height: 250px; }
.bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.bar-value { font-size: 8.5px; color: var(--muted); white-space: nowrap; }
.bar-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; }
.bar-track i { display: block; width: 100%; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #a58bf4, #5b32d6); min-height: 4px; transition: height .5s var(--ease); opacity: .9; }
.bar-col:hover .bar-track i { opacity: 1; background: linear-gradient(180deg, #ffb36b, #ff6f3c); }
.bar-col b { font-size: 10px; font-weight: 800; color: var(--text); }
.bar-col small { font-size: 8px; color: var(--muted); white-space: nowrap; }

.recent-orders { display: flex; flex-direction: column; }
.recent-order { display: flex; align-items: center; gap: 9px; padding: 9px 2px; border-bottom: 1px dashed var(--line-2); text-align: right; transition: background .18s; border-radius: 10px; }
.recent-order:last-child { border-bottom: 0; }
.recent-order:hover { background: var(--surface-2); }
.ro-orb { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 11px; background: var(--orb, var(--brand-3)); color: var(--orb-ink, var(--brand)); display: grid; place-items: center; }
.ro-orb .ic { width: 17px; height: 17px; }
.ro-main { flex: 1; min-width: 0; }
.ro-main b { display: block; font-size: 10.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ro-main small { display: block; font-size: 8.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ro-side { text-align: left; flex: 0 0 auto; }
.ro-side b { display: block; font-size: 10.5px; font-weight: 900; }
.ro-side small { font-size: 8.5px; color: var(--muted); }
.mini-empty { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 34px 12px; text-align: center; color: var(--muted); font-size: 10.5px; }
.mini-empty .ic { width: 30px; height: 30px; color: var(--muted-2); }

.top-products { display: flex; flex-direction: column; }
.top-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line-2); }
.top-row:last-child { border-bottom: 0; }
.top-rank { width: 20px; flex: 0 0 auto; font-size: 10px; font-weight: 900; color: var(--muted); text-align: center; }
.top-art { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; font-size: 17px; }
.top-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top-main b { font-size: 10.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-main small { font-size: 8.5px; color: var(--muted); }
.top-amount { font-size: 10px; font-weight: 900; color: var(--brand); flex: 0 0 auto; }
.status-breakdown { display: flex; flex-direction: column; gap: 8px; }
.status-row { display: grid; grid-template-columns: 96px 1fr 26px; align-items: center; gap: 8px; font-size: 10px; }
.status-name { display: flex; align-items: center; gap: 5px; color: var(--text); white-space: nowrap; }
.status-name i { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.status-bar { height: 7px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.status-bar i { display: block; height: 100%; border-radius: 99px; transition: width .5s var(--ease); }
.status-row b { font-size: 10px; font-weight: 900; text-align: left; }

/* ---------- orders ---------- */
.filter-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: 10.5px; font-weight: 700; transition: .18s; white-space: nowrap; }
.filter-tab span { font-size: 9px; color: var(--muted); }
.filter-tab:hover { border-color: #d5c8f0; color: var(--brand); }
.filter-tab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter-tab.is-active span { color: #d8cdf6; }
.orders-list { display: flex; flex-direction: column; gap: 12px; }
.order-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 15px 16px; box-shadow: var(--shadow-sm); position: relative; }
.order-card.is-new { border-color: #f2d6a4; box-shadow: 0 0 0 3px rgba(209, 148, 39, .08), var(--shadow-sm); }
.order-card.is-new::before { content: ''; position: absolute; top: 15px; right: -1px; bottom: 15px; width: 3px; border-radius: 4px 0 0 4px; background: #e2a33a; }
.oc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line-2); flex-wrap: wrap; }
.oc-code { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.oc-code > b { font-size: 14px; font-weight: 900; letter-spacing: -.2px; }
.oc-head time { font-size: 9.5px; color: var(--muted); }
.demo-tag { font-size: 8px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 6px; }
.oc-body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; padding: 12px 0; }
.oc-customer { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.oc-avatar { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 13px; background: linear-gradient(145deg, var(--brand-3), #f8f4ff); color: var(--brand); font-size: 15px; font-weight: 900; display: grid; place-items: center; }
.oc-customer-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.oc-customer-main b { font-size: 12px; font-weight: 900; }
.oc-customer-main a, .oc-customer-main span, .oc-customer-main em { display: flex; align-items: flex-start; gap: 4px; font-size: 9.5px; color: var(--muted); font-style: normal; line-height: 1.7; }
.oc-customer-main a { color: var(--brand); font-weight: 700; direction: ltr; justify-content: flex-end; }
.oc-customer-main em { color: #a06a2a; background: var(--warn-bg); border-radius: 6px; padding: 2px 6px; width: fit-content; }
.oc-customer-main .ic { width: 12px; height: 12px; flex: 0 0 auto; margin-top: 2px; }
.oc-items { background: var(--surface-2); border-radius: 13px; padding: 9px 11px; min-width: 0; }
.oc-items-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 9px; color: var(--muted); margin-bottom: 5px; }
.oc-items ul { display: flex; flex-direction: column; gap: 2px; }
.oc-items li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--text); }
.oc-items li small { color: var(--muted); }
.oc-items li b { font-weight: 700; white-space: nowrap; }
.oc-totals { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; font-size: 9.5px; color: var(--muted); }
.oc-totals b { font-size: 12px; color: var(--ink); font-weight: 900; }
.oc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px dashed var(--line-2); padding-top: 10px; flex-wrap: wrap; }
.oc-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.oc-meta span { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; color: var(--muted); }
.oc-meta .ic { width: 14px; height: 14px; }
.oc-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-right: auto; }
.oc-actions .btn { min-height: 36px; padding: 6px 12px; font-size: 10.5px; border-radius: 10px; }
.admin-empty { text-align: center; padding: 50px 20px; background: #fff; border: 1px dashed var(--line); border-radius: 20px; color: var(--muted); }
.admin-empty > span { width: 60px; height: 60px; border-radius: 20px; background: var(--brand-3); color: var(--brand); display: grid; place-items: center; margin: 0 auto 10px; }
.admin-empty > span .ic { width: 28px; height: 28px; }
.admin-empty h3 { font-size: 15px; color: var(--ink); font-weight: 900; }
.admin-empty p { font-size: 11px; }

/* ---------- products ---------- */
.page-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.page-toolbar .field { min-width: 150px; }
.page-toolbar .field input, .page-toolbar .field select { min-height: 40px; font-size: 11px; background: #fff; }
.toolbar-count { margin-right: auto; font-size: 10px; color: var(--muted); white-space: nowrap; }
.admin-table { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-row { display: grid; grid-template-columns: minmax(190px, 2.1fr) minmax(100px, 1fr) minmax(90px, .8fr) minmax(95px, .9fr) 78px; align-items: center; gap: 12px; padding: 10px 15px; border-bottom: 1px solid var(--line-2); }
.admin-row:last-child { border-bottom: 0; }
.admin-row.head { background: var(--surface-2); font-size: 9.5px; font-weight: 800; color: var(--muted); padding-block: 9px; }
.admin-row.product-row { min-height: 66px; transition: background .18s; }
.admin-row.product-row:not(.head):hover { background: #fcfaff; }
.prod-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.prod-art { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; font-size: 23px; }
.prod-main { min-width: 0; }
.prod-main b { display: block; font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-main small { display: block; font-size: 8.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-cat { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-dot { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; flex: 0 0 auto; }
.prod-price { display: flex; flex-direction: column; line-height: 1.6; }
.prod-price b { font-size: 11px; font-weight: 900; }
.prod-price small { font-size: 8.5px; color: var(--muted); }
.prod-stock { display: flex; }
.stock-toggle { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 8px; font-size: 9px; font-weight: 800; background: var(--green-bg); color: var(--green); white-space: nowrap; }
.stock-toggle i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.stock-toggle.out { background: var(--red-bg); color: var(--red); }
.prod-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }

/* ---------- categories ---------- */
.category-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 10px; }
.category-admin-card { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 11px 13px; box-shadow: var(--shadow-sm); }
.cat-admin-art { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; font-size: 24px; }
.cat-admin-main { flex: 1; min-width: 0; }
.cat-admin-main b { display: block; font-size: 11.5px; font-weight: 900; }
.cat-admin-main small { display: block; font-size: 9px; color: var(--muted); }
.cat-admin-actions { display: flex; gap: 3px; }
.admin-note { margin-top: 14px; }

/* ---------- hours ---------- */
.hours-layout { display: grid; grid-template-columns: 1.08fr .92fr; gap: 14px; align-items: start; }
.hours-live { display: flex; align-items: center; gap: 10px; border-radius: 14px; padding: 11px 13px; margin-bottom: 12px; background: var(--green-bg); border: 1px solid #cdeeda; }
.hours-live.is-closed { background: var(--warn-bg); border-color: #f3e2c1; }
.hours-live.is-paused { background: #f1edf8; border-color: #e3dcef; }
.live-icon { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; background: rgba(255, 255, 255, .7); color: var(--green); display: grid; place-items: center; }
.hours-live.is-closed .live-icon { color: var(--warn); }
.hours-live.is-paused .live-icon { color: #6d6183; }
.live-icon .ic { width: 19px; height: 19px; }
.live-copy { flex: 1; min-width: 0; }
.live-copy b { display: block; font-size: 11.5px; font-weight: 900; color: #0d6d47; }
.hours-live.is-closed .live-copy b { color: #8a5d0e; }
.hours-live.is-paused .live-copy b { color: #5d5273; }
.live-copy small { display: block; font-size: 9px; color: #3f7d61; line-height: 1.6; }
.hours-live.is-closed .live-copy small { color: #9a7229; }
.hours-live.is-paused .live-copy small { color: #7a6f8e; }
.hours-editor { display: flex; flex-direction: column; }
.hours-row { display: grid; grid-template-columns: 1fr auto 1.25fr; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); }
.hours-row:last-child { border-bottom: 0; }
.hours-day b { display: block; font-size: 11px; font-weight: 800; }
.hours-day small { display: block; font-size: 8.5px; color: var(--muted); }
.time-range { display: flex; align-items: center; gap: 5px; justify-content: flex-end; }
.time-range > span { font-size: 9px; color: var(--muted); }
.time-range input { width: 86px; min-height: 36px; border: 1px solid var(--line); border-radius: 9px; background: #fdfcff; padding: 4px 6px; font-size: 11px; font-weight: 700; text-align: center; direction: ltr; font-variant-numeric: tabular-nums; }
.time-range.is-disabled { opacity: .42; }
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 40px; height: 23px; border-radius: 999px; background: #dcd3ec; position: relative; transition: background .2s; }
.switch-track::after { content: ''; position: absolute; top: 3px; right: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(30, 15, 70, .2); transition: transform .2s var(--ease); }
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(-17px); }
.switch input:focus-visible + .switch-track { outline: 3px solid #9b7bf2; outline-offset: 2px; }
.switch.small .switch-track { width: 34px; height: 20px; }
.switch.small .switch-track::after { width: 14px; height: 14px; }
.switch.small input:checked + .switch-track::after { transform: translateX(-14px); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.field-grid + .form-actions { margin-top: 16px; }
.pause-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 11px 13px; margin-top: 14px; }
.pause-box b { display: block; font-size: 11px; font-weight: 800; }
.pause-box small { display: block; font-size: 9px; color: var(--muted); line-height: 1.7; max-width: 340px; }

/* ---------- reports ---------- */
.report-facts { display: flex; flex-direction: column; }
.fact-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line-2); font-size: 11px; color: var(--text); }
.fact-row:last-child { border-bottom: 0; }
.fact-row b { font-size: 13px; font-weight: 900; color: var(--brand); }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.settings-grid .card:first-child { grid-column: span 1; }
.check-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 13px; padding: 10px 12px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: 0 0 auto; }
.check-row b { display: block; font-size: 11px; font-weight: 800; }
.check-row small { display: block; font-size: 9px; color: var(--muted); line-height: 1.6; }
.data-actions { display: flex; flex-direction: column; gap: 8px; }
.data-actions .btn { justify-content: flex-start; font-size: 11.5px; }
.file-btn { cursor: pointer; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff8f9; border: 1px solid #f6d7dc; border-radius: 14px; padding: 12px 13px; margin-top: 14px; flex-wrap: wrap; }
.danger-zone b { display: block; font-size: 11px; font-weight: 900; color: #a52a3c; }
.danger-zone small { display: block; font-size: 9px; color: #b56b77; line-height: 1.6; }
.help-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.help-list li { position: relative; padding-right: 26px; }
.help-list li::before { counter-increment: help; content: counter(help); position: absolute; right: 0; top: 1px; width: 19px; height: 19px; border-radius: 6px; background: var(--brand-3); color: var(--brand); font-size: 9px; font-weight: 900; display: grid; place-items: center; }
.help-list { counter-reset: help; }
.help-list b { display: block; font-size: 11px; font-weight: 800; }
.help-list span { display: block; font-size: 9.5px; color: var(--muted); line-height: 1.7; }

/* ---------- admin modals ---------- */
#productModal .modal-card { width: min(690px, 100%); }
.modal-body .field-grid { gap: 11px; }
.modal-body .check-row { margin-top: 13px; }
.modal-body .form-actions { border-top: 1px solid var(--line-2); padding-top: 13px; margin-top: 16px; }

/* =========================================================
   ADMIN RESPONSIVE
   ========================================================= */
@media (max-width: 1120px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .dash-grid.equal { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .hours-layout { grid-template-columns: 1fr; }
  .admin-row { grid-template-columns: minmax(170px, 2fr) minmax(90px, 1fr) minmax(85px, .8fr) minmax(88px, .9fr) 72px; gap: 9px; }
}
@media (max-width: 1000px) {
  .oc-body { grid-template-columns: 1fr; gap: 11px; }
  .oc-items { background: var(--surface-2); }
  .admin-row { grid-template-columns: minmax(170px, 2fr) minmax(90px, 1fr) minmax(88px, .9fr) 72px; }
  .admin-row.product-row > .prod-cat { display: none; }
  .admin-row.head > span:nth-child(2) { display: none; }
}
@media (max-width: 940px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; }
  .admin-shell { display: block; }
  .admin-sidebar {
    position: fixed; inset: auto 0 0 0; top: auto; height: auto; width: 100%;
    flex-direction: row; align-items: center; gap: 0;
    border-left: 0; border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 30px rgba(35, 18, 78, .09); overflow-x: auto; z-index: 90;
  }
  .admin-brand, .side-store, .side-version { display: none; }
  .side-nav { flex-direction: row; flex: 1; gap: 1px; overflow-x: auto; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-link { flex-direction: column; gap: 1px; min-width: 60px; min-height: 50px; padding: 5px 6px; font-size: 8.5px; border-radius: 11px; justify-content: center; text-align: center; }
  .side-link .ic { width: 20px; height: 20px; }
  .side-link.is-active::before { display: none; }
  .side-badge { position: absolute; top: 2px; left: 10px; margin: 0; min-width: 16px; height: 16px; font-size: 8px; }
  .side-foot { margin: 0 0 0 4px; border: 0; padding: 0; flex-direction: row; gap: 0; }
  .side-foot .side-link { min-width: 46px; font-size: 0; }
  .side-foot .side-link .ic { width: 21px; height: 21px; }
  .admin-content { padding: 16px 14px calc(92px + env(safe-area-inset-bottom, 0px)); }
  .admin-topbar { padding: 11px 14px; gap: 10px; flex-wrap: wrap; }
  .admin-title h1 { font-size: 18px; }
  .admin-title p { font-size: 9.5px; }
  .admin-top-actions { gap: 6px; }
  .admin-top-actions .btn { min-height: 36px; padding: 6px 10px; font-size: 10px; }
  .admin-status { min-width: 0; padding: 5px 9px; }
  .admin-status small { max-width: 120px; }
  .dash-hello h2 { font-size: 19px; }
}
@media (max-width: 780px) {
  .stat-grid { gap: 9px; }
  .stat-card { padding: 12px 13px; border-radius: 16px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 9.5px; }
  .stat-foot { font-size: 8.5px; }
  .stat-icon { width: 32px; height: 32px; border-radius: 10px; }
  .stat-icon .ic { width: 17px; height: 17px; }
  .card { padding: 14px; border-radius: 17px; }
  .dash-grid { gap: 10px; }
  .bars { height: 165px; gap: 4px; }
  .bars.tall { height: 200px; }
  .bar-value { font-size: 7.5px; }
  .bar-col small { display: none; }
  .bar-track { max-width: 32px; }
  .page-head { align-items: flex-start; gap: 10px; }
  .page-head h2 { font-size: 17px; }
  .page-head p { font-size: 9.5px; }
  .page-actions { width: 100%; }
  .page-actions .field { flex: 1; }
  .page-actions .btn { flex: 0 0 auto; }
  .orders-list { gap: 9px; }
  .order-card { padding: 12px; border-radius: 17px; }
  .oc-items { padding: 8px 9px; }
  .oc-actions { width: 100%; justify-content: flex-end; }
  .oc-actions .btn { flex: 1; }
  .admin-row { display: flex; flex-wrap: wrap; gap: 7px; padding: 11px 12px; }
  .admin-row.head { display: none; }
  .prod-cell { flex: 1 1 100%; }
  .prod-cat { display: none !important; }
  .prod-price, .prod-stock { flex: 0 0 auto; }
  .prod-actions { margin-right: auto; }
  .category-admin-grid { grid-template-columns: 1fr; }
  .hours-row { grid-template-columns: 1fr auto; row-gap: 6px; }
  .time-range { grid-column: 1 / -1; justify-content: flex-start; padding-right: 0; }
  .time-range input { width: 92px; }
  .page-toolbar .field { min-width: 0; }
  .page-toolbar .grow { flex: 1 1 100%; }
  .toolbar-count { margin-right: 0; }
  .settings-grid { gap: 10px; }
  .settings-grid .card:first-child { grid-column: auto; }
  .data-actions { flex-direction: row; flex-wrap: wrap; }
  .danger-zone { flex-direction: column; align-items: stretch; }
  .danger-zone .btn { width: 100%; }
  .modal .field-grid { grid-template-columns: 1fr; }
  .modal-body .field-grid .span-2 { grid-column: auto; }
  .side-link.is-active { background: var(--brand-3); }
  .oc-meta { gap: 8px; }
  .oc-code > b { font-size: 12.5px; }
}
@media (max-width: 520px) {
  .admin-topbar { align-items: flex-start; }
  .admin-top-actions { width: 100%; }
  .admin-status { flex: 1; }
  .admin-status small { max-width: none; }
  #pauseBtn { min-width: 0; }
  #pauseBtn span { display: none; }
  .dash-quick { width: 100%; }
  .quick-chip { flex: 1; justify-content: center; font-size: 9.5px; padding: 6px 8px; }
  .stat-card::after { display: none; }
  .stat-tag { display: none; }
  .bars { height: 150px; }
  .bar-col b { font-size: 9px; }
  .filter-tabs { gap: 4px; }
  .filter-tab { min-height: 33px; font-size: 9.5px; padding: 5px 10px; }
  .status-row { grid-template-columns: 84px 1fr 22px; }
  .side-link { min-width: 54px; font-size: 8px; }
  .side-link .ic { width: 18px; height: 18px; }
  .side-foot .side-link { min-width: 40px; }
  .login-panel { padding: 22px 18px; }
  .login-visual-cards { flex-direction: column; }
}
/* ---------- order notifications ---------- */
.side-badge.soft { background: var(--brand-3); color: var(--brand); letter-spacing: .3px; }
a.quick-chip { text-decoration: none; }
.bell-wrap { position: relative; }
.bell-btn { position: relative; }
.bell-btn .ic { width: 19px; height: 19px; }
.bell-btn.has-new { color: var(--accent-2); border-color: #ffd7c6; background: var(--accent-soft); }
.bell-badge {
  position: absolute; top: -5px; left: -5px; min-width: 18px; height: 18px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 999px; background: var(--accent-2);
  color: #fff; font-size: 9px; font-weight: 900; font-style: normal;
  box-shadow: 0 0 0 2px #fff; animation: bellPulse 1.8s infinite;
}
.bell-badge[hidden] { display: none; }
@keyframes bellPulse {
  0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 0 rgba(255, 91, 55, .35); }
  55% { box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(255, 91, 55, 0); }
}
.notify-panel {
  position: absolute; top: calc(100% + 10px); left: 0; width: 348px; max-width: calc(100vw - 28px);
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg, 0 22px 50px rgba(40, 20, 90, .18));
  z-index: 70; overflow: hidden;
}
.notify-panel[hidden] { display: none; }
.notify-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.notify-head b { display: block; font-size: 12px; font-weight: 900; }
.notify-head small { display: block; font-size: 9px; color: var(--muted); margin-top: 1px; }
.notify-list { max-height: 380px; overflow: auto; padding: 8px; display: grid; gap: 7px; }
.notify-item { border: 1px solid var(--line-2); border-radius: 13px; padding: 10px; background: var(--surface-2); }
.notify-item.is-new { background: #fff8f4; border-color: #ffd9ca; }
.ni-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ni-head b { font-size: 11px; font-weight: 850; }
.ni-head small { font-size: 8.5px; color: var(--muted); }
.ni-meta { font-size: 9.5px; color: var(--muted); margin-top: 4px; line-height: 1.7; }
.ni-actions { display: flex; gap: 6px; margin-top: 8px; }
.ni-actions .mini-btn { flex: 1; justify-content: center; }
.notify-empty { text-align: center; padding: 26px 12px; color: var(--muted); font-size: 10.5px; }
.notify-empty .ic { width: 26px; height: 26px; margin: 0 auto 6px; color: var(--brand); display: block; }

.order-alerts {
  position: fixed; left: 18px; bottom: 18px; z-index: 160;
  display: flex; flex-direction: column; gap: 10px; width: min(365px, calc(100vw - 26px));
  pointer-events: none;
}
.order-alert {
  pointer-events: auto; position: relative; display: grid; grid-template-columns: 40px 1fr;
  gap: 10px; padding: 13px 14px 12px; background: #fff;
  border: 1px solid #ffd9ca; border-right: 4px solid var(--accent-2); border-radius: 16px;
  box-shadow: 0 20px 46px rgba(50, 22, 90, .2); animation: alertIn .35s var(--ease);
}
@keyframes alertIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.oa-orb { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.oa-orb .ic { width: 21px; height: 21px; }
.oa-main { min-width: 0; }
.oa-main b { display: block; font-size: 12px; font-weight: 900; }
.oa-main small { display: block; font-size: 9.5px; color: var(--muted); margin-top: 2px; line-height: 1.7; }
.oa-main .oa-money { color: var(--ink); font-weight: 800; }
.oa-actions { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 2px; }
.oa-actions .btn { min-height: 34px; padding: 6px 10px; font-size: 10px; flex: 1; justify-content: center; }
.oa-close { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.oa-close:hover { background: var(--surface-2); color: var(--ink); }
.oa-close .ic { width: 14px; height: 14px; }
.notify-perm { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 9.5px; color: var(--muted); line-height: 1.7; }
.notify-perm.is-on { background: var(--green-bg); border-color: #cdeeda; color: #0d6d47; }
.notify-perm.is-off { background: var(--warn-bg); border-color: #f3e2c1; color: #8a5d0e; }

.order-card.is-flash { animation: orderFlash 1.5s ease; }
@keyframes orderFlash {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 4px #ffd9ca; }
}

@media (max-width: 780px) {
  .pos-link { display: none; }
  .order-alerts { left: 12px; right: 12px; width: auto; bottom: 12px; }
  .bell-wrap .notify-panel { left: auto; right: 0; }
}
@media (max-width: 520px) {
  .notify-panel { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; max-width: none; }
  .bell-wrap { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  .order-alert { animation: none; }
  .bell-badge { animation: none; }
}

/* ---------- settings: store location & delivery radius ---------- */
.settings-grid .card-wide { grid-column: 1 / -1; }
.settings-grid .card-wide .map-picker { height: 300px; }
.geo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.geo-range {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}
.geo-range input[type="range"] { width: 100%; accent-color: var(--brand); }
@media (max-width: 860px) {
  .geo-grid { grid-template-columns: 1fr; }
  .settings-grid .card-wide .map-picker { height: 240px; }
}

/* ---------- geo mode toggle, drawing tools, postal note ---------- */
.geo-mode {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--surface-2, #f3f1fb);
  border: 1px solid var(--line, #e6e2f3);
}
.geo-mode label { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 10px; cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.geo-mode label:has(input:checked) { background: #fff; color: var(--brand); box-shadow: 0 6px 16px rgba(91,50,214,.14); }
.geo-mode input { accent-color: var(--brand); }
.geo-note { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: rgba(91,50,214,.07); border: 1px dashed rgba(91,50,214,.35); font-size: 12.5px; color: var(--brand); font-weight: 600; line-height: 1.9; }
.draw-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.draw-tools .fine-print { margin: 0; }
.map-picker.is-drawing { cursor: crosshair; }
.map-picker.is-drawing::after { content: ''; position: absolute; inset: 0; pointer-events: none; border: 2px dashed rgba(255,122,47,.65); border-radius: inherit; }
.map-picker { position: relative; }

/* ---------- SMS settings ---------- */
.sms-provider { grid-column: 1 / -1; }
.sms-provider[hidden] { display: none; }
.sms-events { border-top: 1px dashed var(--line); padding-top: 12px; }
.sms-events-title { display: block; font-size: 10.5px; font-weight: 800; margin-bottom: 8px; color: var(--ink-2, #4a3f63); }
.sms-event-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 760px) { .sms-event-grid { grid-template-columns: 1fr; } }
.settings-grid .card .map-picker { height: 300px; }
@media (max-width: 860px) { .settings-grid .card .map-picker { height: 240px; } }

/* Separate prefilled demo username and private owner phone login. */
.login-card #loginUser{letter-spacing:0;font-size:16px;font-weight:800;text-align:left;direction:ltr;}
.login-card #loginPin{letter-spacing:5px;}
.login-demo-warning{font-size:10.5px;line-height:1.9;color:var(--muted);text-align:center;margin:9px 0 3px;padding:0 5px;}
.login-card .login-hint{line-height:1.9;}
.login-card .login-hint b{font-size:13px;letter-spacing:0;direction:ltr;display:inline-block;}
