/* MedicalLife v2 — design „Bento” */
:root {
  --bg: #F1EEF8; --surface: #FFFFFF; --row: #F6F4FB; --text: #1C1830; --muted: #5E5875;
  --line: #E6E0F5; --accent: #5B3BEB; --on-accent: #FFFFFF; --accent-text: #4A2BD6; --accent-soft: #ECE6FF;
  --warm: #FFB27A; --on-warm: #3A1A04; --ok: #137A4C; --ok-soft: #D4F2E3; --warn: #C2410C; --warn-soft: #FFE9D8;
  --track: #ECE8F5; --ink: #1C1830; --on-ink: #FFFFFF; --sel: #1C1830; --on-sel: #FFFFFF;
  --t1: #ECE6FF; --t1i: #4A2BD6; --t2: #FFE9D8; --t2i: #9A4A0C; --t3: #D4F2E3; --t3i: #137A4C;
  --t4: #FBE1EE; --t4i: #A02E66; --t5: #DDEEFB; --t5i: #1D5F95;
  --radius: 28px; --radius-s: 18px;
  --shadow: 0 1px 2px rgba(28, 24, 48, .04);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F0D17; --surface: #1A1726; --row: #221E31; --text: #EEEAF8; --muted: #A79FC0;
  --line: #2C2740; --accent: #8F74FF; --on-accent: #120A33; --accent-text: #B9A8FF; --accent-soft: #2E2848;
  --warm: #FF9B57; --on-warm: #2A1100; --ok: #5EE0A0; --ok-soft: #1C3A2E; --warn: #FF9B57; --warn-soft: #3A2A1C;
  --track: #2C2740; --ink: #EEEAF8; --on-ink: #1A1726; --sel: #EEEAF8; --on-sel: #1A1726;
  --t1: #2E2848; --t1i: #B9A8FF; --t2: #3A2A1C; --t2i: #FFB27A; --t3: #1C3A2E; --t3i: #5EE0A0;
  --t4: #3A1C2E; --t4i: #FF8FC2; --t5: #1C2E3A; --t5i: #8FD0FF;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* elementele ascunse de filtre raman ascunse chiar daca au display: flex/grid */
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 'Plus Jakarta Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); }
a:hover { color: var(--accent); }
h1, h2, h3 { letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 20px; font-weight: 800; }
.num { font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif; font-weight: 600; letter-spacing: -0.03em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- cadru ---------- */
.shell { max-width: 1360px; margin: 0 auto; padding: 20px 28px 40px; }
.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
/* antetul ramane sus la derulare; fundal usor transparent, umbra doar dupa ce ai derulat */
.top {
  position: sticky; top: 0; z-index: 30;
  margin: -20px -28px 20px; padding: 14px 28px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  transition: box-shadow .2s;
}
body.scrolled .top { box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(15, 13, 23, .08); }
html { scroll-padding-top: 100px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: 8px; }
.brand b { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
/* alegerea persoanei: un select stilizat ca pastila */
.person-select {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 12px 0 9px;
  border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-weight: 700; font-size: 14px; margin: 0;
}
.person-select select {
  appearance: none; -webkit-appearance: none; border: none; background: transparent; font-weight: 700; font-size: 15px;
  padding: 0 22px 0 0; margin-right: -22px; height: 44px; cursor: pointer; position: relative; z-index: 1;
}
.person-select select:focus-visible { outline: none; }
.person-select:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.person-select svg { color: var(--muted); pointer-events: none; }
.person-select option { color: #1C1830; background: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.person {
  height: 44px; padding: 0 16px 0 5px; border-radius: 999px; display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; text-decoration: none; color: var(--text);
}
.person:hover { background: var(--row); color: var(--text); }
.person.on { background: var(--sel); color: var(--on-sel); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.spacer { flex: 1; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  height: 44px; display: flex; align-items: center; padding: 0 11px; border-radius: 999px;
  text-decoration: none; font-size: 14px; font-weight: 600; color: var(--muted);
}
.nav a:hover { color: var(--text); }
.top { gap: 10px; } .nav a { padding: 0 9px; font-size: 13.5px; }
@media (max-width: 1300px) { .nav a { padding: 0 7px; font-size: 13px; } .brand b { display: none; } }
.nav a.on { background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow); }
.iconbtn {
  width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow);
  text-decoration: none;
}
.iconbtn:hover { color: var(--accent-text); }
.theme-dark-icon { display: none; }
:root[data-theme="dark"] .theme-dark-icon { display: block; }
:root[data-theme="dark"] .theme-light-icon { display: none; }

/* bara de jos pe telefon */
.tabbar { display: none; }
@media (max-width: 900px) {
  .shell { padding: 14px 16px 96px; }
  .top { margin: -14px -16px 16px; padding: 10px 16px; }
  html { scroll-padding-top: 140px; }
  .top .nav { display: none; }
  .tabbar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 20;
    background: var(--surface); border-radius: 24px; padding: 6px; box-shadow: 0 8px 30px rgba(15, 13, 23, .18);
    justify-content: space-around;
  }
  .tabbar a {
    flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border-radius: 18px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700;
  }
  .tabbar a.on { background: var(--accent-soft); color: var(--accent-text); }
}

/* ---------- carduri ---------- */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.card.pad-s { padding: 18px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.span4 { grid-column: 1 / -1; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head a { font-size: 13px; font-weight: 700; text-decoration: none; }
.hero { background: var(--accent); color: var(--on-accent); display: flex; flex-direction: column; justify-content: space-between; gap: 20px; min-height: 250px; }
.hero h1 { font-size: 38px; font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; }
.hero .date { font-size: 14px; font-weight: 600; opacity: .85; }
.warmcard { background: var(--warm); color: var(--on-warm); }
.inkcard { background: var(--ink); color: var(--on-ink); }
.big { font-size: 52px; line-height: 1; }
.stat-card { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 250px; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .span2, .span3 { grid-column: auto; }
  .hero h1 { font-size: 30px; }
  .card { padding: 20px; border-radius: 24px; }
  .stat-card, .hero { min-height: 0; }
}

.btn {
  height: 46px; padding: 0 20px; border-radius: 999px; border: none; font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--on-accent);
}
.btn:hover { filter: brightness(1.08); color: var(--on-accent); }
.btn.light { background: var(--on-accent); color: var(--accent); }
.btn.ghost { background: transparent; color: inherit; border: 1.5px solid currentColor; }
.btn.soft { background: var(--row); color: var(--text); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.neutral { background: var(--row); color: var(--muted); }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 54px; }
.bars span { flex: 1; border-radius: 6px; background: var(--track); min-height: 4px; }
.bars span.last { background: var(--accent); }
.warmcard .bars span { background: rgba(58, 26, 4, .18); }
.warmcard .bars span.last { background: var(--on-warm); }

/* ---------- liste ---------- */
.rows { display: flex; flex-direction: column; gap: 6px; }
.row-item {
  display: flex; align-items: center; gap: 14px; padding: 9px 10px; border-radius: var(--radius-s);
  background: var(--row); text-decoration: none; color: var(--text);
}
a.row-item:hover { outline: 2px solid var(--accent-soft); color: var(--text); }
.datechip {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1;
}
.datechip b { font-size: 16px; font-weight: 800; }
.datechip span { font-size: 10px; font-weight: 700; text-transform: uppercase; margin-top: 2px; }
.k-vitals { background: var(--t1); color: var(--t1i); }
.k-lab { background: var(--t2); color: var(--t2i); }
.k-consult { background: var(--t3); color: var(--t3i); }
.k-body { background: var(--t4); color: var(--t4i); }
.k-other { background: var(--t5); color: var(--t5i); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 700; }
.row-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-kind { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* bara de interval pentru o analiza */
.flag-item { padding: 14px; border-radius: var(--radius-s); background: var(--row); }
.flag-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.flag-top .num { font-size: 20px; color: var(--warn); white-space: nowrap; }
.rangebar { height: 8px; border-radius: 999px; margin-top: 10px; background: var(--track); position: relative; }
.rangebar .ok { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--ok-soft); }
.rangebar .dot { position: absolute; top: -3px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--warn); border: 2px solid var(--surface); }
.rangebar .dot.okv { background: var(--ok); }

.empty { padding: 22px; border-radius: var(--radius-s); background: var(--row); color: var(--muted); text-align: center; font-size: 14px; }

/* ---------- pagini ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 18px; }
.page-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field {
  height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface);
  min-width: 0;
}
.field:focus { border-color: var(--accent); outline: none; }
.pills { display: flex; gap: 4px; flex-wrap: wrap; }
.pill {
  height: 38px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 700; text-decoration: none; color: var(--muted); background: var(--surface); border: none; cursor: pointer;
}
.pill.on { background: var(--sel); color: var(--on-sel); }

.split { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: minmax(0, 1fr); } }
.listcol { max-height: calc(100vh - 210px); overflow: auto; position: sticky; top: 16px; }
@media (max-width: 1000px) { .listcol { max-height: none; position: static; } }
.cat { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 4px 6px; }
.cat:first-child { margin-top: 0; }
.test-link { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; text-decoration: none; color: var(--text); }
.test-link:hover { background: var(--row); color: var(--text); }
.test-link.on { background: var(--accent-soft); }
.test-link .v { font-size: 13px; font-weight: 700; white-space: nowrap; }
.dotflag { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; background: var(--ok); }
.dotflag.warn { background: var(--warn); }
.dotflag.neutral { background: var(--track); }

.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
.chartbox { position: relative; height: 300px; }
.chartbox.s { height: 220px; }

.kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.kv h3 { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.kv .txt { white-space: pre-line; font-size: 15px; }
.docs { display: flex; flex-wrap: wrap; gap: 8px; }
.doc {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--row); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; max-width: 100%;
}
.doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc:hover { color: var(--accent-text); }
.year { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin: 26px 4px 10px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 420px; }
.login .card { padding: 32px; }
.login h1 { font-size: 30px; font-weight: 800; margin: 18px 0 6px; }
.login label { display: block; font-size: 13px; font-weight: 700; margin: 16px 0 6px; }
.login .field { width: 100%; border-radius: 16px; height: 50px; }
.login .btn { width: 100%; justify-content: center; margin-top: 22px; height: 52px; font-size: 15px; }
.alert { padding: 12px 16px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 600; margin-top: 14px; }

.foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 28px; }

/* documente grupate pe eveniment */
.docgroup { padding: 14px 16px; border-radius: var(--radius-s); background: var(--row); }
.docgroup + .docgroup { margin-top: 8px; }
.docgroup-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.docgroup-head a { color: var(--text); text-decoration: none; }
.docgroup-head a:hover { color: var(--accent-text); }
.docgroup .doc { background: var(--surface); }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 28px 4px 12px; }
.section-title:first-child { margin-top: 0; }
.section-title h2 { font-size: 22px; }
.more-docs { margin-top: 8px; }
.more-docs summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--accent-text); padding: 6px 2px; list-style: none; }
.more-docs summary::before { content: '+ '; }
.more-docs[open] summary::before { content: '− '; }
.more-docs .docs { margin-top: 6px; }
.spec-pills { margin-bottom: 16px; }
.spec-pills .pill { height: 34px; font-size: 12.5px; background: var(--row); }
.spec-pills .pill.on { background: var(--accent); color: var(--on-accent); }

