:root {
  --canvas: #f3f2ee;
  --surface: #fbfaf7;
  --surface-strong: #ffffff;
  --ink: #1d211e;
  --muted: #7f8580;
  --muted-dark: #626a64;
  --line: #dedfd9;
  --line-light: #ebebe6;
  --accent: #6d7651;
  --accent-dark: #505b37;
  --accent-soft: #e8eadf;
  --amber: #b98234;
  --amber-soft: #f4eadb;
  --red: #b65a50;
  --red-soft: #f4e1de;
  --shadow: 0 18px 50px rgba(37, 43, 37, .10);
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); }
body { min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(109, 118, 81, .25); outline-offset: 2px; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }
.eyebrow { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .17em; line-height: 1.4; }

/* Login */
.login-view { min-height: 100svh; display: grid; grid-template-columns: 1.06fr .94fr; background: var(--surface); overflow: hidden; }
.login-visual { position: relative; min-height: 100svh; overflow: hidden; background: #78826d; isolation: isolate; }
.login-visual::before { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(29, 41, 30, .07), rgba(31, 40, 30, .38)), url("https://images.unsplash.com/photo-1551488831-00ddcb6c6bd3?auto=format&fit=crop&w=1600&q=88") center/cover; opacity: .84; z-index: -3; filter: saturate(.75); }
.login-visual::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(117deg, transparent 0, transparent 22px, rgba(255,255,255,.035) 23px, transparent 24px); mix-blend-mode: screen; z-index: -2; }
.visual-caption { position: absolute; left: clamp(34px, 6vw, 92px); bottom: clamp(40px, 8vw, 112px); color: #f5f5ee; z-index: 2; animation: fade-up .7s .15s both ease-out; }
.visual-caption .eyebrow { color: rgba(245,245,238,.66); margin-bottom: 20px; }
.visual-caption p { margin: 0; font-size: clamp(28px, 3.7vw, 58px); font-weight: 300; letter-spacing: -.055em; line-height: 1.16; }
.visual-caption em { color: #d9dfc5; font-style: normal; }
.visual-orbit { position: absolute; border: 1px solid rgba(243,245,223,.30); border-radius: 999px; transform: rotate(-18deg); animation: orbit 16s linear infinite; }
.orbit-one { width: 39vw; height: 17vw; top: 21%; left: -6%; }
.orbit-two { width: 31vw; height: 13vw; top: 23%; left: -2%; opacity: .44; animation-duration: 22s; animation-direction: reverse; }
.fabric-swatch { position: absolute; width: 130px; height: 230px; border: 8px solid rgba(235,239,221,.45); box-shadow: 0 20px 35px rgba(28, 42, 31, .20); transform: rotate(-18deg); opacity: .76; }
.swatch-one { right: 17%; top: 13%; background: #acb89a; animation: drift 7s ease-in-out infinite; }
.swatch-two { right: 8%; top: 19%; background: #d4bea1; transform: rotate(11deg); animation: drift 8s .6s ease-in-out infinite reverse; }
.swatch-three { right: 28%; top: 29%; width: 105px; height: 176px; background: #51594c; transform: rotate(30deg); opacity: .55; animation: drift 9s .3s ease-in-out infinite; }
.visual-stitch { position: absolute; right: 14%; bottom: 12%; width: 94px; height: 94px; border: 1px dashed rgba(245,245,238,.64); border-radius: 50%; animation: spin 22s linear infinite; }

.login-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 7vw, 120px); background: var(--surface); }
.brand-mark { display: inline-flex; align-items: center; gap: 11px; width: max-content; color: var(--ink); }
.brand-symbol { display: grid; place-items: center; width: 34px; height: 34px; color: var(--surface); background: var(--ink); font-size: 17px; font-weight: 600; border-radius: 10px 10px 10px 2px; }
.brand-mark strong { display: block; font-size: 17px; line-height: 1; letter-spacing: .05em; }
.brand-mark small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.login-copy { margin-top: clamp(76px, 11vh, 144px); animation: fade-up .7s .25s both ease-out; }
.login-copy .eyebrow { margin-bottom: 18px; }
.login-copy h1 { margin: 0; font-size: clamp(30px, 4vw, 47px); letter-spacing: -.055em; line-height: 1.12; font-weight: 550; }
.login-copy p { max-width: 320px; margin: 15px 0 0; color: var(--muted-dark); font-size: 14px; line-height: 1.7; }
.login-form { max-width: 390px; margin-top: 49px; animation: fade-up .7s .35s both ease-out; }
.login-form > label { display: block; margin-bottom: 10px; color: var(--muted-dark); font-size: 12px; font-weight: 650; }
.input-wrap { display: flex; align-items: center; height: 55px; border-bottom: 1px solid var(--ink); }
.input-prefix { color: var(--accent); font-size: 20px; font-weight: 500; }
.input-wrap input { flex: 1; min-width: 0; height: 100%; padding: 0 12px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; letter-spacing: .07em; }
.input-wrap input::placeholder { color: #a9aca5; letter-spacing: 0; }
.clear-input { display: none; border: 0; color: var(--muted); background: transparent; font-size: 22px; line-height: 1; }
.input-wrap:focus-within .clear-input { display: block; }
.form-error { min-height: 20px; margin: 9px 0 0; color: var(--red); font-size: 12px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; border-radius: 9px; transition: background .2s ease, transform .2s ease, box-shadow .2s ease; }
.primary-button { min-height: 46px; padding: 0 18px; color: #fff; border: 1px solid var(--accent-dark); background: var(--accent-dark); font-size: 13px; font-weight: 650; }
.primary-button:hover { background: #414b2b; box-shadow: 0 9px 18px rgba(80, 91, 55, .17); transform: translateY(-1px); }
.button-arrow { font-size: 18px; font-weight: 400; line-height: 1; }
.login-button { width: 100%; margin-top: 3px; justify-content: space-between; padding: 0 16px 0 19px; }
.login-footnote { display: flex; align-items: center; gap: 8px; margin-top: 55px; color: var(--muted); font-size: 11px; animation: fade-up .7s .45s both ease-out; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* App shell */
.workspace-view { min-height: 100svh; display: grid; grid-template-columns: 246px minmax(0, 1fr); background: var(--surface); }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100svh; padding: 29px 18px 20px; border-right: 1px solid var(--line); background: #f7f6f2; z-index: 10; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; }
.brand-mark.compact .brand-symbol { width: 30px; height: 30px; font-size: 15px; border-radius: 8px 8px 8px 2px; }
.brand-mark.compact strong { font-size: 15px; }
.workspace-selector { margin-top: 49px; padding: 0 7px; }
.workspace-label { display: block; margin-bottom: 11px; color: var(--muted); font-size: 10px; letter-spacing: .06em; }
.workspace-switcher { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); text-align: left; }
.workspace-switcher:hover { border-color: #b9bcae; }
.workspace-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; border-radius: 7px; color: #f5f6ed; background: var(--accent); font-size: 11px; font-weight: 700; }
.workspace-name { overflow: hidden; flex: 1; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.chevron { color: var(--muted); font-size: 14px; }
.main-nav, .quick-nav { display: grid; gap: 3px; margin-top: 28px; }
.nav-item, .quick-item { display: flex; align-items: center; width: 100%; min-height: 39px; padding: 0 10px; border: 0; border-radius: 8px; color: var(--muted-dark); background: transparent; text-align: left; font-size: 13px; transition: background .2s ease, color .2s ease; }
.nav-item:hover, .quick-item:hover { color: var(--ink); background: rgba(255,255,255,.66); }
.nav-item.active { color: var(--ink); background: var(--surface-strong); box-shadow: 0 2px 8px rgba(41, 43, 35, .04); }
.nav-icon { display: inline-grid; place-items: center; width: 25px; color: var(--accent); font-size: 18px; }
.nav-item:not(.active) .nav-icon { color: #a3a89e; }
.nav-count { margin-left: auto; color: var(--muted); font-size: 11px; }
.sidebar-divider { height: 1px; margin: 30px 8px 22px; background: var(--line); }
.sidebar-section-heading { padding: 0 17px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.quick-nav { margin-top: 10px; }
.quick-item { gap: 10px; }
.quick-item strong { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 600; }
.quick-dot { width: 7px; height: 7px; border-radius: 50%; }
.quick-dot.amber { background: var(--amber); }
.quick-dot.red { background: var(--red); }
.sidebar-bottom { margin-top: auto; padding: 0 7px; }
.sync-mini { display: flex; align-items: center; gap: 10px; padding: 13px 9px; border-top: 1px solid var(--line); color: var(--muted-dark); }
.sync-icon { color: var(--accent); font-size: 20px; }
.sync-mini strong, .sync-mini small { display: block; }
.sync-mini strong { font-size: 11px; font-weight: 650; }
.sync-mini small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.logout-button { padding: 8px 9px; border: 0; color: var(--muted); background: transparent; font-size: 11px; }
.logout-button:hover { color: var(--red); }

.main-content { min-width: 0; background: var(--surface); }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 82px; padding: 0 clamp(24px, 5vw, 75px); border-bottom: 1px solid var(--line-light); }
.breadcrumb { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: var(--ink); font-weight: 650; }
.breadcrumb-separator { color: #b6b9b0; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.sync-button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 0; border: 0; color: var(--muted-dark); background: transparent; font-size: 11px; }
.sync-button:hover { color: var(--accent-dark); }
.sync-button-icon { color: var(--accent); font-size: 17px; transition: transform .4s ease; }
.sync-button.is-syncing .sync-button-icon { animation: spin 1s linear infinite; }
.avatar-button { width: 30px; height: 30px; border: 0; border-radius: 50%; color: #f8f8f2; background: #7e8b76; font-size: 11px; }
.content-wrap { max-width: 1260px; margin: 0 auto; padding: clamp(42px, 6vw, 78px) clamp(24px, 5vw, 75px) 90px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; padding-bottom: 39px; }
.page-heading .eyebrow { margin-bottom: 15px; }
.page-heading h2 { margin: 0; font-size: clamp(31px, 4vw, 48px); font-weight: 520; letter-spacing: -.065em; line-height: 1; }
.page-heading p { margin: 14px 0 0; color: var(--muted-dark); font-size: 13px; }
.add-button { min-width: 124px; padding: 0 15px; }
.plus { font-size: 20px; font-weight: 300; line-height: 1; }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.summary-item { position: relative; min-height: 112px; padding: 21px 25px 18px 0; }
.summary-item + .summary-item { padding-left: 25px; border-left: 1px solid var(--line); }
.summary-label { display: block; color: var(--muted); font-size: 11px; }
.summary-item strong { display: inline-block; margin-top: 14px; font-size: 30px; font-weight: 500; letter-spacing: -.05em; }
.summary-note { margin-left: 5px; color: var(--muted); font-size: 11px; }
.summary-item.warning strong { color: var(--amber); }
.summary-item.quiet strong { color: var(--muted-dark); }
.toolbar-section { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 43px; }
.search-field { display: flex; align-items: center; flex: 1; max-width: 470px; height: 39px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #f7f6f2; }
.search-field:focus-within { border-color: #a5ad8f; box-shadow: 0 0 0 3px rgba(109, 118, 81, .08); }
.search-icon { color: var(--muted); font-size: 22px; line-height: 1; transform: rotate(-15deg); }
.search-field input { flex: 1; min-width: 0; height: 100%; padding: 0 9px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-field input::placeholder { color: #a3a79e; }
kbd { display: grid; place-items: center; width: 19px; height: 19px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: var(--surface); font-size: 10px; }
.toolbar-actions { display: flex; align-items: center; gap: 9px; }
.secondary-button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); color: var(--muted-dark); background: transparent; font-size: 12px; }
.secondary-button:hover { border-color: #a8ada1; color: var(--ink); background: var(--surface-strong); }
.filter-icon { color: var(--accent); font-size: 18px; transform: rotate(90deg); }
.view-toggle { display: inline-flex; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: transparent; }
.view-toggle span { display: grid; place-items: center; width: 29px; border-radius: 5px; font-size: 17px; }
.view-toggle .view-toggle-active { color: var(--ink); background: var(--surface-strong); box-shadow: 0 2px 4px rgba(0,0,0,.06); }
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 15px; animation: fade-down .25s ease-out; }
.filter-label { margin-right: 4px; color: var(--muted); font-size: 11px; }
.filter-chip { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted-dark); background: transparent; font-size: 11px; }
.filter-chip:hover, .filter-chip.active { color: var(--accent-dark); border-color: #bbc3a5; background: var(--accent-soft); }
.product-table-head { display: grid; grid-template-columns: minmax(240px, 1.6fr) 1fr .8fr 1fr 32px; gap: 16px; margin-top: 31px; padding: 0 13px 11px; border-bottom: 1px solid var(--ink); color: var(--muted); font-size: 10px; letter-spacing: .05em; }
.product-list { min-height: 180px; }
.product-row { display: grid; grid-template-columns: minmax(240px, 1.6fr) 1fr .8fr 1fr 32px; align-items: center; gap: 16px; min-height: 84px; padding: 10px 13px; border-bottom: 1px solid var(--line-light); transition: background .2s ease, transform .2s ease; animation: row-in .4s both ease-out; }
.product-row:hover { background: #f5f5f0; }
.product-info { display: flex; align-items: center; gap: 14px; min-width: 0; }
.product-thumb { display: block; flex: 0 0 auto; width: 49px; height: 62px; object-fit: cover; border-radius: 5px; background: #e5e5df; }
.product-thumb.placeholder { display: grid; place-items: center; color: var(--muted); background: #e8e7e0; font-size: 16px; }
.product-name-wrap { min-width: 0; }
.product-name { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 650; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
.product-code { margin-top: 5px; color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.product-category, .product-spec { color: var(--muted-dark); font-size: 12px; }
.product-spec { color: var(--muted); }
.stock-cell { min-width: 0; }
.stock-number { display: flex; align-items: baseline; gap: 4px; }
.stock-number strong { font-size: 14px; font-weight: 650; }
.stock-number span { color: var(--muted); font-size: 10px; }
.stock-bar { width: 82px; height: 4px; margin-top: 8px; border-radius: 99px; background: #e4e5dd; overflow: hidden; }
.stock-fill { height: 100%; border-radius: inherit; background: var(--accent); }
.stock-fill.low { background: var(--amber); }
.stock-fill.out { background: var(--red); }
.status-label { display: inline-block; margin-top: 6px; padding: 3px 6px; border-radius: 4px; color: var(--amber); background: var(--amber-soft); font-size: 9px; }
.status-label.out { color: var(--red); background: var(--red-soft); }
.row-menu { width: 28px; height: 28px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 18px; }
.row-menu:hover { color: var(--ink); background: var(--surface-strong); }
.empty-state { padding: 72px 20px; text-align: center; }
.empty-mark { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 18px; border-radius: 50%; color: var(--muted); background: var(--accent-soft); font-size: 23px; transform: rotate(-15deg); }
.empty-state h3 { margin: 0; font-size: 17px; font-weight: 600; }
.empty-state p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

/* Activity and categories */
.compact-heading { align-items: flex-start; }
.activity-list { border-top: 1px solid var(--ink); }
.activity-day { padding: 22px 0 7px; color: var(--muted); font-size: 11px; font-weight: 650; }
.activity-row { display: grid; grid-template-columns: 50px minmax(150px, 1fr) 1.2fr 1fr 80px; align-items: center; gap: 14px; min-height: 72px; border-bottom: 1px solid var(--line-light); font-size: 12px; }
.activity-badge { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--accent-dark); background: var(--accent-soft); font-size: 17px; }
.activity-badge.out { color: var(--red); background: var(--red-soft); }
.activity-badge.adjust { color: var(--amber); background: var(--amber-soft); }
.activity-product strong, .activity-product small { display: block; }
.activity-product strong { font-weight: 650; }
.activity-product small, .activity-meta { margin-top: 4px; color: var(--muted); font-size: 10px; }
.activity-change { font-size: 14px; font-weight: 650; }
.activity-change.in { color: var(--accent-dark); }
.activity-change.out { color: var(--red); }
.activity-change.adjust { color: var(--amber); }
.activity-time { color: var(--muted); font-size: 11px; text-align: right; }
.category-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 42px; }
.category-tree { border-top: 1px solid var(--ink); }
.category-group { border-bottom: 1px solid var(--line-light); }
.category-line { display: flex; align-items: center; min-height: 57px; gap: 10px; }
.category-line.level-1 { padding-left: 0; }
.category-line.level-2 { padding-left: 29px; }
.category-line.level-3 { padding-left: 58px; }
.category-toggle { width: 18px; height: 25px; border: 0; color: var(--muted); background: transparent; }
.category-toggle.empty { visibility: hidden; }
.category-name { font-size: 13px; font-weight: 600; }
.category-meta { margin-left: auto; color: var(--muted); font-size: 11px; }
.category-actions { display: none; margin-left: 13px; }
.category-group:hover .category-actions { display: block; }
.category-actions button { border: 0; color: var(--muted); background: transparent; font-size: 16px; }
.category-note { display: flex; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); }
.note-mark { display: grid; place-items: center; flex: 0 0 auto; width: 19px; height: 19px; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent-dark); font-size: 11px; }
.category-note strong { font-size: 12px; font-weight: 650; }
.category-note p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }

/* Drawers and modals */
.drawer-layer, .modal-layer { position: fixed; inset: 0; z-index: 30; }
.drawer-backdrop, .modal-backdrop { position: absolute; inset: 0; background: rgba(29, 33, 30, .25); backdrop-filter: blur(3px); animation: fade-in .25s ease-out; }
.drawer { position: absolute; top: 0; right: 0; display: flex; flex-direction: column; width: min(570px, 100%); height: 100%; background: var(--surface); box-shadow: -18px 0 50px rgba(0,0,0,.12); animation: slide-in .32s cubic-bezier(.2,.8,.2,1); }
.drawer-header, .modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 32px 34px 25px; border-bottom: 1px solid var(--line); }
.drawer-header h2, .modal-header h2 { margin: 10px 0 0; font-size: 25px; letter-spacing: -.04em; font-weight: 550; }
.icon-button { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 7px; color: var(--muted-dark); background: transparent; font-size: 23px; line-height: 1; }
.icon-button:hover { color: var(--ink); background: var(--line-light); }
.drawer-body { flex: 1; overflow-y: auto; padding: 31px 34px 60px; }
.detail-hero { display: grid; grid-template-columns: 126px 1fr; gap: 22px; align-items: start; padding-bottom: 29px; border-bottom: 1px solid var(--line); }
.detail-image { width: 126px; height: 160px; border-radius: 7px; object-fit: cover; background: #e5e5df; }
.detail-image.placeholder { display: grid; place-items: center; color: var(--muted); font-size: 23px; }
.detail-name { margin: 7px 0 0; font-size: 20px; line-height: 1.35; letter-spacing: -.04em; }
.detail-code { margin-top: 9px; color: var(--muted); font-size: 11px; letter-spacing: .06em; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 17px; }
.detail-tag { padding: 5px 8px; border-radius: 5px; color: var(--accent-dark); background: var(--accent-soft); font-size: 10px; }
.detail-summary { display: flex; align-items: center; gap: 24px; margin-top: 22px; }
.detail-summary-item strong, .detail-summary-item span { display: block; }
.detail-summary-item strong { font-size: 22px; font-weight: 520; letter-spacing: -.04em; }
.detail-summary-item span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.drawer-section { margin-top: 32px; }
.drawer-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.drawer-section-title { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.drawer-section-note { color: var(--muted); font-size: 10px; }
.variant-table { border-top: 1px solid var(--ink); }
.variant-head, .variant-row { display: grid; grid-template-columns: 1fr 70px 106px; align-items: center; gap: 10px; }
.variant-head { min-height: 33px; border-bottom: 1px solid var(--line-light); color: var(--muted); font-size: 10px; }
.variant-row { min-height: 54px; border-bottom: 1px solid var(--line-light); font-size: 12px; }
.variant-name { display: flex; align-items: center; gap: 7px; }
.color-swatch { width: 9px; height: 9px; border: 1px solid rgba(0,0,0,.14); border-radius: 50%; }
.variant-stock { font-size: 14px; font-weight: 650; }
.variant-stock.low { color: var(--amber); }
.variant-stock.out { color: var(--red); }
.stepper { display: inline-flex; align-items: center; justify-content: space-between; width: 100px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-strong); }
.stepper button { display: grid; place-items: center; width: 29px; height: 100%; border: 0; color: var(--muted-dark); background: transparent; font-size: 17px; }
.stepper button:hover { color: var(--accent-dark); background: var(--accent-soft); }
.stepper span { color: var(--muted); font-size: 10px; }
.movement-preview { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.movement-line { display: flex; align-items: center; justify-content: space-between; min-height: 48px; border-bottom: 1px solid var(--line-light); font-size: 11px; }
.movement-left { display: flex; align-items: center; gap: 10px; }
.movement-symbol { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--accent-dark); background: var(--accent-soft); font-size: 13px; }
.movement-symbol.out { color: var(--red); background: var(--red-soft); }
.movement-line small { color: var(--muted); }
.movement-amount { font-weight: 650; }
.movement-amount.out { color: var(--red); }
.drawer-empty { padding: 22px 0; color: var(--muted); font-size: 12px; }

.modal-layer { display: grid; place-items: center; padding: 20px; }
.modal { position: relative; width: min(640px, 100%); max-height: min(760px, calc(100svh - 40px)); overflow: auto; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); animation: modal-in .3s cubic-bezier(.2,.8,.2,1); }
.small-modal { width: min(430px, 100%); }
.modal-header { padding: 28px 31px 23px; }
.product-form { padding: 28px 31px 31px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 15px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field span { color: var(--muted-dark); font-size: 11px; font-weight: 650; }
.field i { color: var(--red); font-style: normal; }
.field small { margin-left: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }
.field input, .field select { width: 100%; height: 41px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; outline: 0; color: var(--ink); background: #f7f6f2; font-size: 12px; }
.field input:focus, .field select:focus { border-color: #a5ad8f; background: var(--surface-strong); box-shadow: 0 0 0 3px rgba(109, 118, 81, .08); }
.field input::placeholder { color: #b0b3ad; }
.full-width { grid-column: 1 / -1; }
.image-preview { position: relative; width: 100px; height: 125px; margin-top: 22px; }
.image-preview img { width: 100%; height: 100%; border-radius: 7px; object-fit: cover; }
.image-preview button { position: absolute; top: -9px; right: -9px; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--surface); border-radius: 50%; color: #fff; background: var(--red); font-size: 16px; line-height: 1; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 31px; padding-top: 20px; border-top: 1px solid var(--line); }

.toast { position: fixed; bottom: 26px; left: 50%; z-index: 60; min-width: 190px; padding: 12px 17px; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; color: #fff; background: rgba(34, 40, 34, .90); box-shadow: 0 12px 25px rgba(0,0,0,.14); font-size: 12px; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .25s ease, transform .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes fade-up { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes row-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slide-in { from { transform: translateX(30px); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
@keyframes modal-in { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes orbit { from { transform: rotate(-18deg) translateX(0); } 50% { transform: rotate(-13deg) translateX(25px); } to { transform: rotate(-18deg) translateX(0); } }
@keyframes drift { 0%, 100% { transform: translateY(0) rotate(-18deg); } 50% { transform: translateY(-15px) rotate(-14deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 920px) {
  .login-view { grid-template-columns: .85fr 1.15fr; }
  .login-panel { padding: 48px; }
  .workspace-view { grid-template-columns: 216px minmax(0, 1fr); }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .content-wrap { padding-left: 36px; padding-right: 36px; }
  .product-table-head, .product-row { grid-template-columns: minmax(205px, 1.6fr) .85fr .75fr .85fr 28px; gap: 10px; }
  .product-category { font-size: 11px; }
}

@media (max-width: 720px) {
  .desktop-only { display: none; }
  .mobile-only { display: grid !important; }
  .login-view { display: block; min-height: 100svh; }
  .login-visual { display: none; }
  .login-panel { min-height: 100svh; padding: 37px 26px; }
  .login-copy { margin-top: 110px; }
  .login-copy h1 { font-size: 37px; }
  .login-footnote { margin-top: 42px; }
  .workspace-view { display: block; min-height: 100svh; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(286px, 88vw); transform: translateX(-105%); box-shadow: 18px 0 40px rgba(0,0,0,.12); transition: transform .28s ease; }
  .sidebar.open { transform: translateX(0); }
  .topbar { height: 65px; padding: 0 20px; }
  .topbar > .mobile-only { margin-right: 13px; }
  .topbar .breadcrumb { margin-right: auto; }
  .topbar-actions { gap: 11px; }
  .content-wrap { padding: 38px 20px 70px; }
  .page-heading { align-items: flex-start; flex-direction: column; padding-bottom: 30px; }
  .page-heading h2 { font-size: 37px; }
  .page-heading p { margin-top: 12px; }
  .add-button { width: 100%; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-item { min-height: 95px; padding: 18px 15px 13px 0; }
  .summary-item + .summary-item { padding-left: 15px; }
  .summary-item:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .summary-item:nth-child(4) { border-top: 1px solid var(--line); }
  .summary-item strong { margin-top: 10px; font-size: 26px; }
  .toolbar-section { align-items: stretch; flex-direction: column; margin-top: 30px; }
  .search-field { max-width: none; }
  .toolbar-actions { justify-content: space-between; }
  .toolbar-actions .secondary-button { flex: 1; }
  .product-table-head { display: none; }
  .product-row { grid-template-columns: minmax(0, 1fr) 80px 25px; gap: 8px; min-height: 80px; padding: 9px 0; }
  .product-category, .product-spec { display: none; }
  .product-info { gap: 10px; }
  .product-thumb { width: 45px; height: 57px; }
  .product-name { font-size: 12px; }
  .stock-bar { width: 70px; }
  .row-menu { justify-self: end; }
  .activity-row { grid-template-columns: 42px 1fr 70px; gap: 9px; min-height: 75px; }
  .activity-row .activity-meta { display: none; }
  .activity-time { text-align: right; }
  .category-layout { display: block; }
  .category-note { margin-top: 32px; }
  .drawer-header, .modal-header { padding: 25px 21px 21px; }
  .drawer-body, .product-form { padding: 24px 21px 42px; }
  .detail-hero { grid-template-columns: 95px 1fr; gap: 15px; }
  .detail-image { width: 95px; height: 122px; }
  .detail-name { font-size: 17px; }
  .variant-head, .variant-row { grid-template-columns: 1fr 49px 100px; gap: 7px; }
  .form-grid { display: block; }
  .field { margin-bottom: 18px; }
  .form-actions { position: sticky; bottom: -1px; margin-left: -21px; margin-right: -21px; padding: 15px 21px 2px; background: linear-gradient(var(--surface), var(--surface)); }
}

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

.shake { animation: shake .28s ease-out; }
