*, *::before, *::after { box-sizing: border-box; }
:root {
  /* paletă caldă; accentul e culoarea companiei (vezi body[data-company]) */
  --bg: #f4f1ec;
  --ink: #221c15;
  --muted: #7a7267;
  --card: #fff;
  --line: #e2dcd2;
  --brand: #8a5a2b;
  --brand-strong: #6f4620;        /* variantă închisă (hover / text pe alb) */
  --brand-tint: color-mix(in srgb, var(--brand) 8%, #fff);
  --ink-dark: #17130f;            /* near-black cald pentru copertă/modal */
  --danger: #b3261e;

  /* scară tipografică (1.20 ratio, bază 16px) */
  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;

  /* scară de spațiere (4px) */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem;
  --s5: 1.5rem; --s6: 2rem; --s7: 3rem;

  /* rază + umbre (tentă caldă, nu negru pur) */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(60 46 30 / .05), 0 1px 3px rgb(60 46 30 / .07);
  --shadow-md: 0 4px 14px rgb(60 46 30 / .08), 0 10px 32px rgb(60 46 30 / .10);

  /* curbe de mișcare (Emil Kowalski: ease-out puternic, curbă de sertar iOS) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}
body[data-company="solutions"] { --brand: #1f6f6b; --brand-strong: #175753; }
[x-cloak] { display: none !important; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

/* ---------- stări de interacțiune globale (a11y + tactilitate) ---------- */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
/* feedback la apăsare pe butoanele proeminente (nu pe link-uri text) */
button:not(.link):active { transform: scale(.97); }
button:not(.link) { transition: transform 140ms var(--ease-out), background-color 140ms var(--ease-out), border-color 140ms var(--ease-out); }
input, select, textarea { transition: border-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out); }
:where(input, select, textarea):focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
/* cifre tabulare pentru prețuri/totaluri — nu mai sar coloanele */
.card-price, .line-total, .hrow-total, .trow, .totals { font-variant-numeric: tabular-nums; }

/* ---------- login ---------- */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.login-card {
  width: 100%;
  max-width: 22rem;
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--s6) var(--s5);
  display: grid;
  gap: var(--s4);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}