/* numarul dintr-un filtru: bulina separata, sa nu para parte din nume */
.count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px;
  margin-left: 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; line-height: 1;
  background: var(--accent-soft); color: var(--accent-text);
}
.pill.on .count { background: rgba(255, 255, 255, .22); color: inherit; }
:root[data-theme="dark"] .pill.on .count { background: rgba(26, 23, 38, .18); }

/* cautarea globala din bara de sus */
.search {
  position: relative; flex: 1 1 160px; max-width: 380px; min-width: 140px; height: 46px; display: flex; align-items: center; gap: 8px;
  padding: 0 16px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); color: var(--muted);
}
.search:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }
.search input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; height: 100%; font-size: 15px; color: var(--text); }
.search input::placeholder { color: var(--muted); }
.search-panel {
  position: absolute; top: calc(100% + 8px); left: 0; width: min(560px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow: auto;
  background: var(--surface); border-radius: 22px; padding: 8px; z-index: 50; box-shadow: 0 18px 50px rgba(15, 13, 23, .22);
  border: 1px solid var(--line);
}
.search-group + .search-group { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.search-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 4px; }
.search-item { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border-radius: 14px; text-decoration: none; color: var(--text); }
.search-item:hover, .search-item.on { background: var(--accent-soft); color: var(--text); }
.search-title { font-size: 14px; font-weight: 700; }
.search-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item mark { background: var(--warn-soft); color: inherit; border-radius: 3px; }
.search-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }
@media (max-width: 1180px) { .search { order: 5; flex-basis: 100%; max-width: none; } }
@media (max-width: 900px) { .search-panel { width: 100%; } }

/* lista de consultatii: an -> specialitate */
.yeargroup + .yeargroup { margin-top: 6px; }
.yeargroup > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 14px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em;
}
.yeargroup > summary::-webkit-details-marker { display: none; }
.yeargroup > summary::after { content: '+'; font-size: 18px; color: var(--muted); margin-left: 10px; }
.yeargroup[open] > summary::after { content: '−'; }
.yeargroup > summary span:first-child { flex: 1; }
.yeargroup > summary:hover { background: var(--row); }
.specgroup { padding: 0 2px 6px; }
.specgroup .cat { display: flex; align-items: center; margin: 10px 8px 6px; }
.row-item.on { outline: 2px solid var(--accent); background: var(--accent-soft); }

/* analize: buletine pe carduri, firimituri de navigare */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 700; margin: 4px 0 0; flex-wrap: wrap; }
.crumbs a { text-decoration: none; }
.crumbs span { color: var(--muted); }
.bulletin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.card.bulletin { display: flex; flex-direction: column; gap: 14px; padding: 18px; text-decoration: none; color: var(--text); border: 2px solid transparent; }
.card.bulletin:hover { border-color: var(--accent-soft); color: var(--text); }
.flag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.yeargroup > summary .badge { font-size: 11px; letter-spacing: 0; }

/* analize: un card pe an */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card.yearcard { display: flex; flex-direction: column; gap: 8px; padding: 20px; text-decoration: none; color: var(--text); border: 2px solid transparent; }
.card.yearcard:hover { border-color: var(--accent-soft); color: var(--text); }
.card.yearcard.on { background: var(--accent); color: var(--on-accent); }
.yearcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.yearcard-year { font-size: 34px; line-height: 1; }
.yearcard-main { font-size: 14px; font-weight: 700; }
.yearcard-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yearcard.on .yearcard-sub { color: inherit; opacity: .8; }
.yearcard.on .badge.ok { background: rgba(255,255,255,.2); color: inherit; }
.yearcard.on .badge.warn { background: var(--warn-soft); color: var(--warn); }

@media (max-width: 640px) {
  .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card.yearcard { padding: 14px; gap: 6px; border-radius: 22px; }
  .yearcard-year { font-size: 26px; }
  .yearcard-top { flex-direction: column; align-items: flex-start; gap: 6px; }
  .yearcard-main { font-size: 13px; }
  /* antetul pe un singur rand: doar sigla, fara text */
  .brand b { display: none; }
  .top { gap: 8px; }
  .person-select { height: 46px; }
}
.yearcard-spec { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; min-height: 2.4em; }

