/* ============================================================
   CTL CRM — Layout
   Shell aplicație, sidebar, bară superioară, navigație mobilă,
   kanban producție, ecran monitor hală
   ============================================================ */

/* ---------- SHELL ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}
.shell.nav-collapsed { grid-template-columns: var(--nav-w-collapsed) minmax(0, 1fr); }

/* ---------- SIDEBAR ---------- */
.sidebar {
  grid-column: 1;
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-brd);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 60;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 12px;
  border-bottom: 1px solid var(--nav-brd);
  flex: none;
}
.nav-brand .mark {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 14px;
  letter-spacing: -.02em;
  flex: none;
  overflow: hidden;
}
.nav-brand .mark img { width: 100%; height: 100%; object-fit: contain; }
.nav-brand .txt { min-width: 0; }
.nav-brand .txt strong {
  display: block;
  color: var(--nav-ink-hi);
  font-size: var(--fs-sm);
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.nav-brand .txt span {
  display: block;
  color: var(--nav-ink-dim);
  font-size: var(--fs-2xs);
  letter-spacing: .02em;
  margin-top: 1px;
}

.nav-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px 14px;
  scrollbar-width: thin;
}
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-scroll::-webkit-scrollbar-thumb { background: #2e3743; border: 0; }

.nav-group {
  padding: 12px 10px 5px;
  font-size: var(--fs-2xs);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--nav-ink-dim);
}
.nav-group:first-child { padding-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  margin-bottom: 1px;
  border-radius: var(--r-md);
  color: var(--nav-ink);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background var(--tr), color var(--tr);
  position: relative;
}
.nav-item > i:first-child {
  width: 16px;
  font-size: 13px;
  text-align: center;
  flex: none;
  color: var(--nav-ink-dim);
  transition: color var(--tr);
}
.nav-item:hover { background: var(--nav-active-bg); color: var(--nav-ink-hi); }
.nav-item:hover > i:first-child { color: var(--nav-ink); }

.nav-item.is-active {
  background: var(--nav-active-bg);
  color: var(--nav-ink-hi);
  font-weight: 600;
}
.nav-item.is-active > i:first-child { color: var(--brand); }
.nav-item.is-active::before {
  content: '';
  position: absolute;
  left: -8px; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--brand);
  border-radius: 0 2px 2px 0;
}