.login-card h1 { margin: 0 0 var(--s3); font-size: var(--fs-xl); line-height: 1.25; text-align: center; letter-spacing: -.01em; }
.login-card label { display: grid; gap: .3rem; font-size: .85rem; color: var(--muted); }
.login-card input {
  padding: .65rem .8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
}
.login-card button[type=submit] {
  padding: .8rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  margin-top: var(--s2);
}
.login-card button[type=submit]:hover { background: #000; }
.login-card button[type=submit]:disabled { opacity: .55; cursor: progress; }
.error { color: #b3261e; margin: 0; font-size: .9rem; }

.link { background: none; border: 0; color: var(--muted); text-decoration: underline; }

/* ---------- topbar + navigare ---------- */
/* Bara e translucidă (blur pe ::before, nu pe .topbar: backdrop-filter ar face
   din ea containing block pentru bara de jos fixă de pe mobil). */
:root { --topbar-h: 60px; --tabbar-h: 64px; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  height: var(--topbar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s4);
  padding: 0 var(--s4);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
}

.brand {
  display: flex; align-items: center; gap: .6rem; min-width: 0; justify-self: start; max-width: 100%;
  border: 0; background: none; padding: .3rem .5rem .3rem .3rem; margin-left: -.3rem;
  border-radius: var(--radius); color: var(--ink);
}
@media (hover: hover) { .brand:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); } }
.brand-mark {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; background: var(--brand); color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14), 0 1px 2px rgb(60 46 30 / .2);
}
.brand-name { font-weight: 650; font-size: .95rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* nav segmentat (desktop) */
.nav {
  display: flex; gap: 2px; padding: 3px; margin: 0 auto;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border-radius: var(--radius-pill);
}
.nav button {
  position: relative; display: flex; align-items: center; gap: .45rem;
  border: 0; background: none; color: var(--muted);
  padding: .42rem .95rem; border-radius: var(--radius-pill);
  font-size: var(--fs-sm); font-weight: 550;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.nav button:active { transform: none; }
.nav svg { width: 16px; height: 16px; }
@media (hover: hover) { .nav button:not(.on):hover { color: var(--ink); } }
.nav button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.nav button.on svg { color: var(--brand); }
.nav-dot {
  font-style: normal; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: var(--radius-pill);
  background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700;
}

/* cont */
.account { position: relative; justify-self: end; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: .75rem; font-weight: 700; letter-spacing: .03em;
}
@media (hover: hover) { .avatar:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); } }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  width: 250px; padding: 6px; display: grid;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transform-origin: top right;
  opacity: 0; transform: scale(.96) translateY(-4px); visibility: hidden;
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out), visibility 150ms;
}
.menu.open { opacity: 1; transform: none; visibility: visible; }
.menu-id { display: grid; padding: .55rem .7rem .7rem; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-id strong { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; }
.menu-id small { color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; }
.menu button {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  border: 0; background: none; text-align: left; color: var(--ink);
  padding: .55rem .7rem; border-radius: var(--radius-sm); font-size: var(--fs-sm);
}
.menu button:active { transform: none; }
@media (hover: hover) { .menu button:hover { background: var(--bg); } }
.menu button small { color: var(--muted); font-size: .68rem; font-variant-numeric: tabular-nums; }
.menu .menu-out { color: var(--danger); }

.spacer { flex: 1; }

/* mobil: nav-ul devine bară de taburi jos (zona sigură iOS inclusă) */
@media (max-width: 799px) {
  .topbar { grid-template-columns: 1fr auto; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding: 0 max(var(--s2), env(safe-area-inset-left)) env(safe-area-inset-bottom);
    border-radius: 0; gap: 0;
    background: color-mix(in srgb, var(--card) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(16px);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line);
  }
  .nav button {
    flex: 1; flex-direction: column; justify-content: center; gap: 3px;
    padding: 0; border-radius: 0; font-size: .7rem;
  }
  .nav button.on { background: none; box-shadow: none; color: var(--brand-strong); }
  .nav svg { width: 22px; height: 22px; }
  .nav-dot { position: absolute; top: 8px; left: calc(50% + 6px); }
  .catalog, .history, .admin { padding-bottom: calc(var(--tabbar-h) + 6rem); }
  .offer-fab { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + .75rem) !important; }
}

/* ---------- catalog ---------- */
.catalog { padding: 1rem; max-width: 1400px; margin: 0 auto; }
.filters { display: grid; gap: .75rem; margin-bottom: 1rem; }
.filters input[type=search] {
  width: 100%;
  padding: .7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}
.chips { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; }
.chip {
  flex: 0 0 auto;
  padding: .4rem .95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--muted);
}
@media (hover: hover) { .chip:not(.on):hover { border-color: var(--brand); color: var(--brand-strong); } }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.empty { color: var(--muted); text-align: center; padding: 3rem 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.card {
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  transition: transform .12s, box-shadow .12s;
}
.card { transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), border-color .16s var(--ease-out); }
@media (hover: hover) {
  .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
}
.card:active { transform: translateY(-1px); }
.card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #ddd; }
.card-body { padding: .7rem .85rem .85rem; display: grid; gap: .2rem; }
.card-name { font-weight: 600; font-size: var(--fs-sm); line-height: 1.3; }
.card-cat { color: var(--muted); font-size: var(--fs-xs); }
.card-price { font-weight: 700; color: var(--brand-strong); font-size: var(--fs-sm); display: flex; gap: .5rem; align-items: baseline; margin-top: .1rem; }
.card-price small { color: var(--muted); font-weight: 400; }

/* ---------- ofertă ---------- */
.card { position: relative; cursor: pointer; }
.card.added { border-color: var(--brand); }
.card-view {
  position: absolute; top: .4rem; right: .4rem;
  background: rgb(255 255 255 / .85);
  border-radius: 50%;
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  text-decoration: none;
}
.card-added {
  position: absolute; top: .4rem; left: .4rem;
  background: var(--brand); color: #fff;
  font-size: .72rem; font-weight: 600;
  padding: .15rem .5rem; border-radius: 999px;
}

