
:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --line: #e2e5e9;
  --line-strong: #cfd4da;
  --text: #17191c;
  --muted: #69717c;
  --soft: #929aa5;
  --ink: #111214;
  --accent: #1e4f6b;
  --accent-soft: #edf4f7;
  --positive: #23724d;
  --positive-soft: #eef8f2;
  --warning: #9a6415;
  --warning-soft: #fff7e7;
  --danger: #a23b3b;
  --danger-soft: #fff0f0;
  --shadow: 0 12px 30px rgba(20, 28, 36, .07);
  --radius: 10px;
  --sidebar: 232px;
  --topbar: 64px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100%; color: var(--text); background: var(--bg); font-family: var(--font); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.btn, button, [role="button"], summary, .row-action-option {
  -webkit-user-select: none;
  user-select: none;
}
svg { display: block; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #121416; color: #eef0f2; display: flex; flex-direction: column; z-index: 50; }
.brand { height: var(--topbar); display: flex; align-items: center; gap: 11px; padding: 0 19px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-mark { width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.55); border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 12px; letter-spacing: -.03em; }
.brand-copy { min-width: 0; }
.brand-name { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.brand-sub { color: #969da5; font-size: 11px; margin-top: 1px; }
.nav { padding: 15px 10px; display: grid; gap: 4px; overflow-y: auto; }
.nav-label { padding: 14px 10px 6px; color: #707880; text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 39px; padding: 8px 10px; border-radius: 7px; color: #adb3b9; font-size: 13px; font-weight: 540; transition: .15s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-link.active { color: #fff; background: rgba(255,255,255,.105); }
.nav-icon { width: 18px; height: 18px; opacity: .95; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; font-size: 10px; background: #2b3035; color: #d9dde1; }
.sidebar-foot { margin-top: auto; padding: 11px; border-top: 1px solid rgba(255,255,255,.09); }
.user-tile { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #eceff1; color: #1e2226; font-size: 11px; font-weight: 700; }
.user-name { font-size: 12px; font-weight: 600; color: #f2f4f5; }
.user-meta { font-size: 10px; color: #8f979f; margin-top: 1px; }
.main { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { height: var(--topbar); position: sticky; top: 0; z-index: 35; display: flex; align-items: center; gap: 14px; padding: 0 24px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.menu-button { display: none; width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; align-items: center; justify-content: center; cursor: pointer; }
.top-search { flex: 1; max-width: 640px; position: relative; }
.top-search input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 13px 0 38px; background: #f8f9fa; outline: none; transition: .15s; }
.top-search input:focus { background: #fff; border-color: #aeb6bf; box-shadow: 0 0 0 3px rgba(30,79,107,.08); }
.top-search svg, .search-field svg { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; color: #6f7882; transform: translateY(-50%); pointer-events: none; }
.topbar-context { display: grid; gap: 2px; }
.topbar-context strong { font-size: 12px; }
.topbar-context span { color: var(--muted); font-size: 10px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 24px; max-width: 1580px; margin: 0 auto; }

/* Common */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-title { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 680; letter-spacing: -.035em; }
.page-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn { height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: #25292e; font-size: 12px; font-weight: 620; cursor: pointer; transition: .15s ease; white-space: nowrap; }
.btn:hover { border-color: #aeb5bd; background: #fafafa; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: #151719; border-color: #151719; color: #fff; }
.btn-primary:hover { background: #292c2f; border-color: #292c2f; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #173f56; border-color: #173f56; }
.btn-danger { color: var(--danger); border-color: #e4bcbc; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 32px; padding: 0 10px; border-radius: 7px; font-size: 11px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.icon { width: 16px; height: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-title { margin: 0; font-size: 13px; font-weight: 660; }
.card-meta { color: var(--muted); font-size: 11px; }
.card-body { padding: 16px; }
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { min-height: 112px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-icon { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: #4b535c; }
.stat-value { font-size: 27px; font-weight: 680; letter-spacing: -.04em; line-height: 1; }
.stat-note { color: var(--muted); font-size: 11px; margin-top: 7px; }
.valuation-card { min-width:0; display:grid; grid-template-columns:minmax(0,1fr) minmax(250px,auto); align-items:center; gap:28px; padding:18px 20px; overflow:hidden; background:linear-gradient(135deg,#fff 0%,#f7fafb 100%); }
.valuation-copy { min-width:0; }
.valuation-eyebrow { color:var(--muted); font-size:10px; font-weight:720; letter-spacing:.08em; text-transform:uppercase; }
.valuation-copy h2 { margin:5px 0 3px; font-size:17px; letter-spacing:-.025em; }
.valuation-copy p { margin:0; color:var(--muted); font-size:11px; }
.valuation-total { min-width:0; display:grid; justify-items:end; text-align:right; }
.valuation-total strong { max-width:100%; font-size:clamp(28px,3.2vw,42px); line-height:1; letter-spacing:-.045em; font-variant-numeric:tabular-nums; }
.valuation-total span { max-width:100%; margin-top:7px; color:#4e5862; font-size:11px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.valuation-total small { margin-top:3px; color:var(--muted); font-size:10px; }
.delta-up { color: var(--positive); }
.delta-down { color: var(--danger); }
.section-gap { margin-top: 14px; }
.muted { color: var(--muted); }
.micro { color: var(--muted); font-size: 11px; }
.divider { height: 1px; background: var(--line); }

/* Tags & status */
.tag { display: inline-flex; align-items: center; gap: 6px; min-height: 23px; padding: 2px 8px; border-radius: 5px; border: 1px solid #ccd7dd; color: #2d5266; background: #f3f7f9; font-size: 10px; font-weight: 660; white-space: nowrap; }
.tag-dot { width: 5px; height: 5px; border-radius: 50%; background: #58798b; }
.status { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-good { color: var(--positive); background: var(--positive-soft); }
.status-low { color: var(--warning); background: var(--warning-soft); }
.status-out { color: var(--danger); background: var(--danger-soft); }
.status-neutral { color: #59616a; background: #f0f2f4; }
.row-actions { position: relative; display: inline-block; }
.row-actions > summary { list-style: none; cursor: pointer; white-space: nowrap; }
.row-actions > summary::-webkit-details-marker { display: none; }
.row-actions-trigger { border-color: #bfc6cd; background: linear-gradient(#fff,#f8f9fa); box-shadow: 0 1px 2px rgba(20,28,36,.05); }
.row-actions-chevron, .control-chevron { width: 7px; height: 7px; margin: -3px 1px 0 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; color: #68717a; transform: rotate(45deg); transition: transform .16s ease; }
.row-actions[open] .row-actions-chevron, [aria-expanded="true"] .control-chevron, .column-settings[open] .control-chevron { margin-top: 3px; transform: rotate(225deg); }
.row-actions-menu { position: fixed; z-index: 110; top: 0; left: 0; visibility: hidden; width: 248px; max-height: calc(100vh - 24px); overflow: auto; padding: 7px; border: 1px solid rgba(190,198,206,.95); border-radius: 13px; background: rgba(255,255,255,.98); box-shadow: 0 22px 60px rgba(20,28,36,.2), 0 3px 10px rgba(20,28,36,.08); backdrop-filter: blur(14px); }
.row-actions-head { display: grid; gap: 1px; margin: -1px -1px 5px; padding: 10px 11px; border-radius: 8px; background: linear-gradient(135deg,#f7f9fa,#f0f4f6); }
.row-actions-head span { color: var(--muted); font-size: 9px; font-weight: 720; letter-spacing: .07em; text-transform: uppercase; }
.row-actions-head strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.row-action-option { width: 100%; min-height: 42px; padding: 8px 10px; display: grid; gap: 2px; border: 0; border-radius: 7px; background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.row-action-option:hover, .row-action-option:focus-visible { background: var(--surface-2); outline: none; }
.row-action-disabled { cursor: not-allowed; opacity: .55; }
.row-action-disabled:hover { background: transparent; }
.row-action-option span { font-size: 11px; font-weight: 650; }
.row-action-option small { color: var(--muted); font-size: 9px; line-height: 1.3; }
.row-action-divider { height: 1px; margin: 5px 4px; background: var(--line); }
.row-action-danger span { color: var(--danger); }
.action-in { color: var(--positive); }
.action-out { color: var(--danger); }
.action-transfer { color: var(--accent); }

/* Dashboard */
.project-scope { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.project-scope label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.project-scope select { border: 0; outline: 0; background: transparent; font-weight: 620; min-width: 170px; }
.action-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.action-card { min-height: 88px; padding: 14px; display: flex; align-items: center; gap: 13px; transition: .15s; }
.action-card:hover { border-color: #b8bec5; box-shadow: 0 7px 18px rgba(20,28,36,.05); transform: translateY(-1px); }
.action-card .action-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: #f1f3f4; }
.action-search-icon { position: relative; color: #56616c; }
.action-search-icon::before { content: ""; width: 11px; height: 11px; border: 1.8px solid currentColor; border-radius: 50%; box-sizing: border-box; transform: translate(-2px, -2px); }
.action-search-icon::after { content: ""; position: absolute; left: 21px; top: 22px; width: 7px; height: 1.8px; border-radius: 2px; background: currentColor; transform: rotate(45deg); transform-origin: left center; }
.action-copy { min-width: 0; display: grid; gap: 4px; }
.action-name { display: block; font-size: 13px; font-weight: 650; line-height: 1.25; }
.action-desc { display: block; color: var(--muted); font-size: 10px; line-height: 1.35; }
.split-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 14px; }
.activity-list { display: grid; }
.activity-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: 0; }
.activity-symbol { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #f2f4f5; }
.activity-title { font-size: 12px; font-weight: 610; }
.activity-sub { color: var(--muted); font-size: 10px; margin-top: 3px; }
.activity-qty { font-size: 12px; font-weight: 680; text-align: right; }
.project-bars { padding: 6px 16px 16px; display: grid; gap: 14px; }
.project-bar-head { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 6px; }
.bar { height: 6px; background: #eef0f2; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: #4c626f; border-radius: inherit; }

/* Explorer */
.explorer { overflow: visible; }
.explorer-toolbar { padding: 13px 14px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.search-field { flex: 1; min-width: 250px; position: relative; }
.search-field input { width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px 0 38px; outline: none; background: #fff; }
.search-field input:focus { border-color: #9fa8b2; box-shadow: 0 0 0 3px rgba(30,79,107,.07); }
.quick-filters { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.premium-control { border-color: var(--line); background: linear-gradient(#fff,#fafbfb); box-shadow: 0 1px 2px rgba(20,28,36,.04); }
.filter-control-icon { position: relative; width: 13px; height: 12px; background: linear-gradient(currentColor,currentColor) 0 2px/13px 1px no-repeat, linear-gradient(currentColor,currentColor) 0 6px/13px 1px no-repeat, linear-gradient(currentColor,currentColor) 0 10px/13px 1px no-repeat; color: #69737d; }
.filter-control-icon::before { content:""; position:absolute; left:3px; top:0; width:3px; height:3px; border:1px solid currentColor; border-radius:50%; background:#fff; box-shadow: 5px 4px 0 -1px #fff, 5px 4px 0 0 currentColor, 0 8px 0 -1px #fff, 0 8px 0 0 currentColor; }
.column-settings { position: relative; }
.column-settings > summary { list-style: none; }
.column-settings > summary::-webkit-details-marker { display:none; }
.column-settings-icon { width: 13px; height: 12px; border: 1px solid #69737d; border-radius: 2px; background: linear-gradient(90deg,transparent 31%,#69737d 31%,#69737d 38%,transparent 38%,transparent 64%,#69737d 64%,#69737d 71%,transparent 71%); }
.column-settings-popover { position: absolute; z-index: 85; top: calc(100% + 8px); right: 0; width: 360px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 13px; background: rgba(255,255,255,.98); box-shadow: 0 22px 55px rgba(20,28,36,.17); backdrop-filter: blur(14px); }
.popover-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.popover-section-head > div { display:grid; gap:2px; }
.popover-section-head strong { font-size: 13px; letter-spacing: -.01em; }
.popover-section-head span { color: var(--muted); font-size: 10px; }
.saved-setting-badge { padding: 3px 7px; border-radius: 99px; background: var(--positive-soft); color: var(--positive) !important; font-size: 9px !important; font-weight: 700; }
.column-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.column-setting-option { min-height: 34px; display:flex; align-items:center; gap:9px; padding: 6px 8px; border:1px solid transparent; border-radius:8px; font-size:11px; cursor:pointer; }
.column-setting-option:hover { border-color:var(--line); background:#f8fafb; }
.column-setting-option input { accent-color: var(--accent); }
.popover-actions { display:flex; justify-content:space-between; gap:8px; margin-top:13px; padding-top:12px; border-top:1px solid var(--line); }
.filter-live-status { min-width: 54px; align-self: center; color: var(--muted); font-size: 10px; }
.quick-filters #id_project { max-width: 190px; }
.quick-filters #id_sort { max-width: 210px; }


/* Inventory Explorer compact single-row filter composition */
.inventory-explorer-toolbar {
  flex-wrap: nowrap;
  gap: 10px;
}
.inventory-explorer-toolbar > .inventory-explorer-search {
  flex: 1 1 460px;
  min-width: 340px;
  max-width: none;
}
.inventory-explorer-toolbar > .inventory-explorer-filters {
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.inventory-explorer-filters #id_location { width: 150px; min-width: 140px; }
.inventory-explorer-filters #id_stock_status { width: 142px; min-width: 132px; }
.inventory-explorer-filters #id_date_preset { width: 136px; min-width: 128px; }
.inventory-explorer-filters #id_sort { width: 170px; min-width: 158px; max-width: 170px; }
.inventory-explorer-icon-control {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  border-color: var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}
.inventory-explorer-icon-control:hover { border-color: #b7c0c8; background: #fcfcfc; }
.inventory-explorer-icon-control:focus-visible { outline: none; border-color: #8c98a3; box-shadow: 0 0 0 3px rgba(30,79,107,.08); }
.inventory-explorer-icon-control .filter-control-icon { width: 15px; height: 14px; }
.inventory-explorer-icon-control .column-settings-icon { width: 15px; height: 14px; }
.inventory-explorer-filters .filter-live-status:empty { display: none; }
.condition-filter-menu { position: relative; flex: 0 0 auto; }
.condition-filter-menu > summary { list-style: none; }
.condition-filter-menu > summary::-webkit-details-marker { display: none; }
.condition-filter-trigger {
  width: 142px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #33383d;
  font-size: 11px;
  font-weight: 560;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.condition-filter-trigger:hover { border-color: #b7c0c8; background: #fcfcfc; }
.condition-filter-trigger:focus-visible {
  outline: none;
  border-color: #8c98a3;
  box-shadow: 0 0 0 3px rgba(30,79,107,.08);
}
.condition-filter-chevron {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-right: 1.5px solid #6f7882;
  border-bottom: 1.5px solid #6f7882;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .14s ease;
}
.condition-filter-menu[open] .condition-filter-chevron { transform: rotate(225deg) translate(-1px,-1px); }
.condition-filter-popover {
  position: absolute;
  z-index: 86;
  top: calc(100% + 7px);
  left: 0;
  width: 220px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255,255,255,.99);
  box-shadow: 0 18px 45px rgba(20,28,36,.16);
  backdrop-filter: blur(12px);
}
.condition-filter-head { display: grid; gap: 3px; margin-bottom: 10px; }
.condition-filter-head strong { font-size: 12px; }
.condition-filter-head span { color: var(--muted); font-size: 9px; line-height: 1.4; }
.condition-filter-options ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.condition-filter-options label {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 7px;
  border-radius: 7px;
  color: #343a40;
  font-size: 11px;
  cursor: pointer;
}
.condition-filter-options label:hover { background: #f5f7f8; }
.condition-filter-options input[type="checkbox"] { width: 15px; height: 15px; flex: 0 0 auto; accent-color: #17191c; }
.condition-filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1580px) {
  .inventory-explorer-toolbar { flex-wrap: wrap; }
  .inventory-explorer-toolbar > .inventory-explorer-search { flex: 1 1 420px; min-width: 320px; max-width: none; }
  .inventory-explorer-toolbar > .inventory-explorer-filters { flex: 1 1 760px; justify-content: flex-start; flex-wrap: wrap; }
}
.date-filter-control { position: relative; }
.date-range-popover { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; width: 360px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; box-shadow: 0 18px 46px rgba(30,34,38,.15); }
.date-range-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.date-range-head > div { display: grid; gap: 3px; }
.date-range-head strong { font-size: 12px; }
.date-range-head span { color: var(--muted); font-size: 10px; }
.popover-close { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.popover-close:hover { background: var(--surface-2); color: var(--text); }
.date-range-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.date-range-fields label { display: grid; gap: 6px; color: #4d555e; font-size: 10px; font-weight: 680; }
.date-range-fields .input { width: 100%; height: 38px; }
.date-range-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.filter-select { height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; padding: 0 30px 0 11px; color: #33383d; font-size: 11px; font-weight: 560; outline: 0; }
.view-tabs { display: flex; gap: 3px; background: #eff1f3; padding: 3px; border-radius: 8px; }
.view-tab { height: 32px; padding: 0 11px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-size: 11px; color: var(--muted); font-weight: 620; }
.view-tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(20,25,30,.08); }
.active-filters { min-height: 42px; padding: 8px 14px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; border-bottom: 1px solid var(--line); background: #fbfbfc; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 25px; padding: 0 8px; border: 1px solid #d9dde2; border-radius: 6px; background: #fff; font-size: 10px; }
.filter-chip button { border: 0; background: none; padding: 0; cursor: pointer; color: #7a828b; }
.result-meta { margin-left: auto; font-size: 10px; color: var(--muted); white-space: nowrap; }
.advanced-panel { border-bottom: 1px solid var(--line); background: #fafbfb; padding: 15px; }
.explorer form[data-filter-form] { position: relative; }
.filter-popover { position:absolute; z-index:75; top:66px; right:14px; width:min(820px,calc(100% - 28px)); max-height:min(650px,calc(100vh - 150px)); overflow:auto; border:1px solid var(--line-strong); border-radius:13px; background:rgba(255,255,255,.99); box-shadow:0 24px 65px rgba(20,28,36,.18); backdrop-filter:blur(14px); }
.filter-popover .advanced-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.filter-popover .popover-section-head { padding-bottom:12px; border-bottom:1px solid var(--line); }
.advanced-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.advanced-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; }
[data-filter-results] { overflow: hidden; border-radius: 0 0 var(--radius) var(--radius); transition: opacity .15s ease; }
[data-filter-results][aria-busy="true"] { opacity: .55; }
.filter-stack { display: grid; align-content: start; gap: 12px; }
.archive-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; padding:12px 14px; border-bottom:1px solid var(--line); background:#fbfcfc; }
.archive-tab { min-height:54px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--muted); font-size:11px; font-weight:650; transition:.15s ease; }
.archive-tab:hover { border-color:#b8c0c8; color:var(--text); }
.archive-tab.active { border-color:#9fabb5; color:var(--text); background:linear-gradient(135deg,#fff,#f1f5f7); box-shadow:0 3px 10px rgba(20,28,36,.06); }
.archive-tab strong { min-width:24px; height:24px; display:grid; place-items:center; border-radius:99px; background:#eef1f3; color:#3d454d; font-size:10px; }
.archive-search { min-height:64px; display:flex; align-items:center; gap:8px; padding:12px 14px; border-bottom:1px solid var(--line); }
.archive-search .search-field { max-width:620px; }
.archive-result-head { min-height:42px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 14px; border-bottom:1px solid var(--line); color:var(--muted); font-size:10px; }
.range-inputs { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 7px; }
.range-inputs > span { color: var(--muted); font-size: 10px; }
.range-inputs .input { min-width: 0; }
.column-options { align-self: start; }
.column-options > summary { width: fit-content; color: #394047; font-size: 11px; font-weight: 650; cursor: pointer; }
.column-options[open] > summary { margin-bottom: 8px; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 41px; padding: 0 12px; text-align: left; background: #fafafa; border-bottom: 1px solid var(--line); color: #68717a; font-size: 10px; text-transform: uppercase; letter-spacing: .045em; font-weight: 720; white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 11px; vertical-align: middle; white-space: nowrap; }
.description-column { width: var(--description-column-width, 360px); min-width: var(--description-column-width, 360px); max-width: var(--description-column-width, 360px); }
th.description-column { position: relative; padding-right: 19px; }
.description-cell { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-resize-handle { position: absolute; z-index: 2; top: 6px; right: 2px; bottom: 6px; width: 10px; cursor: col-resize; touch-action: none; }
.column-resize-handle::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; border-radius: 2px; background: #d7dde1; transition: background .12s, box-shadow .12s; }
.column-resize-handle:hover::after, .column-resize-handle:focus-visible::after, body.is-resizing-column .column-resize-handle::after { background: #71808b; box-shadow: 0 0 0 2px rgba(113,128,139,.12); }
body.is-resizing-column { cursor: col-resize; user-select: none; }
tbody tr { transition: .12s; }
tbody tr:hover { background: #fbfcfc; }
tbody tr:last-child td { border-bottom: 0; }
.cell-main { font-size: 12px; font-weight: 620; color: #202429; }
.cell-sub { margin-top: 3px; color: var(--muted); font-size: 10px; }
.qty { font-variant-numeric: tabular-nums; font-weight: 700; }
.price { font-variant-numeric: tabular-nums; }
.row-link { color: #1f4e68; font-weight: 620; }
.table-footer { min-height: 48px; padding: 9px 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pagination { display: flex; align-items: center; gap: 5px; }
.page-button { width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 10px; cursor: pointer; }
.page-button.active { background: #1b1d20; color: #fff; border-color: #1b1d20; }
.empty-state { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 42px; height: 42px; margin: 0 auto 12px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; }
.popover { position: absolute; z-index: 90; min-width: 240px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.column-menu { right: 0; top: 43px; }
.check-list { display: grid; gap: 2px; }
.check-row { min-height: 32px; display: flex; align-items: center; gap: 9px; padding: 4px 6px; border-radius: 6px; font-size: 11px; }
.check-row:hover { background: #f6f7f8; }
.relative { position: relative; }

/* Forms */
.form-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 14px; align-items: start; }
.form-card { padding: 18px; }
.form-section + .form-section { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.form-section-title { font-size: 12px; font-weight: 680; margin: 0 0 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); align-items: start; gap: 13px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { display: grid; align-content: start; gap: 6px; }
.field-control-row { display: flex; align-items: stretch; gap: 7px; }
.field-control-row > .input, .field-control-row > .select { min-width: 0; flex: 1 1 auto; }
.field-add { width: 40px; min-width: 40px; height: 40px; padding: 0; display: grid; place-items: center; font-size: 16px; }
.field-full { grid-column: 1 / -1; }
label.field-label { color: #4d555e; font-size: 10px; font-weight: 680; }
.required::after { content: ' *'; color: var(--danger); }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; outline: 0; color: #24282d; }
.input, .select { height: 40px; padding: 0 11px; }
.transfer-table .transfer-quantity { min-width: 88px; width: 100%; }
.transfer-table td { vertical-align: top; }
.transfer-row-error { background: #fff1f1; }
.textarea { min-height: 84px; padding: 10px 11px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: #939da7; box-shadow: 0 0 0 3px rgba(30,79,107,.07); }
.help { color: var(--muted); font-size: 9px; line-height: 1.4; }
.input-group { display: flex; }
.input-group .input { border-radius: 8px 0 0 8px; }
.input-addon { min-width: 48px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 8px 8px 0; background: #f5f6f7; color: var(--muted); font-size: 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.summary-card { position: sticky; top: 82px; }
.summary-list { display: grid; gap: 11px; }
.summary-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; font-size: 11px; }
.summary-key { color: var(--muted); }
.summary-value { text-align: right; font-weight: 620; }
.balance-preview { margin-top: 13px; padding: 13px; border-radius: 8px; background: #f5f7f8; }
.balance-line { display: flex; justify-content: space-between; align-items: center; min-height: 27px; font-size: 11px; }
.balance-line.total { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 8px; font-size: 13px; font-weight: 700; }
.match-panel { margin-top: 13px; padding: 13px; border: 1px solid #c6d8e0; border-radius: 9px; background: var(--accent-soft); }
.match-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.match-title { font-size: 11px; font-weight: 700; color: #234a5f; }
.match-data { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.match-data strong { display: block; font-size: 11px; }
.match-data span { display: block; color: #5d707c; font-size: 9px; margin-top: 2px; }
.alert { padding: 12px 13px; border-radius: 8px; font-size: 11px; }
.alert-warning { color: #6e4c14; background: var(--warning-soft); border: 1px solid #ecd29d; }
.alert-danger { color: #7e2d2d; background: var(--danger-soft); border: 1px solid #e9bcbc; }
.alert-success { color: #285f44; background: var(--positive-soft); border: 1px solid #bddcc9; }
.file-box { min-height: 78px; padding: 13px; border: 1px dashed #bcc3ca; border-radius: 8px; display: flex; align-items: center; gap: 12px; background: #fafafa; cursor: pointer; }

/* Detail */
.detail-hero { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; align-items: start; padding: 18px; }
.detail-title { margin: 9px 0 3px; font-size: 23px; font-weight: 690; letter-spacing: -.03em; }
.detail-desc { color: var(--muted); font-size: 12px; max-width: 720px; }
.hero-balance { min-width: 190px; padding-left: 24px; border-left: 1px solid var(--line); text-align: right; }
.hero-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.hero-value { margin-top: 4px; font-size: 29px; font-weight: 700; letter-spacing: -.04em; }
.detail-meta { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); border-top: 1px solid var(--line); }
.meta-cell { padding: 14px 16px; border-right: 1px solid var(--line); }
.meta-cell:last-child { border-right: 0; }
.meta-label { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.meta-value { margin-top: 5px; font-size: 11px; font-weight: 620; }
.detail-tabs { display: flex; align-items: center; gap: 18px; min-height: 47px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.detail-tab { height: 47px; display: flex; align-items: center; border-bottom: 2px solid transparent; color: var(--muted); font-size: 11px; font-weight: 620; }
.detail-tab.active { color: var(--text); border-bottom-color: #16181a; }

/* Projects */
.project-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.project-card { padding: 16px; transition: .15s; }
.project-card:hover { border-color: #b7bec6; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(20,28,36,.05); }
.project-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-name { font-size: 14px; font-weight: 670; margin-top: 10px; }
.project-client { color: var(--muted); font-size: 10px; margin-top: 4px; }
.project-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.project-stat strong { display: block; font-size: 13px; }
.project-stat span { color: var(--muted); font-size: 9px; }

/* Saved views */
.saved-list { display: grid; gap: 9px; }
.saved-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.saved-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #f2f4f5; }
.saved-title { font-size: 12px; font-weight: 650; }
.saved-filters { color: var(--muted); font-size: 10px; margin-top: 4px; }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.2fr) minmax(420px,.8fr); background: #f4f5f6; }
.login-showcase { padding: 54px; background: #151719; color: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.login-brand { display: flex; align-items: center; gap: 11px; }
.login-brand .brand-mark { width: 32px; height: 32px; }
.login-copy { max-width: 650px; }
.login-copy h1 { margin: 0; font-size: clamp(35px,4vw,58px); line-height: 1.02; letter-spacing: -.055em; font-weight: 650; }
.login-copy p { max-width: 530px; margin: 19px 0 0; color: #a9b0b6; font-size: 14px; }
.login-preview { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; max-width: 650px; }
.preview-cell { padding: 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: rgba(255,255,255,.035); }
.preview-value { font-size: 18px; font-weight: 650; }
.preview-label { margin-top: 5px; color: #8f979e; font-size: 10px; }
.login-panel { display: grid; place-items: center; padding: 42px; }
.login-box { width: min(380px,100%); }
.login-box h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.login-box > p { margin: 8px 0 24px; color: var(--muted); font-size: 12px; }
.login-box .field { margin-bottom: 13px; }
.login-box .btn { width: 100%; height: 42px; margin-top: 5px; }
.login-note { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }

/* Modal/toast */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(17,20,23,.52); display: grid; place-items: center; padding: 20px; }
.modal { width: min(560px,100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 12px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.2); }
.modal-head, .modal-foot { min-height: 55px; padding: 12px 17px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-head { border-bottom: 1px solid var(--line); }
.modal-foot { border-top: 1px solid var(--line); justify-content: flex-end; }
.modal-body { padding: 17px; }
.modal-title { font-size: 14px; font-weight: 680; }
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 130; display: grid; gap: 8px; }
.toast { min-width: 280px; max-width: 380px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .2s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.mobile-nav { display: none; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .advanced-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-meta { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .meta-cell:nth-child(3) { border-right: 0; }
  .meta-cell:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 920px) {
  :root { --sidebar: 228px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 15px 0 35px rgba(0,0,0,.18); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open::after { content:''; position: fixed; inset: 0; z-index: 45; background: rgba(17,19,21,.42); }
  .main { margin-left: 0; }
  .menu-button { display: inline-flex; }
  .content { padding: 18px; }
  .split-main, .form-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .action-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .advanced-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .top-search { max-width: none; }
}
@media (max-width: 680px) {
  body { padding-bottom: 62px; }
  .topbar { height: 57px; padding: 0 12px; }
  .content { padding: 13px; }
  .valuation-card { grid-template-columns:1fr; gap:16px; }
  .valuation-total { justify-items:start; text-align:left; }
  .page-head { display: block; }
  .page-title { font-size: 21px; }
  .head-actions { justify-content: flex-start; margin-top: 13px; }
  .grid-4, .grid-3, .grid-2, .project-grid, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .action-strip { grid-template-columns: 1fr 1fr; }
  .action-card { min-height: 78px; padding: 11px; }
  .action-desc { display: none; }
  .split-main { display: block; }
  .split-main > * + * { margin-top: 13px; }
  .top-search { display: none; }
  .top-actions .btn span { display: none; }
  .top-actions .btn { width: 36px; padding: 0; }
  .explorer-toolbar { align-items: stretch; }
  .search-field { min-width: 100%; }
  .quick-filters { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .archive-tabs { grid-template-columns:1fr 1fr; }
  .archive-search { align-items:stretch; flex-wrap:wrap; }
  .archive-search .search-field { max-width:none; min-width:100%; }
  .column-settings-popover { position: fixed; left: 12px; right: 12px; top: auto; bottom: 74px; width: auto; max-height: calc(100vh - 98px); overflow:auto; }
  .filter-popover { position:fixed; z-index:90; left:12px; right:12px; top:72px; width:auto; max-height:calc(100vh - 88px); }
  .filter-select { width: 100%; }
  .view-tabs { width: 100%; }
  .view-tab { flex: 1; }
  .advanced-grid { grid-template-columns: 1fr; }
  .advanced-footer { display: block; }
  .advanced-footer .head-actions { margin-top: 10px; }
  .table-footer { align-items: flex-start; flex-direction: column; }
  .detail-hero { grid-template-columns: 1fr; }
  .hero-balance { padding: 13px 0 0; border-left: 0; border-top: 1px solid var(--line); text-align: left; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
  .meta-cell { border-top: 1px solid var(--line); }
  .meta-cell:nth-child(-n+2) { border-top: 0; }
  .meta-cell:nth-child(2n) { border-right: 0; }
  .match-data { grid-template-columns: 1fr 1fr; }
  .login-page { display: block; min-height: 100vh; }
  .login-showcase { display: none; }
  .login-panel { min-height: 100vh; padding: 24px; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 62px; padding: 5px 8px 7px; display: grid; grid-template-columns: repeat(5,1fr); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
  .mobile-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #707880; font-size: 8px; font-weight: 620; }
  .mobile-link.active { color: #16181a; }
  .mobile-link svg { width: 17px; height: 17px; }
}

/* Django foundation refinements */
.login-box-mark { margin-bottom: 22px; background: #17191c; color: #fff; border-color: #17191c; }
.btn-block { width: 100%; justify-content: center; }
.field-error { color: var(--danger); font-size: 10px; }
.message-stack { display: grid; gap: 8px; margin-bottom: 14px; }
.nav-glyph { width: 20px; text-align: center; font-size: 15px; line-height: 1; }
.user-tile { grid-template-columns: 34px minmax(0,1fr) auto; }
.user-tile-copy { min-width: 0; }
.text-button { border: 0; background: transparent; padding: 4px; color: var(--muted); font-size: 10px; cursor: pointer; }
.text-button:hover { color: var(--text); }
.menu-button { font-size: 17px; }
.top-search > span,
.search-glyph { position: absolute; left: 13px; top: 50%; z-index: 1; width: 16px; height: 16px; color: #6f7882; font-size: 0; line-height: 0; transform: translateY(-50%); pointer-events: none; }
.top-search > span::before,
.search-glyph::before { content: ""; position: absolute; left: 1px; top: 1px; width: 9px; height: 9px; border: 1.7px solid currentColor; border-radius: 50%; box-sizing: border-box; }
.top-search > span::after,
.search-glyph::after { content: ""; position: absolute; left: 9px; top: 10px; width: 6px; height: 1.7px; border-radius: 2px; background: currentColor; transform: rotate(45deg); transform-origin: left center; }
.empty-state h2 { margin: 0 0 7px; color: var(--text); font-size: 16px; }
.empty-state p { max-width: 560px; margin: 7px auto 16px; line-height: 1.6; }
.check-list-status { display: grid; gap: 10px; font-size: 11px; color: #3f474f; }
@media (max-width: 760px) { .login-showcase { display: none; } .login-panel { min-height: 100vh; } }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--page); }
.error-card { width: min(440px, 100%); padding: 36px; text-align: center; }
.error-card .brand-mark { margin: 0 auto 20px; }
.error-code { color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .12em; }
.error-card h1 { margin: 8px 0; font-size: 24px; }
.error-card p { margin: 0 0 20px; color: var(--muted); line-height: 1.6; }

/* Project, stock-record and transaction workspace */
.narrow-form { width: min(720px, 100%); }
.management-search { margin-bottom: 14px; }
.import-format-guide { overflow: hidden; }
.import-format-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.import-format-summary > div { display: grid; gap: 4px; padding: 14px 16px; background: #f8f9fa; }
.import-format-summary strong { font-size: 12px; }
.import-format-summary span { color: var(--muted); font-size: 10px; }
.format-table code { display: inline-block; padding: 3px 6px; border-radius: 5px; background: #f1f3f4; color: #34404b; font: 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.import-rule-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px 18px; padding: 15px 16px; border-top: 1px solid var(--line); color: #46505a; font-size: 11px; }
.import-rule-list > div { display: grid; grid-template-columns: 16px minmax(0,1fr); gap: 6px; line-height: 1.45; }
.import-rule-list > div > span:first-child { color: var(--positive); font-weight: 700; }
@media (max-width: 760px) {
  .import-format-summary, .import-rule-list { grid-template-columns: 1fr; }
}
.field input[type="checkbox"] { width: 17px; height: 17px; accent-color: #17191c; }
.field:has(input[type="checkbox"]) { align-content: start; }
.errorlist { margin: 0; padding: 0; list-style: none; color: var(--danger); font-size: 10px; }
.form-card > .alert:first-child { margin-bottom: 16px; }
.project-bars .tag { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.table-wrap .empty-state { min-width: 520px; }
.btn[aria-disabled="true"] { pointer-events: none; opacity: .55; }
@media (max-width: 680px) {
  .project-scope { width: 100%; margin-top: 13px; }
  .project-scope select { min-width: 0; width: 100%; }
  .table-wrap { margin-bottom: 0; }
  .narrow-form { width: 100%; }
}

/* Upgrade 3: safe stock movements */
.compact-stat { padding: 14px 16px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 12px; align-items: center; }
.compact-stat span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.compact-stat strong { grid-row: 1 / 3; grid-column: 2; font-size: 24px; }
.compact-stat small { color: var(--muted); font-size: 10px; }
.text-positive { color: var(--positive); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.summary-heading { margin: 12px 0; font-size: 17px; letter-spacing: -.02em; }
.code-value { max-width: 240px; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.checkbox { width: 17px; height: 17px; accent-color: #17191c; }
input[type="file"].input { height: auto; min-height: 40px; padding: 8px 10px; }
.explorer-toolbar .input,
.explorer-toolbar .select { width: auto; min-width: 135px; height: 38px; font-size: 11px; }
.explorer-toolbar .search-field .input { width: 100%; min-width: 100%; }
.movement-direction { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #f1f3f4; font-weight: 750; }
[data-submit-once][disabled] { opacity: .65; cursor: wait; }
#liveMatchPanel:empty { display: none; }
#liveMatchPanel .match-panel { margin-bottom: 15px; }
@media (max-width: 680px) {
  .compact-stat { grid-template-columns: minmax(0,1fr) auto; }
  .explorer-toolbar .input,
  .explorer-toolbar .select { width: 100%; }
  .quick-filters > * { min-width: 0; }
  .quick-filters #id_project,
  .quick-filters #id_sort { max-width: none; }
  .inventory-explorer-toolbar > .inventory-explorer-search { flex: 1 1 100%; min-width: 100%; max-width: none; }
  .inventory-explorer-filters #id_location,
  .inventory-explorer-filters #id_stock_status,
  .inventory-explorer-filters #id_date_preset,
  .inventory-explorer-filters #id_sort { width: 100%; min-width: 0; max-width: none; }
  .condition-filter-menu, .condition-filter-trigger { width: 100%; }
  .condition-filter-popover { position: fixed; left: 12px; right: 12px; top: auto; bottom: 76px; width: auto; }
  .date-range-popover { position: fixed; left: 12px; right: 12px; top: auto; bottom: 76px; width: auto; }
  .topbar-context span { display: none; }
}

/* Upgrade 4: complete storekeeper workspace */
.picker-state { min-height: 17px; margin-top: 6px; color: var(--muted); font-size: 10px; }
select:disabled, input:disabled, textarea:disabled { background: #f3f4f5; color: #69717a; cursor: not-allowed; }
.record-lifecycle { display: grid; gap: 10px; align-items: start; }
.record-lifecycle form { margin: 0; }
.micro-heading { margin: 0; color: var(--text); font-size: 11px; font-weight: 700; }
.activity-row .tag { flex: none; }
.alert + .page-head { margin-top: 14px; }
@media (max-width: 680px) {
  .record-lifecycle .btn { width: 100%; justify-content: center; }
}

/* Upgrade 5: advanced search, date filters and saved views */
.is-hidden { display: none !important; }
.filter-error { margin: 0; border-width: 0 0 1px; border-radius: 0; }
.field-span-2 { grid-column: span 2; }
.check-list { max-height: 170px; overflow: auto; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.check-list ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.check-list.columns ul { grid-template-columns: repeat(3,minmax(0,1fr)); }
.check-list label { display: flex; align-items: center; gap: 7px; color: #394047; font-size: 10px; line-height: 1.3; cursor: pointer; }
.check-list input[type="checkbox"] { width: 15px; height: 15px; flex: none; accent-color: #17191c; }
.filter-chip { text-decoration: none; color: var(--text); }
.filter-chip:hover { border-color: #aeb4bc; background: #f7f8f9; }
.filter-chip-muted { color: var(--muted); }
.save-view-control { position: relative; }
.save-view-control > summary { list-style: none; cursor: pointer; }
.save-view-control > summary::-webkit-details-marker { display: none; }
.save-view-popover { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(340px, calc(100vw - 32px)); padding: 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; box-shadow: 0 18px 46px rgba(30,34,38,.15); }
.save-view-popover .input { width: 100%; margin-bottom: 8px; }
.save-view-popover .head-actions { margin-top: 12px; justify-content: space-between; }
.saved-view-groups { display: grid; gap: 14px; }
.saved-view-section { overflow: visible; }
.saved-view-list { display: grid; }
.saved-view-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 11px 14px; border-top: 1px solid var(--line); }
.saved-view-row:first-child { border-top: 0; }
.saved-view-main { min-width: 0; flex: 1; display: grid; gap: 4px; color: var(--text); text-decoration: none; }
.saved-view-main:hover strong { text-decoration: underline; }
.saved-view-actions { position: relative; }
.saved-view-actions > summary { list-style: none; cursor: pointer; }
.saved-view-actions > summary::-webkit-details-marker { display: none; }
.saved-view-menu { position: absolute; right: 0; top: calc(100% + 7px); z-index: 20; width: 280px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; box-shadow: 0 14px 38px rgba(30,34,38,.14); }
.saved-view-menu form { display: grid; gap: 8px; }
.saved-view-menu form + form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.empty-compact { padding: 22px 14px; color: var(--muted); font-size: 11px; }
.empty-compact p { margin: 0 0 10px; }
.history-filter { border-top: 1px solid var(--line); }
.history-filter-row { display: flex; align-items: center; gap: 8px; padding: 11px 14px; }
.history-filter-row .search-field { flex: 1; min-width: 200px; }
.history-filter-row .select { width: auto; min-width: 135px; }
.history-advanced { border-top: 1px solid var(--line); }
.history-chips { border-top: 1px solid var(--line); }
.compact-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.errorlist { margin: 5px 0 0; padding: 0; list-style: none; color: var(--danger); font-size: 10px; }
@media (max-width: 920px) {
  .check-list.columns ul { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .compact-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .field-span-2 { grid-column: auto; }
  .check-list.columns ul { grid-template-columns: 1fr 1fr; }
  .save-view-control, .save-view-control > summary { width: 100%; }
  .save-view-control > summary { justify-content: center; }
  .save-view-popover { position: fixed; left: 12px; right: 12px; top: auto; bottom: 76px; width: auto; }
  .saved-view-row { align-items: flex-start; }
  .saved-view-menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: 76px; width: auto; }
  .history-filter-row { display: grid; grid-template-columns: 1fr 1fr; }
  .history-filter-row .search-field { grid-column: 1 / -1; min-width: 0; }
  .history-filter-row .select, .history-filter-row .btn { width: 100%; }
  .compact-grid { grid-template-columns: 1fr; }
}

/* Upgrade 6: exact exports and administrator import previews */
.export-menu { position: relative; }
.export-menu > summary { list-style: none; cursor: pointer; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-popover { position: absolute; right: 0; top: calc(100% + 8px); z-index: 35; width: 300px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; box-shadow: 0 18px 46px rgba(30,34,38,.15); }
.export-popover-title { margin-bottom: 3px; font-size: 11px; font-weight: 700; }
.export-option { display: grid; gap: 2px; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; }
.export-option:hover { border-color: #aeb4bc; background: #f7f8f9; }
.export-option span { font-size: 11px; font-weight: 700; }
.export-option small { color: var(--muted); font-size: 9px; }
.import-summary { grid-template-columns: repeat(5,minmax(0,1fr)); }
.import-confirm-card { overflow: visible; }
.confirm-grid { display: grid; gap: 12px; }
.import-confirm-card .card-body { padding: 16px; }
@media (max-width: 920px) {
  .import-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .export-menu, .export-menu > summary { width: 100%; }
  .export-menu > summary { justify-content: center; }
  .export-popover { position: fixed; left: 12px; right: 12px; top: auto; bottom: 76px; width: auto; }
  .import-summary { grid-template-columns: 1fr; }
}
.delete-confirm-grid { align-items: start; }
.effect-list { display: grid; gap: .7rem; margin: .8rem 0 0; padding-left: 1.25rem; color: var(--text); }
.effect-list li::marker { color: var(--muted); }
.confirm-check { display: flex; align-items: flex-start; gap: .65rem; line-height: 1.45; cursor: pointer; }
.confirm-check input { margin-top: .2rem; }
.trash-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.trash-toolbar .archive-search { flex: 1; max-width: 48rem; }
@media (max-width: 760px) { .trash-toolbar { align-items: stretch; flex-direction: column; } }

/* SESCCO MS brand image utility for authentication/error surfaces. */
.brand-mark--image { overflow: hidden; background: #fff; border-color: var(--line, #dfe2e5); }
.brand-mark--image img { width: 100%; height: 100%; display: block; object-fit: contain; }

/* 1.0.101 Sourcing access-control landing shell. */
.sourcing-access-head { margin-bottom: 18px; }
.sourcing-access-head .eyebrow, .sourcing-access-card .eyebrow { display:block; margin-bottom:5px; color:var(--muted, #667085); font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.sourcing-access-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:14px; }
.sourcing-access-card { display:grid; gap:12px; align-content:start; min-height:190px; padding:18px; }
.sourcing-access-card h2 { margin:0; font-size:18px; }
.sourcing-access-card p { margin:0; color:var(--muted, #667085); line-height:1.55; }
.sourcing-access-card small { color:var(--muted, #667085); line-height:1.45; }
.sourcing-access-card .status-pill { justify-self:start; }
.sourcing-access-card .status-pill, .sourcing-access-chip { display:inline-flex; align-items:center; min-height:24px; padding:3px 8px; border:1px solid var(--line); border-radius:999px; background:var(--surface-2, #f7f8f6); color:var(--text); font-size:10px; font-weight:680; }
.sourcing-nav-preview { cursor:default; opacity:.76; }
.sourcing-nav-preview small { margin-left:auto; color:var(--muted); font-size:9px; font-weight:650; }
