/* Sietynas · Prekių valdymas — v3 „Parduotuvės veidrodis" stiliai.
 * Backoffice kalba ta pačia vizualine kalba kaip sietynas.lt: juodas headeris,
 * auksiniai CTA, Source Sans Pro 13px, 4px border-radius, mėlynos nuorodos. */
:root {
  --gold: #cea92b;
  --gold-dark: #b8961f;
  --black: #1a171b;
  --dark-border: #272729;
  --text: #676767;
  --light: #f5f5f5;
  --grey: #e1e1e1;
  --grey-light: #f3f3f3;
  --grey-mid: #7a7e82;
  --green: #49a942;
  --green-text: #2e7d29;
  --red: #bf1a26;
  --link: #3399cc;
  --review-bg: #fdf6e0;
  --review-border: #e7d391;
  --review-text: #8a6d0e;
  --radius: 4px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 13px/1.5 'Source Sans Pro', -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 12px; font-weight: 700; color: var(--black); }
h2 { font-size: 15px; }
h3 { font-size: 13px; margin-top: 18px; text-transform: uppercase; letter-spacing: .06em; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }
.muted { color: var(--grey-mid); }
.small { font-size: 12px; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.warn-text { color: var(--review-text); font-weight: 700; }

/* ---- headeris — parduotuvės juoda juosta ---- */
.site-header {
  background: var(--black);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  border-bottom: 2px solid var(--gold);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 300px;
}
.header-brand img { height: 40px; width: auto; display: block; }
.header-brand .brand-divider { width: 1px; height: 28px; background: var(--dark-border); }
.header-brand .brand-app {
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.header-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 8px;
  align-self: stretch;
}
.header-nav a {
  display: flex;
  align-items: center;
  padding: 0 22px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  position: relative;
  text-decoration: none;
}
.header-nav a:hover { color: var(--gold); text-decoration: none; }
.header-nav a.active { color: var(--gold); }
.header-nav a.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 0;
  height: 3px;
  background: var(--gold);
}
.header-status {
  min-width: 300px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  color: #b9b6ba;
  font-size: 12px;
}
.header-status .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.header-status .dot.off { background: var(--grey-mid); }
.header-status strong { color: #fff; font-weight: 600; }

/* ---- breadcrumb ---- */
.breadcrumb {
  background: var(--light);
  border-bottom: 1px solid var(--grey);
  padding: 9px 32px;
  font-size: 12px;
  color: var(--grey-mid);
}
.breadcrumb .sep { margin: 0 7px; color: #b9b6ba; }
.breadcrumb .current { color: var(--black); font-weight: 600; }

/* ---- layout ---- */
.container { max-width: 1400px; margin: 0 auto; padding: 20px 24px 40px; }
.card {
  background: #fff;
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.card h2 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 12px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

/* ---- lentelės ---- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--grey-mid);
  background: var(--light);
  padding: 9px 10px;
  border-bottom: 1px solid var(--grey);
  white-space: nowrap;
}
.table th.num { text-align: right; }
.table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--grey-light);
  vertical-align: top;
  color: var(--text);
}
.table td.num { color: var(--black); }
.table tbody tr:hover td { background: #fafafa; }
.table tbody tr.selected td {
  background: var(--review-bg);
  border-bottom-color: var(--review-border);
}
.table tbody tr.selected td:first-child { box-shadow: inset 2px 0 0 var(--gold); }

/* inline redagavimo afordansas */
td.editable { position: relative; cursor: text; }
td.editable:hover:not(:focus-within) {
  outline: 1px dashed var(--gold);
  outline-offset: -3px;
  background: #fffdf2 !important;
}
td.editable:hover:not(:focus-within)::after {
  content: "redaguoti";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-dark);
  background: #fffdf2;
  padding-left: 5px;
}
.cell-input {
  width: 100%; min-width: 70px; padding: 2px 5px; font: inherit;
  border: 1px solid var(--gold); border-radius: var(--radius);
}

/* eilučių veiksmai — nuorodų stiliaus mygtukai lentelėse */
.actions { white-space: nowrap; }
.actions .btn {
  background: none;
  border: none;
  padding: 2px 4px;
  margin-right: 10px;
  color: var(--link);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}
.actions .btn:hover { background: none; text-decoration: underline; }
.actions .btn-approve { color: var(--green-text); }
.actions .btn-danger { color: var(--red); }

/* ---- badges pagal statusą ---- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
  background: var(--grey-light);
  color: var(--grey-mid);
  border: 1px solid var(--grey);
}
.badge-uploaded, .badge-processing, .badge-pending { background: #eef2f5; color: #52626e; border-color: #d3dde3; }
.badge-extracted, .badge-approved, .badge-auto_approved, .badge-done { background: #edf7ec; color: var(--green-text); border-color: #b8ddb4; }
.badge-in_review, .badge-needs_review { background: var(--review-bg); color: var(--review-text); border-color: var(--review-border); }
.badge-failed, .badge-rejected { background: #fbeaec; color: var(--red); border-color: #ecb8bd; }
.badge-expired { background: #d9534f; color: #fff; border-color: #c9302c; font-weight: 700; }
.badge-edited { background: #e8f3fa; color: #22769e; border-color: #bcdcee; }
/* konfigūracijos šaltinio indikatoriai */
.badge-manufacturer { background: var(--review-bg); color: var(--review-text); border-color: var(--review-border); }
.badge-default { background: #e8f3fa; color: #22769e; border-color: #bcdcee; }
.badge-inherit { background: var(--grey-light); color: var(--grey-mid); border-color: var(--grey); }

/* ---- mygtukai (parduotuvės stilius) ---- */
.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.2;
  padding: 9px 18px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--black);
  border: 1px solid #c9c9c9;
  cursor: pointer;
}
.btn:hover { border-color: var(--black); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--black); }
.btn-primary:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn-danger { color: var(--red); border-color: #ecb8bd; }
.btn-danger:hover { border-color: var(--red); background: #fbeaec; }
.btn-sm { padding: 5px 10px; font-size: 11px; letter-spacing: .06em; }
.btn-linkish {
  display: inline-block;
  background: none;
  border: none;
  color: var(--link);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.2;
  padding: 9px 6px;
  cursor: pointer;
}
.btn-linkish:hover { text-decoration: underline; }

.spinner {
  display: inline-block; width: 12px; height: 12px; vertical-align: -2px;
  border: 2px solid var(--grey); border-top-color: var(--gold);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- formos ---- */
.form-row { margin-bottom: 12px; }
.form-row > label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; color: var(--black); }
input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; padding: 7px 9px; border: 1px solid #c9c9c9; border-radius: var(--radius);
  font: inherit; background: #fff; color: var(--black);
}
textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(206, 169, 43, .2);
}
.hint { margin: 4px 0 0; font-size: 12px; color: var(--grey-mid); }
/* „Išsamiau" — matomas vienas trumpas sakinys, detalės suskleistos (Martynas 2026-09-23) */
details.hint > summary { cursor: pointer; width: fit-content; }
details.hint ul { margin: 4px 0 0; padding-left: 18px; }
.form-actions { display: flex; gap: 8px; margin-top: 14px; }

