:root {
  --stock-ink: #193b32;
  --stock-muted: #64796e;
  --stock-line: #dfe8e2;
  --stock-surface: #fff;
  --stock-shadow: 0 5px 22px #193b2d06;
  background: #f3f6f3;
  font-family: "Segoe UI", Arial, sans-serif;
}

.top { border-top: 4px solid #1b6654; }
.top-inner, .modules, main { max-width: 1516px; padding-inline: 26px; }
.top-inner { min-height: 103px; }
.brand img { width: 54px; height: 54px; object-fit: contain; box-shadow: var(--stock-shadow); }
.brand h1 { font-size: 1.75rem; line-height: 1.3; }
.brand small { display: block; margin-bottom: 2px; }
.modules { gap: 8px; padding-block: 21px 26px; }
.modules a { padding: 10px 17px; white-space: nowrap; font-size: .94rem; color: var(--stock-muted); }
.modules a[aria-current] { color: var(--stock-ink); box-shadow: var(--stock-shadow); }
.modules a span { font-size: .78em; padding-left: 2px; }
.stock-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 23px; }
.sidebar {
  position: sticky;
  top: 18px;
  min-width: 0;
  padding: 11px;
  gap: 5px;
  border-color: var(--stock-line);
  box-shadow: var(--stock-shadow);
}
.side-heading { padding: 10px 9px 5px; }
.side-heading .side-label, .sidebar .side-group { font-size: .69rem; color: var(--stock-muted); }
.sidebar button[data-stock-view] {
  width: 100%;
  min-height: 52px;
  padding: 11px 12px;
  font-size: .91rem;
  color: var(--stock-muted);
  line-height: 1.4;
}
.sidebar button[aria-pressed=true] { color: #155844; background: #e9f3ec; }
.sidebar button .side-icon { flex: 0 0 21px; text-align: center; font-size: 1.05rem; }
.sidebar button .side-label { min-width: 0; }
.sidebar .side-group { margin: 20px 12px 3px; }
.sidebar .side-count { padding: 2px 6px; }
.overview-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; margin-bottom: 26px; }
.overview-intro small { display: block; font-size: .78rem; color: var(--stock-muted); }
.overview-intro h2 { margin: 10px 0 9px; font-size: 2rem; line-height: 1.24; letter-spacing: -.035em; }
.overview-intro p { color: var(--stock-muted); }
.overview-intro button { min-height: 46px; padding-inline: 19px; }
.stock-stats { gap: 15px; margin: 0 0 24px; }
.stock-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 147px;
  padding: 19px;
  border-color: var(--stock-line);
  border-radius: 18px;
  font-size: .87rem;
  line-height: 1.4;
  box-shadow: var(--stock-shadow);
}
.stock-stat span, .stock-stat small { color: var(--stock-muted); }
.stock-stat b { margin: 7px 0 6px; color: var(--stock-ink); font-size: 2.15rem; font-weight: 800; letter-spacing: -.02em; }
.stock-stat[data-signal=duplicates] b, .stock-stat[data-signal=manufacturer] b { color: #996820; }
.stock-stat[data-signal=overdue] b { color: #ac3f42; }
.overview-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; margin: 0; }
.overview-grid > .card { padding: 25px; border-color: var(--stock-line); box-shadow: var(--stock-shadow); }
.overview-grid .section-heading { margin-bottom: 15px; }
.overview-grid .section-heading small { text-transform: uppercase; letter-spacing: .09em; font-weight: 700; }
.overview-row { padding: 15px 0; }
.overview-row b { min-width: 22px; font-size: 1rem; }
#stock-tasks .overview-row b { color: #996820; }
.overview-row strong { font-size: .92rem; }
.overview-row small { margin-top: 3px; color: var(--stock-muted); }
.overview-recent { grid-template-columns: minmax(52px, auto) minmax(0, 1fr) auto; }
.overview-grid .stock-links { gap: 0; }
:is(button, a, input, select, summary):focus-visible { outline: 3px solid #83baa5; outline-offset: 2px; }

.auto-heading { margin: 0 0 21px; }
.auto-heading h2 { font-size: 1.75rem; }
.auto-files { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.auto-files .auto-file { margin: 0; padding: 20px; }
.auto-file h3 { margin: 0 0 13px; font-size: 1.03rem; }
.auto-drop {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-height: 155px;
  margin: 0;
  padding: 14px;
  border: 1px dashed #b9cfc6;
  border-radius: 14px;
  background: #f7faf8;
  text-align: center;
  cursor: pointer;
}
.auto-drop:focus-within, .auto-drop[data-dragging=true] { outline: 2px solid #67a58d; outline-offset: 2px; }
.auto-drop input { margin: 0; width: 100%; background: var(--stock-surface); color: inherit; font-size: .85rem; }
.auto-drop small, #auto-catalog-status { font-size: .81rem; font-weight: 400; color: var(--stock-muted); overflow-wrap: anywhere; }
.auto-file > button { margin-top: 12px; }
#auto-catalog-status { margin: 10px 0 0; }
.auto-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 11px; margin: 18px 0; }
.auto-toolbar label { margin: 0; }
.auto-output { margin-block: 14px; }
.auto-output label { display: flex; align-items: center; gap: 8px; margin: 0; }
.auto-output input[type=checkbox] { display: inline; width: auto; margin: 0; accent-color: #176658; }
.auto-output table { min-width: 570px; }
.auto-output td { vertical-align: top; }
.auto-output small { display: block; }
.auto-output summary { cursor: pointer; }
.auto-output ul { padding-inline-start: 23px; }
.auto-output li { margin-block: 4px; }
#auto-confirm {
  width: min(440px, calc(100% - 30px));
  padding: 24px;
  border: 1px solid var(--stock-line);
  border-radius: 18px;
  background: var(--stock-surface);
  color: var(--stock-ink);
  box-shadow: 0 17px 55px #193b2d44;
}
#auto-confirm::backdrop { background: #092b206b; }
#auto-confirm .line { justify-content: flex-end; }

html[data-stock-theme=dark] { --stock-ink: #e6f0ea; --stock-muted: #bdd5c7; --stock-line: #456053; --stock-surface: #22372d; }
html[data-stock-theme=dark] .auto-drop { background: #253a30; border-color: #648a76; }
html[data-stock-theme=dark] .stock-stat[data-signal=overdue] b { color: #ff9a94; }
html[data-stock-theme=dark] :is(.stock-stat[data-signal=duplicates] b,.stock-stat[data-signal=manufacturer] b,#stock-tasks .overview-row b) { color: #efc581; }

@media (max-width: 1120px) {
  .overview-intro h2 { max-width: 19ch; }
  .stock-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .stock-layout { gap: 21px; }
}
@media (min-width: 761px) and (max-width: 1120px) {
  .modules { padding-block: 39px 48px; }
  .overview-intro { margin-bottom: 30px; }
  .stock-stat { min-height: 157px; }
}
@media (max-width: 920px) {
  .auto-files { grid-template-columns: minmax(0, 1fr); }
  .auto-drop { min-height: 110px; }
}
@media (max-width: 760px) {
  .top-inner, .modules, main { padding-inline: 14px; }
  .top-inner { min-height: 69px; }
  .brand img { width: 38px; height: 38px; }
  .brand h1 { font-size: 1.3rem; }
  .modules { flex-wrap: nowrap; overflow-x: auto; padding-block: 11px 15px; }
  .modules a { padding: 8px 10px; font-size: .82rem; }
  .stock-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .sidebar { position: static; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
  .side-heading { flex: 0 0 100%; padding: 0 4px; }
  .sidebar button[data-stock-view] { width: auto; min-height: 38px; font-size: .78rem; padding: 5px 9px; gap: 5px; }
  .sidebar .side-group { display: none; }
  .sidebar button .side-icon { flex-basis: 16px; font-size: .9rem; }
  .overview-intro { gap: 8px; margin-bottom: 17px; }
  .overview-intro h2 { font-size: 1.5rem; }
  .overview-intro small, .overview-intro p { font-size: .77rem; }
  .overview-intro button { min-height: 39px; font-size: .78rem; padding-inline: 9px; }
  .stock-stats { gap: 9px; margin-bottom: 15px; }
  .stock-stat { min-height: 108px; padding: 12px; }
  .stock-stat b { font-size: 1.75rem; }
  .overview-grid > .card { padding: 16px; }
  .auto-files .auto-file { padding: 15px; }
}
