/* ============================================================
   CASA DIN CHIRPICI — Calculator Constructiv
   styles.css v2.0 — Design system complet
   ============================================================ */

/* ── VARIABILE ─────────────────────────────────────────────── */
:root {
  --blue:       #1F4E79;
  --blue-l:     #2E75B6;
  --blue-bg:    #EBF3FB;
  --blue-dark:  #163d61;
  --green:      #375623;
  --green-bg:   #E8F5E9;
  --orange:     #C55A11;
  --orange-bg:  #FFF3E0;
  --purple:     #5E35B1;
  --purple-bg:  #EDE7F6;
  --teal:       #00695C;
  --teal-bg:    #E0F2F1;
  --red:        #C62828;
  --red-bg:     #FFEBEE;
  --wood:       #5D4037;
  --wood-bg:    #EFEBE9;
  --gray:       #546E7A;
  --gray-bg:    #ECEFF1;

  --text:       #1a1d23;
  --muted:      #6b7280;
  --border:     #e2e6ea;
  --border2:    #c8cdd6;
  --bg:         #f5f7fa;
  --white:      #ffffff;

  --font:   'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:   'Cascadia Mono', 'Consolas', monospace;
  --r:      10px;
  --r-sm:   6px;
  --r-lg:   16px;
  --sh:     0 2px 8px rgba(0,0,0,0.08);
  --sh-md:  0 4px 16px rgba(0,0,0,0.10);
  --sh-lg:  0 8px 32px rgba(0,0,0,0.12);
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ────────────────────────────────────────────────── */
.app-header {
  background: var(--blue);
  color: #fff;
  padding: 0 24px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(31,78,121,0.4);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.logo > div:last-child { min-width: 0; }
.logo-icon {
  width: 46px; height: 46px;
  background: transparent;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: 0;
  flex-shrink: 0;
}
.logo-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-text { font-size: 18px; font-weight: 800; letter-spacing: 0; line-height: 1.05; }
.logo-sub {
  font-size: 10.5px;
  opacity: .72;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 230px;
}
.header-actions { display: flex; gap: 8px; align-items: center; }
.credit-badge {
  font-size: 12px;
  opacity: .9;
  margin-right: 2px;
  white-space: nowrap;
}

/* ── PROGRESS BAR ──────────────────────────────────────────── */
.progress-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
}
.progress-bar::-webkit-scrollbar { display: none; }
.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 20px;
  transition: all .2s;
}
.step-item.active  { background: var(--blue-bg); }
.step-item.done    { cursor: pointer; }
.step-item.locked  { cursor: not-allowed; opacity: .4; }
.step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--muted);
  transition: all .2s;
  flex-shrink: 0;
}
.step-item.active  .step-num { border-color: var(--blue); background: var(--blue); color: #fff; }
.step-item.done    .step-num { border-color: var(--green); background: var(--green); color: #fff; }
.step-label { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.step-item.active  .step-label { color: var(--blue); font-weight: 600; }
.step-item.done    .step-label { color: var(--green); }
.step-sep { width: 24px; height: 2px; background: var(--border); flex-shrink: 0; margin: 0 2px; }
.step-sep.done { background: var(--green); }

/* ── MAIN CONTENT ──────────────────────────────────────────── */
.app-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 100px;
}

/* ── STEP CONTAINER ────────────────────────────────────────── */
.step-view { display: none; animation: fadeIn .3s ease; }
.step-view.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

.step-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -.02em;
}
.step-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

/* ── SELECTION CARDS ───────────────────────────────────────── */
.card-grid {
  display: grid;
  gap: 14px;
}
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.sel-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 16px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  position: relative;
  box-shadow: var(--sh);
}
.sel-card:hover {
  border-color: var(--blue-l);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}