/* consultatia: sectiuni colorate */
.consult-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.csec { border-radius: 22px; padding: 18px 20px 20px; background: var(--sec-bg); }
.csec.wide { grid-column: 1 / -1; }
.csec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.csec-head h3 { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; color: var(--sec-ink); }
.csec-icon { width: 34px; height: 34px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--sec-ink); color: var(--sec-bg); flex-shrink: 0; }
.csec .txt { white-space: pre-line; font-size: 15px; line-height: 1.6; color: var(--text); }
.s-reason { --sec-bg: var(--t5); --sec-ink: var(--t5i); }
.s-diag   { --sec-bg: var(--t2); --sec-ink: var(--t2i); }
.s-diag .txt { font-weight: 600; }
.s-exam   { --sec-bg: var(--t1); --sec-ink: var(--t1i); }
.s-treat  { --sec-bg: var(--t3); --sec-ink: var(--t3i); }
.s-recom  { --sec-bg: var(--t4); --sec-ink: var(--t4i); }
@media (max-width: 760px) { .consult-grid { grid-template-columns: minmax(0, 1fr); } }

/* vizualizatorul de documente */
html.viewer-open { overflow: hidden; }
.viewer {
  width: min(1100px, calc(100vw - 48px)); height: calc(100vh - 48px); max-width: none; max-height: none;
  padding: 0; border: none; border-radius: 28px; background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px rgba(15, 13, 23, .35); overflow: hidden;
}
.viewer[open] { display: flex; flex-direction: column; animation: vw-in .18s ease-out; }
.viewer::backdrop { background: rgba(15, 13, 23, .55); backdrop-filter: blur(6px); }
@keyframes vw-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.vw-bar { display: flex; align-items: center; gap: 16px; padding: 14px 14px 14px 24px; border-bottom: 1px solid var(--line); }
.vw-info { flex: 1; min-width: 0; }
.vw-title { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-meta { font-size: 13px; color: var(--muted); }
.vw-actions { display: flex; align-items: center; gap: 6px; }
.vw-pos { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 4px; white-space: nowrap; }
.vw-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--row); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none;
}
.vw-btn:hover { background: var(--accent-soft); color: var(--accent-text); }
.vw-btn:disabled { opacity: .35; cursor: default; background: var(--row); color: var(--text); }
.vw-close { background: var(--ink); color: var(--on-ink); }
.vw-close:hover { background: var(--accent); color: var(--on-accent); }
.vw-body { flex: 1; min-height: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; position: relative; }
.vw-body iframe { width: 100%; height: 100%; border: none; background: #fff; }
/* pozele mici (ex. imagini RMN de 384 px) se maresc pana umplu fereastra */
.vw-body img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 12px; }
.vw-body.loading::after {
  content: ''; position: absolute; width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: vw-spin .8s linear infinite;
}
@keyframes vw-spin { to { transform: rotate(360deg); } }
.vw-none { text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
@media (max-width: 700px) {
  .viewer { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; inset: 0; border-radius: 0; }
  .vw-bar { padding: 10px 10px 10px 16px; gap: 8px; flex-wrap: wrap; }
  .vw-info { flex-basis: 100%; }
  .vw-actions { width: 100%; justify-content: flex-end; }
  .vw-pos { margin-right: auto; }
}

/* cautare: butonul de stergere si rezultatul deschis ultima data */
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search-clear {
  width: 30px; height: 30px; border-radius: 50%; border: none; background: var(--row); color: var(--muted); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin-right: -6px;
}
.search-clear:hover { background: var(--accent-soft); color: var(--accent-text); }
.search-item.seen { background: var(--row); }
.seen-tag { margin-left: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); vertical-align: 1px; }

/* data / medic / clinica sub titlu */
.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px; border-radius: 999px;
  font-size: 14.5px; font-weight: 700; background: var(--chip-bg); color: var(--chip-ink);
}
.m-date   { --chip-bg: var(--t1); --chip-ink: var(--t1i); }
.m-doctor { --chip-bg: var(--t3); --chip-ink: var(--t3i); }
.m-clinic { --chip-bg: var(--t5); --chip-ink: var(--t5i); }
.m-count  { --chip-bg: var(--t2); --chip-ink: var(--t2i); }

.card.attachments { margin-top: 16px; }
.grid > .card.attachments { margin-top: 0; }
.attachments .card-head h2 { display: flex; align-items: center; gap: 10px; }
.attachments .card-head h2 svg { color: var(--accent-text); }

/* istoricul unei analize iesite din interval */
.hist { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.hist-times { font-weight: 700; color: var(--text); }
.hist-msg { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.hist-msg::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hist-warn .hist-msg { color: var(--warn); }
.hist-warn .hist-msg::before { background: var(--warn); }
.hist-ok .hist-msg { color: var(--ok); }
.hist-ok .hist-msg::before { background: var(--ok); }
.hist-new .hist-msg { color: var(--muted); }
.hist-new .hist-msg::before { background: var(--track); }

/* unirea analizelor */
.notice { padding: 12px 16px; border-radius: 16px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.suggest-list { display: flex; flex-direction: column; gap: 12px; }
.suggest { padding: 14px; border-radius: var(--radius-s); background: var(--row); display: flex; flex-direction: column; gap: 6px; }
.suggest-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.suggest-head .btn { height: 40px; }
.merge-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px; background: var(--surface); cursor: pointer; }
.merge-row:hover { outline: 2px solid var(--accent-soft); }
.merge-row input { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; }
.unit-tag { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--t5); color: var(--t5i); white-space: nowrap; }
.merge-n { font-size: 12px; text-align: right; white-space: nowrap; min-width: 86px; }
.manual-list { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow: auto; padding: 2px; }
.manual-list .merge-row { background: var(--row); }
dialog.confirm {
  width: min(520px, calc(100vw - 32px)); border: none; border-radius: 26px; padding: 26px; background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px rgba(15, 13, 23, .35);
}
dialog.confirm::backdrop { background: rgba(15, 13, 23, .55); backdrop-filter: blur(4px); }
dialog.confirm h2 { font-size: 22px; }
.merge-targets { display: flex; flex-direction: column; gap: 6px; }
.merge-target { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--row); cursor: pointer; }
.merge-target input { accent-color: var(--accent); width: 18px; height: 18px; }
.merge-unitwarn { margin: 14px 0 0; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: var(--on-ink); padding: 12px 20px;
  border-radius: 999px; font-weight: 700; font-size: 14px; z-index: 100; box-shadow: 0 10px 30px rgba(15, 13, 23, .3); }

/* unire: fiecare analiza cu toate datele pe coloane, ca sa se poata compara */
.merge-row {
  display: grid; grid-template-columns: 22px minmax(150px, 1.3fr) minmax(80px, .7fr) minmax(120px, 1fr) minmax(110px, 1fr) minmax(150px, 1.2fr) minmax(110px, 1fr) minmax(80px, .6fr);
  align-items: start; gap: 12px;
}
.merge-row input { margin-top: 2px; }
.mc { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; }
.mc-name .row-title { font-size: 15px; }
.mc-l { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mc-v { line-height: 1.45; overflow-wrap: anywhere; }
.mc-v .unit-tag { display: inline-block; }
/* pe ecrane inguste bifa sta in colt, iar datele curg pe 3 / 2 coloane */
@media (max-width: 1100px) {
  .merge-row { grid-template-columns: repeat(3, minmax(0, 1fr)); position: relative; padding-left: 46px; row-gap: 10px; }
  .merge-row input { position: absolute; left: 14px; top: 12px; }
  .mc-name { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .merge-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* recomandarea din fiecare sugestie */
.rec { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--rec-bg); color: var(--rec-ink); margin-bottom: 4px; }
.rec-icon { width: 30px; height: 30px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--rec-ink); color: var(--rec-bg); }
.rec-title { font-size: 14.5px; font-weight: 700; }
.rec-why { font-size: 13px; color: var(--text); margin-top: 2px; line-height: 1.5; }
.rec-merge { --rec-bg: var(--ok-soft); --rec-ink: var(--ok); }
.rec-keep  { --rec-bg: var(--warn-soft); --rec-ink: var(--warn); }
.rec-check { --rec-bg: var(--t5); --rec-ink: var(--t5i); }
.suggest .rec { background: var(--rec-bg); }

/* Config: in meniu pe ecran lat, rotita in antet pe telefon */
.config-btn { display: none; }
.config-btn.on { background: var(--accent-soft); color: var(--accent-text); }
@media (max-width: 900px) { .config-btn { display: inline-flex; } }
.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.config-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--text); border: 2px solid transparent; }
.config-card:hover { border-color: var(--accent-soft); color: var(--text); }
.config-card .cc-icon { width: 48px; height: 48px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--t1); color: var(--t1i); }
.config-card h2 { font-size: 20px; }
.config-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.cc-stats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

