/* SmileRPA Dental Suite — foaie de stil principală */

@font-face {
  font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.1ad231aac0a8.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --sidebar: #0f2231;
  --sidebar-line: #1d3344;
  --sidebar-text: #c9d6df;
  --sidebar-muted: #7f95a5;
  --sidebar-active: #13495a;
  --primary: #0f7c85;
  --primary-hover: #0c6870;
  --primary-soft: #e3f3f3;
  --bg: #f2f5f7;
  --card: #ffffff;
  --line: #e2e8ed;
  --line-soft: #eef2f5;
  --text: #0f1c2a;
  --muted: #5b6b79;
  --faint: #8a98a5;
  --success: #15803d; --success-bg: #e6f6ec;
  --warning: #b45309; --warning-bg: #fdf3e2;
  --danger: #c2261d;  --danger-bg: #fdecea;
  --info: #1d4ed8;    --info-bg: #e8effd;
  --neutral-bg: #eef1f4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 28, 42, .04);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14.5px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 18px;
         border-bottom: 1px solid var(--sidebar-line); }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #1ba7ae, #0e7881);
}
.brand-name { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.1; }
.brand-sub { color: var(--sidebar-muted); font-size: 10.5px; letter-spacing: .14em; margin-top: 3px; }
.nav { padding: 8px 0; overflow-y: auto; flex: 1; }
.nav-section { font-size: 10px; letter-spacing: .14em; color: var(--sidebar-muted);
               padding: 16px 18px 6px; text-transform: uppercase; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 8.5px 18px; color: var(--sidebar-text);
  border-left: 3px solid transparent; font-size: 14px; white-space: nowrap;
}
.nav a:hover { background: rgba(255, 255, 255, .04); color: #fff; }
.nav a.active { background: var(--sidebar-active); color: #fff; border-left-color: #22b3b9; font-weight: 600; }
.nav a .soon { margin-left: auto; font-size: 9.5px; color: var(--sidebar-muted);
               border: 1px solid var(--sidebar-line); border-radius: 6px; padding: 1px 6px; }
.license-box {
  margin: 12px; padding: 10px 12px; border: 1px solid var(--sidebar-line); border-radius: 10px;
  font-size: 11.5px; color: var(--sidebar-muted); background: rgba(255, 255, 255, .02);
}
.license-box strong { color: #fff; font-weight: 600; display: block; font-size: 12px; }
.userbox { display: flex; align-items: center; gap: 10px; padding: 14px 16px;
           border-top: 1px solid var(--sidebar-line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
          background: #178b93; color: #fff; font-size: 12px; font-weight: 600; flex: none; }
.userbox .name { color: #fff; font-weight: 600; font-size: 13px; }
.userbox .role { color: var(--sidebar-muted); font-size: 11.5px; }
.userbox form { margin-left: auto; }
.userbox button { background: none; border: 0; color: var(--sidebar-muted); cursor: pointer; padding: 4px; }
.userbox button:hover { color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 14px 28px;
  display: flex; align-items: center; gap: 20px; position: sticky; top: 0; z-index: 5;
}
.topbar .titles { min-width: 0; }
.topbar h1 { font-size: 19px; font-weight: 700; }
.topbar .subtitle { color: var(--muted); font-size: 13px; margin-top: 1px; }
.topbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; width: 300px; padding: 8px 12px; color: var(--faint);
  border: 1px solid var(--line); border-radius: 9px; background: #fafbfc;
}
.search input[type=search] { border: 0; outline: 0; box-shadow: none; padding: 0; background: transparent; font: inherit; color: var(--text); width: 100%; }
.topbar .actions { display: flex; gap: 10px; }
.content { padding: 24px 28px 40px; }

/* ---------- Components ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 9px;
  font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: #fff; color: var(--text);
}
.btn:hover { border-color: #cfd8df; color: var(--text); background: #fafbfc; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-link { border: 0; background: none; color: var(--primary); padding: 0; font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
             padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.card-head h2 { font-size: 15.5px; font-weight: 700; }
.card-head .hint { color: var(--muted); font-size: 12.5px; font-weight: 400; margin-left: 8px; }
.card-body { padding: 18px 20px; }
.content > .card + .card, .content > .grid + .card, .stack > * + * { margin-top: 18px; }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid-main-wide { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }

.kpi { padding: 16px 20px; }
.kpi .label { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 28px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -.02em; }
.kpi .value small { font-size: 14px; font-weight: 500; color: var(--muted); }
.kpi .note { font-size: 12.5px; font-weight: 600; }
.kpi .note.ok { color: var(--success); }
.kpi .note.warn { color: var(--warning); }
.kpi .note.bad { color: var(--danger); }
.kpi .note.dim { color: var(--muted); font-weight: 400; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
         font-size: 12px; font-weight: 600; background: var(--neutral-bg); color: var(--muted); white-space: nowrap; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.teal { background: var(--primary-soft); color: var(--primary); }

table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
            color: var(--faint); font-weight: 600; padding: 10px 20px; border-bottom: 1px solid var(--line-soft); background: #fbfcfd; }
.table td { padding: 11px 20px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.row-link:hover td { background: #fafcfd; }
.table .sub { color: var(--muted); font-size: 12.5px; }

dl.details { display: grid; grid-template-columns: 34% 1fr; margin: 0; }
dl.details dt, dl.details dd { padding: 12px 20px; border-bottom: 1px solid var(--line-soft); margin: 0; }
dl.details dt { color: var(--muted); }
dl.details dd { font-weight: 600; }
dl.details dd .sub { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
dl.details > :nth-last-child(-n+2) { border-bottom: 0; }
dl.kv { display: grid; grid-template-columns: 44% 1fr; row-gap: 8px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; font-weight: 600; }

.keybox { display: inline-flex; align-items: center; padding: 6px 12px; border: 1px solid var(--line);
          border-radius: 8px; background: #fafbfc; font-weight: 700; letter-spacing: .06em; }

.empty { text-align: center; color: var(--muted); padding: 34px 20px; }
.empty .icon { width: 34px; height: 34px; color: var(--faint); margin-bottom: 8px; }
.empty h3 { color: var(--text); font-size: 15px; margin-bottom: 4px; }

.messages { margin-bottom: 18px; display: grid; gap: 8px; }
.alert { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; border: 1px solid transparent;
         display: flex; gap: 10px; align-items: flex-start; }
.alert.success { background: var(--success-bg); color: #14532d; border-color: #bfe6cc; }
.alert.error { background: var(--danger-bg); color: #7f1d1d; border-color: #f5c6c2; }
.alert.info { background: var(--info-bg); color: #1e3a8a; border-color: #c9d8fb; }
.alert.warning { background: var(--warning-bg); color: #78350f; border-color: #f4dcb0; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line-soft); }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
                   border: 1.5px solid var(--line); color: transparent; flex: none; }
.checklist .done .tick { background: var(--success); border-color: var(--success); color: #fff; }
.checklist .done .text { color: var(--muted); }
.checklist .go { margin-left: auto; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--faint); width: 94px; flex: none; font-size: 12.5px; padding-top: 1px; }

.modules-grid { display: grid; grid-template-columns: 1fr 1fr; }
.modules-grid > div { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.modules-grid > div:nth-child(odd) { border-right: 1px solid var(--line-soft); }
.modules-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.modules-grid .icon { color: var(--success); }
.modules-grid .badge { margin-left: auto; }

.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.doclist li:last-child { border-bottom: 0; }
.doclist .icon { color: var(--primary); }
.doclist .meta { color: var(--faint); font-size: 12px; }
.doclist a.dl { margin-left: auto; color: var(--muted); }

.hero { display: flex; align-items: center; gap: 20px; padding: 22px 24px;
        background: linear-gradient(90deg, #f3fafa, #fff 60%); }
.hero .logo { width: 70px; height: 70px; border-radius: 16px; display: grid; place-items: center; color: #fff;
              background: linear-gradient(135deg, #1ba7ae, #0e7881); flex: none; }
.hero .logo .icon { width: 34px; height: 34px; }
.hero h2 { font-size: 24px; }
.hero .desc { color: var(--muted); margin-top: 3px; }
.hero .right { margin-left: auto; text-align: right; font-size: 12.5px; color: var(--muted); }
.hero .right .badge { font-size: 13px; padding: 5px 12px; margin-bottom: 8px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field .help { color: var(--faint); font-size: 12px; margin-top: 5px; }
.field .errors { color: var(--danger); font-size: 12.5px; margin-top: 5px; }
.field.checkbox { display: flex; align-items: flex-start; gap: 10px; }
.field.checkbox label { margin: 0; }
input[type=text], input[type=url], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=search], input[type=file], select, textarea {
  width: 100%; font: inherit; color: var(--text); padding: 9px 12px; border: 1px solid #d4dce3;
  border-radius: 9px; background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 124, 133, .12); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--primary); margin-top: 1px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px;
                border-top: 1px solid var(--line-soft); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 20px;
           border-bottom: 1px solid var(--line-soft); }
.filters .field { min-width: 150px; }
.filters .field label { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.filters input, .filters select { padding: 7px 10px; height: 36px; }

.pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px;
              border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; }
.pagination .pages { display: flex; gap: 6px; }

.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix .yes { color: var(--success); } .matrix .no { color: #cfd8df; }

.changes { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.changes b { color: var(--text); font-weight: 600; }
.changes .old { text-decoration: line-through; color: var(--faint); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: var(--sidebar); color: var(--sidebar-text); padding: 48px; display: flex;
              flex-direction: column; justify-content: space-between; }
.login-side .brand { border: 0; padding: 0; }
.login-side h2 { color: #fff; font-size: 30px; line-height: 1.2; max-width: 420px; }
.login-side p { color: var(--sidebar-muted); max-width: 420px; }
.login-side .foot { font-size: 12px; color: var(--sidebar-muted); }
.login-form { display: grid; place-items: center; padding: 40px; }
.login-form .box { width: 100%; max-width: 380px; }
.login-form h1 { font-size: 24px; margin-bottom: 6px; }
.login-form .field { margin-top: 16px; }
.login-form .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 22px; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-main-wide { grid-template-columns: 1fr; }
  .search { display: none; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .login-page { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .form-grid, .grid-2, .grid-3, .grid-4, .modules-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
}

@media print {
  .sidebar, .topbar .actions, .search, .no-print { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- Nomenclatoare ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent;
          margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.dot-warn { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; display: inline-block; }
.content > .alert { margin-bottom: 18px; }
.group-row td { background: #f7f9fa; font-weight: 700; font-size: 13px; padding: 8px 20px; }
.row-dim td { opacity: .55; }
.row-title { color: var(--text); font-weight: 600; }
.row-title:hover { color: var(--primary); }
.table td.num, .table th.num { text-align: right; }
.switch { width: 36px; height: 20px; border-radius: 999px; background: #d4dce3; border: 0; padding: 0; position: relative; cursor: pointer; }
.switch span { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
               box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.switch.on { background: var(--primary); }
.switch.on span { left: 18px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: block; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--text); }
.table .day { text-align: center; padding-left: 6px; padding-right: 6px; font-size: 12px; }
.slot { border-left: 3px solid; background: #f7f9fa; border-radius: 4px; padding: 2px 6px; margin: 2px 0; white-space: nowrap; text-align: left; }
.slot span { display: block; color: var(--faint); font-size: 11px; }
.schedule-table td, .schedule-table th { padding: 8px 10px; }
.schedule-table select, .schedule-table input { padding: 6px 8px; }
.errors-cell { color: var(--danger); font-size: 12.5px; padding-top: 0 !important; }
input.time-input { width: 86px; text-align: center; font-variant-numeric: tabular-nums; }
.schedule-table select { min-width: 110px; }

/* ---------- Pacienți ---------- */
.search-wrap { position: relative; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; }
.search-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(15,28,42,.12); overflow: hidden; min-width: 340px; }
.search-item { display: flex; gap: 10px; align-items: center; padding: 9px 12px; color: var(--text); border-bottom: 1px solid var(--line-soft); }
.search-item:hover { background: #f5f9f9; color: var(--text); }
.search-item .sub { display: block; color: var(--muted); font-size: 12px; }
.search-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.search-foot { display: flex; gap: 6px; align-items: center; padding: 9px 12px; font-weight: 600; font-size: 13px; background: #fafbfc; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.patient-head { display: flex; align-items: center; gap: 18px; padding: 20px 24px; }
.patient-head .who { min-width: 0; }
.patient-head h2 { font-size: 22px; }
.patient-head .muted { font-size: 13.5px; margin-top: 2px; }
.patient-head .allergy { margin-top: 6px; color: var(--danger); font-weight: 600; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.head-stats { margin-left: auto; display: flex; align-items: center; gap: 28px; text-align: right; }
.head-stats span { display: block; color: var(--muted); font-size: 12.5px; }
.head-stats b { font-size: 15px; white-space: nowrap; }
.tabs .count { background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 0 7px; font-size: 11.5px; }
.odonto { display: grid; gap: 6px; }
.odonto-row { display: grid; grid-template-columns: repeat(16, 1fr); gap: 4px; }
.odonto-row:has(> :nth-child(10):last-child) { grid-template-columns: repeat(10, 1fr); padding: 0 18.75%; }
.odonto-row.lower { margin-top: 4px; }
.tooth { display: block; aspect-ratio: 3 / 4; border: 1.5px solid; border-radius: 6px; padding: 0; font: inherit; cursor: default; }
button.tooth { cursor: pointer; }
button.tooth:hover { box-shadow: 0 0 0 2px var(--primary); }
.tooth.gap { margin-right: 6px; }
.odonto.big .tooth { aspect-ratio: 3 / 4.2; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; }
.odonto.big .tooth span { font-size: 11px; color: var(--muted); font-weight: 600; }
.odonto-labels { display: flex; justify-content: space-between; color: var(--faint); font-size: 11.5px; margin: 6px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0 20px 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 11px; height: 11px; border: 1.5px solid; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
#tooth-panel:not(:empty) { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fbfcfd; }
.tooth-form-head { display: flex; justify-content: space-between; margin-bottom: 10px; }
.feed.auto li { align-items: flex-start; }
.dot-blue { width: 16px; height: 16px; border-radius: 50%; background: var(--info-bg); flex: none; margin-top: 2px; position: relative; }
.dot-blue::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--info); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form select, .inline-form input[type=date] { width: auto; flex: 1 1 150px; }
.table tfoot td { border-top: 1px solid var(--line); background: #fbfcfd; }
@media (max-width: 1100px) { .head-stats { flex-wrap: wrap; gap: 14px; } .patient-head { flex-wrap: wrap; } }

/* ---------- Programări ---------- */
.hidden { display: none !important; }
.cat-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: 0; }
.cal-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.cal-toolbar .seg { display: flex; gap: 6px; align-items: center; }
.cal-toolbar select, .date-sm { width: auto; padding: 6px 10px; height: 34px; }
.switch-view { margin-left: auto; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.switch-view a { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 13px; }
.switch-view a.on { background: var(--primary); color: #fff; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-right: auto; margin-left: 20px; }
.cal-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.cal-card { overflow: hidden; }
.cal { --gutter: 64px; overflow-x: auto; }
.cal-head, .cal-body { display: grid; grid-template-columns: var(--gutter) repeat(var(--cols), minmax(150px, 1fr)); }
.cal-head { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 3; }
.cal-colhead { padding: 10px 14px; border-left: 1px solid var(--line-soft); font-size: 14px; }
.cal-colhead a { color: var(--text); }
.cal-colhead.today { background: #eef8f8; }
.cal-colhead .holiday { color: var(--warning); font-size: 11.5px; font-weight: 600; }
.cal-body { position: relative; }
.cal-gutter .cal-hour { font-size: 12px; color: var(--faint); text-align: right; padding: 2px 10px 0 0; border-top: 1px solid var(--line-soft); }
.cal-col { position: relative; border-left: 1px solid var(--line-soft);
           background: repeating-linear-gradient(135deg, #f6f8f9 0 6px, #f1f4f6 6px 12px);
           background-image: linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px),
                             repeating-linear-gradient(135deg, #f7f9fa 0 6px, #f2f5f7 6px 12px);
           background-size: 100% var(--px-hour), auto; }
.cal-col.today { box-shadow: inset 0 0 0 9999px rgba(15,124,133,.025); }
.cal-work { position: absolute; left: 0; right: 0; background: #fff;
            background-image: linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px); background-size: 100% var(--px-hour); }
.cal-col.today .cal-work { background-color: #fbfefe; }
.cal-slot { position: absolute; left: 0; right: 0; height: calc(var(--px-hour) / 2); z-index: 1; }
.cal-slot:hover { background: rgba(15,124,133,.08); }
.cal-slot:hover::after { content: "+"; position: absolute; right: 8px; top: 2px; color: var(--primary); font-weight: 700; }
.cal-appt { position: absolute; z-index: 2; border-radius: 7px; padding: 5px 9px; overflow: hidden; color: var(--text);
            border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 11%, #fff); font-size: 12.5px; line-height: 1.3;
            box-shadow: 0 1px 2px rgba(15,28,42,.06); }
.cal-appt:hover { color: var(--text); box-shadow: 0 2px 8px rgba(15,28,42,.15); z-index: 4; }
.cal-appt b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-appt span { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-appt .meta { color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.cal-appt.st-neprezentat, .cal-appt.st-finalizat { opacity: .6; }
.cal-appt.st-neprezentat b { text-decoration: line-through; }
.st-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; }
.st-dot.ok { background: var(--success); } .st-dot.here { background: var(--info); }
.st-dot.done { background: var(--faint); } .st-dot.no { background: var(--danger); }
.cal-block { position: absolute; left: 3px; right: 3px; z-index: 2; border-radius: 7px; padding: 5px 9px; font-size: 12.5px;
             background: #eef1f4; border-left: 3px solid #64748b; color: var(--muted); overflow: hidden; }
.cal-block b { display: block; color: var(--text); }
.cal-col.is-holiday { background: repeating-linear-gradient(135deg, #fdf3e2 0 6px, #fbeccf 6px 12px); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 5; display: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.st-badge-programat { background: var(--neutral-bg); color: var(--muted); }
.st-badge-confirmat { background: var(--success-bg); color: var(--success); }
.st-badge-prezent { background: var(--info-bg); color: var(--info); }
.st-badge-finalizat { background: var(--primary-soft); color: var(--primary); }
.st-badge-neprezentat, .st-badge-anulat { background: var(--danger-bg); color: var(--danger); }
.chosen { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7fbfb; }
.search-item.pick { width: 100%; border: 0; background: #fff; text-align: left; font: inherit; cursor: pointer; }
.service-picker .svc-group + .svc-group { margin-top: 12px; }
.svc-cat { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.svc { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--line-soft); border-radius: 8px; margin-bottom: 5px; cursor: pointer; }
.svc span:nth-child(2) { flex: 1; }
.svc.on { border-color: var(--primary); background: var(--primary-soft); }
.slot-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow-y: auto; }
.slot-btn { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 5px 9px; font: inherit; font-size: 13px;
            font-variant-numeric: tabular-nums; cursor: pointer; }
.slot-btn:hover { border-color: var(--primary); }
.slot-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.status-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.holiday-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 20px; padding: 16px 20px; font-size: 13.5px; }
.holiday-list b { font-variant-numeric: tabular-nums; margin-right: 6px; }
.today-list li { display: flex; gap: 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.today-list .time { font-weight: 700; font-size: 15px; width: 52px; font-variant-numeric: tabular-nums; }
.today-list .who { flex: 1; min-width: 0; }
.today-list .who b { display: block; }
.cal-appt.short { padding: 3px 8px; display: flex; gap: 6px; align-items: baseline; }
.cal-appt.short b { flex: none; max-width: 60%; }
.cal-appt.short span { flex: 1; min-width: 0; }

/* ---------- Financiar ---------- */
.bar-chart { height: 260px; }
.bars { display: flex; align-items: stretch; height: 100%; gap: 2px; }
.bar-col { flex: 1; display: flex; flex-direction: column; position: relative; min-width: 0; outline: none; }
.bar-track { flex: 1; position: relative; border-bottom: 1px solid var(--line); }
.bar { position: absolute; left: 12%; right: 12%; bottom: 0; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-zero { position: absolute; left: 12%; right: 12%; bottom: 0; height: 2px; background: var(--line); }
.bar-col.is-today .bar { background: #0b5f66; }
.bar-col:hover .bar, .bar-col:focus .bar { background: #0b5f66; }
.bar-label { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.bar-x { height: 22px; font-size: 11.5px; color: var(--faint); text-align: center; padding-top: 5px; white-space: nowrap; }
.bar-tip { display: none; position: absolute; bottom: calc(100% - 20px); left: 50%; transform: translate(-50%, -8px); z-index: 5;
           background: var(--text); color: #fff; padding: 6px 9px; border-radius: 7px; font-size: 12px; white-space: nowrap; pointer-events: none; }
.bar-tip b { display: block; font-weight: 600; opacity: .8; }
.bar-col:hover .bar-tip, .bar-col:focus .bar-tip { display: block; }
.pay-achitata { background: var(--success-bg); color: var(--success); }
.pay-partial { background: var(--warning-bg); color: var(--warning); }
.pay-neachitata { background: var(--danger-bg); color: var(--danger); }
.pay-anulata { background: var(--neutral-bg); color: var(--muted); }
.head-stats b.neg { color: var(--danger); }
.head-stats b.pos { color: var(--success); }
.doc-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--text); }
.doc-lines th, .doc-lines td { padding-left: 8px; padding-right: 8px; }
.print-only { display: none; }
@media print {
  .print-only { display: block !important; }
  .tabs, .cal-toolbar, .messages { display: none !important; }
  .grid-main-wide { grid-template-columns: 1fr !important; }
}
.patient-head .next-appt { margin-top: 6px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.patient-head .who { flex: 1 1 280px; }
.table td.mono { white-space: nowrap; }

/* ---------- Stocuri ---------- */
.stk-ok { background: var(--success-bg); color: var(--success); }
.stk-sub_prag { background: var(--warning-bg); color: var(--warning); }
.stk-zero, .stk-negativ { background: var(--danger-bg); color: var(--danger); }
.mv-intrare, .mv-ajustare, .mv-stornare { background: var(--success-bg); color: var(--success); }
.mv-consum, .mv-consum_auto { background: var(--info-bg); color: var(--info); }
.mv-casare { background: var(--danger-bg); color: var(--danger); }
.neg-num { color: var(--danger); } .pos-num { color: var(--success); }
.receipt-table td { padding: 8px 10px; }
.receipt-table select, .receipt-table input { padding: 7px 9px; }

/* ---------- Notificări și automatizări ---------- */
.nt-trimis { background: var(--success-bg); color: var(--success); }
.nt-test { background: var(--primary-soft); color: var(--primary); }
.nt-in_asteptare { background: var(--info-bg); color: var(--info); }
.nt-esuat { background: var(--danger-bg); color: var(--danger); }
.nt-anulat, .nt-omis { background: var(--neutral-bg); color: var(--muted); }
.msg-preview { cursor: pointer; list-style: none; font-size: 13.5px; }
.msg-preview::-webkit-details-marker { display: none; }
.msg-full { margin-top: 6px; padding: 10px 12px; background: #f7f9fa; border-radius: 8px; font-size: 13px; }
.row-selected td { background: var(--primary-soft); }
.row-dim-soft td { color: var(--muted); }
.proc-table td { vertical-align: middle; }
.run-feed li { align-items: flex-start; }
.run-feed time { width: 72px; font-size: 12.5px; }
.run-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; margin-top: 2px; position: relative; }
.run-dot::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: currentColor; }
.rs-succes { color: var(--success); background: var(--success-bg); }
.rs-atentie { color: var(--warning); background: var(--warning-bg); }
.rs-eroare { color: var(--danger); background: var(--danger-bg); }
.rs-fara_actiuni, .rs-ruleaza { color: var(--faint); background: var(--neutral-bg); }
.rsb-succes { background: var(--success-bg); color: var(--success); }
.rsb-atentie { background: var(--warning-bg); color: var(--warning); }
.rsb-eroare { background: var(--danger-bg); color: var(--danger); }
.run-details { font-size: 11.5px; white-space: pre-wrap; background: #f7f9fa; padding: 8px; border-radius: 6px; max-height: 240px; overflow: auto; }
.public-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.public-card { max-width: 520px; width: 100%; padding: 28px; }
.public-card h1 { font-size: 22px; margin: 16px 0 6px; }
.brand-row { display: flex; gap: 10px; align-items: center; }
.public-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.public-actions .btn { justify-content: center; padding: 11px; }
.auto-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto-cards > div { padding: 14px 20px; border-right: 1px solid var(--line-soft); }
.auto-cards > div:last-child { border-right: 0; }
.auto-cards .top { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12.5px; color: var(--faint); }
@media (max-width: 1100px) { .auto-cards { grid-template-columns: 1fr 1fr; } }
.proc-table th, .proc-table td { padding-left: 14px; padding-right: 14px; }
.proc-table .proc-name { min-width: 190px; }
.proc-table td.sub { font-size: 12.5px; }
.proc-table .switch { vertical-align: middle; }
.proc-table td:last-child { padding-left: 4px; }

/* ---------- Modul 7 – Rapoarte ---------- */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.period-btn { min-width: 170px; justify-content: space-between; color: var(--text); font-weight: 600; }
.period-btn .caret { font-size: 11px; color: var(--muted); }
.dropdown-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 250px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 28, 42, .12); padding: 6px; }
.dropdown-menu.right { left: auto; right: 0; }
.dropdown-menu > a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; color: var(--text); font-size: 13.5px; white-space: nowrap; }
.dropdown-menu > a:hover { background: var(--bg); }
.dropdown-menu > a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.dropdown-menu .range { border-top: 1px solid var(--line-soft); margin-top: 6px; padding: 10px 8px 6px; display: grid; gap: 8px; }
.dropdown-menu .range-title { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.dropdown-menu .range-row { display: flex; align-items: center; gap: 6px; }
.dropdown-menu .range-row input { padding: 6px 8px; font-size: 13px; }

.line-chart { position: relative; }
.line-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.lc-grid { stroke: var(--line-soft); stroke-width: 1; }
.lc-grid.lc-base { stroke: var(--line); }
.lc-y { font-size: 11.5px; fill: var(--faint); text-anchor: end; font-variant-numeric: tabular-nums; }
.lc-x { font-size: 12px; fill: var(--muted); text-anchor: middle; }
.lc-area { fill: var(--primary); fill-opacity: .07; }
.lc-line { fill: none; stroke: var(--primary); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.lc-dot { fill: #fff; stroke: var(--primary); stroke-width: 2.2; }
.lc-dot-hover { opacity: 0; }
.lc-hit { fill: transparent; }
.lc-pt { outline: none; cursor: default; }
.lc-pt:hover .lc-dot, .lc-pt:focus .lc-dot { fill: var(--primary); opacity: 1; }
.lc-pt:hover .lc-hit, .lc-pt:focus .lc-hit { fill: rgba(15, 124, 133, .05); }
.lc-closed { fill: #f3f5f7; }
.line-chart.is-empty .lc-line, .line-chart.is-empty .lc-area, .line-chart.is-empty .lc-dot { opacity: .35; }
.lc-empty { position: absolute; inset: 0 0 30px 48px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.chart-note { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; line-height: 1.5; }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hb-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.hb-head b { font-variant-numeric: tabular-nums; }
.hb-track { height: 7px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.hb-fill { height: 100%; border-radius: 99px; background: var(--primary); min-width: 3px; }
.occ { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.occ .hb-track { flex: 0 0 90px; }
.occ span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.cdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px;
  border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12.5px; }
.text-warn { color: var(--warning); }
.report-print-head { margin-bottom: 12px; font-size: 13px; }
@media print {
  .dropdown, .tabs { display: none !important; }
  .card { break-inside: avoid; }
  .grid-4 { grid-template-columns: repeat(4, 1fr) !important; }
}

/* ---------- Modul 8 – Prețuri pe site ---------- */
.subnav { display: flex; gap: 6px; margin: -6px 0 18px; flex-wrap: wrap; }
.subnav a { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid transparent; }
.subnav a:hover { color: var(--text); background: #fff; border-color: var(--line); }
.subnav a.active { background: #fff; color: var(--primary); border-color: var(--line); box-shadow: var(--shadow); }
.seg-pills { display: inline-flex; background: var(--bg); border-radius: 9px; padding: 3px; gap: 2px; }
.seg-pills a { padding: 4px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.seg-pills a.active { background: #fff; color: var(--primary); box-shadow: 0 1px 2px rgba(15, 28, 42, .08); }
.kpi .value.value-sm { font-size: 22px; margin: 10px 0 8px; }
.site-preview { padding-top: 6px; }
.sp-group + .sp-group { margin-top: 18px; }
.sp-group h3 { font-size: 15px; margin: 12px 0 6px; display: flex; align-items: center; gap: 8px; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sp-table td { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.sp-table td:last-child { text-align: right; font-weight: 700; white-space: nowrap; padding-left: 16px; font-variant-numeric: tabular-nums; }
.sp-table .badge { font-size: 10.5px; padding: 0 6px; }
.sp-note { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }
.publish-box p { margin: 0 0 12px; }
.publish-box .help { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.publish-box .btn { width: 100%; justify-content: center; }
.confirm-box { display: flex; gap: 10px; align-items: flex-start; background: var(--warning-bg); color: #78350f; border: 1px solid #f4dcb0;
  border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; cursor: pointer; }
.confirm-box input { margin-top: 2px; }
.changes-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 13.5px; }
.changes-list li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.changes-list .ch-val { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.changes-list s { color: var(--faint); }
.warn-list { list-style: none; margin: 0; padding: 4px 0; }
.warn-list li { display: flex; gap: 10px; padding: 9px 20px; font-size: 13px; align-items: flex-start; }
.warn-list li .icon { flex: none; margin-top: 1px; }
.warn-list li.danger .icon { color: var(--danger); }
.warn-list li.warning .icon { color: var(--warning); }
.method-list { display: grid; gap: 8px; }
.method-opt { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13.5px; }
.method-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.form-section { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 22px 0 10px; }
.inline-check { display: flex; gap: 6px; align-items: center; font-weight: 400 !important; font-size: 12.5px; margin-top: 8px; }
.help-text { font-size: 13px; color: var(--muted); line-height: 1.55; }
.help-text p { margin: 0 0 10px; }
.help-text p:last-child { margin-bottom: 0; }
.code-view { margin: 0; padding: 16px 20px; background: #0f2231; color: #d6e2ea; font-size: 12px; line-height: 1.55;
  overflow: auto; max-height: 420px; border-radius: 0 0 var(--radius) var(--radius); }
.code-view.small { border-radius: 10px; max-height: none; padding: 12px 14px; font-size: 11.5px; }
.steps { margin: 0 0 14px; padding-left: 20px; font-size: 13.5px; line-height: 1.7; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; background: var(--bg); padding: 1px 5px; border-radius: 5px; }
.code-view code, pre code { background: none; padding: 0; }
.alert.site-sync { display: flex; align-items: center; gap: 10px; }
.alert.site-sync .btn { margin-left: auto; }

/* ---------- Modul 9 – Stare sistem ---------- */
.health-list { list-style: none; margin: 0; padding: 0; }
.health-list li { display: flex; gap: 14px; align-items: flex-start; padding: 13px 20px; border-bottom: 1px solid var(--line-soft); }
.health-list li:last-child { border-bottom: 0; }
.health-list .h-main { flex: 1; min-width: 0; }
.health-list .h-main .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.health-list .h-fix { font-size: 12.5px; margin-top: 6px; color: var(--text); background: var(--bg); padding: 6px 10px; border-radius: 8px; }
.h-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--success); }
.h-atentie .h-dot { background: #f59e0b; }
.h-eroare .h-dot { background: var(--danger); }
.userbox .userbox-key { margin-left: auto; color: var(--sidebar-muted); padding: 4px; display: inline-flex; }
.userbox .userbox-key:hover { color: #fff; }
.radio-row { display: flex; gap: 18px; } .radio-row label { display: flex; gap: 6px; align-items: center; font-weight: 600; }