.upload-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.upload-row label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; color: var(--black); }
.upload-row select, .upload-row input[type=file] { width: auto; min-width: 240px; }
/* failo input ir mygtukas lygiuojami į apačią; būsenos tekstas — su mygtuko linija */
.upload-row .btn { margin-bottom: 1px; }
.upload-row .small { align-self: center; }
/* kainyno atpažinimo pastaba — atskira eilute po laukais, kad „Kainynas" tilptų į vieną eilutę;
   tuščia arba be „Kainynas" lauko — neužima vietos */
.upload-row #m-upload-part-note { flex: 0 0 100%; order: 1; margin-top: -6px; }
.upload-row #m-upload-part-note:empty, #m-upload-part-wrap.hidden ~ #m-upload-part-note { display: none; }
/* failo laukas — tokio pat aukščio kaip select, kad etiketės būtų vienoje linijoje */
.upload-row input[type=file] {
  padding: 6px 9px; border: 1px solid #c9c9c9; border-radius: var(--radius);
  background: #fff; font: inherit; font-size: 13px;
}

/* ---- chips / confidence ---- */
.chip {
  display: inline-block;
  background: var(--grey-light);
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  color: var(--grey-mid);
  font-size: 11px;
  padding: 1px 7px;
  margin: 0 3px 2px 0;
  line-height: 1.6;
}
.conf { font-size: 12px; font-weight: 600; white-space: nowrap; }
.conf::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
}
.conf-high { color: var(--green-text); }
.conf-medium { color: var(--review-text); }
.conf-low { color: var(--red); }

/* ---- toolbar ---- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
}
.toolbar .spacer { flex: 1; }
.rows-search { width: auto; min-width: 300px; padding: 7px 12px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; color: var(--black); }
.check input { width: auto; accent-color: var(--gold); cursor: pointer; }
.page-nav { display: inline-flex; gap: 6px; align-items: center; }
.page-nav select { width: auto; min-width: 110px; padding: 5px 8px; }
.page-nav .btn { padding: 5px 10px; font-size: 14px; line-height: 1; }

/* Nuolaidų rėžiai dokumento antraštėje — pastebimi iš karto */
.doc-discounts {
  display: inline-block; margin: 6px 0 2px; padding: 4px 12px;
  background: #fdf6e3; border: 1px solid var(--gold); border-radius: 12px;
  font-weight: 600; font-size: 13px; color: var(--black);
}

/* ---- dokumento antraštė ---- */
.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.doc-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: .01em;
  text-transform: none;
  border-bottom: none;
  padding-bottom: 0;
}

/* ---- review išdėstymas + puslapio vaizdas ---- */
.review-split { display: flex; gap: 16px; align-items: flex-start; }
.viewer-pane { flex: 0 0 46%; padding: 8px; }
.rows-pane { flex: 1; min-width: 0; overflow-x: auto; padding: 0; }
.viewer {
  position: relative; overflow: hidden; height: calc(100vh - 320px); min-height: 420px;
  background: var(--grey-light); border-radius: var(--radius); cursor: grab;
}
.viewer.dragging { cursor: grabbing; }
.viewer-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.viewer-canvas img {
  display: block; user-select: none; -webkit-user-drag: none;
  box-shadow: 0 1px 4px rgba(26, 23, 27, .25); background: #fff;
}
.bbox {
  position: absolute;
  border: 2px solid var(--gold);
  background: rgba(206, 169, 43, .18);
  border-radius: 2px;
  pointer-events: none;
}
.viewer-pane .hint { padding: 6px 4px 0; margin: 0; }

