@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700&display=swap');

:root {
  font-family: "DM Sans", system-ui, sans-serif;
  color: #2b2725;
  background: #f5f1ef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --bg: #f5f1ef;
  --surface: #fffdfc;
  --surface-2: #f8f4f2;
  --surface-3: #efe7e3;
  --text: #2b2725;
  --muted-text: #756d68;
  --subtle-text: #938984;
  --line: #e7deda;
  --brand: #b8897c;
  --brand-deep: #92685d;
  --brand-soft: #ead7d1;
  --brand-faint: #f7edeb;
  --ink: #36383a;
  --success: #317a5a;
  --success-bg: #e8f4ee;
  --warning: #9b6726;
  --warning-bg: #fff2dc;
  --danger: #b64444;
  --danger-bg: #fbeaea;
  --info: #396b8d;
  --info-bg: #eaf3f8;
  --shadow: 0 16px 44px rgba(79, 54, 45, .07);
  --sidebar-width: 260px;
}

:root[data-theme="dark"] {
  color: #f2ece8;
  background: #171514;
  --bg: #171514;
  --surface: #211f1e;
  --surface-2: #292624;
  --surface-3: #322e2b;
  --text: #f2ece8;
  --muted-text: #b6aba5;
  --subtle-text: #968d88;
  --line: #3b3633;
  --brand: #c79b8f;
  --brand-deep: #ddb7ad;
  --brand-soft: #5b4039;
  --brand-faint: #302522;
  --ink: #d8d1cd;
  --success: #86c9a6;
  --success-bg: #20372c;
  --warning: #e8bd7e;
  --warning-bg: #3d3020;
  --danger: #ee9696;
  --danger-bg: #422727;
  --info: #92bfdb;
  --info-bg: #21333e;
  --shadow: 0 18px 48px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { width: 100%; min-width: 320px; max-width: 100%; overflow-x: clip; background: var(--bg); }
body, #root { width: 100%; min-width: 320px; max-width: 100%; min-height: 100vh; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); }
img, video, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { min-width: 0; cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: .78rem .86rem; outline: none; transition: border .2s, box-shadow .2s; font-size: .94rem; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
textarea { resize: vertical; }
label > span { display: block; margin-bottom: .42rem; color: var(--muted-text); font-weight: 600; font-size: .84rem; }
label small { display: block; margin-top: .4rem; color: var(--subtle-text); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; color: var(--brand-deep); background: var(--brand-faint); border: 1px solid var(--brand-soft); border-radius: 7px; padding: .24rem .44rem; white-space: nowrap; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Manrope", system-ui, sans-serif; letter-spacing: -.025em; }
.modal-open { overflow: hidden; }

.app-shell { width: 100%; min-width: 0; min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: var(--sidebar-width); background: #2d2927; color: #f7f1ee; padding: 1.1rem .9rem; display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,.07); }
:root[data-theme="dark"] .sidebar { background: #11100f; }
.brand-block { min-height: 74px; display: grid; grid-template-columns: 47px 1fr auto; align-items: center; gap: .7rem; padding: .1rem .45rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-logo { width: 47px; height: 47px; border-radius: 15px; object-fit: cover; box-shadow: 0 7px 18px rgba(0,0,0,.2); }
.brand-block strong { display: block; font-family: "Manrope", sans-serif; font-size: 1rem; }
.brand-block span { color: #c7bcb7; font-size: .75rem; }
.main-nav { display: grid; gap: .22rem; padding: 1rem 0; overflow-y: auto; }
.main-nav button { position: relative; display: grid; grid-template-columns: 22px 1fr 16px; align-items: center; gap: .68rem; border: 0; border-radius: 11px; background: transparent; color: #cfc6c2; padding: .67rem .72rem; text-align: left; font-size: .87rem; font-weight: 500; transition: .2s; }
.main-nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.main-nav button.active { background: linear-gradient(115deg, rgba(184,137,124,.25), rgba(184,137,124,.08)); color: #fff; }
.main-nav button.active::before { content: ""; position: absolute; left: -.9rem; width: 3px; height: 24px; border-radius: 0 3px 3px 0; background: #d6a89b; }
.nav-chevron { justify-self: end; opacity: .65; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 1rem .45rem .2rem; display: grid; grid-template-columns: 35px 1fr auto; gap: .6rem; align-items: center; }
.user-avatar, .avatar-button { display: grid; place-items: center; border-radius: 50%; background: #c49689; color: #fff; font-weight: 700; }
.user-avatar { width: 35px; height: 35px; }
.sidebar-footer strong { display: block; font-size: .78rem; max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer span { color: #aa9f9a; font-size: .7rem; }
.text-button { border: 0; color: #d3aaa0; background: transparent; font-size: .75rem; padding: .3rem; }
.sidebar-close, .menu-button, .sidebar-scrim { display: none !important; }

.workspace { grid-column: 2; width: 100%; min-width: 0; max-width: 100%; }
.topbar { height: 77px; position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(1rem, 3vw, 2.4rem); background: color-mix(in srgb, var(--surface) 88%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar-title { min-width: 0; display: flex; align-items: center; gap: .75rem; }
.topbar-title > div { min-width: 0; }
.topbar-title span { display: block; color: var(--subtle-text); text-transform: uppercase; font-size: .63rem; font-weight: 700; letter-spacing: .12em; }
.topbar-title h1 { margin: .12rem 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.08rem; }
.topbar-actions { min-width: 0; display: flex; align-items: center; gap: .55rem; }
.connection-button { height: 39px; display: flex; align-items: center; gap: .52rem; border: 1px solid var(--line); border-radius: 999px; padding: 0 .75rem; background: var(--surface); font-size: .78rem; color: var(--muted-text); }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--subtle-text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--subtle-text) 10%, transparent); }
.connection-dot.online { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 13%, transparent); }
.connection-button b { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 99px; background: var(--warning-bg); color: var(--warning); font-size: .7rem; }
.icon-button { width: 39px; height: 39px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted-text); transition: .2s; }
.icon-button:hover { color: var(--brand-deep); border-color: var(--brand-soft); background: var(--brand-faint); }
.icon-button.danger { color: var(--danger); }
.avatar-button { width: 39px; height: 39px; border: 0; }
.content { width: min(100%, 1640px); min-width: 0; max-width: 100%; margin: 0 auto; padding: clamp(1rem, 2.7vw, 2.35rem); padding-bottom: 6.5rem; }
.page-stack { min-width: 0; display: grid; gap: 1.25rem; }
.page-stack > *, .panel { min-width: 0; max-width: 100%; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.eyebrow { color: var(--brand-deep); text-transform: uppercase; font-size: .68rem; font-weight: 800; letter-spacing: .13em; }

.primary-button, .secondary-button, .ghost-button, .danger-button, .small-action { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: .48rem; border-radius: 10px; padding: .66rem 1rem; font-weight: 700; font-size: .86rem; border: 1px solid transparent; }
.primary-button { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 25%, transparent); }
.secondary-button { color: var(--brand-deep); background: var(--brand-faint); border-color: var(--brand-soft); }
.ghost-button { color: var(--muted-text); background: var(--surface); border-color: var(--line); }
.danger-button { color: var(--danger); background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.small-action { min-height: 34px; padding: .42rem .62rem; color: var(--brand-deep); background: var(--brand-faint); border-color: var(--brand-soft); }
.small-action.danger-action { color: var(--danger); background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 24%, transparent); }
.quick-fab { position: fixed; z-index: 28; right: 1.7rem; bottom: 1.7rem; min-height: 48px; display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border: 0; border-radius: 14px; background: var(--ink); color: var(--surface); box-shadow: 0 13px 30px rgba(20,18,17,.25); font-weight: 700; }
.mobile-nav { display: none; }
.install-prompt { position: fixed; z-index: 60; left: calc(var(--sidebar-width) + 1.2rem); bottom: 1.2rem; width: min(520px, calc(100vw - var(--sidebar-width) - 2.4rem)); display: grid; grid-template-columns: 40px 1fr auto 39px; align-items: center; gap: .7rem; padding: .75rem; border: 1px solid var(--brand-soft); border-radius: 15px; background: var(--surface); box-shadow: 0 18px 50px rgba(42,28,24,.2); }
.install-prompt > span { width: 38px; height: 38px; display: grid; place-items: center; color: var(--brand-deep); background: var(--brand-faint); border-radius: 11px; }
.install-prompt strong, .install-prompt small { display: block; }
.install-prompt strong { font-size: .82rem; }
.install-prompt small { margin-top: .12rem; color: var(--muted-text); font-size: .68rem; }

.welcome-panel { position: relative; overflow: hidden; min-height: 151px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: clamp(1.4rem, 3vw, 2.1rem); border-radius: 20px; color: #fff; background: linear-gradient(116deg, #a9776b 0%, #c79b90 58%, #b6897e 100%); box-shadow: 0 18px 42px rgba(130,88,76,.18); }
.welcome-panel::after { content: "WG"; position: absolute; right: 11%; top: -54px; font-family: Georgia, serif; font-style: italic; font-size: 13rem; color: rgba(255,255,255,.065); transform: rotate(-8deg); }
.welcome-panel > * { position: relative; z-index: 1; }
.welcome-panel .eyebrow { color: rgba(255,255,255,.72); }
.welcome-panel h2 { margin: .38rem 0 .4rem; max-width: 600px; font-size: clamp(1.5rem, 3vw, 2.25rem); }
.welcome-panel p { margin: 0; color: rgba(255,255,255,.8); }
.welcome-panel .primary-button { flex: 0 0 auto; background: #fff; color: #8e655a; box-shadow: 0 10px 25px rgba(97,57,48,.2); }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; }
.stat-card { min-height: 122px; display: flex; gap: .85rem; align-items: flex-start; padding: 1.1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 26px rgba(71,48,41,.045); }
.stat-card.emphasis { background: var(--ink); color: var(--surface); border-color: transparent; }
.stat-card.warning { border-color: color-mix(in srgb, var(--warning) 25%, var(--line)); }
.stat-icon { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-faint); color: var(--brand-deep); }
.stat-card.emphasis .stat-icon { background: rgba(255,255,255,.11); color: inherit; }
.stat-card.warning .stat-icon { color: var(--warning); background: var(--warning-bg); }
.stat-card span:not(.stat-icon) { display: block; color: var(--muted-text); font-size: .75rem; }
.stat-card.emphasis span:not(.stat-icon), .stat-card.emphasis small { color: color-mix(in srgb, var(--surface) 72%, transparent); }
.stat-card strong { display: block; margin: .15rem 0 .12rem; font-family: "Manrope"; font-size: 1.65rem; line-height: 1.1; }
.stat-card small { color: var(--subtle-text); font-size: .69rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(330px, .8fr); gap: 1.1rem; }
.dashboard-grid.lower { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-heading { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.panel-heading h3 { margin: .2rem 0 0; font-size: 1rem; }
.chart-wrap { height: 282px; padding: .5rem .6rem .6rem; }
.legend { display: flex; gap: .9rem; font-size: .7rem; color: var(--muted-text); }
.legend span { display: flex; align-items: center; gap: .36rem; }
.legend i { width: 8px; height: 8px; border-radius: 3px; }
.legend i.rose { background: var(--brand); }
.legend i.ink { background: var(--ink); }
.activity-list { padding: .35rem 1.1rem .65rem; }
.activity-item { min-height: 62px; display: grid; grid-template-columns: 38px 1fr auto; gap: .7rem; align-items: center; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border: 0; }
.activity-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; }
.activity-icon.positive { color: var(--success); background: var(--success-bg); }
.activity-icon.negative { color: var(--danger); background: var(--danger-bg); }
.activity-item strong, .activity-item span { display: block; }
.activity-item strong { font-size: .8rem; }
.activity-item div > span { color: var(--subtle-text); font-size: .69rem; margin-top: .14rem; }
.positive-number { color: var(--success) !important; font-weight: 700; }
.negative-number { color: var(--danger) !important; font-weight: 700; }
.compact-table, .import-mini-list { padding: .5rem 1.1rem .8rem; }
.compact-table > div { display: grid; grid-template-columns: 12px 1fr auto auto; gap: .65rem; align-items: center; min-height: 57px; border-bottom: 1px solid var(--line); }
.compact-table > div:last-child, .import-mini-list > div:last-child { border: 0; }
.color-swatch { width: 10px; height: 31px; border-radius: 99px; }
.compact-table strong, .compact-table span, .import-mini-list strong, .import-mini-list span { display: block; }
.compact-table strong, .import-mini-list strong { font-size: .78rem; }
.compact-table div > span, .import-mini-list div > span { color: var(--subtle-text); font-size: .68rem; }
.compact-table b { font-size: 1rem; }
.import-mini-list > div { display: flex; min-height: 57px; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.muted-copy { color: var(--subtle-text); font-size: .82rem; padding: .7rem 0; }

.section-heading { min-width: 0; min-height: 67px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.section-heading > div { min-width: 0; }
.section-heading.compact { min-height: auto; padding-top: .4rem; }
.section-heading h2 { margin: .22rem 0 .2rem; font-size: clamp(1.35rem, 2.4vw, 1.8rem); }
.section-heading h3 { margin: .2rem 0 0; }
.section-heading p { margin: 0; color: var(--muted-text); font-size: .87rem; }
.heading-actions { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.toolbar { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; padding: .75rem; box-shadow: none; }
.search-input { min-width: min(100%, 350px); flex: 1; position: relative; }
.search-input svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--subtle-text); }
.search-input input { padding-left: 2.45rem; }
.select-with-icon { position: relative; }
.select-with-icon svg { position: absolute; z-index: 1; left: .72rem; top: 50%; transform: translateY(-50%); color: var(--subtle-text); }
.select-with-icon select { width: auto; min-width: 170px; padding-left: 2.1rem; }
.result-count { flex: 0 0 auto; padding: 0 .4rem; color: var(--subtle-text); font-size: .76rem; }
.inventory-table { overflow: hidden; }
.inventory-select-all { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; }
.inventory-product-cell { display: flex; align-items: center; gap: .7rem; }
.inventory-product-cell > div { min-width: 0; }
.inventory-variant-image, .inventory-variant-placeholder { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); }
.inventory-variant-image { object-fit: cover; }
.inventory-variant-placeholder { display: grid; place-items: center; color: var(--brand-deep); font-weight: 800; }
.inventory-table tr.selected-row td { background: color-mix(in srgb, var(--brand-faint) 72%, var(--surface)); }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 720px; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th { height: 46px; padding: .65rem .85rem; color: var(--subtle-text); background: var(--surface-2); text-align: left; text-transform: uppercase; letter-spacing: .055em; font-size: .65rem; white-space: nowrap; }
td { padding: .82rem .85rem; border-top: 1px solid var(--line); vertical-align: middle; }
td strong, td small { display: block; }
td small { margin-top: .18rem; color: var(--subtle-text); font-size: .69rem; }
tr:hover td { background: color-mix(in srgb, var(--brand-faint) 40%, var(--surface)); }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.stock-number { font-weight: 700; }
.total-number { font-family: "Manrope"; font-weight: 700; }
.color-name { display: flex; align-items: center; gap: .55rem; white-space: nowrap; }
.color-name i { width: 13px; height: 13px; border-radius: 4px; border: 1px solid rgba(0,0,0,.12); }
.dash { color: var(--subtle-text); }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; }
.status-pill { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: .24rem .56rem; font-size: .66rem; font-weight: 700; white-space: nowrap; }
.status-pill.success { color: var(--success); background: var(--success-bg); }
.status-pill.warning { color: var(--warning); background: var(--warning-bg); }
.status-pill.danger { color: var(--danger); background: var(--danger-bg); }
.status-pill.info { color: var(--info); background: var(--info-bg); }
.status-pill.neutral { color: var(--muted-text); background: var(--surface-3); }
.empty-state { min-height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--line); border-radius: 18px; background: var(--surface); padding: 2rem; }
.empty-state h3 { margin: .8rem 0 .3rem; }
.empty-state p { color: var(--muted-text); }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; color: var(--brand-deep); background: var(--brand-faint); }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.product-card { display: flex; flex-direction: column; min-height: 285px; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.product-card-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 1rem 1rem 0; }
.product-monogram { width: 55px; height: 55px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(145deg, var(--brand-soft), var(--brand-faint)); color: var(--brand-deep); font-family: Georgia, serif; font-size: 1.05rem; font-weight: 700; }
.product-title { padding: .8rem 1rem; }
.product-title h3 { margin: .65rem 0 .12rem; font-size: 1.02rem; }
.product-title > span { color: var(--muted-text); font-size: .75rem; }
.variant-chips { display: flex; flex-wrap: wrap; gap: .38rem; padding: 0 1rem 1rem; }
.variant-chips span { display: flex; align-items: center; gap: .36rem; padding: .34rem .48rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: .69rem; }
.variant-chips i { width: 9px; height: 9px; border-radius: 3px; }
.variant-chips b { margin-left: .22rem; }
.product-card footer { margin-top: auto; min-height: 62px; display: flex; align-items: center; gap: .55rem; padding: .8rem 1rem; background: var(--surface-2); border-top: 1px solid var(--line); }
.product-card footer > div { margin-right: auto; }
.product-card footer span, .product-card footer strong { display: block; }
.product-card footer span { color: var(--subtle-text); font-size: .66rem; }
.product-card footer strong { font-size: .79rem; }

.product-catalog { display: grid; gap: .85rem; }
.product-group-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.product-group-card.expanded { border-color: var(--brand-soft); box-shadow: 0 14px 38px color-mix(in srgb, var(--brand) 12%, transparent); }
.product-group-header { width: 100%; display: grid; grid-template-columns: 58px minmax(210px, 1fr) auto 28px; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border: 0; color: var(--text); background: transparent; text-align: left; }
.product-photo { width: 55px; height: 55px; border-radius: 16px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
.product-group-header:hover { background: color-mix(in srgb, var(--brand-faint) 42%, var(--surface)); }
.product-group-title { min-width: 0; }
.product-group-title code, .product-group-title h3, .product-group-title span { display: block; }
.product-group-title h3, .product-group-title span { overflow-wrap: anywhere; }
.product-group-title h3 { margin: .3rem 0 .12rem; font-size: 1.02rem; }
.product-group-title span { color: var(--muted-text); font-size: .72rem; }
.product-group-summary { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; }
.product-group-summary > span { min-width: 92px; display: flex; align-items: center; gap: .34rem; padding: .5rem .58rem; border-radius: 10px; color: var(--muted-text); background: var(--surface-2); font-size: .68rem; }
.product-group-summary > span svg { color: var(--brand-deep); }
.product-group-summary > span b { color: var(--text); font-size: .84rem; }
.product-group-summary > strong { min-width: 58px; color: var(--brand-deep); font-family: "Manrope"; font-size: 1.3rem; text-align: right; }
.product-group-summary > strong small { display: block; color: var(--subtle-text); font-family: inherit; font-size: .56rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.product-chevron { color: var(--subtle-text); transition: transform .2s ease; }
.expanded .product-chevron { transform: rotate(180deg); }
.product-color-list { border-top: 1px solid var(--line); background: var(--surface-2); }
.product-color-row { min-height: 76px; display: grid; grid-template-columns: minmax(210px, 1.3fr) repeat(3, minmax(74px, .45fr)) minmax(300px, .9fr); align-items: center; gap: .75rem; padding: .75rem 1.1rem; border-bottom: 1px solid var(--line); }
.product-color-row:last-child { border-bottom: 0; }
.product-color-name { min-width: 0; display: flex; align-items: center; gap: .7rem; }
.product-color-name > div { min-width: 0; }
.product-color-name > i { width: 28px; height: 40px; flex: 0 0 auto; border-radius: 9px; border: 1px solid rgba(0,0,0,.12); }
.product-color-name strong, .product-color-name span, .product-stock-value span, .product-stock-value strong { display: block; }
.product-color-name strong { font-size: .82rem; }
.product-color-name span { margin-top: .14rem; color: var(--subtle-text); font-size: .63rem; }
.product-stock-value { padding: .46rem .58rem; border-radius: 9px; background: var(--surface); }
.product-stock-value span { color: var(--subtle-text); font-size: .6rem; text-transform: uppercase; letter-spacing: .05em; }
.product-stock-value strong { margin-top: .15rem; font-size: 1rem; }
.product-stock-value.total { color: var(--brand-deep); background: var(--brand-faint); }
.product-stock-value.disabled { opacity: .5; }
.product-color-actions { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; }
.ghost-alias { color: var(--muted-text); background: var(--surface); border-color: var(--line); }
.product-group-footer { min-height: 48px; display: flex; align-items: center; gap: .65rem; padding: .58rem 1.1rem; border-top: 1px solid var(--line); }
.product-group-footer > span:not(.status-pill) { margin-left: auto; color: var(--subtle-text); font-size: .66rem; }
.marketplace-listings { padding: .85rem 1.1rem 1rem; border-top: 1px solid var(--line); background: var(--surface); }
.marketplace-heading { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; color: var(--brand-deep); }
.marketplace-heading span { margin-left: auto; color: var(--subtle-text); font-size: .7rem; }
.marketplace-listings details { border: 1px solid var(--line); border-radius: 12px; margin-top: .5rem; overflow: hidden; }
.marketplace-listings summary { display: grid; grid-template-columns: 44px 1fr auto; gap: .65rem; align-items: center; padding: .65rem; background: var(--surface-2); cursor: pointer; list-style: none; }
.marketplace-listings summary::-webkit-details-marker { display: none; }
.marketplace-listings summary img { width: 44px; height: 44px; object-fit: cover; border-radius: 9px; }
.marketplace-listings summary strong, .marketplace-listings summary span { display: block; }
.marketplace-listings summary strong { font-size: .78rem; }
.marketplace-listings summary span { margin-top: .14rem; color: var(--subtle-text); font-size: .66rem; }
.marketplace-listings summary b { color: var(--brand-deep); font-size: .78rem; }
.marketplace-details { padding: .8rem; }
.marketplace-details > p { max-height: 120px; overflow: auto; color: var(--muted-text); font-size: .72rem; line-height: 1.5; white-space: pre-line; }
.marketplace-details dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0; }
.marketplace-details dl > div { padding: .55rem; border-radius: 9px; background: var(--surface-2); }
.marketplace-details dt { color: var(--subtle-text); font-size: .61rem; text-transform: uppercase; }
.marketplace-details dd { margin: .18rem 0 0; font-size: .72rem; }

.timeline { padding: .4rem 1.1rem; }
.timeline-item { min-height: 82px; display: grid; grid-template-columns: 12px 76px minmax(200px, 1fr) 92px 145px; gap: .75rem; align-items: center; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border: 0; }
.timeline-marker { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 5px var(--surface-2); }
.timeline-marker.in { background: var(--success); }
.timeline-marker.out { background: var(--danger); }
.timeline-date strong, .timeline-date span, .timeline-main strong, .timeline-main span, .timeline-main small, .movement-quantity span, .movement-user span { display: block; }
.timeline-date strong, .timeline-main strong { font-size: .78rem; }
.timeline-date span, .timeline-main span, .timeline-main small, .movement-quantity span, .movement-user span { color: var(--subtle-text); font-size: .68rem; }
.timeline-main { min-width: 0; }
.timeline-main strong, .timeline-main span, .timeline-main small { overflow-wrap: anywhere; }
.timeline-main small { margin-top: .24rem; }
.movement-quantity { text-align: right; font-size: 1rem; }
.movement-user { text-align: right; }
.movement-user .status-pill { margin-top: .3rem; }

.import-flow { padding: 1.2rem; box-shadow: none; }
.flow-steps { width: min(100%, 720px); margin: .2rem auto 1.4rem; display: flex; align-items: flex-start; }
.flow-steps > span { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--subtle-text); background: var(--surface-3); font-weight: 700; font-size: .78rem; position: relative; }
.flow-steps > span.done { color: #fff; background: var(--brand); }
.flow-steps small { position: absolute; top: 41px; color: var(--muted-text); font-size: .65rem; font-weight: 600; white-space: nowrap; }
.flow-steps i { flex: 1; height: 2px; margin-top: 16px; background: var(--line); }
.source-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin: 2.4rem 0 1rem; }
.source-choice label { position: relative; min-height: 90px; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.source-choice label.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); background: var(--brand-faint); }
.source-choice input { position: absolute; right: .7rem; top: .7rem; width: auto; }
.source-choice strong, .source-choice span { display: block; }
.source-choice strong { margin-bottom: .3rem; }
.source-choice span { color: var(--muted-text); font-size: .75rem; }
.upload-zone { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1.5px dashed var(--brand); border-radius: 16px; color: var(--brand-deep); background: var(--brand-faint); cursor: pointer; text-align: center; }
.upload-zone input { display: none; }
.upload-zone strong { margin-top: .75rem; }
.upload-zone > span { margin-top: .3rem; color: var(--muted-text); font-size: .75rem; }
.file-banner { display: flex; align-items: center; gap: .75rem; padding: .9rem; border-radius: 13px; color: var(--brand-deep); background: var(--brand-faint); border: 1px solid var(--brand-soft); }
.file-banner div { min-width: 0; flex: 1; }
.file-banner strong, .file-banner span { display: block; }
.file-banner strong, .file-banner span { overflow-wrap: anywhere; }
.file-banner span { color: var(--muted-text); font-size: .72rem; margin-top: .16rem; }
.mapping-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-top: 1rem; }
.inline-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.preview-block { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.preview-summary { display: flex; gap: 1.5rem; align-items: center; padding: .8rem 1rem; margin-bottom: .8rem; border-radius: 12px; background: var(--surface-2); }
.preview-summary > div { display: flex; align-items: center; gap: .45rem; }
.preview-summary > div:last-child { margin-left: auto; }
.preview-summary span { color: var(--muted-text); font-size: .75rem; }
.confirm-import { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0 0; }
.confirm-import p { margin: 0; color: var(--muted-text); font-size: .78rem; }
.sales-selection-actions { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .65rem; }
.sales-selection-actions > span { color: var(--muted-text); font-size: .75rem; }
.sales-selection-actions > div { display: flex; gap: .45rem; }
.sales-selection-actions button { min-height: 34px; padding: .42rem .62rem; font-size: .72rem; }
.row-checkbox { width: 18px; height: 18px; accent-color: var(--brand); }
.title-match-note { color: var(--info) !important; font-weight: 700; }
.product-import-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem; border-radius: 12px; background: var(--surface-2); }
.product-import-toolbar strong, .product-import-toolbar span { display: block; }
.product-import-toolbar strong { font-size: .82rem; }
.product-import-toolbar span { margin-top: .18rem; color: var(--subtle-text); font-size: .7rem; }
.compact-actions { margin: 0; }
.compact-actions button { min-height: 36px; padding: .48rem .65rem; font-size: .73rem; }
.import-warning, .import-stock-note { display: flex; align-items: flex-start; gap: .55rem; padding: .7rem; border-radius: 10px; color: var(--warning); background: var(--warning-bg); font-size: .73rem; }
.product-import-list { display: grid; gap: .55rem; max-height: min(48vh, 520px); overflow: auto; padding-right: .2rem; }
.product-import-choice { display: grid; grid-template-columns: 22px 58px 1fr; gap: .7rem; align-items: start; padding: .72rem; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); cursor: pointer; }
.product-import-choice.selected { border-color: var(--brand); background: var(--brand-faint); box-shadow: 0 0 0 1px var(--brand-soft); }
.product-import-choice > input { width: 18px; height: 18px; margin-top: 19px; accent-color: var(--brand); }
.product-import-choice > img, .product-import-monogram { width: 58px; height: 58px; border-radius: 11px; object-fit: cover; background: var(--surface); border: 1px solid var(--line); }
.product-import-monogram { display: grid; place-items: center; color: var(--brand-deep); font-weight: 700; }
.product-import-copy { min-width: 0; }
.product-import-copy > div { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: .3rem; }
.product-import-copy > strong, .product-import-copy > span, .product-import-copy > small { display: block; }
.product-import-copy > strong { font-size: .82rem; }
.product-import-copy > span { margin-top: .18rem; color: var(--muted-text); font-size: .7rem; }
.product-import-copy > small { margin-top: .3rem; color: var(--subtle-text); line-height: 1.45; }
.product-import-copy > em { display: flex; gap: .35rem; align-items: flex-start; margin-top: .35rem; color: var(--warning); font-size: .68rem; font-style: normal; }
.product-import-copy > em.success-text { color: var(--success); }
.product-import-sku-editor { display: grid; gap: .28rem; margin-top: .6rem; max-width: 280px; }
.product-import-sku-editor > span { color: var(--subtle-text); font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; }
.product-import-sku-editor > input { width: 100%; min-width: 0; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: .76rem; font-weight: 700; text-transform: uppercase; }
.product-import-sku-editor > input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.product-import-sku-editor > input:disabled { opacity: .62; cursor: not-allowed; background: var(--surface-2); }
.import-stock-note { color: var(--info); background: var(--info-bg); }
.import-stock-note strong, .import-stock-note span { display: block; }
.import-stock-note span { color: var(--muted-text); line-height: 1.45; }
.import-resume-note { display: flex; align-items: flex-start; gap: .6rem; padding: .75rem; border-radius: 11px; color: var(--success); background: var(--success-bg); }
.import-resume-note strong, .import-resume-note span { display: block; }
.import-resume-note strong { font-size: .8rem; }
.import-resume-note span { margin-top: .18rem; color: var(--muted-text); font-size: .72rem; line-height: 1.4; }
.product-import-complete { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; padding: 1.5rem; color: var(--success); background: var(--success-bg); border: 1px dashed color-mix(in srgb, var(--success) 35%, var(--line)); border-radius: 14px; text-align: center; }
.product-import-complete span { max-width: 460px; color: var(--muted-text); font-size: .76rem; line-height: 1.45; }
.alias-explanation { display: flex; gap: .65rem; padding: .8rem; border-radius: 12px; color: var(--info); background: var(--info-bg); }
.alias-explanation p { margin: 0; color: var(--muted-text); font-size: .76rem; line-height: 1.5; }
.alias-add-form { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: end; }
.alias-list { display: grid; gap: .45rem; }
.alias-list > div { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.alias-list strong, .alias-list span { display: block; }
.alias-list strong { font-size: .8rem; }
.alias-list span { margin-top: .15rem; color: var(--subtle-text); font-size: .66rem; }
.alias-list > p { margin: 0; padding: 1rem; color: var(--subtle-text); text-align: center; font-size: .76rem; border: 1px dashed var(--line); border-radius: 11px; }

.alert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.alert-card { display: grid; grid-template-columns: 42px 1fr; gap: .8rem; padding: 1.1rem; border-radius: 17px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--warning) 20%, var(--line)); box-shadow: var(--shadow); }
.alert-card.critical { border-color: color-mix(in srgb, var(--danger) 28%, var(--line)); }
.alert-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--warning); background: var(--warning-bg); }
.critical .alert-icon { color: var(--danger); background: var(--danger-bg); }
.alert-card h3 { margin: .55rem 0 .1rem; font-size: .95rem; }
.alert-card p { color: var(--muted-text); font-size: .76rem; }
.alert-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.alert-values span { padding: .55rem; border-radius: 9px; background: var(--surface-2); color: var(--muted-text); font-size: .65rem; }
.alert-values strong { display: block; margin-top: .15rem; color: var(--text); font-size: .95rem; }
.transfer-hint { display: flex; align-items: center; gap: .42rem; margin-top: .7rem; padding: .55rem; border-radius: 9px; color: var(--info); background: var(--info-bg); font-size: .7rem; }
.audit-list { padding: .4rem 1.1rem; }
.audit-list > div { min-height: 71px; display: grid; grid-template-columns: 38px 1fr auto; gap: .7rem; align-items: center; border-bottom: 1px solid var(--line); }
.audit-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--brand-deep); background: var(--brand-faint); border-radius: 10px; }
.audit-list strong, .audit-list span { display: block; }
.audit-list strong { font-size: .78rem; }
.audit-list span { color: var(--subtle-text); font-size: .69rem; margin-top: .15rem; }
.audit-list > div > div:last-child { text-align: right; }
.sync-overview { display: grid; grid-template-columns: 1.5fr .7fr .7fr; gap: 1rem; }
.sync-hero { min-width: 0; display: flex; align-items: center; gap: 1rem; padding: 1.2rem; }
.sync-hero > div:last-child { min-width: 0; }
.big-connection { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 18px; }
.big-connection.online { color: var(--success); background: var(--success-bg); }
.big-connection.offline { color: var(--subtle-text); background: var(--surface-3); }
.sync-hero span, .sync-hero p, .sync-count span, .sync-count small { color: var(--muted-text); font-size: .74rem; }
.sync-hero h3 { margin: .25rem 0 .2rem; font-size: 1rem; }
.sync-hero p { margin: 0; }
.sync-count { display: flex; flex-direction: column; justify-content: center; padding: 1.2rem; }
.sync-count strong { margin: .2rem 0; font-family: "Manrope"; font-size: 2rem; }
.user-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.user-card { min-width: 0; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: .85rem; align-items: center; padding: 1.1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.large-avatar { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: linear-gradient(145deg, var(--brand), var(--brand-deep)); font-size: 1.2rem; font-weight: 700; }
.user-card h3 { margin: 0 0 .16rem; font-size: .92rem; }
.user-card p { margin: 0 0 .5rem; overflow-wrap: anywhere; color: var(--muted-text); font-size: .75rem; }
.user-card .status-pill { margin-right: .25rem; }
.settings-layout { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.settings-card { padding: 1.2rem; display: grid; gap: 1rem; box-shadow: none; }
.settings-title { display: flex; gap: .7rem; align-items: flex-start; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.settings-title svg { color: var(--brand-deep); }
.settings-title h3 { margin: 0 0 .2rem; font-size: .95rem; }
.settings-title p { margin: 0; color: var(--muted-text); font-size: .72rem; }
.setting-row, .danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.setting-row input { width: 20px; height: 20px; }
.setting-row strong, .setting-row span, .danger-zone strong, .danger-zone span { display: block; }
.setting-row span, .danger-zone span { color: var(--muted-text); font-size: .72rem; margin-top: .2rem; }
.danger-zone { padding-top: 1rem; border-top: 1px solid var(--line); }
.automatic-sync-note { display: flex; align-items: flex-start; gap: .6rem; padding: .75rem; border: 1px solid color-mix(in srgb, var(--success) 24%, var(--line)); border-radius: 11px; color: var(--success); background: var(--success-bg); }
.automatic-sync-note div { min-width: 0; }
.automatic-sync-note strong, .automatic-sync-note span { display: block; }
.automatic-sync-note span { margin-top: .18rem; color: var(--muted-text); font-size: .72rem; line-height: 1.4; }
.settings-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(25,21,19,.62); backdrop-filter: blur(5px); }
.modal { width: min(100%, 590px); min-width: 0; max-height: min(90vh, 800px); overflow: hidden; display: flex; flex-direction: column; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal-wide { width: min(100%, 980px); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.2rem 1.3rem; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0 0 .2rem; font-size: 1.15rem; }
.modal-header p { margin: 0; color: var(--muted-text); font-size: .78rem; }
.modal-body { min-width: 0; overflow: auto; padding: 1.2rem 1.3rem; }
.form-stack { min-width: 0; display: grid; gap: 1rem; }
.form-grid { display: grid; gap: .75rem; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid .span-two { grid-column: span 2; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; padding-top: .3rem; }
.variant-editor-list { display: grid; gap: .65rem; }
.variant-editor { display: flex; gap: .55rem; align-items: end; padding: .75rem; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.variant-editor > label { min-width: 0; flex: 1; }
.variant-editor-image { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: var(--surface); }
.variant-editor.existing-variant input:disabled { opacity: .72; cursor: not-allowed; background: var(--surface-3); }
.variant-number { flex: 0 0 auto; width: 28px; height: 39px; display: grid; place-items: center; color: var(--brand-deep); font-weight: 700; }
.color-field { flex: 0 0 75px !important; }
.color-field input { height: 42px; padding: .3rem; }
.switch-label { flex: 0 0 72px !important; position: relative; }
.switch-label input { position: absolute; opacity: 0; }
.switch-label i { display: block; width: 42px; height: 24px; margin: .58rem auto; border-radius: 99px; background: var(--surface-3); position: relative; transition: .2s; }
.switch-label i::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: .2s; }
.switch-label input:checked + i { background: var(--brand); }
.switch-label input:checked + i::after { transform: translateX(18px); }
.edit-product-note { display: grid; gap: .18rem; padding: .72rem .8rem; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); }
.edit-product-note strong { font-size: .76rem; }
.edit-product-note span { color: var(--muted-text); font-size: .7rem; line-height: 1.45; }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); padding: .3rem; gap: .25rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented button { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: .35rem; border: 0; border-radius: 9px; color: var(--muted-text); background: transparent; font-size: .73rem; font-weight: 700; }
.segmented button.active { color: var(--brand-deep); background: var(--surface); box-shadow: 0 4px 14px rgba(53,35,30,.08); }
.stock-context { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stock-context > div { padding: .72rem; text-align: center; background: var(--surface-2); border-right: 1px solid var(--line); }
.stock-context > div:last-child { border: 0; }
.stock-context span, .stock-context strong { display: block; }
.stock-context span { color: var(--muted-text); font-size: .68rem; }
.stock-context strong { margin-top: .2rem; font-size: 1.12rem; }
.stock-context .disabled { opacity: .45; }
.malharia-activation { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: .65rem; padding: .75rem; border: 1px solid var(--brand-soft); border-radius: 12px; background: var(--brand-faint); cursor: pointer; }
.malharia-activation > input { width: 19px; height: 19px; accent-color: var(--brand); }
.malharia-activation > span, .malharia-activation strong, .malharia-activation small { display: block; margin: 0; }
.malharia-activation > span { color: var(--text); }
.malharia-activation small { margin-top: .15rem; color: var(--muted-text); font-weight: 400; line-height: 1.35; }
.bulk-stock-list { display: grid; gap: .55rem; max-height: min(52vh, 520px); overflow-y: auto; padding-right: .2rem; }
.bulk-stock-row { display: grid; grid-template-columns: minmax(230px, 1.35fr) repeat(3, minmax(120px, .65fr)); align-items: end; gap: .65rem; padding: .75rem; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.bulk-stock-product { display: grid; grid-template-columns: 12px 1fr; gap: .65rem; align-items: stretch; min-width: 0; }
.bulk-stock-product > i { width: 12px; min-height: 62px; border-radius: 8px; border: 1px solid rgba(0,0,0,.1); }
.bulk-stock-product code { display: inline-block; }
.bulk-stock-product strong, .bulk-stock-product span { display: block; }
.bulk-stock-product strong { margin-top: .3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.bulk-stock-product span { margin-top: .12rem; color: var(--muted-text); font-size: .68rem; }
.bulk-stock-row label > span { display: flex; align-items: center; gap: .3rem; font-size: .72rem; }
.bulk-malharia-toggle > div { height: 44px; display: flex; align-items: center; gap: .48rem; padding: 0 .7rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.bulk-malharia-toggle input { width: 18px; height: 18px; accent-color: var(--brand); }
.bulk-malharia-toggle b { font-size: .7rem; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, .95fr) minmax(440px, 1.05fr); background: var(--surface); }
.login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 6vw, 6.5rem); color: #fff; background: linear-gradient(145deg, #9c6f64 0%, #bf8f83 55%, #d0a79d 100%); }
.login-brand::after { content: "WG"; position: absolute; bottom: -80px; right: -30px; font: italic 19rem Georgia, serif; color: rgba(255,255,255,.06); }
.login-brand > * { position: relative; z-index: 1; }
.login-brand > img { width: 95px; height: 95px; border-radius: 25px; object-fit: cover; box-shadow: 0 15px 30px rgba(92,55,46,.2); margin-bottom: 2.6rem; }
.login-brand .eyebrow { color: rgba(255,255,255,.7); }
.login-brand h1 { max-width: 650px; margin: .8rem 0 1rem; font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 1.04; }
.login-brand p { max-width: 540px; color: rgba(255,255,255,.78); font-size: 1rem; line-height: 1.65; }
.login-features { display: grid; gap: .75rem; margin-top: 2.3rem; }
.login-features span { display: flex; align-items: center; gap: .75rem; color: rgba(255,255,255,.86); font-size: .82rem; }
.login-features i { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 9px; font-style: normal; font-size: .62rem; }
.login-form-wrap { display: grid; place-items: center; padding: 2rem; background: var(--bg); }
.login-card { width: min(100%, 430px); display: grid; gap: 1rem; padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.lock-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--brand-deep); background: var(--brand-faint); border-radius: 14px; }
.login-card h2 { margin: .2rem 0 -.7rem; font-size: 1.55rem; }
.login-card > p { margin: 0 0 .5rem; color: var(--muted-text); font-size: .82rem; }
.login-button { width: 100%; min-height: 48px; }
.demo-note, .server-note { text-align: center; color: var(--subtle-text); line-height: 1.45; }
.offline-login-note { display: flex; align-items: center; gap: .5rem; padding: .65rem; border-radius: 10px; color: var(--warning); background: var(--warning-bg); font-size: .73rem; }
.mobile-login-logo { display: none; }
.boot-screen { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 1rem; color: var(--muted-text); }
.boot-screen img { width: 90px; height: 90px; border-radius: 24px; }

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid, .alert-grid { grid-template-columns: repeat(2, 1fr); }
  .product-group-header { grid-template-columns: 58px minmax(190px, 1fr) auto 28px; }
  .product-group-summary > span { min-width: 76px; }
  .product-color-row { grid-template-columns: minmax(190px, 1.2fr) repeat(3, 72px) minmax(250px, .8fr); }
  .mapping-grid { grid-template-columns: repeat(2, 1fr); }
  .variant-editor { flex-wrap: wrap; }
  .variant-editor > label { flex-basis: calc(25% - .5rem); }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 0px; }
  .app-shell { display: block; }
  .workspace { width: 100%; }
  .sidebar { width: min(310px, 88vw); transform: translateX(-102%); box-shadow: 18px 0 50px rgba(0,0,0,.25); transition: transform .25s ease; }
  .install-prompt { left: 1rem; width: calc(100vw - 2rem); bottom: 1rem; }
  .sidebar.sidebar-open { transform: translateX(0); }
  .sidebar-close, .menu-button { display: inline-grid !important; }
  .sidebar-scrim { display: block !important; position: fixed; z-index: 45; inset: 0; border: 0; background: rgba(20,17,16,.45); }
  .topbar { height: 68px; }
  .content { padding-bottom: 7.7rem; }
  .dashboard-grid, .dashboard-grid.lower { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .sync-overview { grid-template-columns: 1fr 1fr; }
  .sync-hero { grid-column: 1 / -1; }
  .settings-layout { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .mobile-login-logo { display: block; text-align: center; }
  .mobile-login-logo img { width: 75px; height: 75px; object-fit: cover; border-radius: 21px; }
  .timeline-item { grid-template-columns: 12px 68px 1fr 82px; }
  .movement-user { display: none; }
  .product-group-header { grid-template-columns: 54px 1fr 24px; }
  .product-group-summary { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .product-group-summary > span { min-width: 0; }
  .product-group-summary > strong { margin-left: auto; }
  .product-chevron { grid-column: 3; grid-row: 1; }
  .product-color-row { grid-template-columns: minmax(180px, 1fr) repeat(3, 70px); }
  .product-color-actions { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .topbar { gap: .5rem; padding: 0 .65rem; }
  .topbar-title { flex: 1; gap: .5rem; }
  .topbar-actions { flex: 0 0 auto; gap: .35rem; }
  .topbar-title h1 { font-size: .98rem; }
  .connection-copy { display: none; }
  .connection-button { padding: 0 .65rem; }
  .avatar-button { display: none; }
  .content { padding: .9rem .78rem 8.2rem; }
  .page-stack { gap: .85rem; }
  .welcome-panel { min-height: 174px; align-items: flex-end; padding: 1.15rem; }
  .welcome-panel h2 { font-size: 1.42rem; }
  .welcome-panel p { font-size: .78rem; }
  .welcome-panel .primary-button { position: absolute; right: 1rem; top: 1rem; min-height: 38px; padding: .55rem .7rem; font-size: .74rem; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .stat-card { min-height: 111px; padding: .78rem; gap: .55rem; }
  .stat-card:last-child { grid-column: 1 / -1; }
  .stat-icon { width: 34px; height: 34px; }
  .stat-card strong { font-size: 1.35rem; }
  .stat-card span:not(.stat-icon) { font-size: .68rem; }
  .panel { border-radius: 14px; }
  .panel-heading { min-height: 62px; padding: .8rem .9rem; }
  .legend { display: none; }
  .chart-wrap { height: 245px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .section-heading p { font-size: .76rem; }
  .section-heading > .primary-button, .section-heading > .secondary-button { width: 100%; flex: 0 0 auto; padding: .55rem .68rem; min-height: 40px; }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .search-input { grid-column: 1 / -1; min-width: 0; }
  .select-with-icon select { width: 100%; min-width: 0; }
  .result-count { display: none; }
  .inventory-table { background: transparent; border: 0; box-shadow: none; }
  .inventory-table table, .inventory-table tbody { min-width: 0; display: block; }
  .inventory-table thead { display: none; }
  .inventory-table tr { display: grid; grid-template-columns: 1fr repeat(3, auto); gap: .7rem; align-items: center; margin-bottom: .65rem; padding: .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
  .inventory-table td { border: 0; padding: 0; }
  .inventory-table td:nth-child(1) { grid-column: 1 / 4; }
  .inventory-table td:nth-child(2) { grid-column: 4; grid-row: 1; text-align: right; }
  .inventory-table td:nth-child(3) { grid-column: 1 / -1; }
  .inventory-table td:nth-child(4), .inventory-table td:nth-child(5), .inventory-table td:nth-child(6) { min-width: 64px; padding: .55rem; border-radius: 9px; background: var(--surface-2); text-align: left; }
  .inventory-table td:nth-child(4)::before, .inventory-table td:nth-child(5)::before, .inventory-table td:nth-child(6)::before { content: attr(data-label); display: block; color: var(--subtle-text); font-size: .6rem; font-weight: 500; }
  .inventory-table td:nth-child(7) { grid-column: 1 / 3; }
  .inventory-table td:nth-child(8) { grid-column: 3 / -1; justify-content: flex-end; }
  .product-grid, .alert-grid, .user-grid { grid-template-columns: 1fr; }
  .product-group-header { grid-template-columns: 48px 1fr 22px; gap: .7rem; padding: .85rem; }
  .product-group-header .product-monogram { width: 48px; height: 48px; border-radius: 13px; }
  .product-group-header .product-photo { width: 48px; height: 48px; border-radius: 13px; }
  .product-group-summary { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr) auto; width: 100%; gap: .38rem; }
  .product-group-summary > span { min-width: 0; justify-content: center; padding: .45rem .35rem; }
  .product-group-summary > span svg { display: none; }
  .product-group-summary > strong { min-width: 46px; margin: 0; }
  .product-color-list { padding: .55rem; }
  .product-color-row { grid-template-columns: repeat(3, 1fr); gap: .45rem; margin-bottom: .55rem; padding: .75rem; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
  .product-color-row:last-child { margin-bottom: 0; border-bottom: 1px solid var(--line); }
  .product-color-name { grid-column: 1 / -1; }
  .product-stock-value { background: var(--surface-2); }
  .product-color-actions { grid-column: 1 / -1; justify-content: stretch; }
  .product-color-actions { flex-wrap: wrap; }
  .product-color-actions .small-action { min-width: 0; flex: 1 1 120px; padding-inline: .5rem; white-space: normal; }
  .marketplace-heading { align-items: flex-start; flex-wrap: wrap; }
  .marketplace-heading span { width: 100%; margin-left: 0; }
  .marketplace-details dl { grid-template-columns: 1fr 1fr; }
  .product-group-footer { padding: .58rem .8rem; }
  .product-group-footer > span:not(.status-pill) { display: none; }
  .product-group-footer .danger { margin-left: auto; }
  .timeline { padding: .25rem .85rem; }
  .timeline-item { grid-template-columns: 10px 1fr auto; grid-template-areas: "marker main qty" "marker date qty"; padding: .65rem 0; }
  .timeline-marker { grid-area: marker; }
  .timeline-main { grid-area: main; }
  .timeline-date { grid-area: date; display: flex; gap: .35rem; }
  .movement-quantity { grid-area: qty; }
  .flow-steps small { display: none; }
  .source-choice { grid-template-columns: 1fr; margin-top: 2.3rem; }
  .source-choice label { min-height: 73px; }
  .mapping-grid, .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .form-grid .span-two { grid-column: 1; }
  .heading-actions { flex-direction: column; align-items: stretch; }
  .heading-actions button { width: 100%; }
  .product-import-toolbar { align-items: stretch; flex-direction: column; }
  .product-import-toolbar .inline-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .product-import-choice { grid-template-columns: 20px 48px 1fr; padding: .6rem; }
  .product-import-choice > img, .product-import-monogram { width: 48px; height: 48px; }
  .product-import-choice > input { margin-top: 14px; }
  .bulk-stock-row { grid-template-columns: 1fr 1fr; }
  .bulk-stock-product { grid-column: 1 / -1; }
  .alias-add-form { grid-template-columns: 1fr; }
  .preview-summary { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
  .preview-summary > div:last-child { margin: 0; grid-column: 1 / -1; justify-content: space-between; }
  .confirm-import { display: grid; }
  .sales-selection-actions { align-items: stretch; flex-direction: column; }
  .sales-selection-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  .sync-overview { grid-template-columns: 1fr 1fr; gap: .55rem; }
  .sync-hero { padding: .9rem; }
  .big-connection { width: 49px; height: 49px; }
  .sync-count { padding: .9rem; }
  .audit-list { padding-inline: .8rem; }
  .audit-list > div { grid-template-columns: 38px minmax(0, 1fr); padding: .65rem 0; }
  .audit-list > div > div:last-child { grid-column: 2; text-align: left; }
  .settings-card { padding: .9rem; }
  .variant-editor { display: grid; grid-template-columns: 28px 46px 1fr 60px; }
  .variant-editor:not(:has(.variant-editor-image)) { grid-template-columns: 28px 1fr 60px; }
  .variant-editor-image { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .variant-editor > label { width: auto; }
  .variant-editor > label:nth-of-type(n+3) { grid-column: span 1; }
  .segmented { grid-template-columns: repeat(2, 1fr); }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .modal-header, .modal-body { padding-left: 1rem; padding-right: 1rem; }
  .modal-actions > button { flex: 1 1 130px; }
  .quick-fab { right: 1rem; bottom: 5.5rem; width: 50px; height: 50px; padding: 0; justify-content: center; border-radius: 50%; }
  .quick-fab span { display: none; }
  .mobile-nav { position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 70px; padding: .42rem .35rem max(.42rem, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(15px); }
  .install-prompt { grid-template-columns: 36px 1fr 35px; bottom: 5.2rem; }
  .install-prompt .secondary-button { grid-column: 2; width: fit-content; min-height: 34px; padding: .45rem .7rem; }
  .install-prompt > .icon-button { grid-column: 3; grid-row: 1; width: 35px; height: 35px; }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .24rem; border: 0; background: transparent; color: var(--subtle-text); font-size: .58rem; }
  .mobile-nav button.active { color: var(--brand-deep); }
  .login-form-wrap { padding: 1rem; }
  .login-card { padding: 1.3rem; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { display: block; }
  .stat-icon { margin-bottom: .55rem; }
  .section-heading h2 { font-size: 1.25rem; }
  .row-actions .small-action { font-size: 0; width: 38px; padding: 0; }
  .row-actions .small-action svg { margin: 0; }
  .bulk-stock-row { grid-template-columns: 1fr; }
  .bulk-stock-product { grid-column: 1; }
  .variant-editor { grid-template-columns: 28px minmax(0, 1fr); }
  .variant-editor-image { grid-column: 2; grid-row: auto; }
  .variant-editor > label, .variant-editor > label:nth-of-type(n+3), .variant-editor > .icon-button { grid-column: 2; }
  .variant-editor .color-field, .variant-editor .switch-label { width: 100%; max-width: none; }
  .preview-summary { grid-template-columns: 1fr; }
  .preview-summary > div:last-child { grid-column: 1; }
  .sync-overview { grid-template-columns: 1fr; }
  .sync-hero { grid-column: 1; }
  .alert-values { grid-template-columns: 1fr 1fr; }
  code { white-space: normal; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* Gráfico leve sem dependência externa: preserva funcionamento offline. */
.stock-bars { display: flex; align-items: stretch; justify-content: space-around; gap: .75rem; padding: 1.25rem .8rem .6rem; border-bottom: 1px solid var(--line); }
.stock-bar-group { flex: 1 1 0; min-width: 0; display: grid; grid-template-rows: 1fr auto; gap: .55rem; align-items: end; height: 100%; }
.stock-bar-columns { height: 100%; min-height: 170px; display: flex; align-items: flex-end; justify-content: center; gap: .3rem; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0 24%, var(--line) 25%); }
.stock-bar { width: min(32px, 38%); border-radius: 7px 7px 0 0; min-height: 0; transition: height .2s ease; }
.stock-bar.galpao { background: var(--brand); }
.stock-bar.malharia { background: var(--ink); }
.stock-bar-group > span { display: block; min-height: 2.3em; overflow: hidden; text-align: center; color: var(--muted-text); font-size: .72rem; line-height: 1.15; }
@media (max-width: 700px) { .stock-bars { overflow-x: auto; justify-content: flex-start; } .stock-bar-group { min-width: 74px; } .stock-bar-columns { min-height: 140px; } }
