:root {
  color-scheme: dark;
  --bg: #07070b;
  --panel: rgba(17, 17, 25, .78);
  --panel-strong: #111119;
  --panel-soft: rgba(255,255,255,.035);
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.14);
  --text: #f5f5f7;
  --muted: #9292a2;
  --primary: #9b5cff;
  --primary-2: #6f38ff;
  --cyan: #51d7ff;
  --green: #3ce6a0;
  --yellow: #ffc65c;
  --red: #ff647c;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0,0,0,.38);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100%; color: var(--text); font-family: var(--font); background:
  radial-gradient(circle at 20% -10%, rgba(127,67,255,.14), transparent 34%),
  radial-gradient(circle at 90% 15%, rgba(55,199,255,.07), transparent 28%), var(--bg); overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.glass { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.ambient { position: fixed; width: 420px; height: 420px; border-radius: 50%; filter: blur(120px); opacity: .14; pointer-events: none; z-index: -1; }
.ambient-a { background: var(--primary); left: -180px; top: 20%; }
.ambient-b { background: var(--cyan); right: -220px; bottom: -140px; }
.eyebrow { color: #b394ff; font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 600px) minmax(480px, 1fr); align-items: stretch; }
.login-card { margin: 24px; padding: clamp(32px, 5vw, 70px); border-radius: 28px; display: flex; flex-direction: column; justify-content: center; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; font-size: 19px; font-weight: 950; color: white; background: linear-gradient(145deg, var(--primary), #5b25df); box-shadow: 0 10px 28px rgba(124,65,255,.35); }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .12em; font-size: 14px; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: .22em; margin-top: 4px; }
.brand-login { position: absolute; top: 60px; }
.login-copy { margin: 70px 0 34px; }
.login-copy h1 { margin: 12px 0; font-size: clamp(38px, 5vw, 62px); line-height: .98; letter-spacing: -.055em; }
.login-copy h1 em { font-style: normal; color: #b990ff; }
.login-copy p { color: var(--muted); max-width: 440px; font-size: 16px; line-height: 1.7; }
.stack { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: #b9b9c5; font-size: 12px; font-weight: 650; }
input, textarea, select { width: 100%; color: var(--text); border: 1px solid var(--line); background: rgba(255,255,255,.035); border-radius: 12px; padding: 12px 14px; outline: none; transition: .2s ease; }
input:focus, textarea:focus, select:focus { border-color: rgba(155,92,255,.75); box-shadow: 0 0 0 3px rgba(155,92,255,.12); }
textarea { resize: vertical; min-height: 110px; }
select option { color: #111; }
.button { border: 0; border-radius: 12px; padding: 11px 16px; cursor: pointer; font-weight: 750; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .18s, filter .18s, background .18s; }
.button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; box-shadow: 0 10px 28px rgba(125,58,255,.25); }
.button-secondary { background: rgba(255,255,255,.07); border: 1px solid var(--line); }
.button-danger { background: rgba(255,100,124,.13); border: 1px solid rgba(255,100,124,.22); color: #ff9aac; }
.button-success { background: rgba(60,230,160,.13); border: 1px solid rgba(60,230,160,.22); color: var(--green); }
.button-lg { padding: 15px 18px; justify-content: space-between; }
.form-error { color: var(--red); min-height: 18px; font-size: 12px; margin: 0; }
.security-note { color: var(--muted); display: flex; gap: 8px; align-items: center; margin-top: 22px; font-size: 11px; }
.security-note i, .live-pill i, .system-status i { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 12px var(--green); }
.login-showcase { position: relative; overflow: hidden; padding: 8vw 7vw; display: flex; flex-direction: column; justify-content: center; }
.login-showcase h2 { font-size: clamp(36px, 5vw, 68px); max-width: 760px; line-height: 1.02; letter-spacing: -.055em; margin: 16px 0 38px; }
.showcase-orbit { position: absolute; width: 600px; height: 600px; border: 1px solid rgba(155,92,255,.14); border-radius: 50%; right: -180px; top: -170px; box-shadow: inset 0 0 90px rgba(155,92,255,.04); }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 700px; }
.preview-grid article { padding: 20px; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 16px; }
.preview-grid span, .preview-grid small { display: block; color: var(--muted); font-size: 11px; }
.preview-grid strong { display: block; margin: 8px 0; font-size: 25px; }
.preview-grid small { color: var(--green); }
.preview-wide { grid-column: 1 / -1; }
.fake-chart { display: flex; align-items: flex-end; height: 80px; gap: 10px; margin-top: 15px; }
.fake-chart i { flex: 1; height: 20%; background: linear-gradient(var(--primary), rgba(155,92,255,.15)); border-radius: 4px 4px 0 0; animation: bars 2.8s ease-in-out infinite alternate; }
.fake-chart i:nth-child(2) { height: 45%; animation-delay: .2s }.fake-chart i:nth-child(3) { height: 35%; animation-delay: .4s }.fake-chart i:nth-child(4) { height: 68%; animation-delay: .6s }.fake-chart i:nth-child(5) { height: 52%; animation-delay: .8s }.fake-chart i:nth-child(6) { height: 76%; animation-delay: 1s }.fake-chart i:nth-child(7) { height: 66%; animation-delay: 1.2s }.fake-chart i:nth-child(8) { height: 92%; animation-delay: 1.4s }
@keyframes bars { to { filter: brightness(1.45); transform: scaleY(.92); } }

.app { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 14px; padding: 14px; }
.sidebar { height: calc(100vh - 28px); position: sticky; top: 14px; border-radius: 20px; padding: 20px 13px 14px; display: flex; flex-direction: column; z-index: 20; }
.sidebar .brand { padding: 5px 8px 24px; }
.sidebar nav { overflow-y: auto; scrollbar-width: thin; flex: 1; }
.sidebar nav p { color: #616171; font-size: 9px; font-weight: 850; letter-spacing: .18em; margin: 21px 12px 8px; }
.sidebar nav button { width: 100%; border: 0; background: transparent; color: #8f8f9f; padding: 10px 12px; margin: 2px 0; border-radius: 10px; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 640; transition: .18s ease; }
.sidebar nav button:hover { color: white; background: rgba(255,255,255,.045); }
.sidebar nav button.active { color: white; background: linear-gradient(100deg, rgba(155,92,255,.22), rgba(155,92,255,.06)); box-shadow: inset 2px 0 var(--primary); }
.nav-icon { width: 20px; text-align: center; color: #b894ff; font-size: 14px; }
.sidebar-foot { padding: 14px 7px 2px; border-top: 1px solid var(--line); }
.system-status { display: flex; align-items: center; gap: 10px; }
.system-status span { display: grid; gap: 3px; }
.system-status strong { font-size: 10px; }.system-status small { color: var(--muted); font-size: 9px; }
.main { min-width: 0; }
.topbar { height: 78px; display: flex; align-items: center; gap: 15px; padding: 0 10px 0 14px; position: sticky; top: 0; z-index: 15; background: linear-gradient(var(--bg) 72%, transparent); }
.topbar h1 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.025em; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); background: rgba(255,255,255,.04); border-radius: 11px; cursor: pointer; display: grid; place-items: center; color: #b8b8c5; font-size: 17px; }
.icon-button:hover { background: rgba(255,255,255,.08); color: white; }
.menu-toggle { display: none; }
.live-pill { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); font-size: 10px; }
.user-chip { display: grid; grid-template-columns: 32px auto; column-gap: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.035); padding: 4px 10px 4px 5px; border-radius: 12px; text-align: left; }
.user-chip > span { grid-row: 1 / 3; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: rgba(155,92,255,.18); color: #c9adff; font-weight: 800; }
.user-chip b { font-size: 10px; align-self: end; }.user-chip small { color: var(--muted); font-size: 8px; align-self: start; }
.content { padding: 14px; animation: enter .3s ease; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }

.grid { display: grid; gap: 14px; }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { min-height: 132px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(255,255,255,.046), rgba(255,255,255,.018)); position: relative; overflow: hidden; }
.metric::after { content: ''; position: absolute; inset: auto -30px -50px auto; width: 110px; height: 110px; border-radius: 50%; background: var(--metric-color, var(--primary)); filter: blur(45px); opacity: .12; }
.metric-head { display: flex; justify-content: space-between; align-items: center; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 650; }
.metric-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--metric-color, #b990ff); background: color-mix(in srgb, var(--metric-color, var(--primary)) 12%, transparent); }
.metric strong { display: block; margin-top: 21px; font-size: clamp(22px, 2.2vw, 31px); letter-spacing: -.04em; }
.metric small { display: block; margin-top: 6px; color: #6e6e7d; font-size: 9px; }
.metric.highlight { background: linear-gradient(145deg, rgba(155,92,255,.19), rgba(155,92,255,.035)); border-color: rgba(155,92,255,.22); }
.section-grid { grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr); margin-top: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.025); padding: 18px; min-width: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.panel-header h2, .panel-header h3 { margin: 0; letter-spacing: -.025em; }.panel-header h2 { font-size: 16px; }.panel-header h3 { font-size: 14px; }
.panel-header p { color: var(--muted); margin: 5px 0 0; font-size: 10px; }
.panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chart-wrap { position: relative; height: 310px; }.chart-wrap.small { height: 250px; }.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.legend { display: grid; gap: 9px; margin-top: 10px; }
.legend-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.legend-row i { width: 8px; height: 8px; border-radius: 3px; }.legend-row b { color: var(--text); font-weight: 700; }
.spotlight { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(155,92,255,.09), rgba(255,255,255,.018)); border-radius: 14px; padding: 14px; }
.spotlight + .spotlight { margin-top: 10px; }
.spotlight span { color: var(--muted); font-size: 9px; }.spotlight strong { display: block; margin-top: 6px; }.spotlight small { color: #b990ff; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 220px; }.toolbar input, .toolbar select { width: auto; min-width: 130px; padding: 10px 12px; font-size: 11px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; white-space: nowrap; }
th { color: #7e7e8e; font-size: 8px; letter-spacing: .12em; text-transform: uppercase; background: rgba(255,255,255,.025); position: sticky; top: 0; }
td { color: #c8c8d2; } tr:last-child td { border-bottom: 0; } tbody tr { cursor: pointer; transition: .15s; } tbody tr:hover { background: rgba(255,255,255,.025); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-size: 8px; font-weight: 800; text-transform: uppercase; background: rgba(255,255,255,.06); }
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.delivered, .status.paid, .status.approved_pending { color: var(--green); background: rgba(60,230,160,.08); }
.status.refunded, .status.cancelled, .status.expired { color: var(--red); background: rgba(255,100,124,.08); }.status.pending_payment, .status.awaiting_payment { color: var(--yellow); background: rgba(255,198,92,.08); }
.muted { color: var(--muted); }.money { color: #d7c3ff; font-weight: 750; }.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-card, .customer-card, .insight-card, .coupon-card { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); overflow: hidden; transition: .2s; }
.product-card:hover, .customer-card:hover, .coupon-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.product-image { height: 150px; background: linear-gradient(135deg, rgba(155,92,255,.15), rgba(81,215,255,.06)); display: grid; place-items: center; overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }.product-image span { font-size: 35px; color: rgba(255,255,255,.18); }
.card-body { padding: 15px; }.card-top { display: flex; justify-content: space-between; gap: 10px; }.card-body h3 { margin: 0; font-size: 14px; }.card-body p { color: var(--muted); font-size: 10px; line-height: 1.6; min-height: 32px; }.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }.tag { padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; color: #b8b8c5; font-size: 8px; }
.card-actions { display: flex; gap: 7px; margin-top: 12px; }.card-actions .button { flex: 1; padding: 8px; font-size: 9px; }
.toggle { width: 34px; height: 19px; border-radius: 20px; background: #333341; padding: 2px; border: 0; cursor: pointer; }.toggle::after { content: ''; display: block; width: 15px; height: 15px; background: white; border-radius: 50%; transition: .2s; }.toggle.on { background: var(--green); }.toggle.on::after { transform: translateX(15px); }
.insights-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.insight-card { padding: 20px; position: relative; overflow: hidden; }.insight-card::after { content: ''; position: absolute; width: 100px; height: 100px; right: -45px; top: -45px; border-radius: 50%; background: var(--tone, var(--primary)); filter: blur(35px); opacity: .15; }.insight-card .insight-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--tone, #b990ff); background: color-mix(in srgb, var(--tone, var(--primary)) 12%, transparent); }.insight-card h3 { margin: 16px 0 7px; font-size: 14px; }.insight-card p { color: var(--muted); margin: 0; font-size: 11px; line-height: 1.7; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }.form-grid .full { grid-column: 1 / -1; }.form-grid .compact textarea { min-height: 78px; }
.tabs { display: flex; gap: 5px; padding: 4px; background: rgba(255,255,255,.035); border-radius: 12px; margin-bottom: 16px; }.tabs button { border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; color: var(--muted); cursor: pointer; font-size: 10px; }.tabs button.active { background: rgba(155,92,255,.17); color: white; }
.inventory-editor { display: grid; grid-template-columns: minmax(280px, 540px) minmax(180px, 1fr); gap: 18px; }
.inventory-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; background: #15151c; border: 1px solid var(--line); padding: 8px; border-radius: 12px; }
.inventory-slot { aspect-ratio: 1; min-width: 0; border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.035); border-radius: 5px; display: grid; place-items: center; position: relative; cursor: pointer; color: #8f8f9d; font-size: 8px; overflow: hidden; }
.inventory-slot:hover { border-color: rgba(155,92,255,.7); background: rgba(155,92,255,.08); }.inventory-slot.filled { background: rgba(155,92,255,.1); color: white; }.inventory-slot b { font-size: 10px; text-align: center; line-height: 1.1; padding: 2px; word-break: break-all; }.inventory-slot small { position: absolute; right: 3px; bottom: 1px; font-size: 8px; text-shadow: 0 1px 2px #000; }
.item-palette { display: grid; gap: 7px; align-content: start; }.palette-item { display: flex; gap: 9px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.03); cursor: grab; }.palette-item strong { font-size: 9px; }.palette-item small { color: var(--muted); font-size: 8px; }
.timeline { position: relative; display: grid; gap: 13px; }.timeline::before { content: ''; position: absolute; top: 0; bottom: 0; left: 7px; width: 1px; background: var(--line); }.timeline-row { display: grid; grid-template-columns: 15px 1fr; gap: 12px; position: relative; }.timeline-row i { width: 15px; height: 15px; border-radius: 50%; border: 4px solid var(--panel-strong); background: var(--primary); box-shadow: 0 0 0 1px rgba(155,92,255,.4); }.timeline-row article { padding: 11px; border: 1px solid var(--line); border-radius: 11px; }.timeline-row strong { font-size: 10px; }.timeline-row p { color: var(--muted); margin: 5px 0 0; font-size: 9px; }
.empty { padding: 45px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }.empty b { color: white; display: block; margin-bottom: 7px; }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }.modal-card { position: relative; width: min(920px, 96vw); max-height: 92vh; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; }.modal-card > header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }.modal-card h2 { margin: 5px 0 0; font-size: 20px; }.modal-body { overflow: auto; padding: 20px; }.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.toast-area { position: fixed; right: 20px; top: 90px; z-index: 150; display: grid; gap: 8px; }.toast { min-width: 260px; max-width: 380px; padding: 12px 14px; background: #181821; border: 1px solid var(--line-strong); border-left: 3px solid var(--primary); border-radius: 10px; box-shadow: var(--shadow); font-size: 10px; animation: toast-in .25s ease; }.toast.error { border-left-color: var(--red); }.toast.success { border-left-color: var(--green); } @keyframes toast-in { from { opacity: 0; transform: translateX(15px); } }
.skeleton { border-radius: 9px; background: linear-gradient(100deg, rgba(255,255,255,.035) 20%, rgba(255,255,255,.08) 35%, rgba(255,255,255,.035) 50%); background-size: 300% 100%; animation: shimmer 1.4s infinite; } @keyframes shimmer { to { background-position: -100% 0; } }

@media (max-width: 1180px) { .metrics { grid-template-columns: repeat(2, 1fr); }.cards { grid-template-columns: repeat(2, 1fr); }.section-grid { grid-template-columns: 1fr; }.login-shell { grid-template-columns: minmax(360px, 520px) 1fr; }.login-showcase { padding: 6vw 4vw; } }
@media (max-width: 860px) {
  .login-shell { display: block; }.login-card { min-height: calc(100vh - 28px); margin: 14px; }.login-showcase { display: none; }
  .app { grid-template-columns: 1fr; padding: 0; }.sidebar { position: fixed; left: -270px; top: 10px; bottom: 10px; height: auto; width: 244px; transition: .25s; }.sidebar.open { left: 10px; }.menu-toggle { display: grid; }.main { padding: 0 4px; }.content { padding: 10px; }.topbar { padding: 0 10px; }.live-pill { display: none; }.user-chip b, .user-chip small { display: none; }.user-chip { grid-template-columns: 32px; padding-right: 5px; }.cards, .insights-grid { grid-template-columns: 1fr; }.inventory-editor { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }.metric { min-height: 112px; padding: 13px; }.metric strong { font-size: 18px; margin-top: 15px; }.toolbar input, .toolbar select { width: 100%; }.toolbar .search { min-width: 100%; }.form-grid { grid-template-columns: 1fr; }.form-grid .full { grid-column: auto; }.topbar h1 { font-size: 19px; }.top-actions { gap: 5px; }.inventory-grid { gap: 2px; padding: 5px; }.inventory-slot b { font-size: 7px; }.modal { padding: 7px; }.modal-card { max-height: 97vh; } }