.sel-card.selected {
  border-color: var(--blue);
  background: var(--blue-bg);
  box-shadow: 0 0 0 3px rgba(31,78,121,0.15);
}
.sel-card.selected .card-check { opacity: 1; }
.card-check {
  position: absolute;
  top: 10px; right: 10px;
  width: 22px; height: 22px;
  background: var(--blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px;
  opacity: 0;
  transition: opacity .2s;
}
.card-icon {
  font-size: 36px;
  line-height: 1;
}
.card-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.sel-card.selected .card-label { color: var(--blue); }
.card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.card-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-green  { background: var(--green-bg);  color: var(--green);  }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue);   }
.badge-gray   { background: var(--gray-bg);   color: var(--gray);   }

/* Disabled card */
.sel-card.disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(0.5);
}
.sel-card.disabled:hover { transform: none; box-shadow: var(--sh); border-color: var(--border); }

/* ── CHIP SELECTOR ─────────────────────────────────────────── */
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border2);
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  display: flex; align-items: center; gap: 6px;
  -webkit-user-select: none;
  user-select: none;
}
.chip:hover { border-color: var(--blue-l); color: var(--blue); }
.chip.on { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); font-weight: 600; }
.chip.on-green  { border-color: var(--green); background: var(--green-bg); color: var(--green); font-weight:600; }
.chip.on-orange { border-color: var(--orange); background: var(--orange-bg); color: var(--orange); font-weight:600; }

/* ── FORM ELEMENTS ─────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label,
.field .field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 10px 13px;
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue-l);
  box-shadow: 0 0 0 3px rgba(46,117,182,0.12);
}
.field input[type=number] { font-family: var(--mono); }
.field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}
.field input.unit-right { padding-right: 48px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.field-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Input cu unitate */
.input-wrap { position: relative; }
.input-unit {
  position: absolute;
  right: 13px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
}

