:root {
    --ink: #162235;
    --muted: #708096;
    --line: #e6ebf2;
    --paper: #f6f8fb;
    --surface: #ffffff;
    --accent: #246bfe;
    --accent-soft: #e9f0ff;
    --success: #16865d;
    --shadow: 0 18px 45px rgba(29, 48, 78, .08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.toast { position: fixed; right: 24px; top: 24px; z-index: 20; padding: 12px 16px; color: #fff; background: #162235; border-radius: 8px; box-shadow: var(--shadow); opacity: 0; transform: translateY(-8px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.modal-dialog { width: min(560px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 26px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 80px rgba(12, 26, 48, .24); }
.modal-dialog::backdrop { background: rgba(12, 26, 48, .58); backdrop-filter: blur(2px); }
.modal-dialog-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.modal-dialog-heading h2 { margin: 0; font-size: 24px; }
.modal-dialog-heading .quiet-button { margin: -8px -8px 0 0; font-size: 24px; line-height: 1; }
.modal-dialog .stack-form { margin-top: 24px; }
.modal-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; margin-top: 4px; }
.danger-button { border: 0; border-radius: 6px; padding: 7px 10px; color: #bd3f52; background: #fff0f2; font-size: 12px; font-weight: 700; }
.danger-button:hover { background: #ffe1e6; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 560px); min-height: 100vh; max-width: 1600px; margin: auto; background: #101b2d; }
.auth-panel { grid-column: 2; display: flex; flex-direction: column; justify-content: center; padding: clamp(48px, 8vw, 128px) clamp(32px, 7vw, 112px); background: var(--surface); box-shadow: -18px 0 50px rgba(8, 20, 40, .12); }
.auth-aside { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; justify-content: center; padding: clamp(48px, 8vw, 128px) clamp(32px, 8vw, 130px); color: #f6f8fb; background: #162235; }
.auth-aside h2 { max-width: 620px; margin: 12px 0 20px; font-size: clamp(32px, 4vw, 64px); line-height: 1.05; letter-spacing: 0; }
.auth-aside p:not(.eyebrow) { max-width: 460px; color: #b4c0d2; line-height: 1.8; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; color: #fff; background: var(--accent); border-radius: 8px; font-weight: 800; letter-spacing: 0; }
.brand-mark.small { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 0; }
.auth-aside .eyebrow { color: #8eb1ff; }
h1, h2, p { margin-top: 0; }
.auth-panel h1 { margin: 22px 0 8px; font-size: 38px; letter-spacing: 0; }
.muted { color: var(--muted); }
.stack-form { display: grid; gap: 16px; width: 100%; margin-top: 34px; }
label { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 650; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 12px 13px; color: var(--ink); background: #fbfcfe; outline: none; transition: border .2s, box-shadow .2s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.primary-button, .quiet-button, .nav-item { border: 0; border-radius: 8px; }
.primary-button { padding: 13px 16px; color: #fff; background: var(--accent); font-weight: 750; }
.primary-button:hover { background: #1858d9; }
.primary-button.compact { display: inline-flex; width: auto; margin-top: 12px; padding: 10px 14px; }
.form-error { margin: 0; color: #bd3f52; font-size: 13px; line-height: 1.5; }
.signal-list { display: grid; grid-template-columns: 42px 120px 1fr; gap: 14px; align-items: center; max-width: 520px; padding: 18px 0; border-top: 1px solid rgba(255,255,255,.13); color: #dce5f4; }
.signal-list span:first-child { color: #8eb1ff; font-size: 12px; }
.signal-list span:last-child { color: #8998ad; font-size: 13px; }
.console-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; min-width: 0; flex-direction: column; padding: 24px 16px; color: #cad4e4; background: #162235; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 30px; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0; }
.sidebar-context { display: flex; align-items: center; gap: 8px; padding: 0 12px 22px; color: #8e9eb5; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #55cf9a; box-shadow: 0 0 0 4px rgba(85,207,154,.13); }
.nav-list { display: grid; min-width: 0; gap: 6px; }
.nav-item { padding: 12px; color: #9eacc1; text-align: left; background: transparent; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
.sidebar-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(255,255,255,.1); color: #7889a3; font-size: 11px; }
.sidebar-foot strong { color: #71dca9; font-weight: 650; }
.console-main { min-width: 0; padding: 30px clamp(20px, 4vw, 56px); }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 32px; }
.topbar h1 { margin: 0; font-size: clamp(28px, 3vw, 42px); letter-spacing: 0; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.user-chip { color: var(--muted); font-size: 13px; }
.quiet-button { padding: 9px 12px; color: var(--muted); background: transparent; }
.quiet-button:hover { color: var(--ink); background: #e9eef5; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card, .surface { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 6px 20px rgba(29,48,78,.03); }
.stat-card { min-width: 0; padding: 20px; }
.stat-card .value { margin: 8px 0 3px; font-size: 30px; font-weight: 750; letter-spacing: 0; }
.stat-card .label { color: var(--muted); font-size: 12px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); gap: 16px; margin-top: 16px; }
.surface { padding: 24px; }
.surface-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.surface h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
.live-pill, .badge { padding: 5px 8px; border-radius: 999px; color: var(--success); background: #e6f6ef; font-size: 10px; font-weight: 800; letter-spacing: 0; }
.summary-list { display: grid; gap: 0; }
.summary-row { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.summary-row strong { color: var(--ink); font-weight: 700; }
.accent-surface { color: #e6efff; background: #246bfe; }
.accent-surface .eyebrow { color: #b5ccff; }
.accent-surface p { color: #d3e0ff; line-height: 1.7; }
.accent-surface .primary-button { color: var(--accent); background: #fff; }
.count-label { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 14px 10px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; }
td strong { font-weight: 700; }
.status-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--success); background: #e6f6ef; font-size: 11px; }
.table-link { color: var(--accent); font-weight: 700; }
.action-button { border: 0; border-radius: 6px; padding: 7px 10px; color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 700; }
.page-list { display: grid; gap: 10px; }
.page-item { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; }
.page-item-head { display: flex; justify-content: space-between; gap: 10px; }
.page-item-head strong { font-size: 14px; }
.page-item small { color: var(--muted); }
.page-item button { justify-self: start; border: 0; padding: 7px 10px; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 700; }
.pages-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr); }
.editor-surface { align-self: start; }
.small-text { font-size: 12px; line-height: 1.55; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.inline-form input { width: min(220px, 100%); }
.order-filters { margin: 0 0 20px; }
.order-filters input { width: min(320px, 100%); }
.order-filters select { width: min(180px, 100%); }
.inline-form .form-error { flex-basis: 100%; }
.catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-form { margin-top: 0; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.catalog-list { display: grid; gap: 0; margin-top: 10px; }
.catalog-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.catalog-row div { display: grid; gap: 4px; }
.catalog-row span, .catalog-row small { color: var(--muted); font-size: 11px; }
.product-editor-surface { margin-bottom: 16px; }
.form-actions, .table-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sku-fields { display: grid; gap: 14px; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.sku-fields legend { padding: 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.sku-manager { display: grid; gap: 16px; padding-top: 20px; }
.sku-manager[hidden] { display: none; }
.sku-manager-heading { align-items: center; margin-bottom: 0; }
.sku-manager-heading h3 { margin: 0; font-size: 17px; }
.sku-editor-scroll { overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sku-editor-header, .sku-editor-row { display: grid; grid-template-columns: 130px 120px 160px 100px 100px 100px 92px 90px 64px; gap: 8px; align-items: center; min-width: 1030px; }
.sku-editor-header { padding: 10px 0; color: var(--muted); font-size: 10px; font-weight: 750; }
.sku-editor-row { padding: 9px 0; border-top: 1px solid var(--line); }
.sku-editor-row:first-child { border-top: 0; }
.sku-editor-row input, .sku-editor-row select { min-width: 0; padding: 8px; font-size: 12px; }
.sku-editor-row.inactive { opacity: .64; }
.sku-editor-row .quiet-button { padding: 7px; color: #bd3f52; font-size: 11px; }
.product-cell { display: flex; gap: 10px; align-items: center; }
.product-cell img, .product-placeholder { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; }
.product-placeholder { display: grid; place-items: center; color: var(--muted); background: #edf1f6; font-size: 11px; }
.media-upload-form { align-items: end; margin-top: 0; padding-top: 0; padding-bottom: 20px; border-top: 0; border-bottom: 1px solid var(--line); }
.media-upload-form label { flex: 1 1 220px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 20px; }
.media-card { display: grid; grid-template-rows: 140px auto auto; gap: 10px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fbfcfe; }
.media-card img { width: 100%; height: 140px; border-radius: 6px; object-fit: cover; background: #edf1f6; }
.media-card div { display: grid; gap: 4px; min-width: 0; }
.media-card strong, .media-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card strong { font-size: 12px; }
.media-card span { color: var(--muted); font-size: 10px; }
.media-card .quiet-button { justify-self: start; padding: 6px 8px; color: #bd3f52; }
.ai-result { min-height: 260px; padding: 18px; border: 1px solid var(--line); border-radius: 9px; color: #42536b; background: #fbfcfe; line-height: 1.75; }
.ai-result h3 { margin: 0 0 8px; color: var(--ink); font-size: 18px; }
.ai-result ul { margin: 8px 0 16px; padding-left: 20px; }
.ai-result .draft-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.ai-result .draft-tags span { padding: 5px 8px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 11px; }
.page-library { min-width: 0; }
.page-item.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.page-item-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.page-item-actions button, .inspector-heading button { border: 0; padding: 7px 10px; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 700; }
.editor-form { display: grid; gap: 18px; }
.editor-toolbar { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(180px, 1fr) auto auto; gap: 10px; align-items: end; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.editor-toolbar label { min-width: 0; }
.editor-toolbar .compact { margin: 0; white-space: nowrap; }
.builder-layout { display: grid; grid-template-columns: 150px minmax(260px, 1fr) 190px; gap: 14px; align-items: start; }
.component-palette { display: grid; gap: 7px; }
.palette-item { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--ink); background: #fbfcfe; text-align: left; }
.palette-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.palette-item strong { font-size: 12px; }
.palette-item span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.editor-canvas { display: grid; gap: 8px; min-height: 180px; padding: 10px; border: 1px dashed #bac7d9; border-radius: 8px; background: #f7f9fc; }
.drop-empty { display: grid; min-height: 150px; place-items: center; padding: 24px; color: var(--muted); text-align: center; font-size: 13px; }
.editor-node { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--surface); cursor: grab; }
.editor-node:active { cursor: grabbing; }
.editor-node.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.drag-handle { color: #aab6c6; font-size: 16px; letter-spacing: 0; }
.editor-node-copy { display: grid; gap: 4px; min-width: 0; }
.editor-node-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.editor-node-copy small { color: var(--muted); font-size: 11px; }
.editor-node-actions { display: flex; gap: 5px; }
.editor-node-actions button { border: 0; padding: 5px 7px; border-radius: 5px; color: var(--accent); background: var(--accent-soft); font-size: 11px; }
.editor-node-actions button:last-child { color: #bd3f52; background: #fff0f2; }
.component-inspector { display: grid; gap: 12px; }
.component-inspector label { font-size: 12px; }
.component-inspector input, .component-inspector textarea, .component-inspector select { padding: 9px 10px; font-size: 12px; }
.component-inspector select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; color: var(--ink); background: #fbfcfe; }
.inspector-heading { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.inspector-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.inspector-heading button { color: #bd3f52; background: #fff0f2; }
.preview-heading { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 8px; }
.preview-canvas { overflow: hidden; min-height: 140px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #f8fafc; }
.preview-hero { position: relative; overflow: hidden; min-height: 130px; border-radius: 8px; padding: 18px; color: #fff; background: #20394a; }
.preview-hero img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; opacity: .45; object-fit: cover; }
.preview-hero div { position: relative; display: grid; gap: 6px; }
.preview-hero strong { font-size: 22px; }
.preview-hero span { color: #dbe6ef; font-size: 12px; }
.preview-text, .preview-coupon, .preview-image, .preview-products, .preview-categories { margin-top: 10px; border-radius: 8px; padding: 13px; background: #fff; }
.preview-image { display: grid; min-height: 80px; place-items: center; padding: 0; color: var(--muted); background: #eef2f5; }
.preview-image img { width: 100%; max-height: 150px; border-radius: 8px; object-fit: cover; }
.preview-products h3 { margin: 0 0 10px; font-size: 15px; }
.preview-products > div, .preview-categories { display: flex; flex-wrap: wrap; gap: 7px; }
.preview-products span, .preview-categories span { padding: 8px; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 11px; }
.preview-coupon { display: flex; justify-content: space-between; gap: 12px; color: #6b4d16; background: #fff6dc; font-size: 12px; }
.coupons-grid { align-items: start; }
.ai-config-surface { margin-top: 18px; }
.coupon-hint { margin: 14px 0 0; line-height: 1.6; }
.coupon-code { letter-spacing: .04em; }
.danger-action { color: #bd3f52; }
.muted-badge { color: #6f7d90; background: #edf1f5; }
.warning-badge { color: #8b641c; background: #fff1c7; }
.advanced-schema { border-top: 1px solid var(--line); padding-top: 14px; }
.advanced-schema summary { color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700; }
.advanced-schema textarea { margin-top: 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.5; }
@media (max-width: 1120px) { .builder-layout { grid-template-columns: 130px minmax(240px, 1fr); } .component-inspector { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); } .inspector-heading { grid-column: 1 / -1; } }
@media (max-width: 720px) { .editor-toolbar { grid-template-columns: 1fr 1fr; } .editor-toolbar .primary-button, .editor-toolbar .action-button { width: 100%; } .builder-layout { grid-template-columns: 1fr; } .component-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); } .component-inspector { grid-template-columns: 1fr; } .inspector-heading { grid-column: auto; } }
@media (max-width: 920px) { .auth-layout { grid-template-columns: 1fr; } .auth-panel { grid-column: 1; grid-row: 2; min-height: 58vh; } .auth-aside { grid-column: 1; grid-row: 1; min-height: 42vh; } .console-layout { grid-template-columns: 1fr; } .sidebar { padding: 12px 16px; } .sidebar-brand { padding-bottom: 12px; } .sidebar-context, .sidebar-foot { display: none; } .nav-list { display: flex; overflow-x: auto; } .nav-item { min-width: max-content; } .console-main { padding: 24px 18px 40px; } .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .content-grid, .pages-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .topbar { display: grid; } .topbar-actions { min-width: 0; justify-content: space-between; } .user-chip { overflow-wrap: anywhere; } .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat-card .value { overflow-wrap: anywhere; } .surface { padding: 18px; } .form-row { grid-template-columns: 1fr; } .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
