:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --surface-soft: #fffaf4;
  --ink: #2f2a28;
  --muted: #857a73;
  --muted-2: #a99e95;
  --line: #ece2d8;
  --line-strong: #e2d5c8;
  --terracotta: #bf6f4c;
  --terracotta-dark: #9f5438;
  --sage: #4c7268;
  --sage-soft: #e1eee9;
  --amber: #f3bf7b;
  --amber-soft: #fff0dc;
  --danger: #cf7469;
  --danger-soft: #fce7e2;
  --success: #4d9a78;
  --success-soft: #e3f3e9;
  --shadow: 0 16px 44px rgba(73, 49, 38, .075);
  --shadow-soft: 0 8px 24px rgba(73, 49, 38, .05);
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar: #352e2a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: var(--bg); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(191,111,76,.28); outline-offset: 2px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: 250px; color: #e8ddd3; background: var(--sidebar); }
.sidebar-inner { display: flex; height: 100%; flex-direction: column; padding: 27px 17px 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff8f0; font-size: 16px; font-weight: 820; letter-spacing: -.035em; text-decoration: none; }
.brand-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; color: var(--sidebar); background: var(--amber); font-size: 14px; font-weight: 950; }
.workspace { margin: 30px 7px 20px; padding: 14px 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: rgba(255,255,255,.045); }
.workspace-label, .nav-section, .kicker, .topbar-kicker { display: block; color: var(--muted-2); font-size: 9px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.workspace-label { color: #a5968b; }
.workspace strong { display: block; margin: 7px 0 9px; color: #fff7ef; font-size: 12px; }
.workspace-tagline { display: block; margin: -3px 0 9px; overflow: hidden; color: #a9988c; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-state { display: flex; align-items: center; gap: 5px; color: #b8aa9f; font-size: 10px; }
.workspace-state i, .status-dot, .warehouse-status i, .user-status i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #83c297; }
.primary-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section { margin: 14px 10px 5px; color: #89796e; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 39px; padding: 0 11px; border-radius: 11px; color: #c2b4aa; font-size: 12px; text-decoration: none; transition: .16s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-link.active { color: #fff; background: rgba(243,191,123,.14); }
.nav-link > span { width: 17px; color: #a69386; font-size: 15px; text-align: center; }
.nav-link.active > span { color: var(--amber); }
.nav-count { display: inline-grid; min-width: 19px; height: 19px; margin-left: auto; place-items: center; border-radius: 7px; color: var(--sidebar); background: var(--amber); font-size: 9px; }
.sidebar-bottom { margin-top: auto; padding: 15px 8px 0; border-top: 1px solid rgba(255,255,255,.09); }
.profile-mini { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.profile-mini strong { display: block; color: #fff7ef; font-size: 11px; }
.profile-mini small { display: block; margin-top: 3px; color: #a9988c; font-size: 9px; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: #fff8f0; background: var(--terracotta); font-size: 11px; font-weight: 850; }
.avatar-small { width: 29px; height: 29px; border-radius: 9px; color: var(--sidebar); background: var(--amber); }
.logout-link { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 2px; color: #ae9e92; background: transparent; font-size: 10px; text-align: left; }
.logout-link:hover { color: #fff; }
.main-shell { display: flex; min-width: 0; width: calc(100% - 250px); min-height: 100vh; margin-left: 250px; flex-direction: column; }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 0 42px; border-bottom: 1px solid rgba(226,213,200,.8); background: rgba(250,246,240,.9); backdrop-filter: blur(16px); }
.topbar-context { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.topbar-context strong { color: var(--ink); font-size: 12px; }
.topbar-kicker { display: none; color: var(--terracotta); }
.topbar-separator { color: #c5b7aa; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.topbar-search { display: flex; align-items: center; gap: 8px; width: 250px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted-2); background: #fff; }
.topbar-search > span { color: var(--terracotta); font-size: 16px; }
.topbar-search input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.topbar-search input::placeholder { color: #b8ada5; }
.topbar-search kbd { padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; color: #aa9e95; background: var(--surface-soft); font-size: 8px; white-space: nowrap; }
.icon-button { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; font-size: 15px; text-decoration: none; }
.icon-button:hover { color: var(--terracotta); border-color: #ddc9b9; }
.notification-button { position: relative; }
.notification-button i { position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border: 1px solid #fff; border-radius: 50%; background: var(--terracotta); }
.topbar-user-menu { position: relative; }
.topbar-user { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 12px; color: var(--ink); background: transparent; }
.topbar-user:hover { background: #fff; }
.topbar-user:focus-visible { outline: 3px solid rgba(191,111,76,.28); outline-offset: 2px; }
.topbar-user-name { max-width: 100px; overflow: hidden; font-size: 11px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.chevron { color: var(--muted-2); font-size: 13px; transition: transform .16s ease; }
.topbar-user-menu.open .chevron { transform: rotate(180deg); }
.user-menu-dropdown { position: absolute; z-index: 40; top: calc(100% + 10px); right: 0; width: min(230px, calc(100vw - 32px)); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.user-menu-dropdown[hidden] { display: none; }
.user-menu-heading { padding: 14px 15px 12px; background: #fffaf5; }
.user-menu-heading strong { display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-heading small { display: block; margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.user-menu-link, .user-menu-logout { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 38px; padding: 0 15px; color: var(--muted); background: #fff; font-size: 10px; text-align: left; text-decoration: none; }
.user-menu-link:hover, .user-menu-logout:hover { color: var(--terracotta-dark); background: var(--surface-soft); }
.user-menu-link span, .user-menu-logout span { width: 15px; color: var(--terracotta); font-size: 14px; text-align: center; }
.user-menu-logout { border-top: 1px solid #f3ece7; }
.mobile-menu { display: none; }
.page-content { width: 100%; max-width: 1500px; margin: 0 auto; padding: 38px 42px 70px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 27px; }
.page-heading h1 { margin: 6px 0 0; color: var(--ink); font-size: clamp(27px, 3vw, 37px); line-height: 1.03; letter-spacing: -.055em; }
.page-heading p { max-width: 600px; margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.back-link { display: inline-block; margin-bottom: 3px; color: var(--terracotta); font-size: 11px; font-weight: 750; text-decoration: none; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 0 15px; border-radius: 10px; font-size: 11px; font-weight: 800; text-decoration: none; transition: transform .14s ease, box-shadow .14s ease, background .14s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fffaf4; background: var(--terracotta); box-shadow: 0 8px 18px rgba(191,111,76,.2); }
.button-primary:hover { background: var(--terracotta-dark); }
.button-soft { color: var(--terracotta-dark); border: 1px solid var(--line-strong); background: #fff; }
.button-soft:hover { border-color: #d8bda9; background: var(--surface-soft); }
.button-amber { color: #634631; background: var(--amber); }
.button-wide { width: 100%; }
.text-link { color: var(--terracotta); font-size: 10px; font-weight: 850; text-decoration: none; white-space: nowrap; }
.text-link span { margin-left: 3px; font-size: 13px; }
.surface-note { color: var(--muted); font-size: 10px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 22px; }
.metric-card { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 17px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft); }
.metric-icon { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 12px; font-size: 18px; font-weight: 850; }
.metric-icon.terracotta { color: var(--terracotta-dark); background: #f7e4d7; }
.metric-icon.sage { color: var(--sage); background: var(--sage-soft); }
.metric-icon.amber { color: #8d5d2a; background: var(--amber-soft); }
.metric-icon.lilac { color: #806b78; background: #f0e5ee; }
.metric-card span { display: block; color: var(--muted); font-size: 10px; }
.metric-card strong { display: block; margin-top: 5px; color: var(--ink); font-size: 23px; line-height: 1; letter-spacing: -.06em; }
.metric-card small { display: block; margin-top: 7px; color: var(--muted-2); font-size: 9px; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(300px, .62fr); gap: 17px; margin-bottom: 18px; }
.panel-card { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-soft); }
.panel-large, .panel-side { min-height: 312px; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.panel-header h2 { margin: 4px 0 0; color: var(--ink); font-size: 16px; letter-spacing: -.04em; }
.warehouse-list { display: flex; flex-direction: column; gap: 7px; }
.warehouse-row { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 12px 11px; border: 1px solid #f1e9e2; border-radius: 12px; text-decoration: none; transition: .15s ease; }
.warehouse-row:hover { border-color: #dec9b8; background: #fffaf5; }
.warehouse-icon { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--terracotta); background: #f8e8dc; font-size: 15px; }
.warehouse-main { min-width: 0; flex: 1; }
.warehouse-main strong { display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.warehouse-main small { display: block; overflow: hidden; margin-top: 4px; color: var(--muted-2); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.warehouse-status { display: flex; align-items: center; gap: 5px; color: var(--success); font-size: 9px; font-weight: 750; }
.row-arrow { color: #b9aa9e; font-size: 15px; }
.critical-list { display: flex; flex-direction: column; gap: 2px; }
.critical-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid #f3ece7; text-decoration: none; }
.critical-row:first-child { border-top: 0; }
.critical-row > span:not(.product-avatar) { min-width: 0; flex: 1; }
.critical-row strong { display: block; overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.critical-row small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.critical-row > b { color: var(--danger); font-size: 12px; }
.product-avatar { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border-radius: 9px; font-size: 11px; font-weight: 850; }
.product-avatar.incoming { color: var(--sage); background: var(--sage-soft); }
.product-avatar.outgoing { color: var(--danger); background: var(--danger-soft); }
.product-avatar.warning { color: #a86d2f; background: var(--amber-soft); }
.product-avatar.critical { color: var(--danger); background: var(--danger-soft); }
.movement-panel { margin-bottom: 0; }
.movement-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.data-table th { padding: 0 12px 12px 0; color: var(--muted-2); font-size: 9px; font-weight: 800; text-align: left; white-space: nowrap; }
.data-table td { padding: 12px 12px 12px 0; border-top: 1px solid #f3ece7; color: #5f554e; vertical-align: middle; white-space: nowrap; }
.table-product { display: flex; align-items: center; gap: 9px; min-width: 160px; }
.table-product strong { display: block; overflow: hidden; max-width: 190px; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.table-product small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.badge { display: inline-flex; align-items: center; min-height: 21px; padding: 0 8px; border-radius: 999px; font-size: 8px; font-weight: 850; }
.badge-success { color: #397a5c; background: var(--success-soft); }
.badge-danger { color: #a75049; background: var(--danger-soft); }
.badge-warning { color: #98642b; background: var(--amber-soft); }
.badge-neutral { color: #6f6964; background: #f0ece9; }
.quantity { font-weight: 850; }
.quantity.positive { color: var(--success); }
.quantity.negative { color: var(--danger); }
.quantity small { color: var(--muted-2); font-size: 8px; font-weight: 600; }
.muted-cell { color: var(--muted-2) !important; font-size: 9px; }

.toolbar-card { margin-bottom: 17px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.63); }
.filter-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 9px; }
.search-field, .select-field, .date-field { display: flex; flex-direction: column; gap: 6px; }
.search-field { min-width: 240px; flex: 1; }
.search-field > span, .select-field > span, .date-field > span { color: var(--muted); font-size: 9px; font-weight: 750; }
.search-field { position: relative; }
.search-field > span { position: absolute; top: 28px; left: 11px; color: var(--terracotta); font-size: 16px; }
.search-field input, .select-field select, .date-field input { width: 100%; height: 37px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: #fff; font-size: 10px; }
.search-field input { padding-left: 32px; }
.search-field input:focus, .select-field select:focus, .date-field input:focus { border-color: #d8b49d; box-shadow: 0 0 0 3px rgba(191,111,76,.1); }
.select-field { width: 180px; }
.date-field { width: 137px; }
.clear-filter { align-self: center; margin-left: 1px; color: var(--muted); font-size: 9px; font-weight: 750; text-decoration: none; }
.clear-filter:hover { color: var(--terracotta); }
.product-grid-table { overflow-x: auto; }
.product-table-head, .product-table-row { display: grid; grid-template-columns: minmax(230px, 1.8fr) minmax(110px, .8fr) minmax(80px, .55fr) minmax(100px, .8fr) minmax(75px, .6fr) 22px; align-items: center; gap: 14px; min-width: 760px; }
.product-table-head { padding: 0 12px 10px 0; color: var(--muted-2); font-size: 9px; font-weight: 800; }
.product-table-row { padding: 12px 12px 12px 0; border-top: 1px solid #f3ece7; color: #5f554e; font-size: 10px; text-decoration: none; }
.product-table-row:hover { background: #fffaf5; }
.product-table-row > strong { color: var(--ink); }

.form-layout { display: flex; max-width: 980px; flex-direction: column; gap: 15px; }
.form-card { padding: 23px; }
.form-card-header, .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.form-card-header { margin-bottom: 20px; }
.form-card-header h2 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.04em; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.field-wide { grid-column: span 2; }
.field > span { color: var(--ink); font-size: 10px; font-weight: 800; }
.field > span small { color: var(--terracotta); font-size: 8px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: #fffdfa; font-size: 11px; }
.field input, .field select { height: 41px; }
.field textarea { min-height: 84px; padding-top: 11px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #b9aea5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #d8b49d; box-shadow: 0 0 0 3px rgba(191,111,76,.1); }
.field-help { color: var(--muted-2); font-size: 9px; line-height: 1.45; }
.input-with-icon, .price-input { position: relative; }
.input-with-icon input { padding-right: 39px; }
.input-with-icon > span { position: absolute; top: 10px; right: 13px; color: var(--terracotta); font-size: 16px; }
.price-input > span { position: absolute; top: 11px; left: 12px; color: var(--terracotta); font-size: 11px; font-weight: 850; }
.price-input input { padding-left: 28px; }
.form-note, .section-description { display: flex; align-items: flex-start; gap: 8px; margin: 16px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.form-note span { display: inline-grid; width: 17px; height: 17px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--sage); background: var(--sage-soft); font-size: 10px; font-weight: 850; }
.unit-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; align-items: end; }
.unit-base { display: flex; align-items: center; gap: 10px; height: 65px; padding: 11px; border: 1px solid #e5eee9; border-radius: 11px; background: #f7fbf9; }
.unit-symbol { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--sage); background: var(--sage-soft); font-size: 14px; font-weight: 900; }
.unit-base strong { display: block; color: var(--ink); font-size: 11px; }
.unit-base small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.unit-base .badge { margin-left: auto; }
.form-actions { justify-content: flex-end; padding-top: 2px; }
.form-actions .button { min-width: 112px; }
.alert { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 17px; padding: 12px 14px; border: 1px solid transparent; border-radius: 11px; font-size: 10px; line-height: 1.5; }
.alert > span { display: inline-grid; width: 18px; height: 18px; flex: 0 0 auto; place-items: center; border-radius: 50%; font-weight: 900; }
.alert-success { color: #397a5c; border-color: #cde7d7; background: var(--success-soft); }
.alert-success > span { color: #fff; background: var(--success); }
.alert-error { color: #9f514b; border-color: #f0cfc8; background: var(--danger-soft); }
.alert-error > span { color: #fff; background: var(--danger); }
.alert button { margin: -2px -4px 0 auto; color: inherit; background: transparent; font-size: 17px; opacity: .7; }

.management-grid, .warehouse-detail-grid, .detail-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); gap: 17px; align-items: start; }
.settings-layout { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(290px,.85fr); gap: 17px; max-width: 960px; align-items: start; }
.settings-preview-card { background: #fffdfa; }
.settings-preview { overflow: hidden; border: 1px solid #eadfd6; border-radius: 14px; background: var(--sidebar); }
.settings-preview-top { display: flex; align-items: center; gap: 10px; padding: 17px 15px; }
.settings-preview-top > div { min-width: 0; }
.settings-preview-top small { display: block; color: #a5968b; font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.settings-preview-top strong { display: block; overflow: hidden; margin-top: 5px; color: #fff7ef; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.settings-preview-top > div > span { display: flex; align-items: center; gap: 5px; margin-top: 6px; color: #b8aa9f; font-size: 8px; }
.settings-preview-top i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #83c297; }
.settings-preview-bar { display: flex; align-items: center; gap: 7px; padding: 12px 15px; color: #a99e95; background: #fff; font-size: 9px; }
.settings-preview-bar strong { color: var(--ink); }
.category-list, .user-list, .warehouse-stock-list { display: flex; flex-direction: column; }
.category-row, .user-row, .warehouse-stock-row { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 12px 0; border-top: 1px solid #f3ece7; }
.category-row:first-child, .user-row:first-child, .warehouse-stock-row:first-child { border-top: 0; }
.category-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px; color: var(--terracotta); background: #f8e8dc; font-size: 15px; }
.category-row > span:nth-child(2), .user-main { min-width: 0; flex: 1; }
.category-row strong, .user-row strong { display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.category-row small, .user-row small { display: block; overflow: hidden; margin-top: 4px; color: var(--muted-2); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.category-row > b { color: var(--terracotta); font-size: 12px; }
.category-row > b small { display: inline; color: var(--muted-2); font-size: 8px; font-weight: 650; }
.user-row { gap: 10px; }
.avatar-user { color: var(--terracotta-dark); background: #f7e4d7; }
.user-status { display: flex; align-items: center; gap: 5px; color: var(--success); font-size: 9px; font-weight: 750; white-space: nowrap; }
.user-status i.inactive { background: #c1b6ae; }
.compact-user-list .user-row { padding: 10px 0; }
.notification-list { display: flex; flex-direction: column; }
.notification-row { display: flex; align-items: flex-start; gap: 11px; padding: 14px 0; border-top: 1px solid #f3ece7; }
.notification-row:first-child { border-top: 0; }
.notification-row.is-read { opacity: .72; }
.notification-icon { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #98642b; background: var(--amber-soft); font-size: 12px; font-weight: 900; }
.notification-main { min-width: 0; flex: 1; }
.notification-main strong { display: block; color: var(--ink); font-size: 11px; }
.notification-main p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.notification-main small { display: block; margin-top: 6px; color: var(--muted-2); font-size: 9px; }
.notification-actions { display: flex; align-items: center; gap: 8px; }
.notification-actions .button { min-height: 31px; padding: 0 10px; font-size: 9px; }
.warehouse-stock-row { text-decoration: none; }
.warehouse-stock-row:hover strong { color: var(--terracotta); }
.warehouse-stock-row > strong { color: var(--ink); font-size: 12px; white-space: nowrap; }
.warehouse-stock-row > strong small { color: var(--muted-2); font-size: 8px; font-weight: 650; }
.detail-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.detail-list > div { padding: 11px; border: 1px solid #f1e9e2; border-radius: 10px; background: #fffaf5; }
.detail-list span { display: block; color: var(--muted-2); font-size: 9px; }
.detail-list strong { display: block; margin-top: 5px; color: var(--ink); font-size: 11px; }
.unit-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.unit-chips span { padding: 6px 8px; border-radius: 7px; color: var(--sage); background: var(--sage-soft); font-size: 9px; }

.movement-form { max-width: 960px; }
.movement-fields { margin-top: 22px; }
.movement-chip { display: inline-flex; align-items: center; min-height: 27px; padding: 0 9px; border-radius: 999px; font-size: 9px; font-weight: 850; }
.chip-in { color: #397a5c; background: var(--success-soft); }
.chip-out { color: #a75049; background: var(--danger-soft); }
.chip-transfer { color: #98642b; background: var(--amber-soft); }
.barcode-lookup { padding: 15px; border: 1px solid #f0e0d3; border-radius: 13px; background: #fffaf5; }
.lookup-label { display: flex; align-items: center; gap: 9px; }
.barcode-symbol { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; color: var(--terracotta); background: #f8e8dc; font-size: 17px; }
.lookup-label strong { display: block; color: var(--ink); font-size: 11px; }
.lookup-label small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.lookup-controls { display: flex; gap: 7px; margin-top: 12px; }
.lookup-controls input { min-width: 0; height: 38px; flex: 1; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: #fff; font-size: 10px; }
.lookup-controls input:focus { border-color: #d8b49d; box-shadow: 0 0 0 3px rgba(191,111,76,.1); }
.lookup-controls .button { min-height: 38px; }
.lookup-message { min-height: 14px; margin-top: 6px; color: var(--muted); font-size: 9px; }
.lookup-message.success { color: var(--success); }
.lookup-message.error { color: var(--danger); }
.stock-warning, .transfer-explainer { display: flex; align-items: center; gap: 9px; margin-top: 19px; padding: 11px 13px; border-radius: 11px; }
.stock-warning { color: #98642b; background: var(--amber-soft); }
.stock-warning > span, .transfer-explainer > span { display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; border-radius: 7px; font-weight: 850; }
.stock-warning > span { color: #fff; background: #d1964f; }
.stock-warning strong, .transfer-explainer strong { display: block; font-size: 10px; }
.stock-warning small, .transfer-explainer small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.transfer-explainer { color: var(--sage); background: #f3faf6; }
.transfer-explainer > span { background: var(--sage-soft); }
.scanner-modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(53,46,42,.55); backdrop-filter: blur(4px); }
.scanner-modal[hidden] { display: none; }
.scanner-card { position: relative; width: min(410px,100%); padding: 23px; border-radius: 19px; background: #fffaf5; box-shadow: 0 25px 70px rgba(25,18,14,.25); }
.scanner-card h2 { margin: 6px 0 5px; font-size: 18px; letter-spacing: -.04em; }
.scanner-card p { margin: 0 0 14px; color: var(--muted); font-size: 10px; }
.scanner-card video { display: block; width: 100%; min-height: 210px; max-height: 300px; border-radius: 13px; background: #342c28; object-fit: cover; }
.scanner-close { position: absolute; top: 13px; right: 15px; width: 30px; height: 30px; border-radius: 9px; color: var(--muted); background: #f3e7dd; font-size: 19px; }
.scanner-fallback { margin-top: 11px; color: var(--muted-2); font-size: 9px; line-height: 1.45; }

.empty-state { display: grid; min-height: 180px; place-items: center; align-content: center; padding: 24px; color: var(--muted); text-align: center; }
.empty-state.compact { min-height: 180px; }
.empty-icon { display: grid; width: 42px; height: 42px; margin-bottom: 10px; place-items: center; border-radius: 13px; color: var(--terracotta); background: #f8e8dc; font-size: 20px; }
.success-empty .empty-icon { color: var(--success); background: var(--success-soft); }
.empty-state strong { color: var(--ink); font-size: 12px; }
.empty-state p { max-width: 290px; margin: 6px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.5; }
.insight-card { display: flex; align-items: flex-start; gap: 11px; max-width: 800px; margin-top: 17px; background: #fffaf5; }
.insight-icon { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: var(--sage); background: var(--sage-soft); font-size: 12px; font-weight: 900; }
.insight-card strong { display: block; color: var(--ink); font-size: 11px; }
.insight-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.report-metrics { max-width: 1000px; grid-template-columns: repeat(3, minmax(0,1fr)); }
.offline-banner { position: fixed; z-index: 150; right: 20px; bottom: 20px; max-width: 360px; padding: 12px 15px; border: 1px solid #edc7bf; border-radius: 11px; color: #914a43; background: var(--danger-soft); box-shadow: var(--shadow); font-size: 10px; }
.offline-banner[hidden] { display: none; }
.mobile-quick-actions { display: none; }

.auth-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--bg); }
.auth-shell { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(360px, 440px); width: min(960px, 100%); min-height: 580px; overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: #fff; box-shadow: 0 30px 80px rgba(73,49,38,.12); }
.auth-hero { display: flex; flex-direction: column; padding: 38px; color: #fff3e9; background: var(--sidebar); }
.auth-brand { display: flex; align-items: center; gap: 10px; color: #fffaf4; font-size: 17px; font-weight: 850; }
.auth-brand .brand-mark { color: var(--sidebar); background: var(--amber); }
.auth-hero-copy { max-width: 370px; margin: auto 0; }
.auth-hero .kicker { color: var(--amber); }
.auth-hero h1 { margin: 10px 0 14px; color: #fffaf4; font-size: clamp(30px,4vw,48px); line-height: 1.02; letter-spacing: -.06em; }
.auth-hero p { margin: 0; color: #c4b4a7; font-size: 13px; line-height: 1.7; }
.auth-hero-foot { display: flex; align-items: center; gap: 7px; color: #b3a196; font-size: 10px; }
.auth-card { display: flex; flex-direction: column; justify-content: center; padding: 49px 46px; }
.auth-heading h2 { margin: 7px 0 8px; color: var(--ink); font-size: 24px; letter-spacing: -.055em; }
.auth-heading p { margin: 0 0 26px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.form-stack { display: flex; flex-direction: column; gap: 15px; }
.auth-help { display: flex; align-items: flex-start; gap: 7px; margin-top: 23px; color: var(--muted-2); font-size: 9px; line-height: 1.5; }
.auth-help .status-dot { margin-top: 3px; }

@media (max-width: 1120px) {
  .sidebar { width: 220px; }
  .main-shell { width: calc(100% - 220px); margin-left: 220px; }
  .topbar { padding: 0 28px; }
  .page-content { padding-right: 28px; padding-left: 28px; }
  .dashboard-layout, .management-grid, .warehouse-detail-grid, .detail-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .panel-side { min-height: auto; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-101%); transition: transform .2s ease; box-shadow: 16px 0 42px rgba(40,28,21,.15); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 15; inset: 0; display: none; background: rgba(53,46,42,.35); }
  .sidebar-scrim.open { display: block; }
  .main-shell { width: 100%; margin-left: 0; }
  .topbar { padding: 0 20px; }
  .mobile-menu { display: grid; }
  .topbar-context { margin-right: auto; margin-left: 12px; }
  .topbar-context .topbar-kicker { display: block; }
  .topbar-context .topbar-separator, .topbar-context strong { display: none; }
  .topbar-search { width: 36px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .topbar-search input, .topbar-search kbd { display: none; }
  .topbar-search > span { font-size: 19px; }
  .topbar-user-name, .topbar-user .chevron { display: none; }
  .user-menu-dropdown { top: calc(100% + 8px); }
  .page-content { padding: 28px 20px 58px; }
}
@media (max-width: 600px) {
  .auth-body { padding: 0; }
  .auth-shell { display: block; min-height: 100vh; border: 0; border-radius: 0; }
  .auth-hero { min-height: 245px; padding: 27px 25px; }
  .auth-hero-copy { margin: auto 0 0; }
  .auth-hero h1 { margin: 8px 0 7px; font-size: 29px; }
  .auth-hero p { font-size: 11px; }
  .auth-hero-foot { margin-top: 22px; }
  .auth-card { padding: 35px 25px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .page-heading h1 { font-size: 31px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .metric-grid, .report-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .metric-card { align-items: flex-start; flex-direction: column; gap: 9px; padding: 13px; }
  .metric-card strong { font-size: 21px; }
  .panel-card { padding: 16px; border-radius: 16px; }
  .filter-form { align-items: stretch; flex-direction: column; }
  .search-field, .select-field, .date-field { width: 100%; min-width: 0; }
  .filter-form > .button { width: 100%; }
  .clear-filter { align-self: flex-start; margin: 0 0 2px; }
  .form-grid, .detail-list { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .unit-grid { grid-template-columns: 1fr; }
  .unit-base { width: 100%; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .lookup-controls { flex-wrap: wrap; }
  .lookup-controls input { flex-basis: 100%; }
  .lookup-controls .button { flex: 1; }
  .table-product { min-width: 175px; }
  .data-table { min-width: 710px; }
  .mobile-quick-actions { position: fixed; z-index: 12; right: 12px; bottom: 12px; left: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; border: 1px solid rgba(226,213,200,.9); border-radius: 14px; background: rgba(255,255,255,.92); box-shadow: 0 12px 30px rgba(73,49,38,.14); backdrop-filter: blur(14px); }
  .mobile-quick-actions a { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 40px; border-radius: 9px; color: var(--terracotta-dark); font-size: 10px; font-weight: 850; text-decoration: none; }
  .mobile-quick-actions a:hover { background: var(--surface-soft); }
  .mobile-quick-actions a.quick-primary { color: #fffaf4; background: var(--terracotta); }
  .mobile-quick-actions a.quick-primary:hover { background: var(--terracotta-dark); }
  .mobile-quick-actions a span { font-size: 15px; line-height: 1; }
  .offline-banner { right: 12px; bottom: 71px; left: 12px; }
}
