/* Reclamații Veltadoors – stiluri (paleta din formularele Velta Doors) */
@import url("https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600&display=swap");

:root {
  --brown: #4a3728;      /* bara de secțiune din formulare */
  --bronze: #b08350;     /* rama logo / linia de sub antet */
  --peach: #fdd8cc;      /* câmpurile de completat din PDF */
  --peach-soft: #fff1ec;
  --ink: #2f2a22;
  --muted: #8a8477;
  --line: #ddd5c8;
  --paper: #ffffff;
  --bg: #f7f5f2;
  --ok: #2f7d4f;
  --err: #b3261e;
  --head: "Jost", "Segoe UI", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 var(--body); color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: #7a5a35; }
a:hover { color: var(--brown); }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--head); font-weight: 500; margin: 0 0 .5em; }
h1 { font-size: 26px; color: var(--brown); }
h3 { font-size: 15px; color: var(--brown); }

/* ---------- antet ---------- */
.top { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: var(--paper); border-bottom: 2px solid var(--bronze); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-sub { font-family: var(--head); font-size: 18px; font-weight: 300; color: var(--muted); border-left: 1px solid var(--line); padding-left: 12px; }
.logo { position: relative; display: inline-flex; align-items: center; height: 44px; padding: 0 6px 0 14px; }
.logo-frame { position: absolute; left: 0; top: 0; width: 34px; height: 44px; border: 2px solid var(--bronze); }
.logo-frame::after { content: ""; position: absolute; left: 6px; top: 4px; width: 30px; height: 42px; border: 2px solid #000; border-left: 0; }
.logo-txt { position: relative; display: flex; flex-direction: column; line-height: 1; font-family: var(--head); font-size: 15px; background: var(--paper); padding: 2px 0 2px 4px; margin-left: 10px; }
.logo-txt b { font-weight: 300; color: var(--bronze); letter-spacing: .04em; }
.logo-txt i { font-style: normal; font-weight: 400; letter-spacing: .04em; }
.menu { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.menu a { text-decoration: none; color: var(--ink); padding: 7px 12px; border-radius: 3px; }
.menu a:hover { background: var(--peach-soft); }
.menu a.on { background: var(--brown); color: #fff; }
.user { color: var(--muted); font-size: 13px; white-space: nowrap; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; flex: 1; }
body.full .wrap { max-width: 100vw; overflow-x: hidden; min-width: 0; padding: 10px 14px 8px; }
body.public .wrap { max-width: 980px; }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 24px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: var(--paper); }
body.full .foot { display: none; }

.page-title { margin-bottom: 16px; }
.page-title p { margin: 0; color: var(--muted); }
.page-title.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.center { text-align: center; }

/* ---------- carduri / secțiuni ca în formular ---------- */
.card { background: var(--paper); border: 1px solid var(--line); padding: 0 18px 18px; margin-bottom: 16px; }
.card > h2 { background: var(--brown); color: #fff; font-size: 15px; font-weight: 500; margin: 0 -18px 14px; padding: 7px 14px; }
.card.narrow { max-width: 460px; margin: 0 auto 16px; padding-top: 18px; }
.card.narrow h1 { font-size: 22px; }
.card.internal > h2 { background: var(--bronze); }
.card.head-box { background: #f4f0ea; padding-top: 14px; }

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
label small { display: block; font-weight: 400; font-style: italic; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 4px; font: inherit; font-weight: 400; color: var(--ink); background: var(--peach-soft); border: 0; border-bottom: 1px solid #c9b8a8; padding: 7px 9px; border-radius: 0; }
input:focus, select:focus, textarea:focus { background: var(--peach); outline: none; border-bottom-color: var(--bronze); }
input:disabled { background: #eee9e2; color: var(--muted); }
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; margin: 0 4px 0 0; accent-color: var(--brown); }
input[type=file] { background: transparent; border: 1px dashed var(--bronze); padding: 12px; }
textarea { resize: vertical; }
.chk { display: inline-flex; align-items: center; font-weight: 400; margin: 0 16px 6px 0; }
.checks { margin-bottom: 10px; }
.lbl { margin-right: 10px; }
.hint { color: var(--muted); font-size: 12.5px; font-style: italic; margin: 6px 0; }
.err { color: var(--err); font-weight: 400; font-size: 12px; }
.mt { margin-top: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
.span2 { grid-column: span 2; }
.hp { position: absolute; left: -9999px; }
fieldset { border: 1px solid var(--line); margin: 0 0 10px; padding: 8px 10px; }
legend { font-weight: 600; font-size: 13px; }
fieldset .chk { display: flex; margin: 3px 0; }
fieldset small { color: var(--muted); display: block; margin-top: 6px; }

/* tabel articole din formular */
.tbl-scroll { overflow-x: auto; }
.art-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.art-table th { background: var(--brown); color: #fff; font-weight: 500; font-size: 12px; padding: 6px; text-align: center; }
.art-table td { border: 1px solid var(--line); padding: 2px; }
.art-table td input, .art-table td select { margin: 0; padding: 5px 6px; }
.art-table td.nr { width: 32px; text-align: center; color: var(--muted); }
.art-table input.num { width: 70px; text-align: right; }
.art-table input.wide { min-width: 220px; }
.btn-x { border: 0; background: transparent; color: var(--err); font-size: 18px; cursor: pointer; padding: 0 6px; }

/* butoane */
.btn { display: inline-block; font: 500 14px var(--head); background: var(--brown); color: #fff; border: 1px solid var(--brown); padding: 8px 16px; cursor: pointer; text-decoration: none; border-radius: 2px; }
.btn:hover { background: #33261b; color: #fff; }
.btn.ghost { background: transparent; color: var(--brown); }
.btn.ghost:hover { background: var(--peach-soft); }
.btn.danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn.big { padding: 11px 26px; font-size: 15px; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: wait; }
.actions { display: flex; gap: 10px; justify-content: flex-end; padding: 10px 0; }
.actions.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding-top: 22px; }

/* mesaje */
.flash { padding: 10px 14px; margin-bottom: 14px; border-left: 4px solid var(--ok); background: #eaf4ee; }
.flash.err { border-color: var(--err); background: #fbeceb; }
.flash.warn { border-color: #b7791f; background: #fdf4e3; }
.flash ul { margin: 4px 0 0; padding-left: 18px; }
.success-box { text-align: center; padding-top: 24px; }
.big-nr { font: 500 34px var(--head); color: var(--brown); letter-spacing: .03em; margin: 4px 0 14px; }
.status-result { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }

/* pastile status */
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eee; white-space: nowrap; }
.st-noua { background: #e6eefc; color: #1f4e9c; }
.st-in_analiza { background: #fff1d6; color: #8a5a00; }
.st-pv_depozit { background: #e1f0d6; color: #3d6b1f; }
.st-finalizata { background: #fff6b3; color: #6b5d00; }
.st-refuzata { background: #fbe0f5; color: #8e1b74; }
.role-admin { background: var(--brown); color: #fff; }
.role-extern { background: #d8eef3; color: #1e5b6b; }

/* fișa detaliu */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.side .card { padding-top: 0; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.file { position: relative; border: 1px solid var(--line); padding: 6px; font-size: 12px; }
.file a { text-decoration: none; display: block; }
.file img { width: 100%; height: 90px; object-fit: cover; display: block; background: #eee; }
.file .ficon { display: flex; align-items: center; justify-content: center; height: 90px; background: var(--peach-soft); font: 500 16px var(--head); color: var(--brown); }
.file .fname { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.file small { color: var(--muted); }
.file form { position: absolute; top: 2px; right: 2px; }
.file .btn-x { background: #fff; }
.log { list-style: none; padding: 0; margin: 0; max-height: 420px; overflow: auto; font-size: 12.5px; }
.log li { padding: 5px 0; border-bottom: 1px solid #f0ebe4; }
.log small { display: block; color: var(--muted); }
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.pre { white-space: pre-wrap; }
.img-slot { margin-top: 12px; border: 1px dashed var(--bronze); padding: 10px; position: relative; }
.img-slot img { display: block; max-width: 100%; max-height: 220px; margin: 8px 0; }
.img-slot .btn-x { position: absolute; top: 4px; right: 4px; }

/* tabele simple */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: middle; }
.tbl th { background: #f4f0ea; font-weight: 600; }
.tbl tr.muted td, .tbl .muted { color: var(--muted); }
.tbl input { margin: 0; padding: 4px 6px; }
.centr .num, .centr input.num { text-align: right; }
.centr input.cell { width: 90px; margin-left: auto; }
.centr input.saved { background: #e3f3e8; }
.centr input.bad { background: #fbe0de; }
.centr td.has { font-weight: 600; }
.centr tfoot th { background: var(--brown); color: #fff; }
.barcell { width: 140px; }
.bar { display: block; height: 8px; background: var(--bronze); }

/* ---------- tabelul tip Excel ---------- */
.toolbar { position: relative; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0 8px; }
.toolbar select, .toolbar input[type=search] { width: auto; margin: 0; padding: 5px 8px; }
.toolbar input[type=search] { min-width: 220px; }
.toolbar .chk { margin: 0 6px; }
.toolbar .sp { flex: 1; }
.tabs { display: flex; border: 1px solid var(--line); background: var(--paper); }
.tabs button { border: 0; border-right: 1px solid var(--line); background: transparent; padding: 5px 9px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.tabs button:last-child { border-right: 0; }
.tabs button.on { background: var(--brown); color: #fff; }
.col-menu { position: absolute; right: 0; top: 40px; z-index: 50; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(60, 40, 20, .18); padding: 8px 12px; max-height: 60vh; overflow: auto; columns: 2; min-width: 380px; }
.col-menu label { font-weight: 400; margin: 3px 0; display: flex; gap: 4px; break-inside: avoid; }
.grid-help { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.grid-help .hl { color: var(--brown); }
kbd { font: 11px var(--body); border: 1px solid var(--line); border-bottom-width: 2px; padding: 0 4px; background: #fff; }
.legend i { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin: 0 4px 0 10px; border: 1px solid rgba(0,0,0,.15); }
.grid-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 5px 2px 0; color: var(--muted); }
.grid-status.busy { color: #8a5a00; }
.grid-status.ok { color: var(--ok); }
.grid-status.err { color: var(--err); font-weight: 600; }

#grid.tabulator { max-width: 100%; font-size: 13px; border: 1px solid #c9c1b4; background: #fff; }
#grid .tabulator-header { background: #f4f0ea; border-bottom: 2px solid var(--bronze); }
#grid .tabulator-header .tabulator-col { background: #f4f0ea; }
#grid .tabulator-col-title { font-weight: 600; }
#grid .tabulator-header-filter input, #grid .tabulator-header-filter select { padding: 2px 4px; font-size: 12px; background: #fff; border: 1px solid #ddd; margin: 0; }
#grid .tabulator-row { min-height: 26px; }
#grid .tabulator-cell { padding: 4px 6px; border-right: 1px solid #e8e2d8; }
#grid .tabulator-row .tabulator-cell.can-edit { background-image: none; }
#grid .tabulator-row.cont { border-top: 0; }
#grid .tabulator-row:not(.cont) { border-top: 1px solid #c9c1b4; }
#grid .tabulator-row.cont .rc-col { color: #b6aea2; }
#grid .tabulator-row.cont .rc-col a, #grid .tabulator-row.cont .rc-col .pill { opacity: .45; }
#grid .tabulator-cell.rez-col { background: #f6fbff; }
#grid .tabulator-cell.tabulator-editing { border: 2px solid var(--bronze) !important; background: #fff; }
#grid .tabulator-row .tabulator-cell.tabulator-range-selected:not(.tabulator-range-only-cell-selected) { background: #f3e2d6; }
#grid .tabulator-range-overlay .tabulator-range.tabulator-range-active { border-color: var(--bronze); }
#grid .tabulator-range-overlay .tabulator-range-cell-active { border-color: var(--brown); }
#grid .tabulator-row.lg-fin { background: #fffbd1; }
#grid .tabulator-row.lg-pv { background: #e9f4df; }
#grid .tabulator-row.lg-pl { background: #e3f3f7; }
#grid .tabulator-row.lg-ref { background: #fde3f8; }
.legend .lg-fin { background: #fff35a; } .legend .lg-pv { background: #9bbb59; } .legend .lg-pl { background: #4bacc6; } .legend .lg-ref { background: #ff00ff; }
#grid .tabulator-calcs-bottom { background: #f4f0ea; font-weight: 600; }
.rc-link { font-weight: 600; text-decoration: none; }
.clip { font-size: 11px; }
.src-web { display: inline-block; line-height: 14px; font-size: 10px; background: var(--bronze); color: #fff; padding: 0 4px; border-radius: 2px; }

@media (max-width: 900px) {
  .grid2, .grid4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .detail-layout { grid-template-columns: 1fr; }
  .top { padding: 8px 12px; gap: 10px; }
  .wrap { padding: 14px 10px 30px; }
  .dl { grid-template-columns: 1fr; }
}
@media print {
  .top .menu, .user, .actions, .side, .foot { display: none; }
  .card { break-inside: avoid; }
}