/* unite pana acum: analiza rezultata + ce a fost unit in ea */
.merged { padding: 14px; border-radius: var(--radius-s); background: var(--row); }
.merged-head { display: flex; align-items: center; gap: 12px; }
.merged-head .row-title a { text-decoration: none; color: var(--text); }
.merged-head .row-title a:hover { color: var(--accent-text); }
.merged-sources { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.merged-src { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--surface); font-size: 14px; }
.merged-src .row-main { display: flex; flex-direction: column; }
.merged-src .btn, .merged-head .btn { height: 40px; }
.merged-head .btn.soft { background: var(--surface); }

/* antetul analizei rezultate, colorat ca sa se deosebeasca de ce a fost unit in ea */
.merged { padding: 0; overflow: hidden; }
.merged-head { background: var(--t1); padding: 14px 14px 14px 16px; }
.merged-head .row-title a { color: var(--t1i); }
.merged-head .row-sub { color: var(--t1i); opacity: .8; }
.merged-icon { width: 34px; height: 34px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--t1i); color: var(--t1); }
.merged-sources { padding: 10px 14px 14px; margin-top: 0; }

/* bulina „i” si fereastra cu explicatia analizei */
.info-dot {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text); font: italic 800 12px/1 Georgia, 'Times New Roman', serif;
  cursor: pointer; vertical-align: 2px; margin-left: 4px; flex-shrink: 0; user-select: none;
  transition: transform .12s, background .12s;
}
.info-dot:hover, .info-dot:focus-visible { background: var(--accent); color: var(--on-accent); transform: scale(1.1); }
h1 .info-dot { width: 28px; height: 28px; font-size: 16px; vertical-align: 6px; }
.info-dlg {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: none; border-radius: 28px;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(15, 13, 23, .35); overflow: auto;
}
.info-dlg[open] { animation: vw-in .18s ease-out; }
.info-dlg::backdrop { background: rgba(15, 13, 23, .55); backdrop-filter: blur(6px); }
.info-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 22px 14px 26px;
  position: sticky; top: 0; background: var(--surface); z-index: 1; border-bottom: 1px solid var(--line); }
.info-head h2 { font-size: 24px; letter-spacing: -0.02em; margin-top: 2px; }
.info-cat { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.info-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.info-body { padding: 18px 26px 24px; display: flex; flex-direction: column; gap: 10px; }
.info-last { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px;
  background: var(--accent-soft); color: var(--text); text-decoration: none; }
.info-last:hover { color: var(--text); outline: 2px solid var(--accent); }
.info-val { font-size: 15px; margin-top: 2px; }
.info-val .num { font-size: 24px; }
.info-go { font-size: 13px; font-weight: 700; color: var(--accent-text); white-space: nowrap; }
.info-sec { padding: 14px 16px; border-radius: 18px; background: var(--sec-bg); }
.info-sec-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--sec-ink); margin-bottom: 6px; }
.info-ico { width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--sec-ink); color: var(--sec-bg); }
.info-sec p { margin: 0; font-size: 15px; line-height: 1.55; }
.is-what { --sec-bg: var(--t1); --sec-ink: var(--t1i); }
.is-why  { --sec-bg: var(--t5); --sec-ink: var(--t5i); }
.is-high { --sec-bg: var(--t2); --sec-ink: var(--t2i); }
.is-low  { --sec-bg: var(--t3); --sec-ink: var(--t3i); }
.is-tip  { --sec-bg: var(--t4); --sec-ink: var(--t4i); }
.info-note { margin: 6px 2px 0; font-size: 12.5px; color: var(--muted); }
.info-loading { height: 220px; display: flex; align-items: center; justify-content: center; }
.info-loading::after { content: ''; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: vw-spin .8s linear infinite; }
@media (max-width: 640px) {
  .info-dlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; inset: 0; border-radius: 0; }
  .info-head { padding: 16px 14px 12px 18px; }
  .info-body { padding: 14px 16px 24px; }
}
.info-head .vw-close { flex-shrink: 0; }

/* categoriile de analize: antet colorat, se restrang / deschid */
.cat-t1 { --cat-bg: var(--t1); --cat-ink: var(--t1i); }
.cat-t2 { --cat-bg: var(--t2); --cat-ink: var(--t2i); }
.cat-t3 { --cat-bg: var(--t3); --cat-ink: var(--t3i); }
.cat-t4 { --cat-bg: var(--t4); --cat-ink: var(--t4i); }
.cat-t5 { --cat-bg: var(--t5); --cat-ink: var(--t5i); }
.catsec { border-radius: 18px; border: 2px solid var(--cat-bg); overflow: hidden; }
.catsec + .catsec { margin-top: 10px; }
.catsec > summary, .catsum > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--cat-bg); color: var(--cat-ink); font-weight: 800; font-size: 16px; letter-spacing: -0.01em;
}
.catsec > summary::-webkit-details-marker, .catsum > summary::-webkit-details-marker { display: none; }
.catsec-name { flex: 1; }
.catsec-ico { width: 30px; height: 30px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--cat-ink); color: var(--cat-bg); }
.catsec .count, .catsum .count { background: var(--surface); color: var(--cat-ink); }
.catsec-arrow { display: inline-flex; transition: transform .15s; }
.catsec:not([open]) .catsec-arrow { transform: rotate(-90deg); }
.catsec .tablewrap { padding: 4px 10px 8px; }
.catsec table.data th { padding-top: 10px; }
.catsum { border-radius: 16px; overflow: hidden; }
.catsum + .catsum { margin-top: 8px; }
.catsum > summary { border-radius: 16px; }
.catsum[open] > summary { border-radius: 16px 16px 0 0; }
.catsum > summary span:nth-child(2) { flex: 1; }
.catsum[open] { border: 2px solid var(--cat-bg); }
.catsum > .rows { padding: 8px !important; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.catsum > summary::after { color: var(--cat-ink); }
.yeargroup.catsum > summary span.catsec-ico:first-child { flex: 0 0 30px; }

/* cautarea in buletin, langa titlu */
.bulletin-filter { flex: 1; max-width: 360px; margin: 0 auto 0 8px; }
.bulletin-filter > input { height: 40px; }
.card-head:has(.bulletin-filter) { flex-wrap: wrap; }
@media (max-width: 760px) { .bulletin-filter { order: 3; max-width: none; flex-basis: 100%; margin: 4px 0 0; } }

/* casutele de filtrare: ✕ propriu, mereu vizibil cand e text */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.filter-wrap { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.filter-wrap > input { width: 100%; padding-right: 44px; }
.filter-clear {
  position: absolute; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-text);
}
.filter-clear:hover { background: var(--accent); color: var(--on-accent); }

/* masuratori: un card pe tip, detaliul celui ales dedesubt */
.measure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card.measure-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; text-decoration: none; color: var(--text); border: 2px solid transparent; }
.card.measure-card:hover { border-color: var(--cat-bg); color: var(--text); }
.card.measure-card.on { background: var(--cat-bg); border-color: var(--cat-ink); }
.mc-top { display: flex; align-items: center; gap: 8px; }
.mc-label { font-size: 14px; font-weight: 800; color: var(--cat-ink); }
.mc-value .num { font-size: 32px; line-height: 1.1; }
.mc-unit { font-size: 13px; color: var(--muted); font-weight: 600; }
.mc-date { font-size: 12.5px; color: var(--muted); }
.mc-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: auto; padding-top: 4px; }
.mc-trend { font-size: 12.5px; font-weight: 700; }
.measure-detail { border-top: 6px solid var(--cat-bg); }
.measure-detail .card-head h2 { color: var(--cat-ink); }
.mstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.mstat { padding: 12px 14px; border-radius: 16px; background: var(--row); }
.mstat-l { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mstat-v { font-size: 22px; margin-top: 2px; }
.mtable-title { font-size: 16px; font-weight: 800; margin: 22px 0 8px; }
@media (max-width: 640px) {
  .measure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card.measure-card { padding: 14px; border-radius: 22px; }
  .mc-value .num { font-size: 24px; }
}
.mstat-v.small { font-size: 14px; line-height: 1.4; margin-top: 6px; }

/* perioada: butoane + De la / Pana la */
.period-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.daterange { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--row); }
.daterange.on { background: var(--accent-soft); outline: 2px solid var(--accent); }
.daterange label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.daterange .field { height: 36px; padding: 0 10px; border-radius: 12px; font-size: 13.5px; }
@media (max-width: 640px) {
  .period-tools { justify-content: flex-start; }
  .daterange { border-radius: 18px; padding: 10px; width: 100%; }
  .daterange label { flex: 1 1 100%; }
  .daterange label .field { flex: 1; }
  .daterange .field { width: 100%; }
  .daterange .btn { width: 100%; justify-content: center; }
}