/* ── SEGMENT ROWS ──────────────────────────────────────────── */
.seg-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.seg-row {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
}
.seg-row:nth-child(even) { background: #fafbfc; }
.seg-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.seg-main-label { font-weight: 400; color: var(--muted); }
.seg-del {
  font-size: 12px;
  color: var(--red);
  cursor: pointer;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 12px;
  transition: background .15s;
}
.seg-del:hover { background: var(--red-bg); }

/* ── SECTION DIVIDER ───────────────────────────────────────── */
.sec-div {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}
.sec-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 5px 10px;
  border-radius: 5px;
  margin: 20px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sec-blue   { background: var(--blue-bg);   color: var(--blue);   }
.sec-green  { background: var(--green-bg);  color: var(--green);  }
.sec-orange { background: var(--orange-bg); color: var(--orange); }
.sec-purple { background: var(--purple-bg); color: var(--purple); }
.sec-teal   { background: var(--teal-bg);   color: var(--teal);   }
.sec-red    { background: var(--red-bg);    color: var(--red);    }
.sec-wood   { background: var(--wood-bg);   color: var(--wood);   }

/* ── TOGGLE SWITCH ─────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .15s;
}
.toggle-row:hover { border-color: var(--blue-l); }
.toggle-row.active { border-color: var(--blue); background: var(--blue-bg); }
.toggle-info { flex: 1; }
.toggle-title { font-size: 14px; font-weight: 600; color: var(--text); }
.toggle-desc  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.toggle-row.active .toggle-title { color: var(--blue); }
.toggle-sw {
  width: 44px; height: 24px;
  background: var(--border2);
  border-radius: 12px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle-row.active .toggle-sw { background: var(--blue); }
.toggle-sw::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-row.active .toggle-sw::after { transform: translateX(20px); }

/* ── COLLAPSIBLE SECTION ───────────────────────────────────── */
.collapsible { overflow: hidden; max-height: 0; transition: max-height .3s ease; }
.collapsible.open { max-height: 2000px; }

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 2px 8px rgba(31,78,121,0.3); }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); box-shadow: 0 4px 12px rgba(31,78,121,0.4); }
.btn-green   { background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(55,86,35,0.3); }
.btn-green:hover:not(:disabled) { background: #2a4118; }
.btn-outline { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover:not(:disabled) { background: var(--blue-bg); }
.btn-ghost   { background: transparent; color: var(--muted); border: 1.5px solid var(--border2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--blue-l); color: var(--blue); }
.btn-danger  { background: var(--red-bg); color: var(--red); border: 1.5px solid rgba(198,40,40,.2); }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--r-lg); }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: var(--r-sm); }
.btn-full { width: 100%; }
.text-link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.text-link-btn:hover { text-decoration: underline; }
.btn-add {
  width: 100%;
  padding: 10px;
  background: var(--blue-bg);
  color: var(--blue);
  border: 1.5px dashed rgba(31,78,121,.4);
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 8px 0;
}
.btn-add:hover { background: var(--blue); color: #fff; border-style: solid; }

/* ── NAVIGATION BUTTONS ────────────────────────────────────── */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.step-nav-right { display: flex; gap: 10px; margin-left: auto; }

/* ── STICKY BOTTOM NAV (mobile) ────────────────────────────── */
.sticky-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  gap: 10px;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.sticky-nav .btn { flex: 1; }

/* ── RESULTS ───────────────────────────────────────────────── */
.results-hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-l) 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 28px 24px;
  margin-bottom: 16px;
  box-shadow: var(--sh-md);
  text-align: center;
}
.results-hero .rh-label { font-size: 12px; opacity: .75; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.results-hero .rh-total { font-size: 42px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.results-hero .rh-sub { font-size: 13px; opacity: .8; margin-top: 10px; }
.results-hero .rh-note { font-size: 11px; opacity: .6; margin-top: 6px; }

/* FREE badge */
.free-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 12px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.results-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: var(--sh);
  min-width: 0;
}
.results-box .rb-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.results-box .rb-val { font-size: 20px; font-weight: 700; color: var(--blue); overflow-wrap: anywhere; }
.results-box .rb-sub { font-size: 11px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }

/* ── TABS ──────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 14px;
  overflow-x: auto;
  gap: 0;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs.results-tabs { margin-top: 20px; }
.tab {
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.tab:hover { color: var(--blue); }
.tab.on { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.on { display: block; }

/* ── EXTRAS TABLE ──────────────────────────────────────────── */
.card-sec {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  margin-bottom: 14px;
  overflow: hidden;
}
.card-sec.scan-extra-card { margin-top: 18px; }
.card-sec-hdr {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.card-sec-hdr.info { background: var(--blue-bg); }
.sec-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.sec-icon.blue { background: var(--blue); color: #fff; font-size: 11px; }
.result-list { margin: 8px 0 0 18px; }
.result-actions { display: flex; gap: 12px; margin: 20px 0; flex-wrap: wrap; }
.scan-empty-msg { padding: 14px; color: var(--muted); font-size: 13px; }
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.tbl td { padding: 8px 12px; border-bottom: 1px solid rgba(226,230,234,.5); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--blue-bg); }
.tbl .qty { font-family: var(--mono); color: var(--blue); font-weight: 600; text-align: right; }
.tbl .um  { color: var(--muted); font-size: 11px; text-align: right; }
.tbl .cost { font-family: var(--mono); font-weight: 600; text-align: right; }
.tbl .cost-green { color: var(--green); }
.tbl .note-small { color: var(--muted); font-size: 10px; }
.tbl .wood-small { color: var(--wood); font-size: 10px; }
.tbl .col-wide { width: 55%; }
/* Grup rows */
.tbl .row-grup td {
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 5px 12px;
}
.tbl .row-grup.green td { background: var(--green-bg); color: var(--green); }
.tbl .row-grup.orange td { background: var(--orange-bg); color: var(--orange); }
.tbl .row-grup.purple td { background: var(--purple-bg); color: var(--purple); }
.tbl .row-grup:hover td { background: inherit; }
.tbl .row-total td { background: #FFFDE7; font-weight: 600; }
.tbl .row-nota td { background: var(--orange-bg); color: var(--orange); font-size: 11px; font-style: italic; }
.tbl .row-info td { color: var(--muted); font-size: 12px; }

/* ── BAR CHART ─────────────────────────────────────────────── */
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  min-width: 0;
}
.bar-lbl {
  width: 170px;
  flex-shrink: 0;
  color: var(--text);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-wrap { flex: 1; background: var(--bg); border-radius: 5px; height: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; transition: width .6s ease; }
.bar-val { width: 90px; text-align: right; font-family: var(--mono); font-size: 11px; color: var(--blue); flex-shrink: 0; }

/* ── MANOPERE MODAL ───────────────────────────────────────── */
.manopere-list {
  max-height: 54vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--white);
}
.manopere-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.manopere-search {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
}
.manopere-accordion {
  background: #f8fafc;
}
.manopere-panel {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.manopere-panel:last-child {
  border-bottom: 0;
}
.manopere-panel[hidden] {
  display: none;
}
.manopere-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.manopere-summary::-webkit-details-marker {
  display: none;
}
.manopere-summary::before {
  content: '+';
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  margin-right: 2px;
  color: var(--muted);
  background: #fff;
  flex-shrink: 0;
}
.manopere-panel[open] .manopere-summary::before {
  content: '-';
}
.manopere-summary-title {
  flex: 1;
  min-width: 0;
}
.manopere-summary-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}
.manopere-panel-body {
  border-top: 1px solid rgba(226,230,234,.75);
}
.manopere-group {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.manopere-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid rgba(226,230,234,.75);
}
.manopere-row:last-child { border-bottom: 0; }
.manopere-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.25;
}
.manopere-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.manopere-price {
  width: 100%;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  text-align: right;
  font-family: var(--mono);
}
.manopere-price-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: stretch;
}
.manopere-price-unit {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  text-align: right;
}