.nav-item .n {
  margin-left: auto;
  min-width: 18px; height: 17px;
  padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #2b3441;
  color: var(--nav-ink);
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 650;
}
.nav-item .n.hot { background: var(--err); color: #fff; }

.nav-foot {
  flex: none;
  border-top: 1px solid var(--nav-brd);
  padding: 8px;
}
.nav-user {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border-radius: var(--r-md);
  transition: background var(--tr);
  text-align: left;
}
.nav-user:hover { background: var(--nav-active-bg); }
.nav-user .av { background: #2b3441; border-color: #37414f; color: var(--nav-ink-hi); }
.nav-user .meta { min-width: 0; flex: 1; }
.nav-user .meta strong {
  display: block; font-size: var(--fs-xs); font-weight: 600;
  color: var(--nav-ink-hi);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-user .meta span {
  display: block; font-size: var(--fs-2xs); color: var(--nav-ink-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-user > i:last-child { color: var(--nav-ink-dim); font-size: 10px; }

/* Sidebar restrâns */
.nav-collapsed .nav-brand { justify-content: center; padding: 0; }
.nav-collapsed .nav-brand .txt,
.nav-collapsed .nav-group,
.nav-collapsed .nav-item span,
.nav-collapsed .nav-item .n,
.nav-collapsed .nav-user .meta,
.nav-collapsed .nav-user > i:last-child { display: none; }
.nav-collapsed .nav-item { justify-content: center; padding: 0; }
.nav-collapsed .nav-item > i:first-child { font-size: 15px; }
.nav-collapsed .nav-user { justify-content: center; }
.nav-collapsed .nav-group { padding: 8px 0 4px; }
.nav-collapsed .nav-group::after {
  content: ''; display: block; height: 1px; background: var(--nav-brd); margin: 0 6px;
}

/* ---------- ZONA PRINCIPALĂ ---------- */
.main {
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: var(--s3);
  height: var(--topbar-h);
  padding: 0 var(--s4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar .crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  min-width: 0;
}
.topbar .crumbs a:hover { color: var(--ink); }
.topbar .crumbs .sep-c { color: var(--ink-4); font-size: 10px; }
.topbar .crumbs strong { color: var(--ink); font-weight: 600; }

.topbar .gsearch {
  position: relative;
  margin-left: auto;
  width: 300px;
  max-width: 34vw;
}
.topbar .gsearch i {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--ink-4); pointer-events: none;
}
.topbar .gsearch .inp {
  height: 32px;
  padding-left: 30px; padding-right: 42px;
  background: var(--surface-2);
  border-color: var(--border);
  font-size: var(--fs-sm);
}
.topbar .gsearch .inp:focus { background: var(--surface); }
.topbar .gsearch kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--font);
  font-size: 10px; font-weight: 600;
  color: var(--ink-4);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 1px 5px;
  pointer-events: none;
}

.topbar .acts { display: flex; align-items: center; gap: 2px; }

/* ---------- PAGINĂ ---------- */
.page {
  flex: 1 1 auto;
  padding: var(--s5) var(--s5) var(--s10);
  max-width: var(--page-max);
  width: 100%;
}
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s5);
  flex-wrap: wrap;
}
.page-head h1 { font-size: var(--fs-2xl); }
.page-head .lede { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 3px; }
.page-head .acts { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }

.section { margin-bottom: var(--s6); }
.section > .section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.section > .section-head h2 { font-size: var(--fs-lg); }

/* ---------- NAVIGAȚIE MOBILĂ ---------- */
.mobile-only { display: none; }
.bottom-nav { display: none; }
.nav-scrim { display: none; }

@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 268px;
    transform: translateX(-100%);
    transition: transform var(--tr-slow);
    box-shadow: var(--sh-lg);
  }
  .shell.nav-open .sidebar { transform: translateX(0); }
  .shell.nav-collapsed .sidebar { width: 268px; }
  .nav-collapsed .nav-brand .txt,
  .nav-collapsed .nav-group,
  .nav-collapsed .nav-item span,
  .nav-collapsed .nav-item .n,
  .nav-collapsed .nav-user .meta { display: revert; }
  .nav-collapsed .nav-item { justify-content: flex-start; padding: 0 10px; }
  .nav-collapsed .nav-brand { justify-content: flex-start; padding: 0 14px; }

  .nav-scrim {
    display: block;
    position: fixed; inset: 0;
    background: rgba(11,15,20,.5);
    z-index: 55;
    opacity: 0; pointer-events: none;
    transition: opacity var(--tr-slow);
  }
  .shell.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }

  .main { grid-column: 1; }
  .mobile-only { display: inline-flex; }
  .topbar .gsearch { width: auto; flex: 1; max-width: none; }
  .topbar .crumbs { display: none; }
}

@media (max-width: 720px) {
  .page { padding: var(--s4) var(--s3) calc(var(--bottombar-h) + var(--s8)); }
  .page-head h1 { font-size: var(--fs-xl); }
  .topbar { padding: 0 var(--s3); gap: var(--s2); }
  .topbar .gsearch kbd { display: none; }
  .topbar .gsearch .inp { padding-right: 10px; }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 70;
    height: calc(var(--bottombar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--border);
  }
  .bottom-nav a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 550;
    color: var(--ink-3);
    position: relative;
    min-height: 48px;
  }
  .bottom-nav a i { font-size: 16px; }
  .bottom-nav a.is-active { color: var(--brand); }
  .bottom-nav a.is-active::before {
    content: '';
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 26px; height: 2px;
    background: var(--brand);
    border-radius: 0 0 2px 2px;
  }
  .bottom-nav a .badge-n {
    position: absolute;
    top: 5px; left: 50%; margin-left: 4px;
  }

  /* Buton de acțiune flotant */
  .fab {
    position: fixed;
    right: var(--s4);
    bottom: calc(var(--bottombar-h) + var(--s4) + env(safe-area-inset-bottom));
    z-index: 65;
    width: 50px; height: 50px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px -4px rgba(225,75,3,.5);
  }
  .fab i { font-size: 18px; }
  .fab:active { transform: scale(.94); }
}

