/* Odontix · UI compacta y minimalista. Tema claro/oscuro con variables. Sin sombras ni brillos. */
:root {
  color-scheme: light;
  --bg: #f6f6f7; --surface: #fff; --surface-2: #f4f4f5; --surface-3: #ececee;
  --text: #18181b; --muted: #71717a; --border: #e4e4e7; --border-strong: #c9c9cf;
  --accent: #0f766e; --accent-soft: #ccfbf1;
  --btn-bg: #18181b; --btn-fg: #fff; --btn-hover: #3f3f46;
  --ok: #166534; --ok-bg: #f0fdf4; --ok-bd: #bbf7d0;
  --warn: #92400e; --warn-bg: #fffbeb; --warn-bd: #fde68a;
  --bad: #b91c1c; --bad-bg: #fef2f2; --bad-bd: #fecaca;
  --info: #1d4ed8; --info-bg: #eff6ff; --info-bd: #bfdbfe;
  --overlay: rgba(24, 24, 27, .45);
  --radius: 8px; --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0c0e; --surface: #141417; --surface-2: #1b1b1f; --surface-3: #25252a;
  --text: #ececef; --muted: #9a9aa4; --border: #26262b; --border-strong: #3a3a42;
  --accent: #2dd4bf; --accent-soft: #123a36;
  --btn-bg: #ececef; --btn-fg: #0c0c0e; --btn-hover: #d4d4d8;
  --ok: #86efac; --ok-bg: #10261a; --ok-bd: #1f4a30;
  --warn: #fcd34d; --warn-bg: #2a200a; --warn-bd: #5a4410;
  --bad: #fca5a5; --bad-bg: #2d1212; --bad-bd: #5c2222;
  --info: #93c5fd; --info-bg: #10203a; --info-bd: #234072;
  --overlay: rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 13.5px/1.45 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; } h3 { font-size: .95rem; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: .8rem; }
.error { color: var(--bad); font-size: .85rem; margin: .6rem 0 0; }
[hidden] { display: none !important; }
.cap1::first-letter { text-transform: uppercase; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }

/* Formularios */
label { display: block; margin-bottom: .75rem; font-size: .78rem; font-weight: 500; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .38rem .6rem; min-height: 32px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: .875rem; color: var(--text); background: var(--surface); transition: border-color .12s; }
textarea { min-height: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=checkbox] { display: inline-block; width: auto; min-height: 0; margin: 0 .4rem 0 0; accent-color: var(--accent); vertical-align: -2px; }
input[type=range] { padding: 0; min-height: 0; }
.check { font-weight: 400; display: flex; align-items: center; margin-bottom: .45rem; color: var(--text); font-size: .85rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bg); padding: 0 .8rem; height: 32px; border-radius: 6px; font: inherit; font-size: .85rem; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s; }
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-sm { height: 26px; padding: 0 .55rem; font-size: .78rem; }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--border); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad-bd); }