/* ── COST SUMMARY ──────────────────────────────────────────── */
.sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.sum-row:last-child { border-bottom: none; font-weight: 700; font-size: 15px; padding-top: 12px; }
.sum-cat { color: var(--text); }
.sum-val { font-family: var(--mono); color: var(--blue); font-weight: 600; }

/* ── ALERT / NOTE ──────────────────────────────────────────── */
.alert {
  padding: 12px 15px;
  border-radius: var(--r);
  font-size: 13px;
  display: flex;
  gap: 10px;
  margin: 12px 0;
  align-items: flex-start;
  line-height: 1.5;
}
.alert-warn { background: var(--orange-bg); border: 1px solid rgba(197,90,17,.2); color: var(--orange); }
.alert-info { background: var(--blue-bg); border: 1px solid rgba(31,78,121,.2); color: var(--blue); }
.alert-red  { background: var(--red-bg); border: 1px solid rgba(198,40,40,.2); color: var(--red); }

/* ── CREDIT MODAL ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn .2s ease;
}
.modal {
  background: var(--white);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  box-shadow: var(--sh-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal.export-meta { max-width: 520px; }
.modal.export-format { max-width: 440px; }
.modal-hdr {
  background: var(--blue);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-hdr h3 { font-size: 16px; font-weight: 700; }
.modal-close { cursor: pointer; opacity: .75; font-size: 20px; line-height: 1; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-text-sm { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 14px; }
.export-input { font-size: 13px; }
.export-input-sm { font-size: 12px; }
.export-input-mono { font-size: 12px; font-family: var(--mono); }
.export-info { margin-bottom: 16px; }
.export-format-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.export-format-option {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  background: #fff;
}
.export-format-radio { margin-right: 6px; }
.export-format-hint { font-size: 10px; color: var(--muted); margin-top: 4px; }
.export-actions { display: flex; gap: 10px; margin-top: 16px; }
.export-note { font-size: 10px; color: var(--muted); text-align: center; margin-top: 10px; }
.auth-login-intro { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.auth-register-intro { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.auth-google-box {
  margin-bottom: 12px;
  min-height: 44px;
  height: 44px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-google-box > div { width: 100%; max-width: 100%; }
.auth-google-box iframe { max-width: 100% !important; max-height: 44px !important; }
.login-google-btn { overflow: hidden; }
.login-google-img { width: 18px; height: 18px; flex-shrink: 0; }
.auth-sep { text-align: center; font-size: 12px; color: var(--muted); margin: 10px 0; }
.auth-sep-wide { text-align: center; font-size: 12px; color: var(--muted); margin: 14px 0; }
.auth-forgot-intro { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.auth-link-row { display: flex; justify-content: space-between; margin-top: 12px; }
.text-link-sm { font-size: 12px; }
.text-link-blue { color: var(--blue); }
.auth-back-wrap { text-align: center; margin-top: 14px; }
.auth-forgot-back-wrap { text-align: center; margin-top: 12px; }
.auth-tip-row { display: flex; gap: 8px; margin-bottom: 12px; }
.auth-tip-btn {
  flex: 1;
  padding: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.auth-tip-btn.active {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: var(--blue);
  font-weight: 600;
}
.auth-legal-text { font-size: 11px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.auth-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.auth-loading-msg { text-align: center; padding: 20px; color: var(--muted); }
.auth-state { text-align: center; padding: 20px; }
.auth-state-icon { font-size: 48px; margin-bottom: 14px; }
.auth-state-title { color: var(--blue); margin-bottom: 8px; }
.auth-state-msg { font-size: 13px; color: var(--muted); }
.auth-state-back { margin-top: 14px; }
body.auth-no-scroll { overflow: hidden; }
.auth-account-summary {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
  padding: 10px;
  background: var(--blue-bg);
  border-radius: 8px;
  line-height: 1.6;
}
.auth-role-box { border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.auth-role-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.auth-role-select { width: 100%; padding: 9px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.auth-actions-stack { display: flex; flex-direction: column; gap: 8px; }
.auth-separator { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.auth-danger-btn { background: var(--red-bg); color: var(--red); border: 1px solid rgba(198,40,40,.2); }
.auth-delete-warn {
  font-size: 13px;
  line-height: 1.55;
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid rgba(198,40,40,.22);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}
.auth-delete-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.auth-cui-line { display: flex; gap: 6px; align-items: center; }
.auth-cui-input { flex: 1; margin: 0; }
.auth-import-btn { white-space: nowrap; flex-shrink: 0; }
.auth-field-hint { font-size: 10px; color: var(--muted); margin-top: 3px; }
.auth-profile-actions { display: flex; gap: 10px; margin-top: 12px; }
.auth-manopere-intro { font-size: 12px; color: var(--muted); line-height: 1.45; margin-bottom: 10px; }
.auth-row-actions { display: flex; gap: 8px; margin-top: 12px; }
.auth-empty { text-align: center; padding: 24px; color: var(--muted); }
.auth-empty-icon { font-size: 36px; margin-bottom: 12px; }
.auth-history-count { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.auth-history-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.auth-notification-card.unread { border-color: var(--blue); background: var(--blue-bg); }
.auth-notification-message { font-size: 12px; color: var(--ink); line-height: 1.45; margin: 8px 0 0; }
.auth-history-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.auth-history-row.center { align-items: center; }
.auth-history-left { flex: 1; min-width: 0; }
.auth-history-title { font-weight: 600; font-size: 13px; }
.auth-history-title-blue { font-weight: 600; font-size: 13px; color: var(--blue); }
.auth-history-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.auth-history-cost { font-size: 12px; color: var(--green); margin-top: 2px; }
.auth-history-sum { font-size: 13px; color: var(--blue); font-weight: 600; margin-top: 2px; }
.auth-history-client { font-size: 11px; color: var(--muted); margin-top: 3px; }
.auth-history-expire { font-size: 10px; color: var(--muted); }
.auth-history-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.auth-history-right.payments { gap: 6px; }
.auth-compact-primary {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.auth-unavailable { font-size: 10px; color: var(--muted); font-style: italic; }
.auth-status { font-size: 11px; padding: 2px 7px; border-radius: 10px; }
.auth-status-paid { background: #E8F5E9; color: #2E7D32; font-weight: 600; }
.auth-status-pending { background: #FFF3E0; color: #C55A11; }
.auth-history-note { font-size: 11px; color: var(--muted); text-align: center; margin: 10px 0; }
.auth-error-text { padding: 16px; color: var(--red); }
.auth-google-fallback { font-size: 14px; color: var(--blue); border-color: var(--blue); }
.furnizor-product-tools {
  margin-bottom: 10px;
}
.furnizor-product-form {
  border-color: rgba(31,78,121,.28);
  background: #f8fafc;
  scroll-margin: 16px;
}
.furnizor-product-form-title {
  margin-bottom: 3px;
}
.furnizor-product-form[hidden] {
  display: none !important;
}
.furnizor-product-form.is-editing {
  border-color: rgba(46,117,182,.42);
}
.install-banner {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1d23;
  color: #fff;
  padding: 12px 14px;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  font-size: 13px;
  max-width: 380px;
  width: 92%;
}
.install-banner-text { flex: 1; line-height: 1.35; }
.install-banner-btn {
  background: #1F4E79;
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  font-size: 13px;
}
.install-banner-btn.compact { padding-inline: 12px; }
.install-banner-close { cursor: pointer; opacity: .65; flex-shrink: 0; font-size: 16px; }

/* Pachete credite */
.pachete-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pachet-card {
  border: 2px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  text-align: center;
}
.pachet-card:hover { border-color: var(--blue-l); }
.pachet-card.popular { border-color: var(--blue); }
.pachet-card.selected { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.pachet-label { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.pachet-credite { font-size: 22px; font-weight: 800; color: var(--blue); }
.pachet-credit-unit { font-size: 12px; font-weight: 400; }
.pachet-pret { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pachet-eco { font-size: 11px; color: var(--green); font-weight: 600; }
.pachete-empty-msg { grid-column: 1 / -1; font-size: 13px; color: var(--muted); text-align: center; }
.legal-accept {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  text-align: left;
  margin: 14px 0 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #F8FAFC;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.legal-accept input { margin-top: 2px; flex-shrink: 0; }
.legal-accept a { color: var(--blue); font-weight: 700; text-decoration: none; }
.legal-accept a:hover { text-decoration: underline; }
.custom-credit-card,
.enterprise-credit-card { grid-column: 1 / -1; cursor: default; }
.custom-credit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.custom-credit-row input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
}
.custom-credit-hint { margin-top: 7px; color: var(--muted); }
.enterprise-credit-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  background: #F8FAFC;
}
.enterprise-credit-card .pachet-pret { grid-column: 1; margin-top: 0; }
.enterprise-credit-link { grid-column: 2; grid-row: 1 / span 2; align-self: center; white-space: nowrap; }
.enterprise-contact-actions { display: grid; gap: 8px; margin-top: 8px; }
.enterprise-contact-success { text-align: center; padding: 10px 0 2px; }
.enterprise-contact-success h3 { color: var(--blue); margin-bottom: 8px; }
.enterprise-contact-success p { color: var(--muted); font-size: 13px; line-height: 1.6; margin-bottom: 16px; }
.pachet-badge {
  position: absolute; top: -1px; right: -1px;
  background: var(--blue); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 3px 8px; border-radius: 0 var(--r-sm) 0 var(--r-sm);
  text-transform: uppercase;
}

/* ── LOADING SPINNER ───────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(31,78,121,0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST NOTIFICATION ────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px; right: 20px;
  background: #1a1d23;
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  z-index: 400;
  box-shadow: var(--sh-lg);
  animation: toastIn .3s ease;
  max-width: 300px;
}
@keyframes toastIn { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

/* ── EMPTY STATE ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 56px; margin-bottom: 16px; opacity: .6; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; }

/* ── UTILS ─────────────────────────────────────────────────── */
.hidden    { display: none !important; }
.text-muted{ color: var(--muted); }
.text-sm   { font-size: 12px; }
.fw-bold   { font-weight: 700; }
.mt-4      { margin-top: 4px; }
.mt-8      { margin-top: 8px; }
.mt-16     { margin-top: 16px; }
.mt-24     { margin-top: 24px; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 700px) {
  .app-header { padding: 0 12px; height: 60px; }
  .logo { gap: 8px; min-width: 0; }
  .logo-icon { width: 38px; height: 38px; font-size: 16px; }
  .logo-text { font-size: 15px; }
  .logo-sub { font-size: 9px; max-width: 150px; }
  .header-actions { gap: 6px; flex-shrink: 0; }
  .header-actions .btn-sm { padding: 7px 9px; font-size: 11px; }
  .credit-badge { display: none; }
  .app-main { padding: 16px 14px 90px; }
  .card-grid.cols-2,
  .card-grid.cols-3,
  .card-grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .results-grid { grid-template-columns: 1fr 1fr; }
  .results-grid .results-box:first-child { grid-column: 1 / -1; }
  .field-row.cols-3 { grid-template-columns: 1fr 1fr; }
  .bar-lbl { width: 120px; font-size: 11px; }
  .bar-val  { width: 70px; }
  .results-hero .rh-total { font-size: 32px; }
  .manopere-toolbar { grid-template-columns: 1fr; }
  .manopere-row { grid-template-columns: minmax(0, 1fr) 92px; }
  .pachete-grid { grid-template-columns: 1fr; }
  .enterprise-credit-card { grid-template-columns: 1fr; }
  .enterprise-credit-card .pachet-pret,
  .enterprise-credit-link { grid-column: auto; grid-row: auto; justify-self: start; }
  .tbl th:last-child, .tbl td:last-child { display: none; } /* ascunde coloana cost pe mobile */
  .modal-overlay { align-items: flex-start; padding: 12px; }
  .modal { max-height: calc(100vh - 24px); border-radius: var(--r); }
}
@media (max-width: 400px) {
  .header-actions .btn-sm { padding: 7px 8px; }
  .logo-sub { max-width: 124px; }
  .header-credit-btn { max-width: 82px; overflow: hidden; }
  .header-login-btn { max-width: 88px; overflow: hidden; }
  .card-grid.cols-2 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .step-label { display: none; }
}

/* ── BREADCRUMB ─────────────────────────────────────────────── */
.breadcrumb {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--blue-l); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.bc-sep { color: var(--border2); }

/* ── AUTH WALL ──────────────────────────────────────────────── */
.auth-wall {
  max-width: 480px;
  margin: 60px auto;
  padding: 0 16px;
  text-align: center;
}
.auth-card {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 40px 32px;
}
.auth-icon  { font-size: 48px; margin-bottom: 16px; }
.auth-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.auth-desc  { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 24px; }
.auth-note  { font-size: 12px; color: #94a3b8; margin-top: 14px; }

/* ── PAGE HERO (sub-pages) ──────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--blue), var(--blue-l));
  border-radius: var(--r-lg);
  padding: 28px 24px;
  color: #fff;
  margin-bottom: 24px;
}
.page-hero h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.page-hero p  { font-size: 13px; opacity: .85; line-height: 1.5; }
.hero-chip {
  display: inline-block;
  background: rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* ── CONTENT WRAP (free calc pages) ────────────────────────── */
.page-wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 80px; }

/* ── GENERIC CONTENT CARD ───────────────────────────────────── */
.content-card {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 16px;
}
.content-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── LINK ACCENT ────────────────────────────────────────────── */
.link-accent { color: var(--blue-l); text-decoration: none; }
.link-accent:hover { text-decoration: underline; }

/* ── PAGE FOOTER (non-fixed, all pages except calculator) ───── */
.page-footer {
  border-top: 1px solid var(--border);
  padding: 18px 20px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 40px;
}
.page-footer a { color: var(--blue-l); text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
.page-footer .sep { margin: 0 4px; opacity: .5; }

/* ── LEGAL FOOTER (fixed, calculator only) ───────────────────── */
.legal-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 10px 20px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
}
.legal-footer a { color: var(--blue-l); }
.legal-footer .beta-link { font-weight: 600; }