/* ---------- TABEL → CARDURI PE MOBIL ---------- */
@media (max-width: 720px) {
  .tbl-cards thead { display: none; }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: var(--s2);
    padding: 11px 12px;
    box-shadow: var(--sh-sm);
  }
  .tbl-cards tr:hover { background: var(--surface); }
  .tbl-cards td {
    border: 0;
    padding: 3px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s3);
    text-align: right;
  }
  .tbl-cards td::before {
    content: attr(data-l);
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-4);
    text-align: left;
    flex: none;
  }
  .tbl-cards td[data-l=""]::before { content: none; }
  /* Prima celulă = titlul cardului, pe toată lățimea */
  .tbl-cards td.card-title {
    display: block;
    text-align: left;
    padding-bottom: 7px;
    margin-bottom: 5px;
    border-bottom: 1px solid var(--border-soft);
  }
  .tbl-cards td.card-title::before { content: none; }
  .tbl-cards td.actions { justify-content: flex-end; padding-top: 8px; }
  .tbl-cards tr.flag-err  { border-left: 3px solid var(--err); }
  .tbl-cards tr.flag-warn { border-left: 3px solid var(--warn); }
  .tbl-cards tr.flag-ok   { border-left: 3px solid var(--ok); }
  .tbl-cards tr td:first-child { box-shadow: none !important; }
}

/* ---------- KANBAN PRODUCȚIE ---------- */
.kanban {
  display: flex;
  gap: var(--s3);
  overflow-x: auto;
  padding-bottom: var(--s3);
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.kan-col {
  flex: 0 0 272px;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  max-height: calc(100vh - 210px);
  scroll-snap-align: start;
}
.kan-head {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  flex: none;
}
.kan-head .k-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.kan-head strong { font-size: var(--fs-xs); font-weight: 650; letter-spacing: .01em; }
.kan-head .n {
  margin-left: auto;
  min-width: 19px; height: 18px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs); font-weight: 650; color: var(--ink-2);
}
.kan-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px;
  display: flex; flex-direction: column; gap: 7px;
  min-height: 80px;
}
.kan-body.drop-active { background: var(--brand-soft); outline: 2px dashed var(--brand-soft-brd); outline-offset: -4px; }

.wo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 11px;
  cursor: grab;
  transition: border-color var(--tr), box-shadow var(--tr);
  box-shadow: var(--sh-sm);
}
.wo-card:hover { border-color: var(--border-hard); box-shadow: var(--sh-md); }
.wo-card:active { cursor: grabbing; }
.wo-card.is-dragging { opacity: .4; }
.wo-card.prio-urgenta  { border-left: 3px solid var(--err); }
.wo-card.prio-ridicata { border-left: 3px solid var(--warn); }
.wo-card .wo-top {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin-bottom: 5px;
}
.wo-card .wo-no { font-size: var(--fs-2xs); font-weight: 650; color: var(--ink-4); letter-spacing: .02em; }
.wo-card .wo-name { font-size: var(--fs-sm); font-weight: 600; line-height: 1.32; margin-bottom: 3px; }
.wo-card .wo-client { font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: 8px; }
.wo-card .wo-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: var(--fs-2xs); color: var(--ink-3);
  margin-top: 7px;
}

@media (max-width: 720px) {
  .kan-col { flex: 0 0 84vw; max-height: none; }
  .kanban { scroll-snap-type: x mandatory; }
}