/* capul tabelului ramane vizibil la derulare (sub antetul aplicatiei) */
.tablewrap:has(> table.sticky-head) { overflow: visible; }
table.sticky-head thead th {
  position: sticky; top: var(--head-h, 76px); z-index: 2;
  background: var(--surface); box-shadow: 0 1.5px 0 var(--line);
}
/* pe ecrane inguste tabelul se poate derula si lateral: are zona lui de derulare, iar capul sta sus in ea */
@media (max-width: 900px) {
  .tablewrap:has(> table.sticky-head) { overflow: auto; max-height: 70vh; border-radius: 12px; }
  table.sticky-head thead th { top: 0; }
}

/* capul fix nu se deseneaza corect cu border-collapse: collapse (fundalul lasa sa se vada randurile) */
table.sticky-head { border-collapse: separate; border-spacing: 0; }
/* legenda zonei recomandate de sub grafic */
.band-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.band-chip { font-size: 12.5px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.band-ok { background: var(--ok-soft); color: var(--ok); }
.band-accent { background: var(--accent-soft); color: var(--accent-text); }
.band-t5i { background: var(--t5); color: var(--t5i); }

/* grafice separate + marire */
.chart-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.chart-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-grid.two .chart-panel:nth-child(3):last-child { grid-column: 1 / -1; }
.chart-panel { padding: 12px 14px 8px; border-radius: 18px; background: var(--row); }
.chart-panel .chartbox { background: transparent; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.chart-head h3 { font-size: 15px; font-weight: 800; }
.chart-zoom { width: 38px; height: 38px; background: var(--surface); }
.chart-dlg {
  width: min(1400px, calc(100vw - 48px)); max-width: none; height: calc(100vh - 48px); max-height: none; padding: 0; border: none;
  border-radius: 28px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(15, 13, 23, .35);
}
.chart-dlg[open] { display: flex; flex-direction: column; animation: vw-in .18s ease-out; }
.chart-dlg::backdrop { background: rgba(15, 13, 23, .55); backdrop-filter: blur(6px); }
.chart-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 10px 26px; }
.chart-dlg-head h2 { font-size: 22px; }
.chart-dlg-body { flex: 1; min-height: 0; position: relative; padding: 4px 22px 22px; }
@media (max-width: 900px) {
  .chart-grid.two { grid-template-columns: minmax(0, 1fr); }
  .chart-dlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; inset: 0; border-radius: 0; }
  .chart-dlg-body { padding: 4px 8px 16px; }
}

/* formularul de masuratori */
.mform { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.mf-sec { padding: 20px 22px; }
.mf-sec.cat-t1, .mf-sec.cat-t2, .mf-sec.cat-t3 { border-top: 5px solid var(--cat-bg); }
.mf-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.mf-head h2 { font-size: 18px; color: var(--cat-ink, var(--text)); }
.mf-last { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.mf-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.mf-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mf-label { font-size: 13px; font-weight: 700; }
.mf-input { position: relative; display: flex; align-items: center; }
.mf-input .field, .mf-field > .field { width: 100%; height: 52px; border-radius: 14px; font-size: 20px; font-weight: 700; padding: 0 14px; }
.mf-field > .field[type=date], .mf-field > .field[type=time] { font-size: 16px; font-weight: 600; }
.mf-input .field { padding-right: 62px; }
.mf-unit { position: absolute; right: 14px; font-size: 13px; color: var(--muted); font-weight: 600; pointer-events: none; }
.mf-note { margin-top: 12px; }
.mf-note .field { height: 46px; font-size: 15px; font-weight: 500; }
.mf-field.has-err .field { border-color: var(--warn); background: var(--warn-soft); }
.mf-err { font-size: 12.5px; font-weight: 700; color: var(--warn); }
.mf-live { min-height: 0; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.mf-live:empty { display: none; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--row); height: 52px; }
.seg-opt { flex: 1; position: relative; }
.seg-opt input { position: absolute; opacity: 0; }
.seg-opt span { display: flex; align-items: center; justify-content: center; height: 100%; border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; text-align: center; padding: 0 6px; }
.seg-opt input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(15, 13, 23, .12); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--accent); }
.mf-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: sticky; bottom: 12px; padding: 12px; border-radius: 22px;
  background: var(--surface); box-shadow: 0 10px 30px rgba(15, 13, 23, .12); z-index: 5; }
