:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --side: #0f172a;
  --side-text: #cbd5e1;
  --danger: #dc2626;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  display: flex;
  min-height: 100vh;
  -webkit-tap-highlight-color: rgba(37, 99, 235, .12);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.3rem; margin: 0; overflow-wrap: break-word; }
h2 { font-size: 1.1rem; margin: 0; }

/* meniu lateral */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--side); color: var(--side-text);
  padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side-head { display: flex; align-items: center; justify-content: space-between; }
.brand { display: block; color: #fff; font-size: 1.2rem; font-weight: 700; padding: 0 10px 10px; }
.brand-name span { color: #60a5fa; }
.brand:hover { text-decoration: none; }
.nav-group {
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: #64748b; padding: 10px 10px 3px;
}
.nav-item { display: block; color: var(--side-text); padding: 4px 10px; border-radius: 6px; }
.nav-item:hover { background: #1e293b; text-decoration: none; color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; }

/* elemente care există doar pe telefon / tabletă */
.menu-btn, .menu-close, .sidebar-user, .topbar-brand, .backdrop { display: none; }

/* zona principală */
.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 8px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.quick-add { margin: 0; }
.quick-add select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font: inherit; }
.content { padding: 16px 20px; max-width: 1200px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.page-head.sub { margin-top: 16px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.count { background: var(--border); color: var(--muted); border-radius: 999px; padding: 1px 9px; font-size: .8rem; font-weight: 500; vertical-align: middle; }
.crumbs { color: var(--muted); font-size: .82rem; margin-bottom: 2px; }
.section { margin: 14px 0 6px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }

/* carduri și tabele */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 0; overflow-x: auto; }
.form, .card:has(.details) { padding: 12px 16px; }
.card.form { overflow: visible; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: center; vertical-align: middle; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 7px 12px; border-bottom: 1px solid var(--border); white-space: normal; word-break: normal; overflow-wrap: normal; hyphens: manual; }
.table td { word-break: normal; hyphens: manual; }
.table td { padding: 6px 12px; border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f9fafb; }
.table td.nowrap { white-space: nowrap; }
.right { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: .8rem; margin: 10px 0 0; }
.empty { color: var(--muted); padding: 14px; margin: 0; text-align: center; }

/* înregistrări fără legături: o singură linie cu butoane, nu 10 casete goale */
.rel-add { margin-top: 18px; }
.rel-add .label { display: block; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* panou principal */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; display: flex; flex-direction: column; color: var(--text); }
a.tile:hover { border-color: var(--brand); text-decoration: none; box-shadow: 0 1px 6px rgba(37,99,235,.15); }
.tile-count { font-size: 1.35rem; line-height: 1.2; font-weight: 700; }
.tile-label { color: var(--muted); font-size: .85rem; }

/* butoane */
.btn { display: inline-block; border: 1px solid var(--border); background: #fff; color: var(--text); padding: 5px 11px; border-radius: 6px; font: inherit; cursor: pointer; touch-action: manipulation; }
.btn:hover { background: #f3f4f6; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.small { padding: 2px 8px; font-size: .82rem; }

/* căutare */
.search { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.search input { flex: 1; min-width: 0; max-width: 420px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }

/* formulare */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.req { color: var(--danger); }
.field input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .field select, .field textarea {
  padding: 5px 9px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; background: #fff; width: 100%; min-width: 0;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--brand); }
.field input[type=checkbox] { width: 20px; height: 20px; }
.actions { display: flex; gap: 6px; margin-top: 12px; }
.alert { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; overflow-wrap: break-word; }

/* detalii */
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; margin: 0; }
.details .row.wide { grid-column: 1 / -1; }
.details dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.details dd { margin: 0; line-height: 1.35; overflow-wrap: break-word; }
.pre { white-space: pre-wrap; }

/* autentificare și utilizatori */
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-menu form { margin: 0; }
.user-menu a { color: var(--text); font-weight: 500; }
.alert.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.alert code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 4px; display: inline-block; }
.card.narrow { max-width: 520px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.btn.block { display: block; width: 100%; margin-top: 18px; padding: 11px 14px; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.inline-pw { display: flex; gap: 6px; }
.inline-pw input { padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; width: 140px; min-width: 0; }
.auth-page { align-items: center; justify-content: center; padding: 20px; background: var(--side); }
.auth-card { background: var(--surface); border-radius: 14px; padding: 32px; width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.auth-card h1 { font-size: 1.25rem; margin-bottom: 18px; }
.auth-card .field { margin-bottom: 14px; }
.auth-brand { font-size: 1.4rem; font-weight: 700; margin-bottom: 14px; }
.auth-brand .brand-name span { color: var(--brand); }

/* registru de casă: totaluri și culori pe sume */
.tiles.totals { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 10px; }
.pos { color: #15803d; }
.neg { color: #b91c1c; }
.inc { color: #1d4ed8; }
td.pos, td.neg { font-variant-numeric: tabular-nums; white-space: nowrap; }


/* ====================================================================
   TABLETĂ ȘI TELEFON  (≤ 800 px): meniul devine un panou peste pagină
   ==================================================================== */
@media (max-width: 800px) {
  body.nav-open { overflow: hidden; }

  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; height: auto; z-index: 30;
    width: min(290px, 86vw);
    padding: calc(12px + env(safe-area-inset-top, 0px)) 10px calc(14px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-100%); visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  .sidebar.open { transform: none; visibility: visible; transition: transform .2s ease, visibility 0s; box-shadow: 0 0 30px rgba(0, 0, 0, .45); }
  .backdrop {
    display: block; position: fixed; inset: 0; z-index: 20;
    background: rgba(15, 23, 42, .55); opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  body.nav-open .backdrop { opacity: 1; pointer-events: auto; }

  .menu-btn, .menu-close {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 44px; height: 44px; font-size: 1.3rem; line-height: 1; cursor: pointer; touch-action: manipulation;
    border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 10px;
  }
  .menu-close { background: transparent; border-color: #334155; color: var(--side-text); }
  .brand { padding-bottom: 0; }
  .side-head { padding: 0 0 8px 10px; }

  .sidebar-user { display: block; margin: 4px 0 6px; padding: 10px; border-radius: 10px; background: #1e293b; }
  .sidebar-user .su-name { color: #fff; font-weight: 600; margin-bottom: 8px; overflow-wrap: break-word; }
  .sidebar-user .su-actions { display: flex; gap: 8px; }
  .sidebar-user form { margin: 0; }

  .nav-item { padding: 11px 12px; font-size: 1rem; }
  .nav-group { padding: 14px 12px 4px; }

  .topbar {
    position: sticky; top: 0; z-index: 10; justify-content: flex-start; gap: 8px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  }
  .topbar-brand { display: block; margin-right: auto; color: var(--text); font-size: 1.1rem; font-weight: 700; white-space: nowrap; }
  .topbar-brand .brand-name span { color: var(--brand); }
  .topbar-brand:hover { text-decoration: none; }
  .user-menu { display: none; }
  .quick-add select { min-height: 44px; max-width: 160px; font-size: 16px; padding: 8px 10px; border-radius: 10px; }

  .content { padding: 14px 12px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .grid, .details { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

  /* zone de atingere confortabile și 16px în câmpuri (iOS nu mai mărește pagina la focus) */
  .btn { min-height: 44px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; }
  .btn.small { min-height: 40px; padding: 8px 12px; font-size: .9rem; }
  .field input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .field select, .field textarea,
  .search input, .inline-pw input {
    font-size: 16px; min-height: 44px; padding: 10px 12px; border-radius: 8px;
  }
  .field textarea { min-height: 96px; }
  .field input[type=checkbox] { width: 26px; height: 26px; }
  .label { font-size: .85rem; }
  .field { gap: 4px; }
  .grid { gap: 12px; }
  .alert { padding: 10px 12px; }
  .auth-card { padding: 24px; }
  .page-head h1 { font-size: 1.25rem; }
  .head-actions { justify-content: flex-start; }
  .head-actions .btn { min-width: 0; }
  .pager { justify-content: space-between; }
  .search .btn.ghost { flex: 1 0 100%; }

  /* butoanele de salvare rămân vizibile la finalul formularelor lungi */
  .form .actions {
    position: sticky; bottom: 0; z-index: 5; gap: 10px;
    margin: 16px -16px -12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
  }
  .form .actions .btn { flex: 1; }
}

/* ====================================================================
   TELEFON  (≤ 640 px): tabelele devin fișe, una sub alta
   ==================================================================== */
@media (max-width: 640px) {
  .topbar-brand { font-size: 1rem; }

  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; }
  .table.cards thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table.cards tbody tr { position: relative; padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .table.cards tbody tr:last-child { border-bottom: 0; }
  .table.cards tbody tr:hover { background: transparent; }
  .table.cards td {
    display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
    padding: 2px 0; border: 0; text-align: right; overflow-wrap: break-word;
  }
  .table.cards td::before {
    content: attr(data-label); flex: 0 0 auto; max-width: 46%; text-align: left;
    color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  }
  .table.cards td:first-child { justify-content: flex-start; text-align: left; font-size: 1.02rem; font-weight: 600; padding-bottom: 4px; }
  .table.cards td:first-child::before { display: none; }
  /* întreaga fișă se atinge ca să deschizi înregistrarea */
  .table.cards td:first-child a::after { content: ""; position: absolute; inset: 0; }
  .table.cards td.none { display: none; }
  .table.cards td.actions-cell { display: block; text-align: left; padding-top: 6px; }
  .table.cards td.actions-cell::before { display: none; }
  .table.cards td.right { text-align: right; }

  .inline-pw { width: 100%; }
  .inline-pw input { flex: 1; width: auto; }
  .row-actions { width: 100%; }

  /* totaluri Casierie: soldul sus, pe tot rândul */
  .tiles.totals { grid-template-columns: 1fr 1fr; }
  .tiles.totals .tile:nth-child(3) { order: -1; grid-column: 1 / -1; }
  .tiles.totals .tile-count { font-size: 1.1rem; overflow-wrap: break-word; }
  .tiles.totals .tile:nth-child(3) .tile-count { font-size: 1.5rem; }
}

/* Creat / Modificat în liste: data și ora pe două rânduri (doar pe ecran lat, ca tabelul să încapă) */
@media (min-width: 641px) {
  .table td.dt { white-space: nowrap; line-height: 1.25; }
  .table td.dt .dtv > span { display: block; font-size: .85em; }
}

/* Alegerea rolului în lista de utilizatori */
.inline-pw select { padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; font: inherit; min-width: 0; }
@media (max-width: 800px) {
  .inline-pw select { flex: 1; min-height: 44px; font-size: 16px; padding: 8px 10px; border-radius: 10px; }
}

/* Setări: nivel de complexitate cu comutator „Activ” */
.level-row { display: flex; align-items: flex-end; gap: 12px; }
.level-row .field { flex: 1; min-width: 0; }
.level-on { display: flex; align-items: center; gap: 6px; padding-bottom: 9px; min-width: 70px; font-size: .9rem; cursor: pointer; }
.level-on input { width: 18px; height: 18px; }

/* Iconițe în meniu, pe panou și la alegerea modulelor */
.nav-item { display: flex; align-items: center; gap: 10px; }
.ico { flex: none; opacity: .9; }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-head .ico { color: var(--brand); opacity: .85; }
.access-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; margin-bottom: 8px; }
.access-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.access-item:hover { border-color: var(--brand); }
.access-item input { width: 18px; height: 18px; flex: none; }
.access-item .ico { color: var(--muted); }
@media (max-width: 800px) { .access-item { min-height: 44px; } }

/* Logo și nume personalizabile */
.brand, .auth-brand { display: flex; align-items: center; gap: 8px; }
@media (max-width: 800px) { .topbar-brand { display: flex; align-items: center; gap: 8px; } }
.brand-logo { display: block; max-height: 32px; max-width: 120px; width: auto; height: auto; object-fit: contain; flex: none; }
.brand .brand-logo { background: #fff; border-radius: 6px; padding: 2px 4px; }   /* meniul e închis la culoare: logo-ul stă pe un fundal alb */
.auth-brand .brand-logo { max-height: 44px; max-width: 160px; }
.brand-name { min-width: 0; overflow-wrap: break-word; line-height: 1.15; }
.brand { flex-wrap: wrap; row-gap: 6px; }
.brand .brand-name { flex: 1 1 90px; }
@media (max-width: 800px) {
  .topbar-brand { min-width: 0; flex: 0 1 auto; overflow: hidden; }
  .topbar-brand .brand-logo { max-height: 28px; max-width: 64px; }
  .topbar-brand .brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.brand-preview { margin-bottom: 10px; padding: 10px; border: 1px dashed var(--border); border-radius: 8px; display: inline-block; background: #fff; }
.brand-preview .brand-logo { max-height: 48px; max-width: 200px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.check input { width: 18px; height: 18px; }

/* Meniu restrângibil: grupuri + bară îngustă */
button.nav-group { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; background: none; border: 0;
  font: inherit; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #64748b; cursor: pointer; text-align: left; border-radius: 6px; }
button.nav-group:hover { color: #cbd5e1; }
button.nav-group .ico { transition: transform .15s; opacity: .8; }
.nav-section.collapsed .nav-group .ico { transform: rotate(-90deg); }
.nav-section.collapsed .nav-items { display: none; }
.nav-tools { padding: 6px 10px 0; }
.nav-all { background: none; border: 0; padding: 0; font: inherit; font-size: .75rem; color: #94a3b8; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.nav-all:hover { color: #fff; }
.rail-btn { display: none; }
@media (min-width: 801px) {
  .rail-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; background: transparent;
    border: 1px solid #334155; border-radius: 8px; color: var(--side-text); cursor: pointer; }
  .rail-btn:hover { background: #1e293b; color: #fff; }
  .side-head { gap: 6px; }
  .side-head .brand { min-width: 0; }
  body.rail .sidebar { width: 64px; padding: 14px 8px; overflow-x: hidden; }
  body.rail .side-head { flex-direction: column; gap: 8px; }
  body.rail .brand { padding: 0; justify-content: center; }
  body.rail .brand .brand-logo { max-width: 40px; max-height: 28px; }
  body.rail .brand-name { font-size: 0; line-height: 1; }
  body.rail .brand-name::first-letter { font-size: 1.3rem; }
  body.rail .brand-logo + .brand-name { display: none; }   /* cu logo, în bara îngustă rămâne doar logo-ul */
  body.rail .nav-item { justify-content: center; padding: 9px 0; }
  body.rail .nav-item span, body.rail .nav-tools, body.rail .nav-group span, body.rail .nav-group .ico { display: none; }
  body.rail button.nav-group { height: 0; padding: 0; margin: 8px 6px; border-top: 1px solid #1e293b; border-radius: 0; pointer-events: none; }
  body.rail .nav-section.collapsed .nav-items { display: block; }   /* în bara îngustă se văd mereu toate iconițele */
}
@media (max-width: 800px) {
  button.nav-group { min-height: 40px; font-size: .78rem; }
  .nav-all { font-size: .85rem; padding: 6px 0; }
}

/* Draft restaurat + fereastra „Salvezi înainte să pleci?” */
.draft-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fffbeb; border-color: #fde68a; color: #92400e; }
.guard-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .55); }
.guard-backdrop[hidden] { display: none; }
.guard-box { background: var(--surface); border-radius: 12px; padding: 18px 20px; width: 100%; max-width: 440px; box-shadow: 0 12px 40px rgba(15, 23, 42, .35); }
.guard-box h2 { margin: 0 0 6px; }
.guard-box p { margin: 0 0 14px; color: var(--muted); }
.guard-box .guard-error { color: #b91c1c; }
.guard-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 800px) { .guard-actions { flex-direction: column-reverse; } .guard-actions .btn { min-height: 44px; width: 100%; } }

/* Sortare și filtre în liste */
.listctl { margin-bottom: 8px; }
.listctl .search { margin-bottom: 6px; }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 12px; }
.filters > summary { cursor: pointer; padding: 8px 0; font-weight: 600; font-size: .92rem; list-style-position: inside; }
.filters[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.filters .count { margin-left: 4px; }
.filter-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 12px; margin-bottom: 8px; }
.filters .actions { padding-bottom: 10px; }
.range-inputs { display: flex; align-items: center; gap: 6px; }
.range-inputs input { min-width: 0; flex: 1; }
.table th a.sort { color: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 4px; text-decoration: none; }
.table th a.sort:hover { color: var(--text); }
.sort-ind { font-size: .7rem; opacity: .45; }
.table th[aria-sort="ascending"] .sort-ind, .table th[aria-sort="descending"] .sort-ind { opacity: 1; color: var(--brand); }
@media (max-width: 800px) {
  .filter-grid { grid-template-columns: 1fr; }
  .filters > summary { min-height: 44px; display: flex; align-items: center; }
}

/* ---- deviz (în tichet) ---- */
.quote { padding: 6px 10px; }
.q-row { display: grid; grid-template-columns: minmax(0,1fr) 70px 80px 100px 100px 150px; gap: 6px; align-items: center; padding: 4px 0; margin: 0; }
.q-row input { width: 100%; min-width: 0; padding: 5px 7px; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: #fff; }
.q-head { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding-bottom: 0; }
.q-head span:last-child { visibility: hidden; }
.q-val { text-align: right; font-variant-numeric: tabular-nums; }
.q-actions { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.q-new { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 8px; }
.q-totals { margin: 8px 0 2px auto; max-width: 320px; }
.q-totals div { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
.q-totals dt, .q-totals dd { margin: 0; }
.q-totals .q-total { border-top: 1px solid var(--text); margin-top: 3px; padding-top: 4px; font-weight: 700; font-size: 1.05rem; }
@media (max-width: 700px) {
  .q-head { display: none; }
  .q-row { grid-template-columns: 1fr 1fr; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .q-row .qc, .q-actions, .q-val { grid-column: 1 / -1; }
  .q-val::before { content: attr(data-label) ": "; color: var(--muted); }
  .q-new .q-val { display: none; }
  .q-totals { max-width: none; }
}

/* ---- rapoarte ---- */
.report-form { margin-bottom: 12px; padding: 10px 12px; }
.report-form [hidden] { display: none !important; }
.bar { display: block; height: 4px; background: var(--border); border-radius: 2px; margin-top: 3px; max-width: 160px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 2px; }
.tile-count.neg { color: var(--danger); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 12px; }
.field input[type="color"], input[type="color"] { width: 64px !important; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; }

/* ---- grafice (panou principal) ---- */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; margin: 8px 0 4px; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 8px; min-width: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.chart-head h2 { margin: 0; font-size: .95rem; }
.chart-link { font-size: .8rem; }
.chart-note { margin: 4px 0 0; color: var(--muted); font-size: .75rem; }
.chart-card .empty { padding: 18px 0; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex: none; }
.donut-track { stroke: #eef0f3; }
.donut .mark { transition: opacity .12s; cursor: pointer; }
.donut .mark:hover, .donut .mark:focus { opacity: .8; outline: none; }
.donut-total, .donut-noun { pointer-events: none; }
.donut-total { font-size: 7px; font-weight: 700; fill: var(--text); }
.donut-noun { font-size: 2.6px; fill: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 150px; display: grid; gap: 2px; }
.legend a { display: flex; align-items: center; gap: 8px; padding: 2px 4px; border-radius: 5px; color: var(--text); font-size: .85rem; }
.legend a:hover { background: #f3f4f6; text-decoration: none; }
.legend .lg-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .lg-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.legend .lg-pct { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: .78rem; }
.legend.inline { display: flex; gap: 14px; margin-bottom: 4px; font-size: .82rem; }
.legend.inline li { display: flex; align-items: center; gap: 6px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.hbars a { display: grid; grid-template-columns: 110px 1fr 34px; align-items: center; gap: 8px; color: var(--text); padding: 3px 4px; border-radius: 5px; font-size: .85rem; }
.hbars a:hover, .hbars a:focus { background: #f3f4f6; text-decoration: none; outline: none; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 14px; display: block; }
.hb-bar { display: block; height: 100%; min-width: 2px; background: #2a78d6; border-radius: 0 4px 4px 0; }
.hb-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.vcols { display: flex; align-items: flex-end; gap: 8px; height: 170px; border-bottom: 1px solid var(--border); padding-top: 4px; }
.vcol { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; outline: none; position: relative; }
.vc-plot { display: flex; align-items: flex-end; justify-content: center; gap: 2px; width: 100%; flex: 1; min-height: 0; }
.vc-bar { display: block; width: 100%; max-width: 24px; min-height: 2px; background: #2a78d6; border-radius: 4px 4px 0 0; transition: opacity .12s; }
.vcol:hover .vc-bar, .vcol:focus .vc-bar, .vc-bar:hover, .vc-bar:focus { opacity: .8; outline: none; }
.vc-val { font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; min-height: 1em; }
.vc-label { position: absolute; top: 100%; margin-top: 4px; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.vcols, .vcols.grouped { margin-bottom: 22px; }
.vcols.grouped .vc-bar { max-width: 16px; }
.chart-table { margin-top: 4px; }
.chart-table summary { cursor: pointer; font-size: .78rem; color: var(--muted); padding: 2px 0; }
.chart-table .table td { padding: 3px 8px; }
.chart-tip { position: fixed; z-index: 50; display: flex; align-items: center; gap: 8px; padding: 5px 9px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.15); pointer-events: none; font-size: .82rem; }
.chart-tip[hidden] { display: none; }
.tip-key { width: 12px; height: 3px; border-radius: 2px; }
.tip-val { font-weight: 700; }
.tip-name { color: var(--muted); }
@media (max-width: 700px) { .charts { grid-template-columns: 1fr; } .donut { width: 130px; height: 130px; } .hbars a { grid-template-columns: 96px 1fr 30px; } }

/* ---- portal clienți ---- */
.portal-page { display: block; min-height: 100vh; background: var(--bg); }
.portal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.portal-brand { display: flex; align-items: center; color: var(--text); font-weight: 700; font-size: 1.1rem; min-width: 0; }
.portal-brand .brand-logo { max-height: 36px; max-width: 150px; }
.portal-brand .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-brand .brand-name span { color: var(--brand); }
.portal-user { display: flex; align-items: center; gap: 10px; }
.portal-user form { margin: 0; }
.portal-main { max-width: 960px; margin: 0 auto; padding: 16px 20px 40px; }
.portal-narrow { max-width: 420px; margin: 24px auto; }
.portal-narrow .card { padding: 16px; }
.pbadge { display: inline-block; padding: 1px 9px; border-radius: 999px; background: #e0ecff; color: #1e3a8a; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pbadge.big { font-size: .9rem; padding: 3px 12px; }
@media (max-width: 700px) { .portal-main { padding: 12px 12px 32px; } .portal-top { padding: 8px 12px; } }
.portal-admin { padding-bottom: 8px; }
.portal-admin .table { margin-bottom: 8px; }
.linkbox input { width: 100%; margin-top: 6px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: .85rem; background: #fff; }
.portal-invite-form { display: flex; gap: 8px; padding: 6px 12px; flex-wrap: wrap; }
.portal-invite-form input { flex: 1; min-width: 200px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }

/* ---- setări: secțiuni (taburi) cu carduri care se adaptează lățimii ---- */
.settings .tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.settings .tab { flex: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 9px 14px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0; touch-action: manipulation; }
.settings .tab:hover { color: var(--text); background: #eef1f5; }
.settings .tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.settings .tab:focus-visible { outline: 2px solid #bfdbfe; outline-offset: -2px; }
.settings .tab-panel[hidden] { display: none; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; align-items: start; }
.scard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px 14px; min-width: 0; }
.scard.swide { grid-column: 1 / -1; }
.scard h2 { margin: 0 0 6px; font-size: 1rem; }
.scard .grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.scard .grid .field.wide { grid-column: 1 / -1; }
.levels-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important; gap: 10px 20px; }
.settings-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 0; margin-top: 12px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
@media (max-width: 700px) {
  .sgrid { grid-template-columns: 1fr; }
  .scard { padding: 12px; }
  .settings .tab { padding: 10px 12px; }
  .settings-actions .btn { flex: 1; padding: 11px; }
}

/* ---- echipamente: indexuri lunare ---- */
.readings { padding: 6px 10px; }
.rd-form { display: grid; grid-template-columns: 150px repeat(3, minmax(0, 120px)) minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 8px 2px; margin: 0; }
.rd-form label, .rd-bar label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); }
.rd-form input, .rd-bar input, .rd-row input { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font: inherit; color: var(--text); background: #fff; }
.rd-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 8px 2px; }
.rd-bar label { width: 170px; }
.rd-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 120px); gap: 8px; align-items: center; padding: 5px 2px; border-top: 1px solid var(--border); }
.rd-head { border-top: 0; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding-bottom: 0; }
.rd-name { overflow-wrap: break-word; }
.rd-name .block { display: block; }
.rd-save { padding: 10px 2px 6px; border-top: 1px solid var(--border); }
.num { font-variant-numeric: tabular-nums; }
.neg { color: #b45309; font-weight: 600; }
tr.inactive td { color: var(--muted); }
.pbadge.off { background: #eef0f3; color: #4b5563; }
@media (max-width: 800px) {
  .rd-form { grid-template-columns: 1fr 1fr; }
  .rd-form .rd-note, .rd-form button { grid-column: 1 / -1; }
  .rd-head { display: none; }
  .rd-row { grid-template-columns: repeat(3, 1fr); padding: 10px 2px; }
  .rd-lab { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 2px; }
  .rd-name { grid-column: 1 / -1; font-weight: 600; }
  .rd-row input::placeholder { color: #9aa3af; }
  .rd-row input { margin-top: 0; }
}
.table td .block { display: block; }

.rd-cell { display: block; margin: 0; }
.rd-lab { display: none; }
@media (max-width: 800px) { .rd-lab { display: block; } }

/* ---- câmp cu căutare (sugestii) ---- */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 3px 0 0; padding: 4px; list-style: none; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgba(15, 23, 42, .15); max-height: 260px; overflow-y: auto; }
.combo-list[hidden] { display: none; }
.combo-list li { padding: 9px 10px; border-radius: 6px; cursor: pointer; overflow-wrap: break-word; }
.combo-list li:hover, .combo-list li.active { background: #e8f0fe; }
.combo-list li.combo-empty { color: var(--muted); cursor: default; }
.combo-list li.combo-empty:hover { background: transparent; }
select:disabled { background: #f3f4f6; color: var(--muted); }

/* ---- deviz: căutare în produse/servicii ---- */
.qc { position: relative; min-width: 0; }
.qc .combo-list { min-width: 260px; }
.combo-list li .cat-name { display: block; }
.combo-list li .cat-meta { display: block; font-size: .78rem; color: var(--muted); }
.card.quote { overflow: visible; }

.first-contact { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; margin: 18px 0 0; padding: 12px 14px 14px; }
.first-contact legend { font-weight: 600; padding: 0 6px; }

.multi { position: relative; }
.multi > summary { list-style: none; cursor: pointer; padding: 10px 36px 10px 14px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='2'/></svg>") no-repeat right 12px center; }
.multi > summary::-webkit-details-marker { display: none; }
.multi[open] > summary { border-color: var(--brand); }
.multi-panel { position: absolute; z-index: 30; left: 0; right: 0; min-width: 240px; margin-top: 4px; padding: 8px; max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--border, #e5e7eb); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .15); }
.multi-panel .check { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.multi-panel .check:hover { background: rgba(100, 116, 139, .1); }
.multi-actions { position: sticky; bottom: -8px; padding: 8px 0 0; background: var(--surface); }

/* poze la produse */
.img-field { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 4px 0 14px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.img-preview { width: 112px; height: 112px; border: 1px dashed var(--border); border-radius: 12px; background: #f8fafc; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.img-preview img { width: 100%; height: 100%; object-fit: contain; }
.img-controls { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 240px; }
.detail-img { float: right; margin: 0 0 12px 16px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.detail-img img { display: block; width: 160px; height: 160px; object-fit: contain; }
.thumb { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; border: 1px solid var(--border); background: #fff; vertical-align: middle; margin-right: 10px; }
.thumb.ph { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: #f8fafc; }
@media (max-width: 700px) { .detail-img { float: none; margin: 0 0 12px; } .detail-img img { width: 100%; height: 200px; } }

/* portal: navigare, pagina de start, magazin */
.portal-nav { display: flex; gap: 4px; padding: 6px 20px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.portal-nav::-webkit-scrollbar { display: none; }
.portal-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.portal-nav a:hover { background: #f1f5f9; text-decoration: none; color: var(--text); }
.portal-nav a.on { background: #e0ecff; color: var(--brand-dark); }
@media (max-width: 700px) { .portal-nav { padding: 6px 12px; } .portal-nav a { padding: 8px 12px; } }

.hub-hello { margin: 8px 0 18px; }
.hub-hello h1 { font-size: 1.6rem; }
.hub-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(15, 23, 42, .10); border-color: #bcd0f5; }
.tile-ico { width: 54px; height: 54px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.tile-tickets .tile-ico { background: #fee2e2; color: #b91c1c; }
.tile-consumabile .tile-ico { background: #dbeafe; color: #1d4ed8; }
.tile-papetarie .tile-ico { background: #dcfce7; color: #15803d; }
.tile-title { font-size: 1.1rem; font-weight: 700; }
.tile-text { color: var(--muted); font-size: .92rem; flex: 1; }
.tile-meta { font-size: .82rem; color: var(--muted); }
.tile-go { margin-top: 6px; color: var(--brand); font-weight: 600; }
.hub-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hub-list { padding: 14px 16px; }
.hub-list-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.hub-list-head h2 { margin: 0; font-size: 1rem; }
.hub-list ul { list-style: none; margin: 0; padding: 0; }
.hub-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); }
.hub-list li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 800px) { .hub-tiles, .hub-cols { grid-template-columns: 1fr; } .tile { flex-direction: row; flex-wrap: wrap; align-items: center; } .tile-text { flex-basis: 100%; order: 5; } }

.portal-main:has(.shop) { max-width: 1180px; }
.shop { padding-bottom: 170px; }
.shop-bar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0 10px; display: flex; flex-direction: column; gap: 8px; }
.shop-search { width: 100%; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--border); font-size: 1rem; background: var(--surface); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 14px; cursor: pointer; white-space: nowrap; font: inherit; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 6px; }
.pcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.pcard.sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(37, 99, 235, .18); }
.pcard[hidden] { display: none; }
.pimg { aspect-ratio: 1 / 1; background: #f8fafc; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); }
.pimg img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.pimg-ph { color: #cbd5e1; display: inline-flex; }
.pbody { padding: 12px 14px 6px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.pcat { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pname { margin: 0; font-size: .98rem; line-height: 1.3; overflow-wrap: break-word; }
.pcode { font-size: .8rem; color: var(--muted); }
.pprice { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 1.05rem; }
.qty { display: flex; align-items: stretch; margin: 10px 14px 14px; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.qty .qb { width: 44px; border: 0; background: #f1f5f9; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--text); }
.qty .qb:hover { background: #e2e8f0; }
.qty input { flex: 1; min-width: 0; width: 100%; border: 0; text-align: center; font-size: 1.05rem; font-weight: 600; padding: 10px 0; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px max(20px, calc((100vw - 1180px) / 2 + 20px)) calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(15, 23, 42, .08); }
.cart-sum { display: flex; flex-direction: column; min-width: 150px; }
.cart-line { display: flex; gap: 8px; align-items: baseline; }
.cart-total { font-size: 1.25rem; font-weight: 800; }
.cart-note { flex: 1 1 260px; }
.cart-note summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.cart-note textarea { width: 100%; margin-top: 6px; }
.btn.big { padding: 12px 26px; font-size: 1rem; border-radius: 999px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 700px) { .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .cartbar { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 10px; } .cart-note { order: 3; flex-basis: 100%; } .btn.big { flex: 1; } .pname { font-size: .9rem; } }

.tier-badge { display: inline-block; margin-left: 6px; padding: 1px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.tier-silver { background: #e5e7eb; color: #374151; }
.tier-gold { background: #fef3c7; color: #92400e; }

.hub-cols.single { grid-template-columns: 1fr; }
.hub-tiles:has(> .tile:nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }
.hub-tiles:has(> .tile:only-child) { grid-template-columns: 1fr; }

/* contracte de închiriere */
.rent { padding-bottom: 10px; }
.rent-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px; }
.rent-pick label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.rent-terms { padding: 0 12px 8px; }
.alert.warn { background: #fff7ed; border-color: #fed7aa; color: #9a3412; margin: 4px 12px; }
.rent-table tr.bad td, .rent-table tr.bad { background: #fffaf3; }
.rent-pool { max-width: 640px; margin: 8px 0 0 12px; }
.rent-totals { margin: 10px 12px 4px auto; max-width: 360px; }
.rent-totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.rent-totals dt { color: var(--muted); } .rent-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.rent-totals .grand { border-top: 1.5px solid var(--text); margin-top: 4px; padding-top: 6px; font-size: 1.1rem; font-weight: 800; }
.rent-totals .grand dt { color: var(--text); }
.rent-sum { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 12px; }
.rent-sum > div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; min-width: 130px; }
.rent-sum b { display: block; font-size: 1.15rem; }
.rent-sum .bad { background: #fff7ed; border-color: #fed7aa; }
tr.bad td { background: #fffaf3; }

.pvat { font-size: .8rem; color: var(--muted); font-weight: 400; margin-top: -2px; }
.pmin { margin-top: 6px; font-size: .78rem; color: var(--muted); }
.pcard.short .pmin { color: #b42318; font-weight: 600; }
.pcard.short { border-color: #f1b0a8; }
.cart-vat { font-size: .8rem; color: var(--muted); }

/* Coloana de denumire în liste: destul de lată ca „Konica Minolta Bizhub C250i” să încapă pe un rând (doar pe ecran lat) */
@media (min-width: 641px) {
  .table.cards th.title-col, .table.cards td.title-col { min-width: 18rem; }
}

/* analiză financiară închirieri (panou principal) */
.rent-an { margin-top: 18px; }
.tiles.kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 8px; }
.tiles.kpis .tile-count { font-size: 1.25rem; overflow-wrap: break-word; }
.kpi-sub { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.hbars.wide a { grid-template-columns: minmax(110px, 40%) 1fr 92px; }
.rent-an .charts { margin-top: 10px; }
