/* Sistemach Odonto — interface */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --accent: #0B7A75;
  --ink: #12262E;
  --ink-2: #33464D;
  --muted: #56676E;
  --line: #E1E8EA;
  --line-2: #EEF2F3;
  --bg: #F3F6F7;
  --card: #FFFFFF;
  --side: #0F2A33;
  --side-2: #1B4A57;
  --ok-bg: #E3F3F1; --ok: #0B5753;
  --warn-bg: #FEF3E2; --warn: #8A4108;
  --danger-bg: #FDECEA; --danger: #8A1C12;
  --info-bg: #EAF0FB; --info: #1D4A9E;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 42, 51, .05), 0 8px 24px rgba(15, 42, 51, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 14px; color: var(--ink); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: 0; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.bold { font-weight: 700; }
.mt { margin-top: 16px; } .mt-sm { margin-top: 8px; } .mb { margin-bottom: 16px; }
.ic { flex: none; }
.text-ok { color: var(--ok); } .text-danger { color: #B42318; } .text-warn { color: var(--warn); }
hr { border: 0; border-top: 1px solid var(--line-2); margin: 16px 0; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: none; background: var(--side); color: #CFE0E4; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand b { display: block; font-size: 14px; color: #fff; line-height: 1.2; }
.brand small { display: block; font-size: 11.5px; color: #9FB8BF; }
.brand-logo { width: 38px; height: 38px; object-fit: contain; border-radius: 10px; background: #fff; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: #2DD4BF; color: var(--side); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.brand-mark.lg { width: 56px; height: 56px; border-radius: 16px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: #CFE0E4; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.on { background: var(--side-2); color: #fff; font-weight: 600; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 6px; border-top: 1px solid #23505D; padding-top: 14px; }
.side-user-link { display: flex; align-items: center; gap: 10px; color: #fff; flex: 1; min-width: 0; padding: 4px; border-radius: 8px; }
.side-user-link:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.side-user-link b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-link small { display: block; font-size: 11.5px; color: #9FB8BF; }
.side-out { color: #9FB8BF; padding: 8px; border-radius: 8px; display: inline-flex; }
.side-out:hover { color: #fff; background: rgba(255,255,255,.08); }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(243,246,247,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.main { padding: 24px 28px 48px; max-width: 1480px; width: 100%; margin: 0 auto; }
.backdrop { display: none; }
.only-mobile { display: none !important; }

.gsearch { position: relative; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #DCE4E7; border-radius: 10px; padding: 0 12px; height: 42px; width: min(440px, 100%); color: var(--muted); }
.gsearch input { border: 0; outline: 0; font: inherit; flex: 1; background: transparent; min-width: 0; color: var(--ink); }
.gsearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.gsearch-results { position: absolute; top: 46px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 420px; overflow: auto; z-index: 50; }
.gsearch-results a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.gsearch-results a:hover, .gsearch-results a.hl { background: var(--bg); text-decoration: none; }
.gsearch-results .empty-res { padding: 14px; color: var(--muted); }

/* ---------- Page ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-head p { margin-top: 3px; font-size: 13.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 20px 0; }
.grid { display: grid; gap: 18px; }
.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)); }
.cols { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.col-main { flex: 2 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.col-main > .card + .card, .col-side > .card + .card, .grid > .card + .card { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: block; color: inherit; }
a.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi .lbl { font-size: 12.5px; color: var(--muted); }
.kpi .num { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; }
.kpi .sub { font-size: 12.5px; margin-top: 2px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid #DCE4E7; background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s; }
.btn:hover { background: #F7FAFA; border-color: #C9D5D9; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); border-color: transparent; }
.btn-danger { background: var(--danger-bg); border-color: #F3C6C1; color: var(--danger); }
.btn-danger:hover { background: #FBDCD8; }
.btn-wa { background: #E8F6EE; border-color: #BFE3D0; color: #146C3E; }
.btn-wa:hover { background: #D6F0E1; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(15,42,51,.05); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 48px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #DCE4E7; background: #fff; border-radius: 10px; cursor: pointer; color: var(--ink); }
.link { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
form.inline { display: inline; }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #E7ECEE; color: var(--ink-2); }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-danger { background: var(--danger-bg); color: var(--danger); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-muted { background: #E7ECEE; color: var(--ink-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: #D7EEEB; color: var(--ok); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; color: #0F2A33; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }

/* ---------- Flash ---------- */
[data-keep] { opacity: 1 !important; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; background: var(--ok-bg); color: var(--ok); border: 1px solid #C6E6E1; }
.flash-danger { background: var(--danger-bg); color: var(--danger); border-color: #F3C6C1; }
.flash-warn { background: var(--warn-bg); color: var(--warn); border-color: #F6DDB4; }
.flash-info { background: var(--info-bg); color: var(--info); border-color: #CCDAF5; }
.alert-box { padding: 12px 14px; border-radius: 10px; font-size: 13.5px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 500; min-width: 0; }
.field input, .field select, .field textarea, .inp { height: 42px; border: 1px solid #D5DFE2; border-radius: 10px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--ink); background: #fff; width: 100%; font-weight: 400; }
.field textarea, textarea.inp { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.field.req > span:first-child::after { content: ' *'; color: #B42318; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; } .s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s9 { grid-column: span 9; } .s12 { grid-column: span 12; }
.form-section { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; grid-column: span 12; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.pass-wrap { position: relative; display: block; }
.pass-wrap .link { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 150px; }
.seg { display: inline-flex; background: #E4EBED; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { height: 34px; padding: 0 13px; border-radius: 8px; display: inline-flex; align-items: center; color: var(--ink-2); font-weight: 500; font-size: 13px; border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.seg a:hover { text-decoration: none; background: rgba(255,255,255,.5); }
.seg .on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFCFC; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: #F8FBFB; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 700; background: #FAFCFC; border-top: 1px solid var(--line); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.pager { display: flex; gap: 4px; align-items: center; justify-content: flex-end; padding: 14px 0 0; flex-wrap: wrap; }
.pager a, .pager span.on { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line); color: var(--ink); }
.pager span.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.pager .muted { margin-left: 10px; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line-2); }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item b { display: block; }
.notice { display: block; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; color: inherit; }
a.notice:hover { text-decoration: none; filter: brightness(.97); }
.notice b { display: block; }
.notice.danger { background: var(--danger-bg); color: var(--danger); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.info { background: var(--info-bg); color: var(--info); }
.timeline { display: flex; flex-direction: column; gap: 14px; }
.tl-item { padding-left: 14px; border-left: 2px solid #CFE3E1; }
.tl-item.first { border-left-color: var(--accent); }
.tl-item .meta { font-size: 12.5px; color: var(--muted); }
.tl-item .txt { margin-top: 3px; white-space: pre-wrap; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid #DCE4E7; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; font-weight: 500; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.tabs .count { background: #E7ECEE; color: var(--ink-2); border-radius: 999px; padding: 1px 7px; font-size: 11px; margin-left: 4px; }

/* ---------- Patient header ---------- */
.pac-head { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.pac-head .info { flex: 1 1 280px; min-width: 0; }
.pac-head h1 { font-size: 22px; }
.pac-head .meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.pac-head .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 18px; font-size: 13.5px; }
.dl div span { display: block; font-size: 12px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(15,42,51,.45); display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow-y: auto; }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 16px; width: min(560px, 100%); padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); position: relative; }
.modal-box.wide { width: min(820px, 100%); }
.modal-box h2 { margin-bottom: 14px; padding-right: 30px; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--muted); }
.modal-close:hover { background: var(--bg); }

/* ---------- Agenda ---------- */
.agenda-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.agenda-grid { display: grid; min-width: 100%; }
.ag-head { position: sticky; top: 0; background: #fff; z-index: 2; padding: 12px 14px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-2); display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.ag-head small { color: var(--muted); font-weight: 400; }
.ag-times { position: relative; }
.ag-time { font-size: 11.5px; color: var(--muted); text-align: right; padding: 3px 8px 0 0; box-sizing: border-box; }
.ag-col { position: relative; border-left: 1px solid var(--line-2); }
.ag-slot { display: block; border-bottom: 1px solid var(--line-2); cursor: pointer; width: 100%; background: transparent; border-left: 0; border-right: 0; border-top: 0; padding: 0; }
.ag-slot:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.ag-slot.hour { border-bottom-color: #E3EAEC; }
.ag-ev { position: absolute; left: 5px; right: 5px; border-radius: 8px; padding: 5px 9px; overflow: hidden; font-size: 12.5px; cursor: pointer; border-left: 4px solid; box-shadow: 0 1px 2px rgba(0,0,0,.06); text-align: left; font-family: inherit; color: var(--ink); border-top: 0; border-right: 0; border-bottom: 0; }
.ag-ev:hover { filter: brightness(.97); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.ag-ev b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev span { display: block; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.ag-ev .warn-ic { color: #B42318; font-weight: 800; display: inline; }
.ag-block { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg, #F1F4F5, #F1F4F5 6px, #E7ECEE 6px, #E7ECEE 12px); color: var(--muted); font-size: 12px; padding: 6px 8px; z-index: 1; }
.ag-now { position: absolute; left: 0; right: 0; height: 2px; background: #E5484D; z-index: 3; pointer-events: none; }
.ag-now::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #E5484D; }
.week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.week-day { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 180px; }
.week-day.today { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.week-day h4 { font-size: 13px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.week-ev { display: block; padding: 6px 8px; border-radius: 7px; margin-bottom: 6px; font-size: 12px; border-left: 3px solid; color: var(--ink); }
.week-ev:hover { text-decoration: none; filter: brightness(.97); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month .mh { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding: 4px; }
.month a.md { background: #fff; border: 1px solid var(--line); border-radius: 10px; min-height: 84px; padding: 8px; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.month a.md:hover { border-color: var(--accent); text-decoration: none; }
.month a.md.out { opacity: .45; }
.month a.md.today { border-color: var(--accent); }
.month .md .n { font-weight: 700; }
.month .md .c { font-size: 12px; color: var(--ok); background: var(--ok-bg); border-radius: 6px; padding: 2px 6px; align-self: flex-start; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- Odontograma ---------- */
.odonto-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.odonto-tools button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid #DCE4E7; background: #fff; font: inherit; font-size: 12.5px; cursor: pointer; }
.odonto-tools button i { width: 13px; height: 13px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); display: inline-block; }
.odonto-tools button.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; font-weight: 700; }
.odonto { overflow-x: auto; padding-bottom: 6px; }
.arch { display: grid; grid-template-columns: repeat(16, minmax(34px, 1fr)); gap: 3px; min-width: 600px; }
.arch.dec { grid-template-columns: repeat(10, minmax(34px, 1fr)); min-width: 380px; max-width: 620px; margin: 0 auto; }
.arch-sep { height: 1px; background: #DCE4E7; margin: 8px 0; min-width: 600px; }
.arch-lbl { text-align: center; font-size: 11.5px; color: var(--muted); margin: 4px 0; min-width: 600px; }
.tooth { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 0; border-radius: 8px; cursor: pointer; border: 2px solid transparent; background: transparent; font: inherit; }
.tooth:hover { background: var(--bg); }
.tooth.sel { background: var(--ok-bg); border-color: var(--accent); }
.tooth .tn { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.tooth svg { width: 100%; max-width: 40px; height: auto; aspect-ratio: 1; display: block; }
.tooth svg .f { stroke: #8FA3A9; stroke-width: 1; cursor: pointer; transition: opacity .1s; }
.tooth svg .f:hover { opacity: .75; }
.tooth .tag { font-size: 9.5px; font-weight: 700; padding: 1px 4px; border-radius: 4px; color: #fff; min-height: 14px; line-height: 12px; }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar .b { width: 100%; border-radius: 6px 6px 0 0; background: #CFE3E1; min-height: 2px; position: relative; }
.bar .b.on { background: var(--accent); }
.bar .b:hover::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -4px); background: var(--ink); color: #fff; font-size: 11px; padding: 3px 6px; border-radius: 5px; white-space: nowrap; }
.bar small { font-size: 11.5px; color: var(--muted); }
.hbar { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ---------- Signature ---------- */
.sig-pad { border: 1.5px dashed #9FB3B9; border-radius: 12px; background: #FCFDFD; touch-action: none; width: 100%; height: 180px; display: block; cursor: crosshair; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery .g-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.gallery .g-thumb { aspect-ratio: 4/3; background: #EEF2F3 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; }
.gallery .g-info { padding: 8px 10px; font-size: 12px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 600px at 10% -10%, #D7EEEB 0, transparent 60%), var(--bg); }
.auth-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.auth-brand { text-align: center; margin-bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.auth-brand h1 { font-size: 22px; }
.auth-foot { text-align: center; font-size: 12px; margin-top: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .only-mobile { display: inline-flex !important; }
  .hide-sm { display: none !important; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 10px 0 40px rgba(0,0,0,.2); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .topbar { padding: 10px 14px; }
  .main { padding: 18px 14px 40px; }
  .form-grid > * { grid-column: span 12 !important; }
  .g2, .g3 { grid-template-columns: 1fr; }
  h1 { font-size: 21px; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .num { font-size: 21px; }
  .card { padding: 16px; }
}
@media print {
  .sidebar, .topbar, .no-print, .actions, .tabs, .flash { display: none !important; }
  .main { padding: 0; }
  .card { border: 0; padding: 0; }
  body { background: #fff; }
}
