:root {
  --bg: #0d0b10;
  --panel: #17131c;
  --panel-2: #211927;
  --text: #f8f5fa;
  --muted: #a99ead;
  --accent: #8f2bc0;
  --accent-2: #cf5cff;
  --line: rgba(255,255,255,.09);
  --danger: #ff5f71;
  --success: #48d29a;
  --warning: #ffb84d;
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: #100d13; color: var(--text); border-radius: 12px; padding: 12px 14px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(207,92,255,.12); }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
small { color: var(--muted); }
.primary-button, .secondary-button, .text-button { border: 0; border-radius: 13px; padding: 13px 18px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.primary-button { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; box-shadow: 0 10px 30px rgba(143,43,192,.25); }
.secondary-button { background: #2a2130; color: white; border: 1px solid var(--line); }
.text-button { background: transparent; color: var(--muted); }
.compact { padding: 9px 13px; font-size: 13px; }
.alert { background: rgba(255,95,113,.12); color: #ff9eaa; border: 1px solid rgba(255,95,113,.25); padding: 12px; border-radius: 12px; font-size: 14px; }

/* Login and landing */
.login-body, .landing-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 70% 20%, rgba(143,43,192,.35), transparent 35%), #09070b; }
.login-card, .landing-card { width: min(100%, 430px); padding: 34px; border: 1px solid var(--line); border-radius: 28px; background: rgba(23,19,28,.9); backdrop-filter: blur(18px); display: grid; gap: 18px; box-shadow: 0 30px 100px rgba(0,0,0,.45); }
.login-card h1, .landing-card h1 { margin: 0; letter-spacing: -.04em; }
.login-card p, .landing-card p { margin: 0; color: var(--muted); }
.logo-orb { width: 64px; height: 64px; border-radius: 21px; display: grid; place-items: center; font-size: 25px; font-weight: 900; background: radial-gradient(circle at 30% 20%, #e889ff, var(--accent) 55%, #42104e); box-shadow: inset 0 1px rgba(255,255,255,.4), 0 15px 40px rgba(143,43,192,.35); }
.landing-card { width: min(100%, 760px); padding: 60px; }
.landing-card h1 { font-size: clamp(54px, 10vw, 100px); line-height: .86; }
.eyebrow { color: var(--accent-2); letter-spacing: .22em; font-size: 12px; font-weight: 900; }
.landing-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Admin */
.admin-body { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); padding: 28px 20px; display: flex; flex-direction: column; background: #0a080c; }
.brand { font-weight: 950; letter-spacing: .04em; font-size: 19px; padding: 10px; }
.brand-dot { color: var(--accent-2); }
.sidebar nav { display: grid; gap: 5px; margin-top: 28px; }
.sidebar nav a { padding: 12px 14px; border-radius: 12px; color: var(--muted); }
.sidebar nav a:hover { background: var(--panel); color: white; }
.logout-form { margin-top: auto; }
.admin-main { min-width: 0; padding: 0 34px 50px; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: flex-end; gap: 15px; border-bottom: 1px solid var(--line); }
.topbar div { display: grid; text-align: right; }
.role-badge { background: rgba(143,43,192,.2); color: #e2a8ff; border: 1px solid rgba(207,92,255,.25); border-radius: 999px; padding: 7px 10px; font-size: 11px; text-transform: uppercase; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 34px 0 24px; }
.page-head h1 { margin: 0 0 6px; font-size: 32px; letter-spacing: -.04em; }
.page-head p { margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.metric { min-height: 130px; padding: 22px; background: linear-gradient(145deg, var(--panel), #121016); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; justify-content: space-between; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { font-size: 30px; letter-spacing: -.04em; }
.metric.warning strong { color: var(--warning); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head a { color: var(--accent-2); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
td { font-size: 14px; }
.status, .stock { display: inline-flex; border-radius: 999px; padding: 6px 9px; font-size: 11px; font-weight: 800; background: rgba(255,255,255,.06); }
.status-new { color: #c994ff; background: rgba(143,43,192,.17); }
.status-completed { color: var(--success); background: rgba(72,210,154,.13); }
.status-cancelled, .stock.low { color: #ff9eaa; background: rgba(255,95,113,.12); }
.empty { color: var(--muted); text-align: center; padding: 40px; }
.modal { border: 1px solid var(--line); border-radius: 22px; background: var(--panel); color: var(--text); width: min(760px, calc(100% - 30px)); padding: 0; }
.modal::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(7px); }
.modal form { padding: 24px; display: grid; gap: 18px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { margin: 0; }
.modal-head button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.07); color: white; font-size: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.check { grid-template-columns: 18px 1fr; align-items: center; }
.check input { width: auto; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { padding: 8px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.chip.active { color: white; border-color: var(--accent); background: rgba(143,43,192,.18); }
.order-list { display: grid; gap: 14px; }
.order-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.order-top { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.order-top h2, .order-top p { margin: 0; }
.order-top p { color: var(--muted); font-size: 12px; margin-top: 5px; }
.order-top > strong { font-size: 20px; }
.order-columns { display: grid; grid-template-columns: 1fr 1.5fr; gap: 30px; padding: 18px 0; }
.order-columns p { margin: 5px 0 14px; }
.status-form { display: flex; gap: 10px; justify-content: flex-end; }
.status-form select { width: auto; min-width: 220px; }

/* Shop Mini App */
.shop-body { background: #0a080c; min-height: 100vh; padding-bottom: 90px; }
.shop-header { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; background: rgba(10,8,12,.88); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.shop-header > div { display: flex; gap: 10px; align-items: center; }
.shop-header > div > div { display: grid; }
.shop-header small { font-size: 10px; }
.shop-mark { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, var(--accent-2), #53116b); font-weight: 900; }
.cart-button { border: 0; border-radius: 12px; padding: 10px 12px; background: var(--panel-2); color: white; font-size: 12px; }
.cart-button b { background: var(--accent); border-radius: 999px; padding: 3px 7px; margin-left: 5px; }
.shop-main { padding: 16px; }
.shop-hero { padding: 25px 22px; border-radius: 25px; min-height: 250px; display: flex; flex-direction: column; justify-content: flex-end; background: radial-gradient(circle at 78% 28%, rgba(235,116,255,.55), transparent 18%), radial-gradient(circle at 70% 20%, #6b198e, transparent 40%), linear-gradient(145deg, #25132e, #120e16); border: 1px solid rgba(255,255,255,.1); overflow: hidden; position: relative; }
.shop-hero::after { content: ""; position: absolute; width: 150px; height: 150px; right: -35px; top: 15px; border-radius: 50%; border: 25px dotted rgba(255,255,255,.08); transform: rotate(20deg); }
.shop-hero span { color: #eaa7ff; font-size: 10px; letter-spacing: .14em; font-weight: 900; }
.shop-hero h1 { font-size: 39px; line-height: .95; letter-spacing: -.05em; margin: 9px 0; }
.shop-hero p { margin: 0; color: #d2c4d6; max-width: 270px; font-size: 13px; }
.search-input { margin: 16px 0 12px; background: var(--panel); }
.category-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.category-scroll::-webkit-scrollbar { display: none; }
.category-button { white-space: nowrap; border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 10px 13px; font-size: 12px; }
.category-button.active { color: white; border-color: var(--accent); background: rgba(143,43,192,.2); }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
.product-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; min-width: 0; }
.product-image { aspect-ratio: 1 / .85; background: linear-gradient(145deg, #2b2031, #151019); display: grid; place-items: center; overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-placeholder { font-size: 44px; filter: grayscale(.3); }
.product-info { padding: 12px; }
.product-info small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-info h3 { font-size: 14px; margin: 5px 0 9px; min-height: 34px; line-height: 1.2; }
.product-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-bottom strong { font-size: 15px; white-space: nowrap; }
.add-button { width: 34px; height: 34px; border-radius: 11px; border: 0; color: white; background: linear-gradient(145deg, var(--accent), var(--accent-2)); font-size: 20px; }
.add-button:disabled { opacity: .35; }
.loading { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 45px; }
.age-gate, .drawer { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.76); backdrop-filter: blur(10px); display: none; }
.age-gate.visible, .drawer.visible { display: flex; }
.age-gate { align-items: center; justify-content: center; padding: 18px; }
.age-card { width: min(100%, 410px); background: var(--panel); border: 1px solid var(--line); border-radius: 26px; padding: 27px; display: grid; gap: 15px; text-align: center; }
.age-card .logo-orb { margin: auto; width: 75px; height: 75px; }
.age-card h2, .age-card p { margin: 0; }
.age-card p { color: var(--muted); line-height: 1.5; font-size: 14px; }
.drawer { align-items: flex-end; }
.drawer-sheet { width: 100%; max-height: 88vh; overflow-y: auto; border-radius: 25px 25px 0 0; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; padding: 20px; display: grid; gap: 15px; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.cart-line h4, .cart-line p { margin: 0; }
.cart-line p { color: var(--muted); font-size: 12px; margin-top: 5px; }
.quantity { display: flex; align-items: center; gap: 8px; }
.quantity button { width: 30px; height: 30px; border: 0; border-radius: 9px; background: #2a2130; color: white; }
.cart-total { display: flex; justify-content: space-between; align-items: center; font-size: 18px; padding-top: 5px; }
.info-box { padding: 12px; border-radius: 12px; background: rgba(143,43,192,.12); color: #ddc4e7; font-size: 12px; line-height: 1.5; }
.toast { position: fixed; z-index: 100; left: 15px; right: 15px; bottom: 20px; background: #28202d; color: white; border: 1px solid var(--line); padding: 14px; border-radius: 14px; transform: translateY(150%); transition: .25s; text-align: center; }
.toast.visible { transform: translateY(0); }

@media (max-width: 900px) {
  .admin-body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; margin: 0 0 0 15px; }
  .logout-form { margin: 0 0 0 auto; }
  .admin-main { padding: 0 16px 40px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .topbar { display: none; }
  .page-head { padding-top: 24px; align-items: flex-start; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 110px; padding: 16px; }
  .metric strong { font-size: 22px; }
  .form-grid, .order-columns { grid-template-columns: 1fr; }
  .status-form { align-items: stretch; flex-direction: column; }
  .status-form select { width: 100%; }
  .landing-card { padding: 34px 25px; }
}