/* ---------- ECRAN MONITOR HALĂ (TV) ---------- */
.monitor {
  position: fixed; inset: 0; z-index: 999;
  background: #070a0e;
  color: #e8edf4;
  display: flex; flex-direction: column;
  font-family: var(--font);
  overflow: hidden;
}
.mon-head {
  display: flex; align-items: center; gap: 20px;
  padding: 16px 30px;
  border-bottom: 2px solid #1b232e;
  background: #0b0f15;
  flex: none;
}
.mon-head .mon-logo { height: 40px; }
.mon-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.mon-head .mon-sub { font-size: 13px; color: #6b7889; letter-spacing: .04em; text-transform: uppercase; }
.mon-clock {
  margin-left: auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mon-clock .t { font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.mon-clock .d { font-size: 13px; color: #6b7889; margin-top: 3px; }

.mon-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  background: #1b232e;
  flex: none;
}
.mon-strip > div { background: #0b0f15; padding: 13px 22px; }
.mon-strip .l {
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  color: #6b7889; font-weight: 600;
}
.mon-strip .v { font-size: 30px; font-weight: 700; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.mon-strip .v.ok { color: #4ade80; } .mon-strip .v.warn { color: #fbbf24; } .mon-strip .v.err { color: #f87171; }

.mon-body {
  flex: 1 1 auto;
  overflow: hidden;
  padding: 20px 30px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, 1fr);
  align-content: start;
}
.mon-card {
  background: #101720;
  border: 1px solid #1e2733;
  border-radius: 10px;
  padding: 16px 18px;
  display: flex; flex-direction: column;
  animation: monIn .35s ease both;
}
@keyframes monIn { from { opacity: 0; transform: translateY(10px); } }
.mon-card.st-urgent { border-color: #7f1d1d; background: #170f11; }
.mon-card.st-run    { border-color: #7c4a12; }
.mon-card.st-block  { border-color: #7f1d1d; }

.mon-card .mc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.mon-card .mc-no { font-size: 12px; font-weight: 700; color: #6b7889; letter-spacing: .05em; }
.mon-card .mc-stage {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 4px;
}
.mc-stage.s-run   { background: #3a2408; color: #fbbf24; }
.mc-stage.s-qc    { background: #221a3d; color: #a78bfa; }
.mc-stage.s-pack  { background: #0b2b33; color: #4dd0e8; }
.mc-stage.s-block { background: #38181a; color: #f87171; }
.mc-stage.s-prep  { background: #1c2430; color: #93a3b8; }

.mon-card .mc-prod { font-size: 20px; font-weight: 650; line-height: 1.25; margin-bottom: 5px; }
.mon-card .mc-client { font-size: 13px; color: #8b98a9; margin-bottom: 14px; }
.mon-card .mc-nums {
  display: flex; align-items: baseline; gap: 8px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 9px;
}
.mon-card .mc-nums b { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.mon-card .mc-nums span { font-size: 15px; color: #6b7889; }
.mon-card .mc-bar { height: 7px; background: #1c2430; border-radius: 4px; overflow: hidden; }
.mon-card .mc-bar > i { display: block; height: 100%; background: #fb923c; border-radius: 4px; transition: width 1s ease; }
.mon-card.st-urgent .mc-bar > i { background: #f87171; }
.mon-card .mc-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 12px;
  font-size: 12px; color: #6b7889;
}

.mon-foot {
  flex: none;
  padding: 11px 30px;
  border-top: 1px solid #1b232e;
  background: #0b0f15;
  display: flex; align-items: center; gap: 18px;
  font-size: 12px; color: #6b7889;
}
.mon-ticker { flex: 1; overflow: hidden; white-space: nowrap; }
.mon-ticker span { display: inline-block; animation: tick 34s linear infinite; padding-left: 100%; }
@keyframes tick { to { transform: translateX(-100%); } }

/* Ecrane mari de fabrică */
@media (min-width: 1900px) {
  .mon-head h1 { font-size: 34px; }
  .mon-clock .t { font-size: 46px; }
  .mon-strip .v { font-size: 40px; }
  .mon-card .mc-prod { font-size: 25px; }
  .mon-card .mc-nums b { font-size: 38px; }
  .mon-body { grid-template-columns: repeat(4, 1fr); gap: 18px; }
}
@media (max-width: 1400px) { .mon-body { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) { .mon-body { grid-template-columns: repeat(2, 1fr); } .mon-strip { grid-template-columns: repeat(3, 1fr); } }

/* ---------- ECRAN AUTENTIFICARE ----------
   O singură coloană, centrată. Fără panouri decorative goale. */
.auth {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: var(--s8) var(--s4);
  background: var(--n-100);
}
[data-theme="dark"] .auth { background: var(--bg); }

.auth-inner {
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; align-items: center;
}

.auth-logo { height: 46px; width: auto; margin-bottom: var(--s5); }

.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 10px 26px -14px rgba(16,24,40,.18);
  padding: var(--s6) var(--s6) var(--s5);
}
[data-theme="dark"] .auth-card { box-shadow: var(--sh-md); }

.auth-card h1 { font-size: var(--fs-xl); margin-bottom: 3px; }
.auth-card .lede { font-size: var(--fs-sm); color: var(--ink-3); margin-bottom: var(--s5); }

.auth-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: var(--s5); padding-top: var(--s4);
  border-top: 1px solid var(--border-soft);
  font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.55;
}
.auth-note i { color: var(--ink-4); margin-top: 2px; font-size: 12px; }

.auth-foot {
  margin-top: var(--s5); text-align: center;
  font-size: var(--fs-xs); color: var(--ink-4); line-height: 1.7;
}

@media (max-width: 480px) {
  .auth { padding: var(--s6) var(--s4); justify-content: flex-start; padding-top: var(--s10); }
  .auth-logo { height: 40px; }
  .auth-card { padding: var(--s5) var(--s4); }
}

/* ---------- VIZUALIZARE OFERTĂ (client, public) ---------- */
.doc {
  max-width: 880px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.doc-head {
  padding: var(--s6) var(--s8);
  border-bottom: 2px solid var(--brand);
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s5);
  flex-wrap: wrap;
}
.doc-head .logo { height: 44px; }
.doc-meta { text-align: right; font-size: var(--fs-sm); }
.doc-meta .no { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; }

.doc-parties {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6);
  padding: var(--s5) var(--s8);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.doc-party .t-up { margin-bottom: 6px; }
.doc-party strong { display: block; font-size: var(--fs-md); margin-bottom: 3px; }
.doc-party p { font-size: var(--fs-sm); color: var(--ink-3); line-height: 1.55; }

/* Linie de produs în ofertă — cu poză, denumire, branding */
.doc-line {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: var(--s4);
  padding: var(--s4) var(--s8);
  border-bottom: 1px solid var(--border-soft);
  align-items: start;
}
.doc-line .ph {
  width: 76px; height: 76px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--n-0);
  object-fit: contain;
  padding: 4px;
}
.doc-line .nm { font-size: var(--fs-md); font-weight: 600; line-height: 1.35; }
.doc-line .sku { font-size: var(--fs-xs); color: var(--ink-4); margin-top: 2px; font-family: var(--mono); }
.doc-line .spec {
  display: flex; flex-wrap: wrap; gap: 4px 6px;
  margin-top: 7px;
}
.doc-line .spec i {
  font-style: normal;
  font-size: var(--fs-2xs);
  padding: 2px 6px;
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-xs);
  color: var(--ink-3);
}
.doc-line .brand-tag {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 7px;
  font-size: var(--fs-2xs); font-weight: 600;
  color: var(--ink-3);
}
.doc-line .brand-tag img { height: 15px; width: auto; }
.doc-line .amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-line .amt .u { font-size: var(--fs-xs); color: var(--ink-3); }
.doc-line .amt .tot { font-size: var(--fs-lg); font-weight: 650; margin-top: 3px; }

.doc-totals {
  padding: var(--s5) var(--s8);
  display: flex; justify-content: flex-end;
}
.doc-totals table { width: 300px; font-size: var(--fs-sm); }
.doc-totals td { padding: 5px 0; }
.doc-totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 550; }
.doc-totals tr.grand td {
  padding-top: 11px;
  border-top: 2px solid var(--ink);
  font-size: var(--fs-lg);
  font-weight: 700;
}

@media (max-width: 720px) {
  .doc-parties { grid-template-columns: 1fr; gap: var(--s4); padding: var(--s4); }
  .doc-head, .doc-line, .doc-totals { padding-left: var(--s4); padding-right: var(--s4); }
  .doc-line { grid-template-columns: 56px minmax(0,1fr); }
  .doc-line .ph { width: 56px; height: 56px; }
  .doc-line .amt { grid-column: 1 / -1; text-align: left; display: flex; align-items: baseline; gap: var(--s3); }
  .doc-line .amt .tot { margin-top: 0; }
  .doc-totals table { width: 100%; }
}

/* ---------- PLACĂ LOGO ----------
   Logo-ul CTL este color, pe fundal deschis. Pe suprafețele închise
   (sidebar, ecran de autentificare, monitor hală) se așază pe o placă
   albă cu colțuri rotunjite, ca să rămână lizibil în orice temă. */
.logo-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  background: #fff;
  border-radius: var(--r-md);
  flex: none;
  line-height: 0;
}
.logo-plate img {
  height: 24px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.logo-plate-sm { padding: 4px 5px; }
.logo-plate-sm img { height: 19px; }

.nav-brand .logo-plate { max-width: calc(100% - 8px); }
.nav-collapsed .nav-brand .logo-plate { padding: 4px 5px; }
.nav-collapsed .nav-brand .logo-plate img { height: 17px; }

/* Pe fundal deja alb nu mai are rost placa */
.doc-head .logo-plate,
.on-light .logo-plate { padding: 0; background: transparent; }