.offer-panel {
  background: var(--card);
  display: flex; flex-direction: column;
  gap: .9rem;
  padding: 1rem;
  overflow-y: auto;
}
.offer-head { display: flex; align-items: center; }
.offer-head h2 { margin: 0; font-size: 1.05rem; flex: 1; }
.offer-no { color: var(--brand); font-size: .85rem; word-break: break-all; }
.offer-meta { display: grid; gap: .6rem; }
.offer-meta label { display: grid; gap: .25rem; font-size: .8rem; color: var(--muted); }
.offer-meta input {
  padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem;
}
.currency { display: flex; gap: .4rem; }
.currency button {
  flex: 1; padding: .4rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--muted);
}
.currency button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.currency button:disabled { opacity: .45; cursor: not-allowed; }

.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.line { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; display: grid; gap: .45rem; }
.line-top { display: flex; gap: .5rem; align-items: baseline; }
.line-name { flex: 1; font-weight: 600; font-size: .9rem; }
.line-controls { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty button { width: 2rem; height: 2rem; border: 0; background: var(--bg); font-size: 1.1rem; }
.qty input { width: 2.6rem; border: 0; text-align: center; font-size: .95rem; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.disc, .override { display: inline-flex; align-items: center; gap: .15rem; font-size: .9rem; color: var(--muted); }
.disc input { width: 3.2rem; }
.override input { width: 5.5rem; }
.disc input, .override input {
  padding: .35rem .4rem; border: 1px solid var(--line); border-radius: 8px; text-align: right; font-size: .9rem;
}
.line-total { margin-left: auto; color: var(--brand); }

/* comutator per linie: preț unitar vs. sumă totală */
.mode { display: inline-flex; gap: .25rem; }
.mode button {
  padding: .2rem .55rem; font-size: .78rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--muted);
}
.mode button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.override.total-in { gap: .4rem; color: var(--muted); font-size: .8rem; }
.override.total-in input { width: 7rem; }
.line-list { color: var(--muted); }

.totals { border-top: 1px solid var(--line); padding-top: .7rem; display: grid; gap: .4rem; }
.trow { display: flex; justify-content: space-between; align-items: center; font-size: .92rem; }
.trow.grand { font-size: 1.05rem; border-top: 1px solid var(--line); padding-top: .5rem; }

.terms summary { cursor: pointer; font-weight: 600; font-size: .92rem; padding: .3rem 0; }
.terms label { display: grid; gap: .25rem; font-size: .8rem; color: var(--muted); margin-top: .6rem; }
.terms input, .terms textarea {
  padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; font-size: .92rem; font-family: inherit;
}

.offer-actions { display: flex; gap: .7rem; align-items: center; justify-content: space-between; margin-top: auto; }
.primary {
  padding: .7rem 1.2rem; border: 0; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; font-weight: 600;
}
.primary:hover { background: var(--brand-strong); }
.primary:disabled { opacity: .5; cursor: not-allowed; }
.primary:disabled:hover { background: var(--brand); }

.card-price .unset { color: var(--muted); font-weight: 400; font-style: italic; }
.line-list.warn { color: #b3261e; }

/* ---------- administrare prețuri ---------- */
.prices { padding: 1rem; max-width: 900px; margin: 0 auto; }
.prices-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.prices-head h2 { margin: 0; font-size: 1.1rem; flex: 1; }
.prices-msg { color: var(--brand); font-size: .9rem; }
.prices-table { display: grid; gap: .4rem; }
.prow {
  display: grid; grid-template-columns: 56px 1fr 6.5rem 6.5rem;
  gap: .6rem; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: .4rem .6rem;
}
.prow.phead { background: none; border: 0; font-size: .78rem; color: var(--muted); padding-bottom: 0; }
.prow img { width: 56px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; }
.prow input {
  padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; text-align: right; width: 100%;
}
@media (max-width: 560px) {
  .prow { grid-template-columns: 56px 1fr 1fr; }
  .prow span, .prow img { grid-column: auto; }
  .prow > span:nth-child(2), .prow > img + span { grid-column: 2 / -1; }
  .prow img { grid-row: span 2; }
  .prow.phead { display: none; }
}

/* ---------- consolă admin ---------- */
.admin { padding: 1rem; max-width: 960px; margin: 0 auto; }
.admin-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.admin-head h2 { margin: 0; font-size: 1.1rem; flex: 1; }
.admin-tabs { display: flex; gap: .4rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.admin-tabs button {
  flex: 0 0 auto; border: 0; background: none; color: var(--muted);
  padding: .55rem .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.admin-tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.admin-panel { display: grid; gap: .8rem; }
.panel-bar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.panel-bar .prices-msg { flex: 1; }

/* utilizatori */
.user-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: grid; gap: .8rem; }
.user-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .7rem; }
.user-form label { display: grid; gap: .25rem; font-size: .8rem; color: var(--muted); }
.user-form input, .user-form select {
  padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; background: var(--card);
}
.user-form-actions { display: flex; gap: .7rem; align-items: center; }
.user-list { display: grid; gap: .5rem; }
.urow {
  display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem;
}
.urow-main { display: grid; gap: .1rem; }
.urow-main small { color: var(--muted); }
.urole { font-size: .78rem; color: var(--muted); padding: .15rem .5rem; border: 1px solid var(--line); border-radius: 999px; }
.urole.admin { color: var(--brand); border-color: var(--brand); }
.urow-actions { display: flex; gap: .4rem; }
.chip.danger { color: #b3261e; border-color: #e6c9c6; }

/* produse */
.prod-table { display: grid; gap: .4rem; }
.prodrow {
  display: grid; grid-template-columns: 56px 2fr 1fr auto; gap: .6rem; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .4rem .6rem;
}
.prodrow.off { opacity: .55; }
.prodrow img { width: 56px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; }
.prodrow input { padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; width: 100%; background: var(--card); }
.prod-active { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) {
  .prodrow { grid-template-columns: 56px 1fr; }
  .prodrow > input, .prodrow > .prod-active { grid-column: 2; }
}

/* oferte (overview) */
.offer-totals { display: flex; gap: .6rem; flex-wrap: wrap; }
.ototal-card { display: grid; gap: .2rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; font-size: .9rem; }
.ototal-card span { color: var(--muted); }

/* sincronizare */
.sync-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: grid; gap: .6rem; }
.sync-card p { margin: 0; }
.sync-cmd { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem; overflow-x: auto; font-size: .85rem; margin: 0; }

/* ---------- partajare + istoric ---------- */
.share-box { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; display: grid; gap: .5rem; }
.saved-ok { margin: 0; color: var(--brand); font-weight: 600; font-size: .9rem; }
.share-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.share-row input { flex: 1; min-width: 0; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; }
.share-days { color: var(--muted); font-size: .85rem; display: inline-flex; gap: .3rem; align-items: center; }
.share-days select { padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font: inherit; }

.history { padding: 1rem; max-width: 900px; margin: 0 auto; }
.history-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.history-head h2 { margin: 0; font-size: 1.1rem; flex: 1 1 100%; }
.history-head input[type=search] { flex: 1; padding: .6rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.history-list { display: grid; gap: .5rem; }
.hrow {
  display: grid; grid-template-columns: 1fr auto; gap: .3rem .8rem; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem;
}
.hrow-main { display: grid; gap: .1rem; }
.hrow-no { color: var(--brand); font-size: .82rem; word-break: break-all; }
.hrow-main small { color: var(--muted); }
.hrow-total { color: var(--brand); }
.hrow-actions { grid-column: 1 / -1; display: flex; gap: .4rem; flex-wrap: wrap; }
.hrow-actions .chip { text-decoration: none; }

/* mobil: oferta e un sheet peste catalog, alunecă de jos (curbă iOS) */
.offer {
  position: fixed; inset: 0; z-index: 20;
  background: rgb(20 14 6 / 0);
  visibility: hidden;
  transition: background .32s var(--ease-drawer), visibility .32s var(--ease-drawer);
}
.offer.open { background: rgb(20 14 6 / .38); visibility: visible; }
.offer .offer-panel {
  position: absolute; inset: 8dvh 0 0 0;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgb(20 14 6 / .22);
  transform: translateY(100%);
  transition: transform .34s var(--ease-drawer);
}
.offer.open .offer-panel { transform: translateY(0); }
.offer-fab {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  z-index: 15;
  border: 0; border-radius: 999px;
  background: var(--ink); color: #fff;
  padding: .8rem 1.4rem; font-weight: 600;
  box-shadow: 0 6px 20px rgb(0 0 0 / .25);
  white-space: nowrap;
}
.badge {
  background: var(--brand); border-radius: 999px;
  padding: .1rem .5rem; font-size: .8rem;
}

/* ---------- desktop ---------- */
@media (min-width: 800px) {
  .workspace {
    display: grid;
    grid-template-columns: 1fr minmax(340px, 420px);
    height: calc(100dvh - var(--topbar-h));
  }
  .catalog { padding: 1.5rem 2rem; overflow-y: auto; max-width: none; }
  .filters { grid-template-columns: minmax(200px, 320px) 1fr; align-items: center; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
  .offer {
    position: static; display: block; background: none;
    visibility: visible;                 /* anulează starea de sheet mobil */
    z-index: auto;                       /* item de grid: z-index 20 ar acoperi meniul contului */
  }
  .offer .offer-panel {
    position: static; height: 100%;
    border-radius: 0; box-shadow: none;
    border-left: 1px solid var(--line);
    transform: none;                     /* anulează translateY(100%) mobil */
    transition: none;
  }
  .offer-close, .offer-fab { display: none; }
}

/* ---------- previzualizare PDF ---------- */
.pdf-modal {
  position: fixed; inset: 0; z-index: 40;
  background: var(--ink-dark);
  display: flex; flex-direction: column;
}
.pdf-modal-bar {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .8rem; background: var(--card); border-bottom: 1px solid var(--line);
}
.pdf-modal-bar strong { font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-modal-bar .primary { padding: .5rem .9rem; }
.pdf-modal-close { font-size: 1.3rem; text-decoration: none; padding: 0 .4rem; }
.pdf-frame { flex: 1; width: 100%; border: 0; background: #525659; }

/* ---------- reduce mișcarea (a11y) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- leaduri ---------- */
.lead-form { margin-bottom: 1.5rem; }
.lead-form textarea, .lead-form input[type=search] { padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; }
.lead-chips { flex-wrap: wrap; max-height: 11rem; overflow-y: auto; }
.lead-form .lead-consent { display: flex; gap: .5rem; align-items: center; color: var(--ink); font-size: var(--fs-sm); }
.leads .hrow { align-items: start; }

/* email generat pentru lead */
.mail-modal { position: fixed; inset: 0; z-index: 60; background: rgb(23 19 15 / .5); display: grid; place-items: center; padding: 1rem; }
.mail-card { width: min(640px, 100%); max-height: 100%; overflow-y: auto; }
.mail-head { display: flex; justify-content: space-between; align-items: center; }
.mail-row { display: flex; gap: .5rem; }
.mail-row input { flex: 1; min-width: 0; }
.mail-card textarea { padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; font-size: var(--fs-sm); line-height: 1.45; }
.mail-card .user-form-actions { flex-wrap: wrap; }
.mail-card .user-form-actions .chip { text-decoration: none; }

/* versiune + opționale pe linia de ofertă (lista Sanremo) */
.variant { display: grid; gap: .45rem; }
.variant select {
  width: 100%; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); font-size: .85rem; color: var(--ink);
}
.variant select.warn { border-color: var(--danger); color: var(--danger); }
.opts { display: flex; flex-wrap: wrap; gap: .3rem; }
.opt {
  display: inline-flex; gap: .35rem; align-items: baseline;
  padding: .28rem .6rem; border: 1px dashed var(--line); border-radius: var(--radius-pill);
  background: none; color: var(--muted); font-size: .75rem;
}
.opt b { font-weight: 600; font-variant-numeric: tabular-nums; }
.opt.on { border-style: solid; border-color: var(--brand); background: var(--brand-tint); color: var(--brand-strong); }
@media (hover: hover) { .opt:not(.on):hover { border-color: var(--brand); color: var(--ink); } }
.rate-bar { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.rate-bar label { display: grid; gap: .25rem; font-size: .8rem; color: var(--muted); }
.rate-bar input { width: 9rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; }
.rate-bar small { flex: 1 1 100%; color: var(--muted); }