/* Autenticación */
.auth { display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; min-height: 100vh; }
.auth-aside { background: #121214; color: #fafafa; padding: 2.5rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside p { color: #a1a1aa; max-width: 36ch; margin: .6rem 0 0; }
.auth-aside ul { list-style: none; padding: 0; margin: 0; color: #d4d4d8; font-size: .85rem; }
.auth-aside li { padding: .55rem 0; border-top: 1px solid #2e2e33; }
.auth-aside h1 { font-size: 1.6rem; line-height: 1.2; max-width: 20ch; }
.auth-main { display: grid; place-items: center; padding: 2rem 1.25rem; position: relative; }
.auth-form { width: 100%; max-width: 340px; }
.auth-form h2 { font-size: 1.35rem; margin-bottom: .3rem; }
.auth-form > p { margin: 0 0 1.5rem; }
.auth-form .foot { margin-top: 1.25rem; font-size: .85rem; color: var(--muted); }
.auth-theme { font-size: 1rem; position: absolute; top: 1rem; right: 1rem; }
.field-pass { position: relative; }
.field-pass button { position: absolute; right: .5rem; bottom: .4rem; background: none; border: 0; color: var(--muted); font: inherit; font-size: .75rem; cursor: pointer; }
.wordmark { display: flex; align-items: center; gap: .55rem; font-weight: 600; font-size: .95rem; }
.wordmark i { width: 20px; height: 20px; border-radius: 6px; background: var(--accent); display: inline-block; flex: none; }

/* Shell */
.shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); grid-template-rows: 48px 1fr; min-height: 100vh; transition: grid-template-columns .18s; }
.shell.collapsed { grid-template-columns: 56px minmax(0, 1fr); }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: .9rem .6rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.shell .sidebar { grid-row: 1 / 3; }
.sidebar .wordmark { padding: 0 .5rem; margin-bottom: 1.1rem; height: 24px; }
.nav-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0 .55rem; margin: .9rem 0 .25rem; }
#nav a { display: flex; align-items: center; gap: .6rem; color: var(--muted); text-decoration: none; padding: .38rem .55rem; border-radius: 6px; font-weight: 500; font-size: .85rem; }
#nav a:hover { background: var(--surface-2); color: var(--text); }
#nav a.active { background: var(--surface-2); color: var(--text); }
#nav a.active svg { color: var(--accent); }
#nav a svg { flex: none; }
.shell.collapsed .wordmark span, .shell.collapsed .nav-label, .shell.collapsed #nav a span { display: none; }
.shell.collapsed .sidebar { padding: .9rem .4rem; }
.shell.collapsed .wordmark { justify-content: center; padding: 0; }
.shell.collapsed #nav a { justify-content: center; padding: .5rem 0; }
.shell.collapsed .nav-label { display: block; height: 1px; background: var(--border); margin: .6rem .5rem; padding: 0; font-size: 0; }
.shell.collapsed .nav-label:first-child { display: none; }
.sidebar-foot { margin-top: auto; padding: .7rem .4rem 0; border-top: 1px solid var(--border); font-size: .8rem; }
.sidebar-foot strong { display: block; font-weight: 500; }
.sidebar-foot button { margin-top: .5rem; }
.shell .sidebar-foot { display: none; }
.ico { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

.topbar { grid-column: 2; display: flex; align-items: center; gap: .5rem; padding: 0 1.1rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; min-width: 0; }
.content { padding: 1.1rem 1.4rem; min-width: 0; }
.shell > .content { grid-column: 2; }
.page { width: 100%; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 6px; width: 30px; height: 30px; display: inline-grid; place-items: center; color: var(--muted); cursor: pointer; position: relative; flex: none; }
.icon-btn:hover, .icon-btn[aria-expanded=true] { background: var(--surface-2); color: var(--text); }
.top-search { position: relative; flex: 0 1 300px; }
.top-search input { margin: 0; padding-left: 1.9rem; height: 30px; min-height: 30px; background: var(--surface-2); border-color: transparent; }
.top-search input:focus { background: var(--surface); border-color: var(--accent); }
.top-search .ico { position: absolute; left: .6rem; top: 7px; color: var(--muted); pointer-events: none; }
.top-spacer { flex: 1; }
.chip-btn { display: inline-flex; align-items: center; gap: .45rem; height: 30px; padding: 0 .65rem; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; font: inherit; font-size: .8rem; color: var(--text); cursor: pointer; white-space: nowrap; }
.chip-btn:hover, .chip-btn[aria-expanded=true] { background: var(--surface-2); }
.chip-btn.primary { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.chip-btn.primary:hover { background: var(--btn-hover); }
.dot-badge { position: absolute; top: 1px; right: 1px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px; background: #dc2626; color: #fff; font-size: .62rem; font-weight: 600; display: grid; place-items: center; }
.avatar { width: 28px; height: 28px; border-radius: 99px; background: var(--accent); color: var(--surface); display: grid; place-items: center; font-size: .72rem; font-weight: 600; border: 0; cursor: pointer; flex: none; }

.pop-anchor { position: relative; }
.popover { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; z-index: 40; overflow: hidden; }
.popover.left { left: 0; right: auto; }
.pop-head { padding: .55rem .85rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: .85rem; }
.pop-item { display: block; width: 100%; text-align: left; padding: .5rem .85rem; background: none; border: 0; font: inherit; font-size: .85rem; color: var(--text); text-decoration: none; cursor: pointer; border-bottom: 1px solid var(--border); }
.pop-item:last-child { border-bottom: 0; }
.pop-item:hover { background: var(--surface-2); }
.pop-item small { display: block; color: var(--muted); }
.pop-item.unread { background: var(--accent-soft); }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; font-size: .78rem; cursor: pointer; padding: 0; }
.notif-list { width: 320px; max-height: 380px; overflow-y: auto; }
.search-results { width: 100%; min-width: 280px; max-height: 320px; overflow-y: auto; }

/* Calendario */
.cal { width: 260px; padding: .6rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; font-weight: 600; }
.cal-head span::first-letter { text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-grid .dow { font-size: .65rem; color: var(--muted); padding: .25rem 0; }
.cal-day { aspect-ratio: 1; border: 0; background: none; border-radius: 6px; font: inherit; font-size: .8rem; cursor: pointer; position: relative; color: var(--text); }
.cal-day:hover { background: var(--surface-2); } .cal-day.out { color: var(--muted); opacity: .55; }
.cal-day.today { border: 1px solid var(--accent); }
.cal-day.has::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 99px; background: var(--accent); }

.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; z-index: 60; max-height: 220px; overflow-y: auto; margin-top: 2px; }
.picker-list button { display: block; width: 100%; text-align: left; padding: .4rem .65rem; border: 0; background: none; font: inherit; font-size: .85rem; color: var(--text); cursor: pointer; }
.picker-list button:hover { background: var(--surface-2); }

.toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .4rem; z-index: 100; }
.toast { display: flex; align-items: center; gap: .55rem; background: var(--btn-bg); color: var(--btn-fg); padding: .55rem .9rem .55rem .65rem; border-radius: 10px; font-size: .82rem; max-width: 340px; animation: dlg-in .18s ease-out; }
.toast-ico { width: 18px; height: 18px; border-radius: 99px; background: #16a34a; color: #fff; display: grid; place-items: center; font-size: .7rem; font-weight: 700; flex: none; }
.toast.err { background: #7f1d1d; color: #fff; } .toast.err .toast-ico { background: #dc2626; }

/* Contenedores y utilidades */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head p { margin: .15rem 0 0; font-size: .85rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1rem; margin-bottom: .85rem; }
.card > h3:first-child { margin-bottom: .6rem; }
.toolbar { display: flex; gap: .6rem; align-items: end; margin-bottom: .8rem; flex-wrap: wrap; }
.toolbar > label { flex: 1; margin: 0; min-width: 180px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .85rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 .85rem; }
.cols { display: grid; gap: .85rem; align-items: start; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-side { grid-template-columns: minmax(0, 1fr) 340px; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.empty { padding: 1.5rem; text-align: center; color: var(--muted); font-size: .85rem; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: .3rem .85rem; font-size: .85rem; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: .5rem 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.list-plain li:last-child { border-bottom: 0; }
.alert { padding: .55rem .8rem; border-radius: 8px; font-size: .85rem; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-bd); margin-bottom: .85rem; }
.alert.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-bd); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .65rem; margin-bottom: .9rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .7rem .9rem; }
.stat b { display: block; font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.stat span { color: var(--muted); font-size: .78rem; }
a.stat:hover { border-color: var(--border-strong); }
.bar { height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: .4rem; }
.bar > div { height: 100%; background: var(--accent); }

/* Tablas */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; margin-bottom: .85rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .45rem .8rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { font-size: .85rem; }
tr:last-child td { border-bottom: 0; }
th { font-size: .68rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); user-select: none; }
th.sortable { cursor: pointer; } th.sortable:hover { color: var(--text); }
th .arr { opacity: .8; margin-left: .2rem; }
td.actions { text-align: right; }
td.wrap { white-space: normal; min-width: 160px; }
tbody tr.click { cursor: pointer; } tbody tr.click:hover td { background: var(--surface-2); }
.tbl-tools { display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem; flex-wrap: wrap; }
.tbl-tools .search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.tbl-tools .search input { margin: 0; padding-left: 1.8rem; }
.tbl-tools .search .ico { position: absolute; left: .55rem; top: 8px; color: var(--muted); }
.tbl-foot { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; color: var(--muted); margin: -.35rem 0 .85rem; flex-wrap: wrap; gap: .5rem; }
.tbl-foot select { display: inline-block; width: auto; min-height: 26px; padding: .1rem .4rem; margin: 0 .3rem; }
.badge { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .72rem; font-weight: 500; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-bd); }
.badge.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-bd); }
.badge.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-bd); }
.badge.info { color: var(--info); background: var(--info-bg); border-color: var(--info-bd); }