.mf-actions .spacer { flex: 1; }
.btn.danger { background: var(--warn); color: #fff; }
.btn.soft.danger { background: var(--warn-soft); color: var(--warn); }
.row-edit { width: 1%; }
.row-edit .iconbtn { width: 34px; height: 34px; background: var(--row); }
.flash { animation: vw-in .2s ease-out; }
@media (max-width: 900px) { .mf-actions { bottom: 84px; } }
@media (max-width: 640px) {
  .mf-row.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mf-row.three .mf-field:nth-child(3) { grid-column: 1 / -1; }
  .mf-row:not(.three) { grid-template-columns: minmax(0, 1fr); }
  .mf-sec { padding: 16px; }
  .mf-last { margin-left: 0; width: 100%; }
}

/* masuratori: un card pe masuratoare */
.mcards { display: flex; flex-direction: column; gap: 14px; }
.mcard { padding: 18px 20px; border: 2px solid transparent; }
.mcard.chosen { border-color: var(--accent-soft); }
.mcard-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.mcard-head h2 { font-size: 20px; }
.mcard-no:not(:empty) { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mcard-type { flex: 1; min-width: 0; }
.mcard-type select { width: 100%; height: 52px; border-radius: 14px; font-size: 17px; font-weight: 700; padding: 0 14px; cursor: pointer; }
.mcard-type.has-err select { border-color: var(--warn); background: var(--warn-soft); }
.mcard-del { width: 40px; height: 40px; background: var(--row); flex-shrink: 0; }
.mcard-hint { font-size: 12.5px; color: var(--muted); margin: 2px 2px 12px; }
.mcard-hint:empty { display: none; }
.mcard-new { padding: 14px; border-radius: 16px; background: var(--accent-soft); margin-bottom: 12px; }
.mcard .mf-row + .mf-row, .mcard .mf-row + .mf-err + .mf-row { margin-top: 10px; }
.mcard-when { margin-top: 12px; }
.mcard-when .field { height: 46px; font-size: 15px; font-weight: 600; }
.add-card { align-self: flex-start; border: 2px dashed var(--accent-soft); background: transparent; color: var(--accent-text); height: 50px; }
.add-card:hover { background: var(--accent-soft); }
.page-head h2 .btn-sm, .card-head h2 .btn-sm { margin-left: 6px; }
.add-card { margin-bottom: 6px; }

/* buletin: randurile cu analize */
.lrows { display: flex; flex-direction: column; gap: 8px; }
.lrow { display: grid; grid-template-columns: minmax(180px, 2.2fr) minmax(110px, 1.1fr) minmax(70px, .7fr) minmax(170px, 1.5fr) minmax(100px, 1fr) 96px 40px;
  gap: 8px; align-items: end; padding: 10px 12px; border-radius: 16px; background: var(--row); }
.lrow label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lr-l { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.lrow .field { height: 42px; border-radius: 12px; padding: 0 10px; width: 100%; }
.lr-name .field, .lr-val .field { font-weight: 700; }
.lr-range { display: flex; align-items: center; gap: 4px; }
.lr-range span { color: var(--muted); }
.lr-flag { align-self: center; padding-top: 16px; }
.lr-del { width: 40px; height: 40px; background: var(--surface); }
.lrow .has-err .field { border-color: var(--warn); background: var(--warn-soft); }
.lr-new { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 700; }
.lr-new label { flex-direction: row; align-items: center; gap: 8px; }
.lr-new .field { height: 36px; width: auto; }
.lr-err { grid-column: 1 / -1; font-size: 12.5px; font-weight: 700; color: var(--warn); }
.copy-from { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.copy-from .field { height: 38px; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 22px; border-radius: 18px;
  border: 2px dashed var(--accent-soft); background: var(--row); cursor: pointer; text-align: center; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone span:first-of-type { display: flex; align-items: center; gap: 8px; color: var(--accent-text); }
.pdfread { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.pdfread-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pdfread-msg:empty { display: none; }
.pdfread-msg { font-size: 13.5px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); }
.pdfread-msg.ok { background: var(--ok-soft); }
.pdfread-msg.warn { background: var(--warn-soft); }
.lrow.lr-frompdf { box-shadow: inset 3px 0 0 var(--accent); }
.pdfread-dup { font-weight: 700; margin-bottom: 6px; }
.lr-src { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: -4px; }
.doc-edit { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.doc-edit-item { display: inline-flex; align-items: center; gap: 6px; padding-right: 10px; border-radius: 999px; background: var(--row); }
.doc-edit-item .doc { background: var(--surface); }
.doc-del { font-size: 12.5px; font-weight: 700; color: var(--warn); display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 1100px) {
  .lrow { grid-template-columns: repeat(2, minmax(0, 1fr)) 40px; }
  .lr-name { grid-column: 1 / 3; }
  .lr-del { grid-column: 3; grid-row: 1; }
  .lr-ref { grid-column: 1 / 3; }
  .lr-flag { padding-top: 0; }
}
@media (max-width: 640px) { .lr-ref, .lr-reftext { grid-column: 1 / -1; } }

/* consultatia: sectiunile colorate ca formular */
.cform .csec-head { cursor: text; }
.csec-input { width: 100%; min-height: 84px; resize: vertical; border-radius: 14px; padding: 12px 14px; font-size: 15px; line-height: 1.55;
  background: var(--surface); border: 1.5px solid transparent; }
.csec-input:focus { border-color: var(--sec-ink); outline: none; }

/* programari */
.appt { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--row); }
.appt.future { background: var(--t2); }
.appt-date { width: 62px; flex-shrink: 0; text-align: center; padding: 8px 4px; border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; line-height: 1.1; }
.appt-date b { font-size: 20px; font-weight: 800; }
.appt-date span { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.appt-date em { font-style: normal; font-size: 13px; font-weight: 800; color: var(--accent-text); margin-top: 4px; }
.appt-main { flex: 1; min-width: 0; }
.appt-when { font-size: 12px; font-weight: 800; color: var(--t2i); text-transform: uppercase; letter-spacing: .05em; }
.appt-when:empty { display: none; }
.appt-rem { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.appt-rem.err { color: var(--warn); }
.appt .iconbtn { width: 38px; height: 38px; }
.seg-multi .seg-opt input:checked + span { background: var(--accent); color: var(--on-accent); }
.inline-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.inline-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.notif-card .field { width: 100%; height: 46px; border-radius: 14px; }

/* ---------- fisa medicala ---------- */
.pill.soft { background: var(--row); color: var(--text); }
.pill.soft:hover { background: var(--accent-soft); color: var(--accent-text); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.fisa-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 16px; }
.fisa-id { display: flex; gap: 18px; align-items: center; }
.fisa-blood { width: 92px; height: 92px; flex-shrink: 0; border-radius: 26px; background: var(--warn-soft); color: var(--warn);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.1; }
.fisa-blood span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.fisa-blood b { font-size: 19px; font-weight: 800; margin-top: 4px; padding: 0 6px; }
.fisa-blood em { font-style: normal; font-size: 10px; font-weight: 700; margin-top: 3px; opacity: .8; }
.fisa-kv { display: grid; gap: 8px; margin: 0; min-width: 0; }
.fisa-kv dt { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fisa-kv dd { margin: 0; font-size: 15px; font-weight: 700; }
.fisa-box { background: var(--sec-bg); }
.fisa-box .csec-icon, .csec .csec-icon { background: var(--surface); color: var(--sec-ink); }
.fisa-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fisa-tag { padding: 6px 12px; border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 700; color: var(--sec-ink); }
.fisa-more { margin-top: 14px; }
.fisa-more > summary { cursor: pointer; font-weight: 800; font-size: 15px; }
.med { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--t3); }
.med.past { background: var(--row); }
.med-ico { width: 42px; height: 42px; border-radius: 14px; flex-shrink: 0; background: var(--surface); color: var(--t3i); display: inline-flex; align-items: center; justify-content: center; }
.med.past .med-ico { color: var(--muted); }
.med-dose { font-size: 14px; font-weight: 700; color: var(--t3i); }
.med.past .med-dose { color: var(--muted); }
.med .iconbtn, .row-ed { width: 38px; height: 38px; flex-shrink: 0; }
.vac-due { padding: 12px 14px; border-radius: var(--radius-s); background: var(--t2); margin-bottom: 12px; display: grid; gap: 6px; }
.vac-due-h { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--t2i); }
.vac-due-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.vac-due-row .badge { margin-left: auto; }
.mf-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fisa-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.fisa-edit-grid .csec { padding: 18px 20px 20px; }
@media (max-width: 1200px) { .fisa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid2, .fisa-edit-grid { grid-template-columns: minmax(0, 1fr); } .mf-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .fisa-grid { grid-template-columns: minmax(0, 1fr); } }
/* tiparit: doar fisa, fara meniu si butoane */
@media print {
  .top, .tabbar, .foot, .btn, .iconbtn, .page-head .btn-row, .dx-acts { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .fisa-grid { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}
/* bara de jos de pe telefon: butonul „Mai mult” si meniul lui */
@media (max-width: 900px) {
  .tabbar > button {
    flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: none; background: none; border-radius: 18px; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; padding: 0;
  }
  .tabbar > button.on, .tabbar > button[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-text); }
  .tabbar a, .tabbar > button { min-width: 0; }
  .tab-more { position: absolute; right: 0; bottom: calc(100% + 8px); background: var(--surface); border-radius: 20px; padding: 6px;
    box-shadow: 0 8px 30px rgba(15, 13, 23, .22); display: flex; flex-direction: column; min-width: 200px; }
  .tab-more a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 16px; font-size: 15px; min-height: 48px; }
}

/* paginare tabele */
.pager { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.pager-info { font-size: 13px; font-weight: 700; color: var(--muted); }
.pager-pages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 0 auto; }
.pager .pill { min-width: 38px; justify-content: center; padding: 0 10px; }
.pager-gap { color: var(--muted); padding: 0 4px; }
.pager-per { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
@media (max-width: 640px) { .pager-pages { order: -1; width: 100%; justify-content: center; flex-wrap: nowrap; gap: 3px; } .pager-info { margin-right: auto; } .pager .pill { min-width: 32px; height: 34px; padding: 0 7px; } .pager-gap { padding: 0 1px; } }

/* ---------- raport Tanita ---------- */
.tn-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; margin: 16px 0; }
.tn-cmp { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tn-cmp-item { padding: 12px 14px; border-radius: 16px; background: var(--row); }
.tn-cmp-item.out { background: var(--warn-soft); }
.tn-cmp-l { font-size: 12px; font-weight: 800; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.tn-cmp-l .badge { font-size: 10.5px; padding: 1px 7px; }
.tn-cmp-v .num { font-size: 26px; }
.tn-cmp-d { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.tn-delta { font-size: 12.5px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.tn-delta.good { color: var(--ok); }
.tn-delta.bad { color: var(--warn); }
.tn-body { display: grid; grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr); gap: 12px; align-items: center; }
.tn-col { display: grid; gap: 12px; }
.tn-fig { display: grid; gap: 10px; justify-items: center; }
.tn-fig svg { width: 130px; height: auto; }
.tn-fig .tn-seg { width: 100%; }
.tn-head { fill: var(--row); stroke: var(--line); }
.tn-p { stroke: var(--surface); stroke-width: 2; }
.tn-p.tn-ok, .tn-key.tn-ok { fill: #34C38F; background: #34C38F; }
.tn-p.tn-mid, .tn-key.tn-mid { fill: #F5A524; background: #F5A524; }
.tn-p.tn-high, .tn-key.tn-high { fill: #E5484D; background: #E5484D; }
.tn-p.tn-na { fill: var(--row); }
.tn-side { font-size: 10px; font-weight: 800; fill: var(--muted); text-anchor: middle; }
.tn-seg { padding: 10px 12px; border-radius: 14px; background: var(--row); border-left: 5px solid var(--line); }
.tn-seg.tn-ok { border-left-color: #34C38F; } .tn-seg.tn-mid { border-left-color: #F5A524; } .tn-seg.tn-high { border-left-color: #E5484D; }
.tn-seg-name { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.tn-seg-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.tn-seg-row span:first-child { color: var(--muted); min-width: 54px; }
.tn-seg-row b { font-size: 15px; }
.tn-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; font-size: 12.5px; font-weight: 600; }
.tn-key { width: 12px; height: 12px; border-radius: 4px; display: inline-block; margin-left: 6px; }
.tn-charts { margin-top: 16px; }
.tn-pdfday { padding: 10px 0; border-top: 1px solid var(--line); }
.tn-pdfday > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.tn-pdfday .docs { margin-top: 10px; }
.tn-file { padding: 18px; border-radius: 18px; border: 2px dashed var(--line); background: var(--row); text-align: center; }
@media (max-width: 1100px) { .tn-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .tn-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tn-fig { grid-column: 1 / -1; order: -1; grid-template-columns: 110px minmax(0, 1fr); align-items: center; }
  .tn-fig svg { width: 100px; }
  .tn-cmp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tn-steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; font-size: 14.5px; }
.tn-file { display: block; cursor: pointer; }

/* cardul Tanita din Măsurători: duce la raportul complet */
.card.measure-card.tanita-card, .card.measure-card.tanita-card:hover { background: var(--ink); color: var(--on-ink); border-color: transparent; }
.tanita-card .mc-label, .tanita-card .mc-trend { color: inherit; }
.tanita-card .mc-unit, .tanita-card .mc-date { color: inherit; opacity: .75; }
.tanita-card .catsec-ico, .tanita-card .badge.neutral { background: color-mix(in srgb, currentColor 16%, transparent); color: inherit; }
.tanita-card .num, .tanita-card .mc-value { color: inherit; }
.card.measure-card.tanita-card:hover { filter: brightness(1.15); }
/* rapoartele Tanita: lista în stânga, raportul în dreapta */
.tn-rep-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tn-rep-tools label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.tn-rep-tools .field { height: 38px; border-radius: 12px; padding: 0 10px; font-size: 13.5px; }
.tn-rep-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.tn-rep-list { display: flex; flex-direction: column; gap: 6px; position: sticky; top: calc(var(--head-h, 80px) + 10px); }
.tn-rep-item { text-align: left; border: none; background: var(--row); border-radius: 14px; padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; color: var(--text); }
.tn-rep-item b { font-size: 14px; }
.tn-rep-item span { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.tn-rep-item:hover { background: var(--accent-soft); }
.tn-rep-item.on { background: var(--accent); color: var(--on-accent); }
.tn-rep-item.on span { color: inherit; opacity: .85; }
.tn-orig { font-style: normal; font-size: 10.5px; font-weight: 800; justify-self: start; padding: 1px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); margin-top: 2px; }
.tn-rep-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tn-rep-mode { height: 40px; min-width: 300px; }
.tn-rep-frame { width: 100%; height: 1180px; border: none; border-radius: 16px; background: #E9E7EF; }
@media (max-width: 900px) {
  .tn-rep-grid { grid-template-columns: minmax(0, 1fr); }
  .tn-rep-list { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .tn-rep-item { flex: 0 0 auto; }
  .tn-rep-item span { display: none; }
  .tn-rep-frame { height: 80vh; }
}
/* pagina Tanita: lista în stânga (Ansamblu, Grafice, rapoartele), conținutul în dreapta */
.tn-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.tn-nav { display: flex; flex-direction: column; gap: 6px; position: sticky; top: calc(var(--head-h, 80px) + 10px); max-height: calc(100vh - var(--head-h, 80px) - 20px); overflow: auto; }
.tn-nav-item { text-align: left; border: none; background: var(--surface); box-shadow: var(--shadow); border-radius: 14px; padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; color: var(--text); }
.tn-nav-item b { font-size: 14px; }
.tn-nav-item span { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.tn-nav-item:hover { background: var(--accent-soft); }
.tn-nav-item.on { background: var(--accent); color: var(--on-accent); }
.tn-nav-item.on span { color: inherit; opacity: .85; }
.tn-nav-sep { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 4px 2px; }
.tn-main > [data-pane] > .card:first-child, .tn-main > .card { margin-top: 0; }
.tn-main .tn-top { margin: 16px 0; }
.tn-main .tn-charts:first-of-type { margin-top: 16px; }
.tn-rep .tn-rep-tools { margin-bottom: 10px; }
.tn-ctrl { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 999px; background: var(--row); cursor: pointer; }
.tn-rep-frame.ctrl { outline: 3px solid var(--warm, #F5A524); }
@media (max-width: 1250px) { .tn-main .tn-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .tn-layout { grid-template-columns: minmax(0, 1fr); }
  .tn-nav { position: sticky; top: var(--head-h, 120px); z-index: 5; flex-direction: row; overflow-x: auto; max-height: none; padding: 4px 0 8px; background: var(--bg); scrollbar-width: none; }
  .tn-nav-item { flex: 0 0 auto; padding: 8px 12px; }
  .tn-nav-item span { display: none; }
  .tn-nav-sep { display: none; }
}
@media (max-width: 640px) { .tn-rep-tools label { flex-wrap: wrap; width: 100%; } .tn-rep-tools .field { max-width: 100%; flex: 1; min-width: 0; } }

/* Raport Tanita: perioada sus, zilele în stânga, rapoartele zilei ca 9 carduri, raportul cu PDF-ul original alături */
.tn-period { margin-bottom: 16px; }
.tn-nav-sep .count { margin-left: 6px; }
.tn-days { display: flex; flex-direction: column; gap: 6px; }
.tn-month > summary { padding: 8px 10px; font-size: 13px; }
.tn-month-days { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 6px; }
.tn-month-days .tn-day { width: 100%; }
.tn-day { position: relative; }
.tn-day .tn-orig { position: absolute; top: 9px; right: 10px; margin: 0; }
.tn-days-flat { display: none; }
.tn-repcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tn-repcard { position: relative; text-align: left; border: 2px solid transparent; background: var(--row); border-radius: 16px; padding: 14px 14px 12px; cursor: pointer;
  display: grid; gap: 4px; align-content: start; color: var(--text); font: inherit; }
.tn-repcard b { font-size: 15px; padding-right: 86px; }
.tn-repcard span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.tn-repcard:hover { border-color: var(--accent-soft); background: var(--accent-soft); }
.tn-repcard .tn-orig { position: absolute; top: 12px; right: 12px; margin: 0; }
.tn-mode .pill { border: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; }
.tn-frames { display: grid; gap: 12px; }
.tn-frames.side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tn-frames.side .tn-rep-frame { height: 1000px; }
.tn-frames [hidden] { display: none !important; }
@media (max-width: 1100px) { .tn-side-only { display: none; } .tn-frames.side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .tn-days { display: none; }
  .tn-days-flat { display: contents; }
  .tn-day .tn-orig { position: static; display: inline-block; margin-left: 4px; }
  .tn-day b { display: inline; }
  .tn-repcards { grid-template-columns: minmax(0, 1fr); }
  .tn-repcard span { display: none; }
  [data-pane="zi"] .card-head .muted { display: none; }
}

/* Config › Conturi și acces */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.acc-card.off { opacity: .75; }
.acc-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.acc-fields.one { grid-template-columns: minmax(0, 1fr); }
.acc-access { border: none; padding: 12px 14px; margin: 14px 0 0; border-radius: 14px; background: var(--row); display: grid; gap: 8px; }
.acc-access legend { padding: 0; margin-bottom: 4px; float: left; width: 100%; }
.acc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.acc-card .field, .acc-grid .field { height: 44px; font-size: 15px; }
.acc-row .small { color: var(--muted); font-size: 12.5px; }
.acc-pw { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.acc-pw .mf-field { flex: 1; }
.acc-pass code { font-size: 17px; font-weight: 800; padding: 2px 8px; border-radius: 8px; background: var(--surface); }
.acc-pass { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
@media (max-width: 640px) { .acc-grid { grid-template-columns: minmax(0, 1fr); } .acc-fields { grid-template-columns: minmax(0, 1fr); } .acc-pw { flex-direction: column; align-items: stretch; } }

/* Config › Explicații analize */
.info-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px; }
.info-list .filter-empty { grid-column: 1 / -1; }
.info-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t b" "n b"; gap: 2px 12px; align-items: center;
  padding: 10px 14px; border-radius: 14px; background: var(--row); text-decoration: none; color: var(--text); }
.info-row b { grid-area: t; } .info-row .small { grid-area: n; } .info-row .badge { grid-area: b; }
.info-row:hover { background: var(--accent-soft); color: var(--text); }
.info-missing { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.info-miss { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--warn-soft); text-decoration: none; color: var(--text); }
.info-miss span { font-size: 12px; color: var(--muted); }
.info-miss em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--accent); }
.info-edit { display: grid; gap: 14px; max-width: 860px; }
.info-edit .field { font-size: 15px; }
.info-edit input.field { height: 44px; }
.info-edit textarea { resize: vertical; min-height: 44px; line-height: 1.45; padding: 10px 14px; }

/* Date din iPhone */
.ip-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .ip-grid { grid-template-columns: 1fr; } }
.ip-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14.5px; }
.ip-facts dt { color: var(--muted); font-weight: 600; }
.ip-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ip-key { margin-top: 16px; padding: 14px; border-radius: 14px; background: var(--ok-soft); display: flex; flex-direction: column; gap: 8px; }
.ip-copy { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; flex-wrap: wrap; }
.ip-copy code { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; padding: 8px 10px; border-radius: 10px; background: var(--surface); font-size: 13px; }
.ip-metrics { margin: 6px 0 0; padding-left: 18px; }
.ip-steps code { font-size: 13px; }

/* FibroMax: filele Raportul / Evoluție și tabelul evoluției */
.fm-tabs { margin: 10px 0 0; }
.fm-evo th[scope], .fm-evo tbody th { text-align: left; font-weight: 700; white-space: normal; min-width: 170px; }
.fm-evo td { white-space: nowrap; }
.fm-evo tr.fm-sec th { background: var(--row); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding-top: 8px; padding-bottom: 8px; }
.fm-chip { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 6px; vertical-align: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }

/* Rezumat pentru medic (rezumat.php): o foaie albă, sobră, care se tipărește pe A4 */
.rz-specs { margin: 4px 0 16px; flex-wrap: wrap; }
.rz-sheet { max-width: 900px; background: #fff; color: #1b1b22; border-radius: 18px; padding: 28px 32px; box-shadow: var(--shadow, 0 2px 12px rgba(0,0,0,.08)); font-size: 14px; line-height: 1.45; }
.rz-sheet h2 { margin: 2px 0 4px; font-size: 24px; color: #1b1b22; }
.rz-sheet h3 { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #4b3fb0; border-bottom: 1px solid #e3e0ef; padding-bottom: 4px; }
.rz-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #1b1b22; padding-bottom: 12px; }
.rz-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #6b6780; }
.rz-id { color: #3a3748; }
.rz-date { color: #6b6780; white-space: nowrap; font-size: 13px; }
.rz-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.rz-sheet ul { margin: 0; padding-left: 18px; }
.rz-none { margin: 0; color: #8a8698; font-style: italic; }
.rz-m { color: #6b6780; font-size: 12.5px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.rz-t { width: 100%; border-collapse: collapse; }
.rz-t td, .rz-t th { padding: 5px 8px 5px 0; vertical-align: top; border-bottom: 1px solid #f0eef5; text-align: left; }
.rz-t th { font-size: 12px; color: #6b6780; font-weight: 600; }
.rz-labs td:first-child { width: 34%; }
.rz-meas td:first-child { width: 24%; }
.rz-t td:nth-child(2) { white-space: nowrap; }
.rz-out td:first-child { font-weight: 700; }
.rz-flag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 0 6px; border-radius: 6px; margin-left: 4px; }
.rz-flag.hi { background: #fde6dc; color: #a33a10; }
.rz-flag.lo { background: #e2ebfd; color: #1c4fb0; }
.rz-cons { padding: 6px 0; border-bottom: 1px solid #f0eef5; }
.rz-foot { margin-top: 20px; padding-top: 8px; border-top: 1px solid #e3e0ef; font-size: 11.5px; color: #8a8698; }
@media (max-width: 700px) { .rz-sheet { padding: 18px 16px; } .rz-two { grid-template-columns: 1fr; } .rz-head { flex-direction: column; } .rz-labs td:first-child { width: auto; } }
@media print {
  .rz-noprint, .rz-specs, .crumbs { display: none !important; }
  .rz-sheet { box-shadow: none; padding: 0; max-width: none; border-radius: 0; font-size: 11.5px; }
  .rz-sheet h3 { break-after: avoid; }
  .rz-t tr, .rz-cons { break-inside: avoid; }
  @page { size: A4; margin: 14mm 12mm; }
}

/* Fișa › Afecțiuni › „Din consultații” (diagnosticele scoase din consultații, inc/derive.php) */
.dx-h { margin: 10px 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dx-list { display: flex; flex-direction: column; gap: 4px; }
.dx { display: block; padding: 7px 10px; border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; font-size: 14px; }
.dx:hover { outline: 2px solid var(--accent-soft); }
.dx-code { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.dx-m { display: block; font-size: 12.5px; color: var(--muted); }
.dx-more > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--accent-text); padding: 4px 2px; }
.dx-more[open] > summary { margin-bottom: 4px; }
.dx-more .dx { margin-bottom: 4px; }
.rz-dx td:first-child { width: 52%; }
.rz-past td:first-child b { color: #8a8698; font-weight: 600; }

/* Fișa › Diagnostice din consultații: ce e actual îl spune omul */
.dx-link { display: inline-block; margin-top: 10px; font-size: 13.5px; font-weight: 700; color: var(--accent-text); }
.dx-card .card-head { flex-wrap: wrap; }
.dx-rows { display: flex; flex-direction: column; gap: 6px; }
.dx-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--row); }
.dx-row.past .dx-main b { color: var(--muted); font-weight: 600; }
.dx-main { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.dx-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin: 0; }
.dx-acts .pill { border: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 10px; }
@media (max-width: 700px) { .dx-row { flex-direction: column; align-items: stretch; } .dx-acts { justify-content: flex-start; } }
