:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #d9deea;
  --text: #172033;
  --muted: #667085;
  --accent: #2563eb;
  --accent2: #16a34a;
  --danger: #dc2626;
  --soft: #eef4ff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(8px); box-shadow: 0 4px 18px rgba(16,24,40,.06); }
.brand { font-weight: 800; text-decoration: none; font-size: 20px; color: #111827; }
nav { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); }
nav a { text-decoration: none; }
nav a:hover { color: var(--accent); }
.container { max-width: 1440px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.page-head.compact { align-items: center; margin-bottom: 12px; }
h1, h2 { margin: 0 0 10px; color: #111827; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
.muted { color: var(--muted); margin: 4px 0 0; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 2fr 1fr; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 18px; box-shadow: 0 10px 26px rgba(16,24,40,.06); }
.login-card { max-width: 420px; margin: 10vh auto; }
.messages { display: grid; gap: 8px; margin-bottom: 16px; }
.msg { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); white-space: pre-wrap; }
.msg.ok { border-color: rgba(22, 163, 74, .35); background: #ecfdf3; color: #14532d; }
.msg.error { border-color: rgba(220, 38, 38, .35); background: #fff1f2; color: #7f1d1d; }
.badge { background: var(--soft); color: #1d4ed8; border: 1px solid #bfdbfe; border-radius: 999px; padding: 8px 12px; font-weight: 700; }
.big-number { font-size: 58px; font-weight: 900; line-height: 1; margin: 10px 0; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 9px; text-align: left; vertical-align: middle; }
th { color: #475467; font-weight: 700; font-size: 13px; background: #f8fafc; }
tr:hover td { background: #f8fbff; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.nowrap { white-space: nowrap; }
pre { margin: 0; max-width: 520px; white-space: pre-wrap; word-break: break-word; font-size: 12px; color: #475467; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px; }
form { margin: 0; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #ffffff; color: var(--text); padding: 10px 11px; outline: none; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
input.amount { width: 110px; font-size: 16px; font-weight: 700; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 11px; background: var(--accent); color: white; padding: 10px 14px; font-weight: 750; text-decoration: none; cursor: pointer; }
button:hover, .btn:hover { filter: brightness(1.05); }
button.secondary, .btn.secondary { background: #e5e7eb; color: #111827; }
button.small, .btn.small { padding: 7px 10px; border-radius: 9px; font-size: 12px; }
button.danger, .btn.danger { background: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid button { grid-column: 1 / -1; }
.inline-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.inline-form label { min-width: 340px; }
.stack { display: grid; gap: 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.disabled-row { opacity: .45; }
.danger-zone { border-color: rgba(220,38,38,.35); background: #fffafa; }
.check { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; margin-bottom: 12px; }
.check input { width: auto; }
code { color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe; padding: 1px 5px; border-radius: 6px; }
.badge.soft { background: #f8fafc; color: var(--muted); border-color: var(--line); }
.metrics-row { display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.warehouse-note { margin-top: 12px; }
.filters-grid { display: grid; grid-template-columns: minmax(240px, 1.3fr) repeat(4, minmax(150px, .8fr)) auto; gap: 12px; align-items: end; }
.cards-actions { margin-top: 14px; }
.cards-actions form { display: inline-flex; }
.cards-summary { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tag { display: inline-flex; align-items: center; border: 1px solid #dbe4f0; background: #f8fafc; color: #344054; border-radius: 999px; padding: 6px 10px; font-size: 13px; }
.excel-card { padding: 0; overflow: hidden; }
.excel-scroll { overflow: auto; max-height: calc(100vh - 250px); }
.excel-table { border-collapse: separate; border-spacing: 0; min-width: 1600px; font-size: 13px; }
.excel-table th { position: sticky; top: 0; z-index: 2; background: #eaf1ff; color: #1f2937; border-bottom: 1px solid #cbd5e1; border-right: 1px solid #cbd5e1; white-space: nowrap; }
.excel-table td { border-right: 1px solid var(--line); vertical-align: top; background: #ffffff; }
.excel-table tbody tr:nth-child(even) td { background: #f8fafc; }
.excel-table tbody tr:hover td { background: #eff6ff; }
.excel-table .idx { width: 54px; text-align: right; color: var(--muted); }
.excel-table .narrow { min-width: 95px; max-width: 120px; }
.excel-table .mid { min-width: 135px; max-width: 180px; }
.excel-table .wide { min-width: 180px; max-width: 280px; }
.excel-table .wrap { min-width: 260px; max-width: 420px; white-space: pre-wrap; }
.excel-table .desc { min-width: 320px; max-width: 520px; white-space: pre-wrap; }
.excel-table .smallwrap { min-width: 180px; max-width: 360px; white-space: pre-wrap; }
.excel-table .media { min-width: 120px; max-width: 220px; }
.excel-table .stock { min-width: 170px; font-weight: 800; }
.right { text-align: right; }
.photos { display: flex; gap: 4px; flex-wrap: wrap; }
.photos img { width: 42px; height: 56px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); background: #f8fafc; }
.job-card { display: grid; gap: 10px; align-content: start; }
.job-card form { margin-top: 4px; }
.nd { color: #98a2b3; font-weight: 700; }
@media (max-width: 1200px) {
  .filters-grid { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .grid.two { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .page-head { flex-direction: column; }
  table { display: block; overflow-x: auto; }
}
@media (max-width: 700px) {
  .filters-grid { grid-template-columns: 1fr; }
}

/* Selected warehouse stock page */
.stock-filter-form { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr) minmax(220px, .8fr) auto auto; gap: 12px; align-items: end; }
.stock-group { overflow: hidden; }
.stock-group-head { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.stock-group-img { width: 72px; height: 96px; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.stock-group-title { font-size: 18px; font-weight: 850; margin-bottom: 5px; overflow-wrap: anywhere; }
.stock-group-meta { color: var(--muted); font-size: 13px; }
.stock-group-total { min-width: 96px; padding: 10px 14px; border-radius: 12px; background: #ecfdf3; border: 1px solid #bbf7d0; color: #14532d; font-size: 24px; font-weight: 900; text-align: center; }
.stock-article-block { margin-top: 12px; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; background: #fff; }
.stock-article-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid #e5e7eb; }

.stock-article-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.stock-article-media { flex: 0 0 auto; }
.stock-article-img { width: 44px; height: 58px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.stock-article-title { min-width: 0; }
.stock-table { min-width: 1180px; }
.stock-table th { white-space: nowrap; }
.stock-table td { vertical-align: middle; }
.photo-cell { width: 62px; }
.stock-thumb { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #f8fafc; display: block; }
.stock-title { min-width: 220px; max-width: 520px; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .stock-filter-form { grid-template-columns: 1fr 1fr; }
  .stock-filter-form button, .stock-filter-form .btn { width: 100%; }
}
@media (max-width: 700px) {
  .stock-filter-form { grid-template-columns: 1fr; }
  .stock-group-head { grid-template-columns: 56px 1fr; }
  .stock-group-total { grid-column: 1 / -1; }
  .stock-group-img { width: 56px; height: 74px; }
}

/* Stock page: collapsed groups and article controls */
details.stock-group { padding: 0; }
details.stock-group > summary.stock-group-head { list-style: none; cursor: pointer; padding: 14px 18px; margin: 0; border-bottom: 0; user-select: none; }
details.stock-group > summary.stock-group-head::-webkit-details-marker { display: none; }
details.stock-group > summary.stock-group-head::before { content: "▶"; font-size: 14px; color: var(--muted); align-self: center; }
details.stock-group[open] > summary.stock-group-head { border-bottom: 1px solid var(--line); margin-bottom: 0; }
details.stock-group[open] > summary.stock-group-head::before { content: "▼"; }
.stock-group-body { padding: 12px 18px 18px; }
details.stock-article-block { display: block; }
details.stock-article-block > summary.stock-article-head { list-style: none; cursor: pointer; user-select: none; }
details.stock-article-block > summary.stock-article-head::-webkit-details-marker { display: none; }
details.stock-article-block > summary.stock-article-head::before { content: "▶"; color: var(--muted); margin-right: 8px; }
details.stock-article-block[open] > summary.stock-article-head::before { content: "▼"; }
details.stock-article-block > table { border-top: 1px solid #e5e7eb; }
.stock-table { min-width: 1120px; }
@media (max-width: 1100px) {
}
@media (max-width: 700px) {
  details.stock-group > summary.stock-group-head { grid-template-columns: 18px 56px 1fr; }
}
details.stock-group > summary.stock-group-head { grid-template-columns: 18px 72px minmax(0, 1fr) auto; }
@media (max-width: 700px) {
  details.stock-group > summary.stock-group-head { grid-template-columns: 18px 56px minmax(0, 1fr); }
  details.stock-group > summary.stock-group-head .stock-group-total { grid-column: 1 / -1; }
}

/* Stock page: article image restored and article-level bulk fill */
.stock-article-head { flex-wrap: wrap; }
.stock-article-left { flex: 1 1 360px; }
.article-stock-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}
.article-stock-value {
  width: 82px;
  min-width: 82px;
  max-width: 82px;
  height: 36px;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}
.article-stock-value.invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}
.stock-article-card-head { grid-template-columns: 18px 72px minmax(0, 1fr) auto auto !important; }
.stock-article-card-head .article-stock-actions { justify-self: end; }
@media (max-width: 900px) {
  .article-stock-actions { width: auto; margin-left: 0; justify-content: flex-start; }
  .stock-article-card-head { grid-template-columns: 18px 56px minmax(0, 1fr) !important; }
  .stock-article-card-head .article-stock-actions,
  .stock-article-card-head .stock-group-total { grid-column: 1 / -1; justify-self: stretch; }
}

/* Stock update confirmation modal */
.stock-confirm-modal[hidden] { display: none !important; }
.stock-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.stock-confirm-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .42); }
.stock-confirm-dialog {
  position: relative;
  z-index: 1;
  width: min(1520px, calc(100vw - 56px));
  max-height: min(880px, calc(100vh - 56px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stock-confirm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.stock-confirm-head h2 { margin: 0 0 4px; }
.icon-button { width: 36px; height: 36px; border-radius: 10px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; line-height: 1; background: #fff; color: #334155; border: 1px solid var(--line); }
.stock-confirm-warning {
  margin: 14px 22px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-weight: 750;
}
.stock-confirm-table-wrap {
  margin: 14px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: auto;
  flex: 1 1 auto;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16,24,40,.05);
}
.stock-confirm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1040px;
  font-size: 16px;
}
.stock-confirm-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475467;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 850;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}
.stock-confirm-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  background: #fff;
}
.stock-confirm-table tbody tr:hover td { background: #f8fbff; }
.stock-confirm-table tbody tr:last-child td { border-bottom: 0; }
.stock-confirm-article, .stock-confirm-chrt, .stock-confirm-barcode { white-space: nowrap; font-weight: 750; }
.stock-confirm-title-cell { min-width: 340px; max-width: 620px; white-space: normal; overflow-wrap: anywhere; font-weight: 650; }
.stock-confirm-size { white-space: nowrap; font-weight: 800; }
.stock-confirm-old-value, .stock-confirm-new-value {
  min-width: 86px;
  text-align: center !important;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 900;
  border-radius: 12px;
}
.stock-confirm-old-value { color: #475467; }
.stock-confirm-arrow-head { width: 42px; }
.stock-confirm-arrow {
  width: 42px;
  padding-left: 4px !important;
  padding-right: 4px !important;
  text-align: center !important;
  color: var(--accent);
  font-size: 24px;
  font-weight: 950;
}
.stock-confirm-new-value { color: #14532d; background: #ecfdf3 !important; }
.stock-confirm-new-value-danger {
  color: #991b1b !important;
  background: #fee2e2 !important;
}
.stock-confirm-table tbody tr:hover td.stock-confirm-new-value-danger {
  background: #fecaca !important;
}
.stock-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: #f8fafc; }
@media (max-width: 700px) {
  .stock-confirm-modal { padding: 10px; align-items: stretch; }
  .stock-confirm-dialog { width: 100%; max-height: calc(100vh - 20px); }
  .stock-confirm-table { font-size: 14px; }
  .stock-confirm-table th, .stock-confirm-table td { padding: 10px 12px; }
  .stock-confirm-actions { flex-direction: column-reverse; }
  .stock-confirm-actions button { width: 100%; }
}

/* Stock update confirmation modal: grouped readable view with article images */
.stock-confirm-groups {
  display: grid;
  gap: 14px;
  padding: 14px;
}
.stock-confirm-bundle {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}
.stock-confirm-bundle > summary.stock-confirm-bundle-head {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.stock-confirm-bundle > summary.stock-confirm-bundle-head::-webkit-details-marker { display: none; }
.stock-confirm-bundle > summary.stock-confirm-bundle-head::before {
  content: "▼";
  color: var(--muted);
  margin-right: 8px;
}
.stock-confirm-bundle:not([open]) > summary.stock-confirm-bundle-head::before { content: "▶"; }
.stock-confirm-bundle-head {
  grid-template-columns: 18px minmax(0, 1fr) auto !important;
}
.stock-confirm-bundle-title {
  font-size: 18px;
  font-weight: 900;
  color: #111827;
  overflow-wrap: anywhere;
}
.stock-confirm-bundle-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.stock-confirm-bundle-count {
  min-width: 54px;
  padding: 8px 12px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  text-align: center;
  font-weight: 900;
}
.stock-confirm-bundle-body {
  display: grid;
  gap: 14px;
  padding: 14px;
}
.stock-confirm-article-block {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
}
.stock-confirm-article-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #fbfcff;
  border-bottom: 1px solid #e5e7eb;
}
.stock-confirm-article-media { flex: 0 0 auto; }
.stock-confirm-article-img {
  width: 54px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
}
.stock-confirm-article-main { min-width: 0; }
.stock-confirm-article-title {
  color: #111827;
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.stock-confirm-article-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.stock-confirm-article-block .stock-confirm-table {
  min-width: 1040px;
  border-collapse: collapse;
}
.stock-confirm-article-block .stock-confirm-table th,
.stock-confirm-article-block .stock-confirm-table td {
  border-bottom: 1px solid var(--line);
}
.stock-confirm-article-block .stock-confirm-table tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 700px) {
  .stock-confirm-groups { padding: 10px; }
  .stock-confirm-bundle-body { padding: 10px; }
  .stock-confirm-article-img { width: 44px; height: 58px; }
  .stock-confirm-article-title { font-size: 15px; }
}

/* Stock page: compact, aligned article-level fill controls */
.stock-article-head,
.stock-article-card-head {
  align-items: center !important;
}

.article-stock-actions {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  align-self: center !important;
  margin-left: 0 !important;
}

.article-stock-value {
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
  border-radius: 10px !important;
  line-height: 38px !important;
  text-align: center !important;
}

.stock-article-head .stock-total-pill,
.stock-article-card-head .stock-group-total {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  min-width: 62px !important;
  width: auto !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 14px !important;
  box-sizing: border-box !important;
  border-radius: 999px !important;
  font-size: 16px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
}

.stock-article-card-head .article-stock-actions {
  justify-self: end !important;
}

.stock-article-card-head .stock-group-total {
  justify-self: end !important;
}

details.stock-article-block > summary.stock-article-head {
  flex-wrap: nowrap !important;
  gap: 10px !important;
}

@media (max-width: 900px) {
  .stock-article-card-head .article-stock-actions,
  .stock-article-card-head .stock-group-total {
    grid-column: auto !important;
    justify-self: end !important;
    width: auto !important;
  }
}

/* Stock page: fix article fill input alignment and keep right-side columns perfectly aligned */
details.stock-article-block > summary.stock-article-head {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr) 86px 72px !important;
  align-items: center !important;
  gap: 14px !important;
  flex-wrap: nowrap !important;
}

details.stock-article-block > summary.stock-article-head::before {
  margin: 0 !important;
  width: 18px;
  text-align: center;
  justify-self: center;
}

.stock-article-left {
  min-width: 0 !important;
  width: 100% !important;
}

.article-stock-actions {
  width: 86px !important;
  min-width: 86px !important;
  max-width: 86px !important;
  margin: 0 !important;
  justify-self: end !important;
}

.article-stock-value {
  display: block !important;
  width: 86px !important;
  min-width: 86px !important;
  max-width: 86px !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  box-sizing: border-box !important;
  border-radius: 12px !important;
  text-align: center !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: normal !important;
  appearance: textfield;
  -moz-appearance: textfield;
}

.article-stock-value::-webkit-outer-spin-button,
.article-stock-value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stock-article-head .stock-total-pill,
.stock-article-card-head .stock-group-total {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  justify-self: end !important;
  align-self: center !important;
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #667085 !important;
  font-size: 16px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  text-align: center !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.stock-article-card-head {
  display: grid !important;
  grid-template-columns: 18px 44px minmax(0, 1fr) 86px 72px !important;
  align-items: center !important;
  gap: 14px !important;
}

.stock-article-card-head::before {
  margin: 0 !important;
  width: 18px;
  text-align: center;
  justify-self: center;
}

.stock-article-card-head .stock-group-media {
  width: 44px;
}

.stock-article-card-head .stock-group-img {
  width: 44px;
  height: 58px;
}

.stock-article-card-head .article-stock-actions,
.stock-article-card-head .stock-group-total {
  justify-self: end !important;
}

@media (max-width: 900px) {
  details.stock-article-block > summary.stock-article-head,
  .stock-article-card-head {
    grid-template-columns: 18px minmax(0, 1fr) 86px 72px !important;
  }

  .stock-article-card-head .stock-group-media {
    display: none !important;
  }
}
/* Stock page: do not show total amounts as big green badges */
.stock-group-total,
.stock-article-head .stock-total-pill,
.stock-article-card-head .stock-group-total {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #667085 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  font-size: 16px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  text-align: right !important;
}

/* Header-level bundle total should also be plain text, not a large badge */
details.stock-group > summary.stock-group-head > .stock-group-total {
  justify-self: end !important;
}


/* Stock page: clean layout after removing the top info blocks */
.stock-filter-card {
  padding: 20px 22px;
}

.stock-toolbar-card {
  padding: 18px 22px;
}

.stock-toolbar {
  margin: 0 !important;
  align-items: center !important;
}

.stock-toolbar h2 {
  margin: 0 !important;
  line-height: 1.2;
}

.stock-toolbar #stock-save-button {
  align-self: center;
}

.stock-filter-card .warehouse-note {
  margin-top: 14px;
}

.stock-group {
  padding-top: 0;
}

details.stock-group > summary.stock-group-head {
  align-items: center !important;
}

.stock-group-title {
  margin-bottom: 3px;
  line-height: 1.25;
}

.stock-group-meta {
  line-height: 1.35;
}

@media (max-width: 900px) {
  .stock-toolbar {
    align-items: stretch !important;
  }

  .stock-toolbar #stock-save-button {
    width: 100%;
  }
}


/* Login page: fixed form alignment */
.login-card {
  max-width: 620px;
  margin: 8vh auto;
  padding: 34px;
}

.login-card h1 {
  margin-bottom: 22px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  font-size: 16px;
  color: var(--muted);
}

.login-form input[type="password"],
.login-form input[type="text"] {
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border-radius: 14px;
  font-size: 18px;
  line-height: normal;
}

.login-submit {
  width: fit-content;
  min-width: 112px;
  height: 48px;
  padding: 0 24px;
  border-radius: 14px;
  font-size: 17px;
  align-self: start;
}

@media (max-width: 700px) {
  .login-card {
    max-width: none;
    margin: 24px 12px;
    padding: 24px;
  }
}


/* Stock page: top-level bundle pagination, 20 bundles per page */
.stock-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 14px;
}

.stock-pagination-bottom {
  margin: 14px 0 0;
}

.stock-pagination[hidden],
.stock-pagination-bottom[hidden] {
  display: none !important;
}

.stock-pagination-info {
  min-width: 180px;
  text-align: center;
  color: var(--muted);
  font-weight: 750;
}

.stock-pagination button {
  min-width: 42px;
  height: 36px;
  padding: 0 12px;
  font-size: 20px;
  line-height: 1;
}

.stock-pagination button:disabled {
  opacity: .45;
  cursor: default;
  filter: none;
}

@media (max-width: 700px) {
  .stock-pagination {
    justify-content: center;
  }
}


/* Stock page pagination: bottom-only centered plain numbers */
.stock-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.stock-pagination-bottom {
  margin: 18px 0 0;
}

.stock-pagination[hidden],
.stock-pagination-bottom[hidden] {
  display: none !important;
}

.stock-page-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.stock-page-number:hover {
  color: var(--accent);
  background: transparent;
  filter: none;
}

.stock-page-number.active {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.stock-pagination-info {
  display: none !important;
}


/* Stock page: Excel-column filter field */
.stock-filter-form {
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.25fr) minmax(260px, .9fr) minmax(220px, .75fr) auto auto;
}

.excel-filter-field textarea {
  width: 100%;
  min-height: 52px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  padding: 9px 11px;
  outline: none;
  font: inherit;
  line-height: 1.35;
}

.excel-filter-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

@media (max-width: 1350px) {
  .stock-filter-form {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .stock-filter-form {
    grid-template-columns: 1fr;
  }
}


/* Stock page: safe bulk edit for the filtered result */
.stock-bulk-edit-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stock-bulk-edit-title {
  font-weight: 850;
  color: var(--text);
  margin-right: 4px;
}

.stock-bulk-edit-value {
  width: 92px !important;
  min-width: 92px !important;
  max-width: 92px !important;
  height: 40px;
  padding: 0 10px;
  text-align: center;
  font-size: 16px;
  font-weight: 750;
  border-radius: 12px;
}

.stock-bulk-edit-note {
  font-size: 13px;
}

@media (max-width: 900px) {
  .stock-bulk-edit-panel {
    align-items: stretch;
  }

  .stock-bulk-edit-panel button {
    width: 100%;
  }
}





/* Stock page: selection checkboxes and toolbar select-all */
.stock-toolbar {
  align-items: center !important;
}

.stock-toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.stock-toolbar-left h2 {
  margin: 0 !important;
}

.stock-select-all-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  cursor: pointer;
}

.stock-select-all-box input,
.stock-select-col input,
.stock-select-box input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.stock-select-col {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.stock-select-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  cursor: pointer;
}

details.stock-group > summary.stock-group-head {
  grid-template-columns: 18px 32px 72px minmax(0, 1fr) auto !important;
}

details.stock-article-block > summary.stock-article-head {
  grid-template-columns: 18px 32px minmax(0, 1fr) 86px 72px !important;
}

.stock-article-card-head {
  grid-template-columns: 18px 32px 44px minmax(0, 1fr) 86px 72px !important;
}

details.stock-group > summary.stock-group-head::before,
details.stock-article-block > summary.stock-article-head::before,
.stock-article-card-head::before {
  grid-column: 1;
}

@media (max-width: 900px) {
  .stock-toolbar {
    align-items: stretch !important;
  }

  .stock-toolbar-left {
    align-items: center;
  }

  details.stock-article-block > summary.stock-article-head,
  .stock-article-card-head {
    grid-template-columns: 18px 32px minmax(0, 1fr) 86px 72px !important;
  }

  .stock-article-card-head .stock-group-media {
    display: none !important;
  }
}


/* Stock page: brand → imtId → article grouping */
.stock-brand-group {
  overflow: hidden;
}

.stock-brand-head {
  display: grid;
  grid-template-columns: 18px 32px minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  margin: 0;
  user-select: none;
}

.stock-brand-head::-webkit-details-marker {
  display: none;
}

.stock-brand-head::before {
  content: "▶";
  font-size: 14px;
  color: var(--muted);
  width: 18px;
  text-align: center;
  justify-self: center;
}

.stock-brand-group[open] > .stock-brand-head::before {
  content: "▼";
}

.stock-brand-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  overflow-wrap: anywhere;
}

.stock-brand-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.stock-brand-group > .stock-group-body {
  border-top: 1px solid var(--line);
}

.stock-brand-group .stock-bundle {
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .stock-brand-head {
    grid-template-columns: 18px 32px minmax(0, 1fr) auto;
  }

  .stock-brand-meta {
    grid-column: 3 / -1;
    white-space: normal;
  }
}


/* Stock page: edit-selected modal */
.stock-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.stock-bulk-edit-modal[hidden] {
  display: none !important;
}

.stock-bulk-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.stock-bulk-edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .38);
}

.stock-bulk-edit-dialog {
  position: relative;
  z-index: 1;
  width: min(460px, calc(100vw - 48px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .22);
  overflow: hidden;
}

.stock-bulk-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.stock-bulk-edit-head h2 {
  margin: 0 0 4px;
}

.stock-bulk-edit-body {
  padding: 18px 20px;
}

.stock-bulk-edit-modal-value {
  width: 130px !important;
  min-width: 130px !important;
  height: 44px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
}

.stock-bulk-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

@media (max-width: 900px) {
  .stock-toolbar-actions {
    justify-content: stretch;
  }

  .stock-toolbar-actions button {
    width: 100%;
  }
}


/* Stock page: non-blocking floating edit panel for selected rows */
.stock-floating-edit[hidden] {
  display: none !important;
}

.stock-floating-edit {
  position: fixed;
  right: 24px;
  top: 84px;
  z-index: 1200;
  width: 360px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.stock-floating-edit-card {
  pointer-events: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 46px rgba(15, 23, 42, .18);
  overflow: hidden;
}

.stock-floating-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.stock-floating-edit-head h2 {
  margin: 0 0 3px;
  font-size: 18px;
}

.stock-floating-edit-body {
  padding: 14px 16px;
}

.stock-floating-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.stock-floating-edit .stock-bulk-edit-modal-value {
  width: 110px !important;
  min-width: 110px !important;
  height: 42px;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
}

@media (max-width: 700px) {
  .stock-floating-edit {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 12px;
    width: auto;
    max-width: none;
  }
}


/* Stock page: floating edit panel position + cancel clears selection */
.stock-floating-edit {
  top: auto !important;
  left: auto !important;
  right: 24px !important;
  bottom: 24px !important;
}

@media (max-width: 700px) {
  .stock-floating-edit {
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 12px !important;
    width: auto !important;
    max-width: none !important;
  }
}


/* Stock page: Excel field compact by default, vertically resizable */
.excel-filter-field textarea {
  min-height: 42px !important;
  height: 42px;
  max-height: none !important;
  resize: vertical !important;
  overflow: auto !important;
  padding: 10px 11px !important;
  line-height: 20px !important;
}


/* Stock page: neat compact floating edit panel */
.stock-floating-edit {
  right: 22px !important;
  bottom: 22px !important;
  top: auto !important;
  left: auto !important;
  width: 390px !important;
  max-width: calc(100vw - 32px) !important;
}

.stock-floating-edit-card {
  border-radius: 18px !important;
  overflow: hidden;
}

.stock-floating-edit-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center !important;
  gap: 12px !important;
  padding: 14px 16px !important;
}

.stock-floating-edit-head h2 {
  margin: 0 0 2px !important;
  font-size: 22px !important;
  line-height: 1.15 !important;
  letter-spacing: -0.02em;
}

.stock-floating-edit-head .muted {
  margin: 0 !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
}

.stock-floating-edit-head .icon-button {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  border-radius: 12px !important;
  font-size: 28px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.stock-floating-edit-body {
  padding: 14px 16px !important;
}

.stock-floating-edit-grid {
  display: grid !important;
  gap: 10px !important;
}

.stock-floating-edit-field {
  display: grid !important;
  grid-template-columns: 1fr 132px;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 !important;
}

.stock-floating-edit-note {
  margin: 2px 0 0 !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
}

.stock-floating-edit-field span {
  font-size: 16px !important;
  line-height: 1.2 !important;
  color: var(--muted);
  font-weight: 750;
}

.stock-floating-edit .stock-bulk-edit-modal-value {
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
  height: 42px !important;
  padding: 0 10px !important;
  text-align: center !important;
  font-size: 18px !important;
  font-weight: 850 !important;
  border-radius: 13px !important;
}


.stock-floating-edit .stock-bulk-edit-modal-value.invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .14) !important;
}

.stock-floating-edit-actions {
  padding: 12px 16px !important;
  justify-content: flex-end !important;
}

.stock-floating-edit-actions button {
  min-width: 126px !important;
  height: 42px !important;
  border-radius: 13px !important;
  padding: 0 18px !important;
}

@media (max-width: 700px) {
  .stock-floating-edit {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    top: auto !important;
    width: auto !important;
    max-width: none !important;
  }

  .stock-floating-edit-field {
    grid-template-columns: 1fr 122px;
  }

  .stock-floating-edit .stock-bulk-edit-modal-value {
    width: 122px !important;
    min-width: 122px !important;
    max-width: 122px !important;
  }
}

/* Stock page: WB price controls on stock page */
.stock-table { min-width: 1380px; }
.price-cell { min-width: 126px; }
.price-cell .amount {
  width: 112px !important;
  min-width: 112px !important;
  text-align: center;
}
.price-result-cell { min-width: 118px; }
.tag.warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}
.article-price-actions {
  display: inline-grid !important;
  grid-template-columns: repeat(3, 96px) minmax(118px, auto) auto auto;
  align-items: end !important;
  justify-content: end !important;
  gap: 8px !important;
  justify-self: end !important;
  align-self: center !important;
  min-width: 550px;
  margin: 0 !important;
}
.article-price-field {
  display: grid !important;
  gap: 3px !important;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
  min-width: 0;
}
.article-price-field span {
  white-space: nowrap;
  font-weight: 750;
}
.article-price-value {
  display: block !important;
  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 9px !important;
  border-radius: 12px !important;
  text-align: center !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: normal !important;
  appearance: textfield;
  -moz-appearance: textfield;
}
.article-price-value::-webkit-outer-spin-button,
.article-price-value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stock-amount-input::placeholder,
.article-stock-value::placeholder,
.article-price-value::placeholder {
  color: #98a2b3 !important;
  opacity: 1 !important;
  font-weight: 750 !important;
}

.article-price-value.invalid,
.price-change-input.invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12) !important;
}
.article-price-result {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0 10px;
  border: 1px solid #dbe4f0;
  background: #f8fafc;
  border-radius: 999px;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  min-width: 112px;
}
.price-live-result-muted {
  color: #98a2b3 !important;
  background: #f9fafb !important;
  border-color: #e4e7ec !important;
  font-weight: 750 !important;
}
.price-live-result-dash {
  color: #667085 !important;
  background: #f8fafc !important;
  border-color: #dbe4f0 !important;
}
.price-result-cell.price-live-result-muted,
.price-result-cell.price-live-result-dash {
  background: transparent !important;
  border-color: transparent !important;
}
.article-price-actions .tag {
  height: 38px;
  align-self: end;
  white-space: nowrap;
}
.stock-toolbar-actions #stock-save-button,
.stock-toolbar-actions #stock-refresh-button,
.stock-toolbar-actions #stock-refresh-empty-button {
  white-space: nowrap;
}
details.stock-article-block > summary.stock-article-head {
  grid-template-columns: 18px 32px minmax(260px, 1fr) minmax(550px, auto) 86px 72px !important;
}
.stock-article-card-head {
  grid-template-columns: 18px 32px 44px minmax(260px, 1fr) minmax(550px, auto) 86px 72px !important;
}
.stock-article-card-head .article-price-actions {
  justify-self: end !important;
}
.price-confirm-dialog {
  width: min(1320px, calc(100vw - 56px));
}
.price-confirm-table { min-width: 1120px; }

@media (max-width: 1500px) {
  details.stock-article-block > summary.stock-article-head {
    grid-template-columns: 18px 32px minmax(0, 1fr) 86px 72px !important;
  }
  .stock-article-card-head {
    grid-template-columns: 18px 32px 44px minmax(0, 1fr) 86px 72px !important;
  }
  details.stock-article-block > summary.stock-article-head .article-price-actions {
    grid-column: 3 / -1;
    justify-self: stretch !important;
    justify-content: start !important;
    min-width: 0;
  }
  .stock-article-card-head .article-price-actions {
    grid-column: 4 / -1;
    justify-self: stretch !important;
    justify-content: start !important;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .article-price-actions {
    grid-template-columns: repeat(2, minmax(96px, 1fr));
    gap: 8px !important;
  }
  .article-price-field,
  .article-price-value,
  .article-price-result,
  .article-price-actions .tag {
    width: 100% !important;
    max-width: none !important;
  }
  details.stock-article-block > summary.stock-article-head,
  .stock-article-card-head {
    grid-template-columns: 18px 32px minmax(0, 1fr) 86px 72px !important;
  }
  .stock-article-card-head .stock-group-media {
    display: none !important;
  }
  .stock-article-card-head .article-price-actions,
  details.stock-article-block > summary.stock-article-head .article-price-actions {
    grid-column: 3 / -1 !important;
  }
}

/* Stock page: bulk edit inputs in one horizontal row + clear on close */
.stock-floating-edit {
  width: min(780px, calc(100vw - 44px)) !important;
}

.stock-floating-edit-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(118px, 1fr)) !important;
  align-items: end !important;
  gap: 10px !important;
}

.stock-floating-edit-field {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  min-width: 0 !important;
}

.stock-floating-edit-field span {
  font-size: 13px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

.stock-floating-edit .stock-bulk-edit-modal-value {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

.stock-floating-edit-note {
  grid-column: 1 / -1 !important;
  margin: 0 !important;
}

@media (max-width: 760px) {
  .stock-floating-edit-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr)) !important;
  }
}

@media (max-width: 460px) {
  .stock-floating-edit-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Stock page: unified save confirmation sections */
.stock-confirm-section {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}
.stock-confirm-section:last-child { margin-bottom: 0; }
.stock-confirm-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 850;
  color: #111827;
}
.stock-confirm-section > .stock-confirm-warning {
  margin: 0;
}
.stock-confirm-section > .stock-confirm-table {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}


/* Stock page: mass edit final price preview */
.stock-floating-edit {
  width: min(920px, calc(100vw - 44px)) !important;
}

.stock-floating-edit-grid {
  grid-template-columns: repeat(5, minmax(112px, 1fr)) !important;
}

.stock-floating-edit-result-field {
  min-width: 0 !important;
}

.stock-bulk-price-result {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 10px !important;
  border: 1px solid #dbe4f0 !important;
  border-radius: 13px !important;
  background: #f8fafc !important;
  text-align: center !important;
  font-size: 18px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

@media (max-width: 900px) {
  .stock-floating-edit-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr)) !important;
  }
}

@media (max-width: 460px) {
  .stock-floating-edit-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Stock page: keep native select arrows centered and inside filter fields */
.stock-filter-form select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  min-height: 52px !important;
  padding-right: 46px !important;
  line-height: 20px !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23172033' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 18px 18px !important;
}

.stock-filter-form select::-ms-expand {
  display: none;
}

/* Stock page: top filter controls uniform size and equal field widths */
.stock-filter-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) max-content max-content !important;
  align-items: end !important;
}

.stock-filter-form > label {
  min-width: 0;
  display: grid;
  grid-template-rows: 22px 56px;
  gap: 6px;
  align-items: end;
}

.stock-filter-form input,
.stock-filter-form select,
.stock-filter-form textarea {
  box-sizing: border-box;
  width: 100%;
  height: 56px !important;
  min-height: 56px !important;
  line-height: 22px;
}

.stock-filter-form textarea {
  resize: vertical;
  overflow: auto;
}

.stock-filter-form button,
.stock-filter-form .btn {
  box-sizing: border-box;
  min-height: 56px;
  height: 56px;
  padding-top: 0;
  padding-bottom: 0;
  align-self: end;
  white-space: nowrap;
}

@media (max-width: 1350px) {
  .stock-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 700px) {
  .stock-filter-form {
    grid-template-columns: 1fr !important;
  }
}

/* Stock page: price changes are shown inside the same confirmation article block */
.stock-confirm-price-inline-table {
  min-width: 720px !important;
  border-bottom: 1px solid var(--line);
}
.stock-confirm-price-inline-table th {
  background: #fff7ed !important;
}
.stock-confirm-price-inline-table td {
  background: #fffaf3 !important;
}
.stock-confirm-price-inline-table tbody tr:hover td {
  background: #fff4e6 !important;
}
.stock-confirm-price-label {
  white-space: nowrap;
  font-weight: 900;
  color: #92400e;
}

/* Stock page: blocking refresh progress modal */
.stock-loading-modal[hidden] {
  display: none !important;
}
.stock-loading-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
}
.stock-loading-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(3px);
}
.stock-loading-card {
  position: relative;
  width: min(520px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  align-items: center;
  padding: 26px 28px;
  border: 1px solid #dbe4f0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.22);
}
.stock-loading-card h2 {
  margin: 0 0 7px;
  font-size: 24px;
  font-weight: 900;
  color: #111827;
}
.stock-loading-card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  color: #667085;
}
.stock-loading-spinner {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 5px solid #dbeafe;
  border-top-color: #2563eb;
  animation: stock-loading-spin 0.8s linear infinite;
}
.stock-refresh-loading-active {
  cursor: progress;
}
button.is-loading {
  pointer-events: none;
  opacity: 0.82;
}
@keyframes stock-loading-spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 520px) {
  .stock-loading-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

/* Stock page: final alignment fix for refresh modal and article price row */
.stock-loading-card {
  width: fit-content !important;
  min-width: min(460px, calc(100vw - 40px)) !important;
  max-width: calc(100vw - 40px) !important;
  grid-template-columns: auto auto !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 22px !important;
  padding: 30px 44px !important;
}

.stock-loading-card h2 {
  margin: 0 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.stock-loading-card > div:last-child {
  display: flex !important;
  align-items: center !important;
}

.stock-loading-spinner {
  flex: 0 0 auto !important;
}

.stock-article-card-head,
details.stock-article-block > summary.stock-article-head {
  align-items: center !important;
  min-height: 82px !important;
}

.stock-article-left,
.stock-group-main {
  align-self: center !important;
}

.article-price-actions {
  grid-template-columns: repeat(3, 112px) 142px auto !important;
  align-items: end !important;
  justify-content: end !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.article-price-field {
  grid-template-rows: 16px 44px !important;
  gap: 4px !important;
}

.article-price-field span {
  line-height: 16px !important;
}

.article-price-value,
.article-price-result,
.article-stock-value {
  height: 44px !important;
  min-height: 44px !important;
  border-radius: 14px !important;
  font-size: 16px !important;
  line-height: normal !important;
}

.article-price-value {
  width: 112px !important;
  min-width: 112px !important;
  max-width: 112px !important;
}

.article-price-result {
  width: 142px !important;
  min-width: 142px !important;
  max-width: 142px !important;
  align-self: end !important;
}

.article-stock-actions {
  width: 112px !important;
  min-width: 112px !important;
  max-width: 112px !important;
  align-self: end !important;
  justify-self: end !important;
}

.article-stock-value {
  width: 112px !important;
  min-width: 112px !important;
  max-width: 112px !important;
}

.stock-article-card-head {
  grid-template-columns: 18px 32px 44px minmax(260px, 1fr) minmax(508px, auto) 112px !important;
}

details.stock-article-block > summary.stock-article-head {
  grid-template-columns: 18px 32px minmax(260px, 1fr) minmax(508px, auto) 112px !important;
}

@media (max-width: 1500px) {
  .article-price-actions {
    justify-content: start !important;
  }

  details.stock-article-block > summary.stock-article-head {
    grid-template-columns: 18px 32px minmax(0, 1fr) 112px !important;
  }

  .stock-article-card-head {
    grid-template-columns: 18px 32px 44px minmax(0, 1fr) 112px !important;
  }

  details.stock-article-block > summary.stock-article-head .article-price-actions {
    grid-column: 3 / -1 !important;
  }

  .stock-article-card-head .article-price-actions {
    grid-column: 4 / -1 !important;
  }
}

@media (max-width: 900px) {
  .article-price-actions {
    grid-template-columns: repeat(2, minmax(112px, 1fr)) !important;
  }

  .article-price-value,
  .article-price-result,
  .article-stock-value {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .article-stock-actions {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

@media (max-width: 520px) {
  .stock-loading-card {
    grid-template-columns: 1fr !important;
    min-width: 0 !important;
    width: min(360px, calc(100vw - 32px)) !important;
    justify-items: center !important;
    text-align: center !important;
    padding: 28px 24px !important;
  }

  .stock-loading-card h2 {
    white-space: normal !important;
  }
}

/* Stock page: aligned WB confirmation price rows */
.stock-confirm-table {
  table-layout: fixed !important;
}
.stock-confirm-price-inline-table,
.price-confirm-table {
  min-width: 1040px !important;
  table-layout: fixed !important;
}
.stock-confirm-price-inline-table th:empty,
.stock-confirm-price-inline-table td.stock-confirm-price-spacer {
  color: transparent !important;
}
.stock-confirm-price-inline-table td.stock-confirm-price-spacer {
  background: #fffaf3 !important;
}
.stock-confirm-price-inline-table .stock-confirm-old-value,
.stock-confirm-price-inline-table .stock-confirm-new-value,
.price-confirm-table .stock-confirm-old-value,
.price-confirm-table .stock-confirm-new-value {
  white-space: nowrap !important;
}

.warehouse-table th:last-child,
.warehouse-table td:last-child { width: 1%; white-space: nowrap; }
.warehouse-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.warehouse-actions .inline-form { display: inline-flex; align-items: center; gap: 0; flex-wrap: nowrap; }
.muted-table td { color: var(--muted); }

.warehouse-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.warehouse-page-head h2 { margin: 0; }
@media (max-width: 640px) {
  .warehouse-page-head { align-items: stretch; flex-direction: column; }
  .warehouse-page-head .secondary { text-align: center; }
}

/* Stock page: final layout cleanup for warehouse hiding move + bulk edit */
.warehouse-page-head .secondary,
.warehouse-page-head .btn {
  text-decoration: none !important;
  white-space: nowrap !important;
}

.warehouse-table th,
.warehouse-table td {
  vertical-align: middle !important;
}

.warehouse-table th:last-child,
.warehouse-table td:last-child {
  width: 120px !important;
  text-align: right !important;
}

/* Stock page: filter field text alignment */
.stock-filter-form {
  display: grid !important;
  grid-template-columns: minmax(220px, 1.05fr) minmax(260px, 1fr) minmax(260px, 1fr) minmax(250px, .95fr) max-content max-content !important;
  gap: 14px !important;
  align-items: end !important;
}

.stock-filter-form > label {
  min-width: 0 !important;
  display: grid !important;
  grid-template-rows: 22px 56px !important;
  gap: 6px !important;
  align-items: stretch !important;
  line-height: 22px !important;
}

.stock-filter-form input,
.stock-filter-form select,
.stock-filter-form textarea {
  box-sizing: border-box !important;
  width: 100% !important;
  height: 56px !important;
  min-height: 56px !important;
  margin: 0 !important;
  font-size: 16px !important;
  line-height: 24px !important;
  border-radius: 14px !important;
  border: 1px solid var(--line) !important;
}

.stock-filter-form input,
.stock-filter-form select {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 16px !important;
  padding-right: 44px !important;
  line-height: 54px !important;
}

.stock-filter-form input {
  padding-right: 16px !important;
}

.stock-filter-form textarea {
  resize: vertical !important;
  overflow: auto !important;
  padding: 15px 16px !important;
  line-height: 24px !important;
}

.stock-filter-form select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23172033' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 18px 18px !important;
}

.stock-filter-form select::-ms-expand {
  display: none !important;
}

.stock-filter-form button,
.stock-filter-form .btn {
  align-self: end !important;
  box-sizing: border-box !important;
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

.stock-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  margin-bottom: 0 !important;
}

.stock-toolbar-left {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  min-width: 0 !important;
}

.stock-toolbar-left h2 {
  margin: 0 !important;
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
}

.stock-toolbar-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  flex: 0 0 auto !important;
}

.stock-toolbar-actions button,
.stock-toolbar-actions .btn {
  min-height: 44px !important;
  height: 44px !important;
  padding: 0 18px !important;
  white-space: nowrap !important;
}

/* Stock page: compact bottom-right mass edit panel */
.stock-floating-edit {
  left: auto !important;
  right: 24px !important;
  bottom: 24px !important;
  top: auto !important;
  transform: none !important;
  width: min(860px, calc(100vw - 48px)) !important;
  max-width: calc(100vw - 48px) !important;
}

.stock-floating-edit-card {
  width: 100% !important;
  margin: 0 !important;
  border-radius: 18px !important;
  overflow: hidden !important;
}

.stock-floating-edit-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 42px !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 14px 16px !important;
}

.stock-floating-edit-head h2 {
  margin: 0 0 2px !important;
  font-size: 20px !important;
  line-height: 1.15 !important;
}

.stock-floating-edit-head .muted {
  margin: 0 !important;
  font-size: 15px !important;
  line-height: 1.25 !important;
}

.stock-floating-edit-body {
  padding: 14px 16px !important;
}

.stock-floating-edit-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(112px, 1fr)) !important;
  gap: 10px !important;
  align-items: end !important;
}

.stock-floating-edit-field,
.stock-floating-edit-result-field {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
}

.stock-floating-edit-field span {
  font-size: 13px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

.stock-floating-edit .stock-bulk-edit-modal-value,
.stock-floating-edit .stock-bulk-price-result {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 44px !important;
  min-height: 44px !important;
  box-sizing: border-box !important;
  font-size: 18px !important;
  border-radius: 14px !important;
}

.stock-floating-edit-actions {
  display: flex !important;
  justify-content: flex-end !important;
  padding: 12px 16px !important;
}

.stock-floating-edit-actions button {
  min-width: 126px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 18px !important;
  border-radius: 13px !important;
}

@media (max-width: 1400px) {
  .stock-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) max-content max-content !important;
  }
}

@media (max-width: 900px) {
  .stock-floating-edit-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr)) !important;
  }
}

@media (max-width: 820px) {
  .stock-filter-form {
    grid-template-columns: 1fr !important;
  }
  .stock-filter-form button,
  .stock-filter-form .btn {
    width: 100% !important;
  }
  .stock-toolbar {
    align-items: stretch !important;
    flex-direction: column !important;
  }
  .stock-toolbar-actions {
    justify-content: stretch !important;
  }
  .stock-toolbar-actions button,
  .stock-toolbar-actions .btn {
    flex: 1 1 auto !important;
  }
}

@media (max-width: 700px) {
  .stock-floating-edit {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    width: auto !important;
    max-width: none !important;
  }
  .stock-floating-edit-grid {
    grid-template-columns: 1fr !important;
  }
}