/* Ventanas modales */
dialog { border: 1px solid var(--border-strong); border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 2rem)); background: var(--surface); color: var(--text); max-height: calc(100vh - 2rem); overflow: hidden; }
dialog[open] { animation: dlg-in .16s ease-out; }
dialog::backdrop { background: var(--overlay); backdrop-filter: blur(2px); animation: dlg-fade .16s ease-out; }
.dlg { display: flex; flex-direction: column; max-height: calc(100vh - 2rem); margin: 0; padding: 0 !important; overflow: visible !important; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 1.25rem .85rem; border-bottom: 1px solid var(--border); }
.dlg-head h3 { font-size: 1rem; margin: 0; }
.dlg-sub { margin: .2rem 0 0; font-size: .8rem; color: var(--muted); }
.dlg-body { padding: 1.1rem 1.25rem; overflow-y: auto; flex: 1; }
.dlg-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .75rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); }
.dlg-sm { width: min(400px, calc(100vw - 2rem)); }
.dlg-confirm { display: flex; gap: .9rem; align-items: flex-start; }
.dlg-confirm h3 { margin: 0 0 .25rem; } .dlg-confirm p { margin: 0; }
.dlg-ico { width: 34px; height: 34px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-bd); display: grid; place-items: center; font-weight: 700; flex: none; }
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(620px, 100vw); border-radius: 0; border-width: 0 0 0 1px; }
dialog.drawer[open] { animation: dlg-slide .2s ease-out; }
dialog.drawer .dlg { height: 100vh; max-height: 100vh; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes dlg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlg-slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog-actions { display: flex; justify-content: flex-end; gap: .45rem; margin-top: 1rem; }

/* Tabs / segmentado / leyendas */
.tabs-bar { display: flex; gap: .15rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs-bar button { background: none; border: 0; border-bottom: 2px solid transparent; padding: .5rem .8rem; font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tabs-bar button:hover { color: var(--text); }
.tabs-bar button.active { color: var(--text); border-color: var(--accent); font-weight: 500; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.segmented button { background: var(--surface); border: 0; padding: 0 .65rem; height: 28px; font: inherit; font-size: .8rem; cursor: pointer; color: var(--muted); }
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button.active { background: var(--btn-bg); color: var(--btn-fg); }
.legend { display: flex; gap: .9rem; font-size: .75rem; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: .3rem; }

/* Gráficos */
.hbar { display: flex; align-items: center; gap: .65rem; margin: .4rem 0; font-size: .8rem; }
.hbar .lbl { width: 130px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { flex: 1; height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.hbar .track > div { height: 100%; background: var(--accent); }
.hbar .val { width: 90px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.vbars { display: flex; align-items: flex-end; gap: .9rem; height: 170px; padding-top: .75rem; }
.vbars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; justify-content: flex-end; }
.vbars .pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.vbars .pair div { width: 40%; max-width: 28px; border-radius: 3px 3px 0 0; }
.vbars .in { background: var(--accent); } .vbars .out { background: var(--border-strong); }
.vbars small { color: var(--muted); font-size: .7rem; }

/* Agenda */
.agenda { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: auto; max-height: calc(100vh - 205px); }
.ag-head, .ag-body { display: grid; min-width: 640px; }
.ag-head { position: sticky; top: 0; background: var(--surface); z-index: 3; border-bottom: 1px solid var(--border); }
.ag-head > div { padding: .45rem .4rem; text-align: center; font-size: .8rem; font-weight: 500; border-left: 1px solid var(--border); }
.ag-head > div.today { color: var(--accent); } .ag-head > div small { display: block; color: var(--muted); font-weight: 400; }
.ag-times div { height: var(--row); font-size: .68rem; color: var(--muted); text-align: right; padding: 0 .45rem; transform: translateY(-.55em); }
.ag-col { position: relative; border-left: 1px solid var(--border); cursor: pointer; background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px); background-size: 100% var(--row); }
.ag-turno { position: absolute; left: 2px; right: 2px; border-radius: 5px; padding: .15rem .4rem; font-size: .74rem; overflow: hidden; background: var(--surface-2); border-left: 3px solid var(--muted); cursor: pointer; line-height: 1.25; color: var(--text); }
.ag-turno b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-turno.confirmado { background: var(--ok-bg); border-color: #16a34a; } .ag-turno.pendiente { background: var(--warn-bg); border-color: #d97706; }
.ag-turno.atendido { background: var(--info-bg); border-color: #2563eb; }
.ag-turno.cancelado, .ag-turno.ausente { background: var(--bad-bg); border-color: #dc2626; opacity: .7; text-decoration: line-through; }
.ag-now { position: absolute; left: 0; right: 0; height: 2px; background: #dc2626; z-index: 2; pointer-events: none; }

/* Odontograma */
.od-wrap { overflow-x: auto; }
.od-arch { display: flex; justify-content: center; gap: 3px; margin: .2rem 0; min-width: max-content; }
.od-arch.small-teeth { opacity: .95; }
.od-arch .gap { width: 12px; flex: none; border-left: 1px dashed var(--border-strong); margin: 0 3px; }
.od-label { text-align: center; font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: .35rem 0; }
.tooth { background: none; border: 1px solid transparent; border-radius: 8px; padding: 2px; cursor: pointer; color: var(--muted); font: inherit; font-size: .68rem; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tooth:hover { background: var(--surface-2); }
.tooth.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 600; }
.tooth svg { display: block; }
.t-face { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1; }
.t-face.hit { cursor: pointer; } .t-face.hit:hover { fill: var(--surface-3); }
.t-face.c-caries { fill: #ef4444; } .t-face.c-obturacion { fill: #3b82f6; } .t-face.c-fractura { fill: #f97316; }
.t-face.c-sellador { fill: #22c55e; } .t-face.c-desgaste { fill: #a78bfa; } .t-face.c-otro { fill: #94a3b8; }
.t-face.done { opacity: .5; }
.t-face.selface { stroke: var(--accent); stroke-width: 2; }
.t-ov { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.t-ov.c-extraccion { stroke: #ef4444; } .t-ov.c-ausente { stroke: #71717a; stroke-dasharray: 3 3; } .t-ov.c-corona { stroke: #eab308; stroke-width: 3; }
.t-ov.c-endodoncia { stroke: #a855f7; } .t-ov.c-implante { stroke: #14b8a6; } .t-ov.c-resto_radicular { stroke: #a16207; } .t-ov.c-protesis { stroke: #0ea5e9; }
.t-ov.c-movilidad { stroke: #f59e0b; } .t-ov.c-fractura { stroke: #f97316; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .75rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; height: 26px; padding: 0 .55rem; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text); font: inherit; font-size: .76rem; cursor: pointer; }
.chip:hover { border-color: var(--border-strong); } .chip.on { border-color: var(--accent); background: var(--accent-soft); }
.chip i { width: 9px; height: 9px; border-radius: 99px; display: inline-block; }

@media (max-width: 1100px) { .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-side { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; } .auth-aside { display: none; }
  .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); }
  .shell .sidebar { position: fixed; left: 0; top: 0; width: 230px; z-index: 50; transform: translateX(-100%); transition: transform .18s; }
  .shell.drawer .sidebar { transform: none; }
  .shell.collapsed .wordmark span, .shell.collapsed .nav-label, .shell.collapsed #nav a span { display: revert; }
  .shell.collapsed #nav a { justify-content: flex-start; padding: .38rem .55rem; }
  .shell.collapsed .nav-label { height: auto; background: none; margin: .9rem 0 .25rem; padding: 0 .55rem; font-size: .65rem; }
  .topbar { grid-column: 1; padding: 0 .6rem; } .shell > .content { grid-column: 1; }
  .top-search, .hide-sm { display: none; }
  .content { padding: .9rem .75rem; } .grid-2, .grid-3, .cols-2, .cols-3 { grid-template-columns: 1fr; }
}
/* Layout simple (panel maestro) */
.layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 100vh; }
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } .layout .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem; border-right: 0; border-bottom: 1px solid var(--border); } .layout .sidebar-foot { margin: 0 0 0 auto; border: 0; padding: 0; } .layout #nav { display: flex; } .layout .nav-label { display: none; } }
.layout .sidebar-foot { display: block; }

@media print {
  .sidebar, .topbar, .no-print, .tbl-tools, .tbl-foot { display: none !important; }
  .shell, .layout { display: block; } body { background: #fff; color: #000; } .content { padding: 0; }
}
#print-root { display: none; }
@media print {
  body.printing .shell, body.printing .layout, body.printing .toasts { display: none !important; }
  body.printing #print-root { display: block; }
  @page { margin: 14mm; }
}
