/* Logo1 Cabinet — stiluri scrise de mână, fără pas de compilare.
   Toate ecranele folosesc doar clasele de aici; culoarea cabinetului vine din --brand (setată în layout). */

:root {
  --brand: #2a9d8f;
  --brand-dark: #1f776c;
  --brand-soft: #e6f4f2;
  --ink: #17212b;
  --ink-2: #44515e;
  --muted: #7a8794;
  --line: #e4e8ec;
  --bg: #f5f7f9;
  --card: #ffffff;
  --ok: #2e9e5b;      --ok-soft: #e5f5ec;
  --warn: #c98a12;    --warn-soft: #fdf3dd;
  --bad: #d64545;     --bad-soft: #fbe8e8;
  --info: #3b6fd8;    --info-soft: #e8effc;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --side: 248px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 .6em; }
img { max-width: 100%; }
[x-cloak] { display: none !important; }

/* ── cadru: meniu lateral + conținut ── */
.app { min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 30;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.side-logo { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.side-name { font-weight: 750; font-size: 15px; line-height: 1.2; }
.side-sub { font-size: 12px; color: var(--muted); }
.nav { padding: 10px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 6px; font-weight: 650; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 550; }
.nav a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand-dark); }
.nav svg { width: 19px; height: 19px; flex: none; }
.nav .count { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.side-user { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }

.main { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; background: rgba(245, 247, 249, .92); backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--line);
}
.top-search { flex: 1; max-width: 420px; position: relative; }
.top-search input[type=search] { padding-left: 36px; }
.top-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--muted); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.page { padding: 24px 28px 48px; width: 100%; max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 4px 0 0; }

.demo-bar { background: #17212b; color: #fff; font-size: 13px; padding: 8px 28px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.demo-bar a { color: #9fe3d9; font-weight: 600; }

/* meniul de jos pe telefon */
.tabbar { display: none; }
.burger { display: none; }

/* ── componente ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 16px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; } .mb-s { margin-bottom: 8px; }
.hide { display: none !important; }

.stat { padding: 16px 18px; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 550; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.stat-note { font-size: 12px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  text-decoration: none !important; white-space: nowrap; line-height: 1.2;
}
.btn:hover { border-color: #cfd6dd; background: #fafbfc; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--bad); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-block { width: 100%; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: #9a6a0c; }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }
.dot { width: 9px; height: 9px; border-radius: 99px; display: inline-block; flex: none; }

.avatar { width: 34px; height: 34px; border-radius: 99px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--brand); flex: none; }
.avatar-lg { width: 56px; height: 56px; font-size: 19px; }
.avatar-soft { background: var(--brand-soft); color: var(--brand-dark); }

.alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert-ok { background: var(--ok-soft); color: #1f6e3f; }
.alert-warn { background: var(--warn-soft); color: #7d570a; }
.alert-bad { background: var(--bad-soft); color: #9b2c2c; }
.alert-info { background: var(--info-soft); color: #274f9e; }

/* tabele */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover { background: #fafbfc; }
.t-click tbody tr { cursor: pointer; }

/* liste */
.list > * { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); color: inherit; }
.list > *:last-child { border-bottom: 0; }
.list > a:hover { background: #fafbfc; text-decoration: none; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }

/* formulare */
label.f { display: block; font-size: 13px; font-weight: 650; color: var(--ink-2); margin-bottom: 5px; }
.input, input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d5dbe1; border-radius: 9px; font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.err { font-size: 12px; color: var(--bad); margin-top: 4px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand); }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfd6dd; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 99px; transition: .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(18px); }

/* file (taburi) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs .on { color: var(--brand-dark); border-bottom-color: var(--brand); }
.seg { display: inline-flex; background: #eceff2; padding: 3px; border-radius: 10px; gap: 2px; }
.seg a, .seg button { padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); border: 0; background: none; cursor: pointer; }
.seg .on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.seg a:hover { text-decoration: none; }

/* ferestre (modal) */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 32, .45); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px; }

.flash { position: fixed; right: 20px; bottom: 20px; z-index: 80; max-width: 380px; box-shadow: var(--shadow-lg); }