/* ---- config puslapio išdėstymas ---- */
.split { display: flex; gap: 16px; align-items: flex-start; }
.split-left { flex: 0 0 300px; min-width: 0; }
.split-right { flex: 1; min-width: 0; }
.split-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.split-head h2 { margin: 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list-item { padding: 8px 10px; border-radius: var(--radius); cursor: pointer; color: var(--text); }
.list-item:hover { background: #fafafa; }
.list-item.selected {
  background: var(--review-bg);
  box-shadow: inset 2px 0 0 var(--gold);
  color: var(--black);
  font-weight: 600;
}
.list-item.inactive { color: #9aa1ab; }
.list-item.static { cursor: default; }
.list-item.static:hover { background: transparent; }
.tag {
  display: inline-block; margin-left: 6px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .05em; background: var(--grey-light); color: var(--grey-mid);
  border: 1px solid var(--grey); border-radius: var(--radius); padding: 1px 5px; font-weight: 600;
}

/* ---- tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--grey); margin-bottom: 16px; }
.tab {
  border: none; background: none; padding: 10px 16px;
  font-family: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; color: var(--grey-mid);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--black); border-bottom-color: var(--gold); }
.tab:hover { color: var(--black); }

/* ---- modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(26, 23, 27, .5);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: #fff; border-radius: var(--radius); width: min(760px, 92vw); max-height: 82vh;
  display: flex; flex-direction: column; padding: 16px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-head h3 { margin: 0; }
.modal-pre {
  overflow: auto; background: #fcfcfc; border: 1px solid var(--grey); border-radius: var(--radius);
  padding: 12px; white-space: pre-wrap; word-break: break-word; font-size: 12.5px; margin: 0;
}
/* ---- kainodaros taisyklių redaktorius (3 žingsnis) ---- */
.rule-tier { margin: 12px 0; padding: 8px 0; border-top: 1px solid var(--grey); }
.rules-table td { padding: 3px 4px; vertical-align: middle; }
.rules-table .struct-input { width: 100%; font-size: 12.5px; }
.rule-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rules-out { margin-top: 10px; }
.rules-out .import-panel { margin: 0; }

/* ---- 2 žingsnio Excel failo peržiūra (struktūros redaktoriui) ---- */
.sheet-preview-box { margin: 10px 0; }
.sheet-preview-wrap {
  overflow: auto; max-height: 300px;
  border: 1px solid var(--grey); border-radius: var(--radius);
}
/* width:max-content (o ne 100%) — kitaip platus lapas suspaudžiamas į konteinerio
 * plotį ir horizontalaus slinkimo išvis nebūna, tad tolimesnių stulpelių nepamatai */
.sheet-preview { border-collapse: collapse; font-size: 12px; white-space: nowrap;
  width: max-content; min-width: 100%; }
.sheet-preview th {
  position: sticky; top: 0; background: #f4f2ee; z-index: 1;
  padding: 4px 8px; text-align: left; border-bottom: 1px solid var(--grey);
}
.sheet-preview td {
  padding: 3px 8px; border-right: 1px solid #f0eeea; border-bottom: 1px solid #f7f5f2;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.sheet-header-row td { background: #e8f4e4; font-weight: 600; }

/* platus modalas prekės juodraščio peržiūrai (masinis kėlimas — prekė po prekės) */
.modal-wide { width: min(1150px, 96vw); max-height: 92vh; }
/* langas „Kainyno struktūra pasikeitė" (structure_proposal.js): stulpeliai su AI prasmėmis */
.sp-body { overflow-y: auto; min-height: 0; padding-right: 4px; }
.sp-body p { margin: 0 0 8px; }
.sp-table-wrap { margin: 10px 0; }
.sp-table td { padding: 4px 8px; vertical-align: top; }
.sp-table .struct-input { width: 100%; min-width: 220px; font-size: 13px; }
.sp-letter { font-weight: 700; width: 3em; }
.sp-sample { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-table tr.sp-changed td { background: #fff7e0; }
.sp-notes > div { margin: 3px 0; font-size: 13px; }
.sp-bases { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--grey); border-radius: var(--radius); }
.sp-base-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.sp-base-row .struct-input { width: auto; min-width: 220px; }
.sp-notes { margin: 8px 0; }
.sp-needs-wrap:empty { display: none; }
.sp-needs-wrap { margin-top: 8px; }
.sp-needs { padding: 8px 10px; border: 1px solid var(--review-border); background: var(--review-bg);
  border-radius: var(--radius); }
/* struktūros pasiūlymas vedlyje / sąraše: ne klaida, o laukiantis patvirtinimas */
.warn-note {
  margin: 0 0 10px; padding: 8px 10px; border-radius: 5px; font-size: 13px;
  background: #fff7e0; border: 1px solid #f0d68a; color: #7a5a00;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.modal-body-scroll { overflow-y: auto; padding-right: 4px; }
.modal-head .actions { display: flex; align-items: center; gap: 8px; }

/* ---- besisukantis ratukas: „kažkas vyksta" ženklas apdorojimo veiksmams
 * (Martynas 2026-09-03 — be jo neaišku, ar mygtukas užšalo, ar tikrai dirba) ---- */
.spinner-ico {
  display: inline-block; width: 11px; height: 11px; margin-right: 5px; vertical-align: -1px;
  border: 2px solid #ccd3d8; border-top-color: #52626e; border-radius: 50%;
  animation: spin-ico .7s linear infinite; flex: none;
}
@keyframes spin-ico { to { transform: rotate(360deg); } }
.badge .spinner-ico { border-color: #b9c7cf; border-top-color: #52626e; }

/* ---- toasts ---- */
#toasts {
  position: fixed; top: 14px; right: 14px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px; max-width: 380px;
}
.toast {
  background: #fff; border: 1px solid var(--grey); border-radius: var(--radius);
  padding: 10px 14px 10px 12px; box-shadow: 0 4px 14px rgba(26, 23, 27, .16);
  font-size: 13px; color: var(--black); transition: opacity .3s;
}
.toast::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--grey-mid);
  margin-right: 9px;
}
.toast.hide { opacity: 0; }
.toast-success::before { background: var(--green); }
.toast-error::before { background: var(--red); }
.toast-warn::before { background: var(--gold); }

/* ---- siauresni ekranai ---- */
@media (max-width: 1100px) {
  .site-header { padding: 0 16px; }
  .header-brand, .header-status { min-width: 0; }
  .header-brand .brand-app { display: none; }
  .breadcrumb { padding: 9px 16px; }
}

/* --- auth header --- */
.header-user { color: rgba(255, 255, 255, .85); font-size: 12px; white-space: nowrap; }
.header-logout {
  color: rgba(255, 255, 255, .55);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}
.header-logout:hover { color: var(--gold, #cea92b); }

/* --- gamintojo logo --- */
.logo-preview {
  display: block;
  max-height: 64px;
  max-width: 220px;
  margin-bottom: 8px;
  padding: 6px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* --- kainu koeficientu laukeliai --- */
.coef-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 6px;
}
.coef-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #444;
}
.coef-item input { width: 100%; }

/* --- paieskos combobox (gamintojo pasirinkimas) --- */
.combo { position: relative; display: block; min-width: 260px; }
.combo-input { width: 100%; }
.combo-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  max-height: 340px;
  overflow-y: auto;
}
.combo-item {
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.combo-item.active { background: #1e4ed8; color: #fff; }
.combo-item.disabled { color: #9aa0a5; cursor: not-allowed; font-style: italic; }
.combo-item.disabled.active { background: #e8eaed; color: #9aa0a5; }
.combo-empty { color: #888; cursor: default; }

/* --- WIZARD (gamintojo kortele: 6 rem inti zingsniai) --- */
/* Vientisas plotis — gamintojų sąrašo kairėje nebėra, tad 3 žingsnio failo
 * peržiūroje telpa gerokai daugiau stulpelių (2026-07-27). */
.wizard-full { width: 100%; }
.mfr-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.mfr-pick .combo { min-width: 340px; flex: 1 1 340px; max-width: 520px; }
.mfr-card { margin-bottom: 10px; }
.mfr-card > summary { cursor: pointer; font-weight: 600; }
/* pasirinkto gamintojo vardas žingsnio antraštėje — ryškiau nei įprasta būsena */
#m-form-title { font-weight: 700; letter-spacing: .3px; }
.wiz-details {
  border: 1px solid #e0e0e0; border-radius: 8px; background: #fafafa;
  padding: 14px 16px; margin-bottom: 14px;
}
.wiz-details .details-row { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.wiz-details .details-name { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.wiz-details .details-logo { display: flex; gap: 10px; align-items: flex-start; }
.wiz-details .details-logo > div { display: flex; flex-direction: column; gap: 4px; }
/* Tiekėjo kortelė gamintojo kortelėje (2026-09-11): tiekėjas iš PrestaShop katalogo,
 * vienkartinis patvirtinimas — kuklu, kaip .wiz-details, tik baltu fonu */
.supplier-card {
  border: 1px solid #e0e0e0; border-radius: 8px; background: #fff;
  padding: 10px 14px; margin: 12px 0;
}
.supplier-card h4 { margin: 0 0 6px; font-size: 14px; }
.supplier-row { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; }
.supplier-status { margin: 8px 0 0; font-size: 13px; }
.supplier-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.supplier-actions select { max-width: 420px; }
.supplier-candidates { margin: 4px 0 0; padding: 0; list-style: none; }
.supplier-candidates li { display: flex; gap: 10px; align-items: center; padding: 3px 0; font-size: 13px; }
.wiz-files { margin: 6px 0 16px; }
.wiz-files-label { display: block; font-weight: 700; margin-bottom: 6px; }

/* JOKIO overflow:hidden — jis nukirpdavo iškrentantį gamintojų sąrašą ties žingsnio
 * kraštu (2026-07-27). Antraštės kampus apvalinam jai pačiai, o ne apkarpymu. */
.wiz-step {
  border: 1px solid #dcdcdc; border-radius: 8px; margin: 20px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
  transition: opacity .2s, border-color .2s;
}
.wiz-step .wiz-head {
  display: flex; align-items: center; gap: 10px; margin: 0;
  padding: 12px 16px; font-size: 16px; background: #f0f1f3; border-bottom: 1px solid #e2e2e2;
  border-radius: 7px 7px 0 0;   /* 8px rėmelis minus 1px linija */
}
/* gamintojo žingsnis — virš tolesnių, kad iškrentantis sąrašas nedingtų po jais, bet TIK kol
 * sąrašas atidarytas: nuolatinis z-index 60 piešdavo visą 1 žingsnį VIRŠ lipnios juostos
 * „Kitas žingsnis" (wizard.css, 40). Uždarytas — be sluoksnio, juosta virš jo. */
#m-step-mfr { position: relative; }
#m-step-mfr:has(.combo-list:not(.hidden)) { z-index: 60; }

/* --- kainyno konstravimas: kaina + iš ko skaičiuojama + „buvo → bus" --- */
/* Kainynu sarasas: senesni failai po jungikliu, blankesni */
.doc-toggle td { padding: 2px 10px 8px; border-bottom: none; }
.doc-old td { background: #fafafa; color: var(--grey-mid); }

/* kainyno vizitine virs failo perziuros: logo + sudarymo data */
.pl-card { display: flex; align-items: center; gap: 16px; padding: 10px 14px;
  border: 1px solid #dcdcdc; border-radius: 8px; background: #fff; margin-bottom: 10px; }
.pl-logo { height: 56px; max-width: 220px; object-fit: contain; display: block; }
.pl-logo-none { font-weight: 700; color: var(--grey-mid); height: auto; }
.pl-meta { min-width: 0; }
.pl-name { font-weight: 700; color: var(--black); }

.pb-rows { border: 1px solid #dcdcdc; border-radius: 8px; overflow: hidden; background: #fff; }
/* dešinysis „buvo → bus" stulpelis platus, kad kodas su tarpais (FMR240WW TRIAC
 * MWH) tilptų į vieną eilutę (Martyno prašymas 2026-09-02) */
.pb-head, .pb-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px;
  padding: 10px 14px; align-items: center;
}
.pb-head { background: #f6f5f2; font-size: 12px; color: var(--grey-mid); }
.pb-row { border-top: 1px solid #f0eeea; }
.pb-row.pb-learned { background: #f1f8f1; }
.pb-label { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.pb-src-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pb-src { width: auto; max-width: 320px; }
/* input.pb-coef PRIVALO nurungti globalų `input:not(...) { width:100% }`
 * (specifiškumas 0,2,1) — kitaip laukelis išsitempia per visą eilutę */
.pb-src-row input.pb-coef { width: 90px; text-align: right; }
/* leidžiamos ir išraiškos („0,55*1,2") — platesnis nei vien skaičiui */
.pb-src-row input.pb-coef { width: 110px; }
.pb-src-row input.pb-bad { border-color: var(--red); background: #fdf0f0; }
.pb-x { color: var(--grey-mid); }
.pb-rule { color: var(--grey-mid); }
/* „buvo → bus": sena kaina blanki, nauja ryški, pokytis spalvotas */
.pb-cmp { text-align: right; display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; white-space: nowrap; }
/* trys pavyzdinės prekės (pigi/vidutinė/brangi) su kodais — stulpeliu dešinėje */
.pb-cmp-multi { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.pb-cmp-multi .pb-now { font-size: 13px; }
.pb-ref { color: #9aa1ab; font-size: 11px; margin-right: 4px; white-space: nowrap; }
.pb-was { color: var(--grey-mid); text-decoration: line-through; }
.pb-arrow { color: var(--grey-mid); }
.pb-now { font-weight: 700; font-size: 15px; }
.pb-now.up, .pb-pct.up { color: #a32d2d; }
.pb-now.down, .pb-pct.down { color: #1c7c2e; }
.pb-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
/* automatinio mokymosi rezultatas — virš eilučių, nes jis jas ir užpildo */
.pb-learn { margin-bottom: 10px; }
.pb-learn-box { border: 1px solid #dcdcdc; border-left-width: 4px; border-radius: 6px; padding: 10px 12px; }
.pb-learn-box.ok { border-color: #cfe3d0; border-left-color: #2e7d32; background: #f3f9f3; }
.pb-learn-box.warn { border-color: #ecdcb0; border-left-color: #c9922a; background: #fdf6e6; }
.pb-learn-act { display: flex; gap: 8px; margin-top: 8px; }
/* „ką daro" + aprašymas savais žodžiais */
.pb-explain { margin-top: 6px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pb-explain details { flex: 1 1 auto; min-width: 0; }
.pb-explain summary { cursor: pointer; color: var(--grey-mid); }
.pb-xls { margin-top: 4px; word-break: break-all; font-size: 11px; }
.pb-text:empty { display: none; }
.pt-box { border: 1px solid #dcdcdc; border-radius: 6px; padding: 10px; margin-top: 8px; background: #fafafa; }
.pt-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.pt-row:first-child { margin-top: 0; }
.pt-input { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; }
.pt-result { border-left: 4px solid #c9922a; background: #fdf6e6; padding: 8px 10px; border-radius: 4px; margin-top: 8px; }
.pt-result.ok { border-left-color: #2e7d32; background: #f3f9f3; }
.pt-lt ul { margin: 4px 0 6px 18px; padding: 0; }
.wiz-step .wiz-head small { color: #8a8e92; font-weight: 400; font-size: 13px; }
.wiz-step .wiz-body { padding: 14px 16px; }
/* žingsnių tonai — kad matytųsi seka (VISIEMS žingsniams, įskaitant 1 ir 8:
 * be tonų jie atrodė kaip svetimkūniai tarp spalvotų kaimynų) */
#m-step-mfr .wiz-head { background: #eef0f6; }
#m-step-1 .wiz-head { background: #eef4fb; }
#m-step-2 .wiz-head { background: #eef7ef; }
#m-step-3 .wiz-head { background: #fbf4e8; }
#m-step-4 .wiz-head { background: #f5eefb; }
#m-step-5 .wiz-head { background: #eefafa; }
#m-step-6 .wiz-head { background: #fdeef0; }
#m-step-7 .wiz-head { background: #e9f6ec; }
/* būsenos */
.wiz-state { margin-left: auto; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 10px; }
.wiz-state.st-done { background: #d6efd3; color: #2c7a2c; }
.wiz-state.st-current { background: #cfe0f8; color: #1e4ed8; }
.wiz-state.st-locked { background: #e6e6e6; color: #999; }
/* failas apdorojamas: ratukas vietoj „atlikta" (2026-09-06) */
.wiz-state.st-busy { background: #fff1c9; color: #8a5a00; display: inline-flex; align-items: center; gap: 6px; }
.wiz-step.wiz-busy { border-color: #d99a00; box-shadow: 0 0 0 2px rgba(217,154,0,.12); }
.wiz-step.wiz-current { border-color: #1e4ed8; box-shadow: 0 0 0 2px rgba(30,78,216,.12); }
.wiz-step.wiz-done { border-color: #cfe6c8; }
.wiz-step.wiz-locked { opacity: .55; }
.wiz-step.wiz-locked .wiz-body { pointer-events: none; filter: grayscale(.3); }
/* promo nuoroda po 8 žingsnio — nepriklauso nuo naujausio failo būsenos (anksčiau buvo 1 žingsnyje):
 * atskiras blokas, ne žingsnio viduje, kad užrakinto žingsnio blankumas jos nepilkintų */
.wiz-promo { margin: -8px 0 20px; padding: 12px 16px 14px; border: 1px solid #dcdcdc; border-radius: 8px;
  background: #f6fbf7; }
.wiz-promo .hint { margin-top: 0; }
.wiz-promo .btn { margin-top: 8px; }
/* veiksmo eilutė: mygtukai + būsenos tekstas vienoje linijoje, centruoti vertikaliai */
.wiz-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
/* paskutinė dalis — pavojingi veiksmai (trynimas / undo) */
.wiz-danger {
  margin-top: 22px; border: 1px solid #e6b8b8; border-radius: 10px;
  background: #fdf5f5; padding: 12px 16px 14px;
}
.wiz-danger-head { margin: 0 0 10px; font-size: 15px; color: #a11c1c; }
.wiz-danger-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wiz-danger .hint { margin-top: 10px; }
.pdf-run-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.pdf-run-row .pdf-run-part { display: inline-flex; align-items: center; gap: 5px; }
.ai-panel-save { margin-top: 8px; }
.parse-summary { margin: 8px 0; padding: 8px 10px; background: #f6f7f8; border-radius: 6px; }
/* į kainyną netraukiamų eilučių sąrašas (3 žingsnis, po peržiūros lentele) */
.skipped-rows { margin-top: 8px; }
.skipped-rows summary { cursor: pointer; font-weight: 600; }
.skipped-rows .skipped-wrap { overflow: auto; max-height: 320px; margin-top: 6px;
  border: 1px solid var(--grey); border-radius: 6px; background: #fff; }
.skipped-table td { vertical-align: top; }
.parse-summary > div { margin: 2px 0; }
/* peržiūros lentelė */
.review-toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
/* „Palikti / Ištrinti" mygtukai statuso celėje */
.row-actions { display: inline-flex; gap: 4px; margin-left: 6px; white-space: nowrap; }

/* filtro laukeliai įrankių juostose — ne visu pločiu (globalus input { width:100% });
 * × dešinėje išvalo vienu paspaudimu */
.review-toolbar .filter-wrap { position: relative; margin-left: auto; }
.review-toolbar #review-q, .review-toolbar #full-q {
  width: 260px; padding: 5px 26px 5px 9px; font-size: 13px;
}
.filter-clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: none; background: none; cursor: pointer; font-size: 16px;
  color: var(--grey-mid); padding: 0 4px; line-height: 1;
}
.filter-clear:hover { color: var(--black); }

/* KOMPAKTIŠKA struktūros zona (2026-08-30): daugiau informacijos ekrane, kad
 * lentelę ir laukus būtų patogu lyginti nekstrolinant */
#m-structure .struct-grid { gap: 6px 8px; margin-bottom: 6px; }
#m-structure .struct-grid label { font-size: 12px; gap: 2px; }
#m-structure .struct-input { padding: 4px 7px; font-size: 12.5px; }
#m-structure .hint, #m-struct-top .hint { font-size: 11.5px; margin-top: 2px; }
#m-struct-top .pl-card img.pl-logo { max-height: 40px; }
#m-struct-top .pl-card { padding: 4px 0; }
.th-letter { font-weight: 400; letter-spacing: normal; text-transform: none; }
/* rūšiavimas ant antraštės — paspaudžiama */
.review-table th.th-sort { cursor: pointer; user-select: none; }
.review-table th.th-sort:hover { color: var(--gold-dark, #8a6d1d); }

/* nemapinti failo stulpeliai — pilki: matomi, bet aiškiai „dar nepaimti" */
.review-table th.unmapped-col, .review-table td.unmapped-col {
  background: #fafafa; color: #777;
}
.review-scroll { max-height: 460px; overflow: auto; border: 1px solid #e6e6e6; border-radius: 6px; }
.review-table { font-size: 13px; margin: 0; }
.review-table thead th { position: sticky; top: 0; background: #f0f1f3; z-index: 1; }
.review-pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 8px; }
.badge-approved { background: #d6efd3; color: #2c7a2c; border-color: #b6e0af; }
.badge-needs_review { background: #fff3cd; color: #8a6d1b; border-color: #f0dfa0; }

/* --- gamintojo korteles zingsniu antrastes (veiksmu seka) --- */
.m-step {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 26px 0 12px;
  padding-top: 18px;
  border-top: 2px solid #ececec;
  font-size: 16px;
  color: var(--black, #1a171b);
}
.m-step:first-of-type { border-top: none; padding-top: 4px; margin-top: 10px; }
.step-no {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold, #b8912f);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  align-self: center;
}
.m-step small { color: #8a8e92; font-weight: 400; font-size: 13px; }

/* --- apdorojimo progresas (PDF puslapiai) --- */
.progress-wrap { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.progress-bar {
  height: 10px; background: #e6e8ea; border-radius: 5px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--gold, #b8912f); border-radius: 5px;
  transition: width .4s ease;
}
.progress-fill.progress-error { background: #d9534f; }
.progress-label { font-size: 13px; color: #555; }
.error-note {
  margin-top: 6px; padding: 8px 10px; border-radius: 5px;
  background: #fbe9e7; border: 1px solid #f3b8b0; color: #a3271b;
  font-size: 13px; white-space: pre-wrap;
}
/* Klaida žingsnio viršuje (m-doc-error) — atskirta nuo turinio žemiau */
#m-doc-error .error-note { margin: 0 0 10px; }
/* 8 ž.: neperžiūrėtos eilutės į DB nekeliamos — turi rėkti (2026-09-06) */
.commit-unreviewed { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
/* peržiūros problemų filtras + masiniai veiksmai (2026-09-06) */
#review-flag { margin: 0 8px; max-width: 320px; }
/* savikainos valiutos pasirinkimas 4 ž. (2026-09-06) */
/* savikainos valiuta — tokia pat kaip šaltinio pasirinkimas, eilutėje prieš jį (2026-09-27) */
.pb-cur { width: auto; }
.pb-src-row .pb-label { margin-bottom: 0; }
.pb-cost-notes { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
/* Kainynų konfliktų lentelė: pasirinkimas kodui (◉ kainyno stulpelyje) */
.xp-table td.xp-pick { cursor: pointer; text-align: left; }
.xp-table .xp-choice { display: inline-flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.xp-table .xp-choice input { margin-top: 3px; }
.xp-table .xp-choice > span { text-align: right; min-width: 56px; }
/* Dublikatų grupės 3 žingsnyje (review_duplicates.js) */
.dup-group { border: 1px solid #e6e0d0; border-radius: 6px; padding: 8px 10px; margin: 10px 0; }
.dup-group .dup-head { margin-bottom: 6px; overflow-wrap: anywhere; }
/* plati lentelė (daug laukų, superadmino „Kodas") slenka kortelės viduje, kaip peržiūros .review-scroll —
 * kitaip išlįsdavo už skydelio ir slinkdavo visas puslapis (390 px: lentelė ~1370 px) */
.dup-group .dup-table-wrap { overflow-x: auto; max-width: 100%; margin-bottom: 6px; }
.dup-group .dup-keep { white-space: nowrap; cursor: pointer; }
/* (0,2,1) + vėliau — nurungia globalų `input:not(...) { width:100% }`: radijas ir kodo laukelis siauri */
.dup-group input[type=radio], .xp-table input[type=radio] { width: auto; }
.dup-group input.dup-code { width: 150px; min-width: 0; }
.dup-group .dup-code-wrap { white-space: nowrap; }
/* Dublikatų skydelis 3 žingsnio viršuje (duplicates_panel.js, 2026-10-01): kompaktiškas, skyriai suskleidžiami */
.dup-panel { border: 1px solid #e6e0d0; border-radius: 6px; padding: 8px 12px; margin: 0 0 12px; background: #fffdf7;
  scroll-margin-top: 80px; }   /* „Atidaryti skydelį": antraštė ne po lipnia „Kitas žingsnis" juosta (.wiz-next) */
.dup-panel-head { font-size: 15px; }
.dup-panel-head.dup-panel-todo strong { color: var(--review-text); }
.dup-panel > details { margin-top: 6px; }
.dup-panel > details > summary { cursor: pointer; font-size: 13.5px; }
.dup-panel .dup-toolbar { margin: 6px 0 2px; align-items: center; }
.dup-panel .dup-pager { display: inline-flex; gap: 4px; align-items: center; }
.dup-panel .dup-group { margin: 8px 0; }
.dup-list { margin: 4px 0 2px 18px; font-size: 13px; }
.dup-item { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 2px 0; border-bottom: 1px dashed #eee6d2; }
.dup-item .dup-item-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }   /* ilgas kodas — ne už skydelio */
.dup-item > .action-notice { flex: 1 1 100%; margin: 4px 0 0; }
.dup-list-pager { margin: 4px 0 0 18px; }
.dup-filter-note { margin: 6px 0; }
/* 5 žingsnio įspėjimas „kodų kainyne pasikartoja" (review_duplicates.js duplicateWarningBlock) */
.dup-warning-list { margin: 4px 0 2px 18px; font-variant-numeric: tabular-nums; }
.dup-warning-actions { margin-top: 4px; }
/* peržiūros eilutės šaltinis po būsena: „psl. 14" / „lapas …" (2026-09-07) */
.row-src { display: block; margin-top: 3px; }
.bulk-actions { display: inline-flex; gap: 6px; margin-left: 10px; }
.commit-unreviewed .small { font-weight: 400; margin-top: 4px; }
/* Gamintojo preambulės pastabos dokumento antraštėje (iš kainyno viršaus) */
.doc-preamble {
  margin-top: 4px; padding: 6px 10px; border-radius: 5px;
  background: #f6f4ee; border: 1px solid #e6e0d0; color: #6b6250; font-size: 13px;
}
/* Langelis, DĖL KURIO eilutė pateko į peržiūrą (flag → stulpelis); priežastis title */
.review-table td.cell-flag {
  background: #fbe9e7; box-shadow: inset 0 0 0 1px #f3b8b0; color: #a3271b;
  cursor: help;
}
@keyframes progind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.progress-fill.progress-indeterminate { width: 40%; animation: progind 1.3s linear infinite; }
/* mini baras kėlimų lentelėje */
.progress-mini-wrap { display: flex; align-items: center; gap: 6px; min-width: 120px; }
.progress-mini { flex: 1; height: 7px; background: #e6e8ea; border-radius: 4px; overflow: hidden; }

/* --- modulio AI override panele gamintojo korteleje --- */
.ai-panel { display: flex; flex-direction: column; gap: 8px; }
.ai-panel-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.ai-panel-row label { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.ai-panel-row select { width: auto; min-width: 160px; }
.ai-prompt { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* --- kainyno santrauka ir pokalbis (P5) --- */
.chat-box { border: 1px solid #ddd; border-radius: 6px; background: #fafafa; }
.chat-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-msg {
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e3e3e3;
  max-width: 92%;
  align-self: flex-start;
}
.chat-msg.chat-user { align-self: flex-end; background: #eef3ff; border-color: #ccd9f5; }
.chat-msg.chat-summary { background: #fdf7e3; border-color: #ecd9a0; align-self: stretch; max-width: 100%; }
.chat-head { font-size: 12px; color: #7a7e82; margin-bottom: 4px; }
.chat-content { white-space: pre-wrap; font-size: 13.5px; }
.chat-msg .btn { margin-top: 8px; }
.chat-controls { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e3e3e3; align-items: flex-end; }
.chat-controls .chat-input { flex: 1; resize: vertical; min-height: 40px; }

/* --- kainynu failu logas (gamintojo kortele, P4) --- */
.files-table { font-size: 13px; }
.files-table th, .files-table td { padding: 6px 8px; }
.files-table .actions { display: flex; gap: 5px; flex-wrap: wrap; }
#m-files > label { display: block; margin-bottom: 6px; }

/* --- kainynu ikelimas pagal paskirti (gamintojo kortele, P3) --- */
.upload-purpose {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.upload-purpose-item {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.upload-purpose-item .hint { margin: 0; }
@media (max-width: 900px) {
  .upload-purpose { grid-template-columns: 1fr; }
}

/* --- isplestiniai nustatymai (details) --- */
details.advanced { margin: 14px 0; }
details.advanced > summary {
  cursor: pointer;
  font-size: 13px;
  color: #666;
  user-select: none;
  padding: 4px 0;
}
details.advanced > summary:hover { color: #1a171b; }
details.advanced[open] > summary { margin-bottom: 8px; }

/* --- rusiuojamos lenteles antrastes --- */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: #1a171b; text-decoration: underline; }

/* --- redaguojamas strukturos redaktorius + eksportas --- */
.struct-status { padding: 8px 11px; border-radius: 4px; font-size: 13.5px; margin-bottom: 10px; }
.struct-status.struct-ok { background: #eef6ec; border: 1px solid #cfe6c8; }
.struct-status.struct-warn { background: #fff6e0; border: 1px solid #f0d98a; }
/* keli lapai, ne visi pažymėti — raudona, kad tikrai pastebėtų (2026-09-06) */
.struct-status.struct-danger { background: #fbeaec; border: 1px solid #ecb8bd; border-left: 4px solid var(--red); }
.struct-status.struct-danger strong { color: var(--red); }
.struct-status.struct-empty { background: #f4f4f4; border: 1px solid #e0e0e0; color: #555; }
.struct-status .small { font-size: 12.5px; margin: 3px 0 0; }
.struct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 12px;
  margin: 6px 0;
}
.struct-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: #555; margin: 0; }
.struct-input { width: 100%; padding: 6px 9px; }
.struct-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
#m-struct-note { margin-top: 6px; }
#m-struct-note > div { margin: 2px 0; }
.export-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0; }

/* --- atnaujinimo importo panelė --- */
.import-panel h3 { margin: 0 0 8px; font-size: 16px; }
.import-panel .small { margin: 3px 0; }
.import-panel .reason { margin: 4px 0; color: #9c2118; font-weight: 600; }
.import-blocked { border: 1px solid #f0b3ab; border-left: 4px solid #bf1a26; background: #fdecea; }
.import-ok { border: 1px solid #cfe6c8; border-left: 4px solid #2e7d32; background: #eef6ec; }
.import-panel .btn { margin-top: 6px; }
/* kainyno tipo juosta — pirmas dalykas panelėje, tad atskirta linija */
.type-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.type-row select { width: auto; padding: 2px 6px; font-size: 13px; }
.type-row > .muted.small { flex-basis: 100%; }
.import-panel details.hint { margin-top: 8px; }
.import-panel details.hint summary { cursor: pointer; font-weight: 600; }
.import-panel details.hint .table { margin-top: 6px; }

/* --- API raktų skiltis --- */
.ok-text { color: #1c7c2e; font-weight: 600; }
#apikeys-table input[type=password] { width: 100%; max-width: 320px; }
#apikeys-table td { vertical-align: middle; }

/* --- KAINYNAI: filtras, paieška --- */
.filter-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.filter-inline .combo { min-width: 220px; }
td.mono, .mono { font-family: ui-monospace, Consolas, monospace; }
#search-results { margin-top: 10px; }
#search-results table { margin-top: 6px; }

/* --- PREKIŲ KĖLIMAS: greito vedimo lentelė --- */
.quick-entry { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.quick-entry label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.quick-entry .qe-mfr { min-width: 260px; }
.quick-entry .qe-mfr .combo { min-width: 260px; }
.quick-entry .qe-ref { flex: 1; min-width: 220px; }
.quick-entry #qe-reference { font-family: ui-monospace, Consolas, monospace; }
.qe-lookup { margin-top: 8px; min-height: 22px; }
.lookup-ok { color: #1c7c2e; font-weight: 600; }
.lookup-warn { color: #9c6d1a; font-weight: 600; }
.lookup-sugg { color: #345; cursor: pointer; padding: 2px 0 2px 12px; }
.lookup-sugg:hover { text-decoration: underline; }
.badge-task-new { background: #e3edf7; color: #1d4e79; }
.badge-task-enriching { background: #fdf3d7; color: #8a6d1a; }
.badge-task-review { background: #fdeadb; color: #9c5518; }
.badge-task-done { background: #e3f2e5; color: #1c7c2e; }
.badge-task-failed { background: #fdecea; color: #bf1a26; }

/* Lapų pasirinkimas (P4): kuriuos Excel lapus importuoti */
.sheet-picker { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
/* lapo atskira struktūra — skiltis po lapų sąrašu (Intelight 2026) */
.sheet-overrides { margin-top: 6px; }
.sheet-override { border: 1px solid #e3dcc4; border-radius: 4px; background: #fffdf5; padding: 4px 8px; margin-top: 4px; }
.sheet-override > summary { cursor: pointer; font-size: 13px; }
.sheet-override .sheet-override-head { align-items: end; }
.sheet-override .struct-grid label.check { flex-direction: row; align-items: center; gap: 6px; }
.sheet-pick { display: inline-flex; align-items: center; gap: 5px; font-size: 13px;
  padding: 3px 8px; border: 1px solid #d5dde5; border-radius: 4px; background: #fff; }
.sheet-pick input { margin: 0; }

/* paieškos combo „×" — išvalyti pasirinkimą (2026-09-03) */
.combo { position: relative; }
.combo-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: #9aa1ab; font-size: 18px; line-height: 1;
  cursor: pointer; padding: 2px 6px;
}
.combo-clear:hover { color: #333; }
.combo-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: #6b7280; font-size: 16px; line-height: 1;
  cursor: pointer; padding: 2px 8px;
}
.combo-toggle:hover { color: #111; }
.combo-input { padding-right: 26px; }

/* Gamintojo kainyno būsenos taškelis paieškos sąraše (2026-09-03) */
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 7px; vertical-align: middle; flex: none;
}
.dot-none    { background: #c8ccd0; }
.dot-pending { background: #6e8ba3; }
.dot-failed  { background: var(--red); }
.dot-review  { background: #c9922a; }
.dot-stale   { background: #d9534f; }
.dot-valid   { background: var(--green); }
/* įkeltas į katalogą, bet tiekėjas dar nepatvirtintas gamintojo kortelėje (2026-09-11) */
.dot-supplier { background: #8e6bbf; }
.dot-legend { display: flex; flex-wrap: wrap; gap: 3px 16px; margin: 6px 0 0; }
.dot-legend .status-dot { margin-right: 4px; }

/* ---- drag & drop failų įkėlimui (2026-09-06) ---- */
.drop-zone { transition: background-color .15s, outline-color .15s; outline: 2px dashed transparent; outline-offset: -6px; }
.drop-zone.drop-active { outline-color: var(--gold); background: #fffdf2; }
.drop-hint { color: var(--grey-mid); font-weight: 400; font-size: 12px; }
/* pavadinimų formavimo blokas: būsena → užduotis → pokalbis → taisyklė (2026-09-15) */
.name-block { margin-top: 14px; padding-top: 10px; border-top: 1px solid #e3dcc4; }
.name-block-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
summary.name-block-title { cursor: pointer; }   /* suskleidžiama — atsiveria pažymėjus vertimą (2026-10-12) */
.name-status { padding: 8px 11px; border-radius: 4px; background: #f4f4f4; border: 1px solid #e0e0e0; font-size: 13px; }
.name-status > div { margin: 2px 0; }
.name-step { margin-top: 12px; }
.name-chat { margin-top: 10px; border: 1px solid #ddd9cb; border-radius: 7px; background: #faf9f5; padding: 8px 12px; }
.name-chat > summary { cursor: pointer; font-size: 13px; }
.name-chat-compose { margin-top: 8px; }
.name-chat-compose .name-chat-input { width: 100%; box-sizing: border-box; font-size: 13px; }
.name-chat-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.name-chat-log { max-height: 380px; overflow: auto; margin-top: 10px; }
.name-chat-log:empty::before { content: 'Aprašykite norimą rezultatą savais žodžiais. Agentas padės parinkti šaltinius ir patikslinti instrukciją.'; display: block; color: #777; font-size: 13px; padding: 8px 0; }
.name-chat-message { padding: 10px 12px; margin: 8px 0; border-radius: 6px; max-width: 92%; border: 1px solid #e5e1d6; background: white; }
.name-chat-user { margin-left: auto; background: #f5edcf; border-color: #e5dba9; }
.name-chat-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; margin-top: 4px; }
.name-chat-suggestion { border-top: 1px solid #e5e1d6; margin-top: 10px; padding-top: 10px; }

/* kainyno DALYS (pricelist_parts.js): dalies žyma struktūros redaktoriuje ir suvestinė prieš kėlimą */
.struct-status.struct-part { background: #eef3fb; border: 1px solid #c5d5ee; color: #1f3a6b; }
.part-summary { margin: 4px 0 8px; padding: 6px 8px; border-left: 3px solid #5b7fbf; background: #f4f7fc; }
.part-summary .small { margin: 2px 0 0 4px; }
.part-row { margin-top: 6px; }

/* kainyno DALIŲ juosta 3 žingsnyje — dalys kaip lapai (pricelist_parts.js) */
.part-tabs { margin-top: 8px; }
.part-tab { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 10px;
  border: 1px solid #c5d5ee; border-radius: 4px; background: #fff; color: #1f3a6b; cursor: pointer; }
.part-tab:hover { background: #f4f7fc; }
.part-tab-active { background: #1f3a6b; color: #fff; border-color: #1f3a6b; font-weight: 700; }
.part-tab-active .muted { color: #d8e1f0; }
.part-tab .badge { font-size: 10px; padding: 1px 7px; }

/* programos versijos pasikeitimo juosta (common.js noteAppBuild) */
.app-build-banner { position: sticky; top: 0; z-index: 50; display: flex; gap: 12px; align-items: center;
  justify-content: center; padding: 8px 14px; background: #fff1c9; color: #6b4a00; border-bottom: 1px solid #f0d98a;
  font-size: 14px; font-weight: 600; }