/* agenda */
.cal { display: grid; position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-scroll { overflow-x: auto; }
.cal-head { position: sticky; top: 0; background: #fff; z-index: 2; }
.cal-col-head { padding: 10px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-weight: 650; font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.cal-hours { border-right: 1px solid var(--line); }
.cal-hour { height: 64px; font-size: 12px; color: var(--muted); text-align: right; padding: 2px 8px 0 0; border-top: 1px solid var(--line); }
.cal-col { position: relative; border-left: 1px solid var(--line); }
.cal-slot { height: 32px; border-top: 1px solid #f0f2f4; cursor: pointer; }
.cal-slot:nth-child(2n+1) { border-top-color: var(--line); }
.cal-slot:hover { background: var(--brand-soft); }
.cal-off { background: repeating-linear-gradient(135deg, #f7f8fa, #f7f8fa 6px, #f1f3f5 6px, #f1f3f5 12px); cursor: default; }
.cal-off:hover { background: repeating-linear-gradient(135deg, #f7f8fa, #f7f8fa 6px, #f1f3f5 6px, #f1f3f5 12px); }
.ev { position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 4px 8px; font-size: 12px; line-height: 1.3; overflow: hidden; cursor: pointer; border-left: 4px solid var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 13%, #fff); color: var(--ink); }
.ev:hover { box-shadow: var(--shadow-lg); z-index: 3; text-decoration: none; }
.ev b { display: block; font-size: 12.5px; }
.ev.st-anulat, .ev.st-neprezentat { opacity: .5; text-decoration: line-through; }
.ev.st-sosit { box-shadow: inset 0 0 0 2px var(--ok); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 4; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 99px; background: var(--bad); }

/* fișa pacientului */
.p-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.progress { height: 8px; background: #eceff2; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.thumb { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; color: inherit; }
.thumb img { width: 100%; height: 110px; object-fit: cover; display: block; background: #0d1116; }
.thumb div { padding: 8px 10px; font-size: 13px; }

/* conversații */
.chat { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: 14px; }
.bubble.pac { background: #eef1f4; align-self: flex-start; border-top-left-radius: 4px; }
.bubble.as { background: var(--brand-soft); align-self: flex-end; border-top-right-radius: 4px; }

/* pagina publică și login */
.public { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; }
.public-box { width: 100%; max-width: 460px; }
.login-hero { text-align: center; margin-bottom: 22px; }
.choice { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: #fff; }
.choice:hover { border-color: var(--brand); }
.choice input { display: none; }
.choice.on, .choice:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot { border: 1px solid var(--line); border-radius: 9px; padding: 8px 0; text-align: center; font-weight: 650; cursor: pointer; background: #fff; font-size: 14px; }
.slot:has(input:checked) { background: var(--brand); color: #fff; border-color: var(--brand); }
.slot input { display: none; }

/* ── telefon și tabletă ── */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .side { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .main { margin-left: 0; padding-bottom: 72px; }
  .burger { display: inline-flex; }
  .top { padding: 10px 14px; }
  .top-search { max-width: none; }
  .top-actions .btn-label { display: none; }
  .page { padding: 16px 14px 32px; }
  .demo-bar { padding: 8px 14px; }
  h1 { font-size: 21px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; position: relative; }
  .tabbar a.on { color: var(--brand-dark); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .count { position: absolute; top: 0; left: 55%; background: var(--bad); color: #fff; font-size: 10px; border-radius: 99px; padding: 0 5px; }
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; overflow-y: auto; }
  .flash { left: 12px; right: 12px; bottom: 84px; max-width: none; }
  .t-cards thead { display: none; }
  .t-cards tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .t-cards td { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border: 0; }
  .t-cards td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: 13px; }
  .hide-m { display: none !important; }
  .slots { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 861px) { .only-m { display: none !important; } }

/* corecturi după asamblare */
@media (min-width: 861px) { .burger { display: none !important; } }
@media (max-width: 860px) { .flash { top: 12px; bottom: auto; } }
