/* =============================================================
   TeleMed · estilos base compartidos (tokens, botones, formularios,
   modales). Los colores de marca vienen de la apariencia configurada
   en la consola (variables --primario, --secundario, ...).
   ============================================================= */
:root {
	--primario: #0b4fa8;
	--secundario: #1d8fe1;
	--acento: #16a34a;
	--fondo: #eaf2fb;
	--texto: #10233f;
	--texto-2: #50607a;
	--borde: #d5dfec;
	--superficie: #ffffff;
	--peligro: #c62828;
	--aviso: #b45309;
	--ok: #15803d;
	--radio: 16px;
	--sombra: 0 10px 30px rgba(16, 35, 63, .10);
	--fuente: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--fuente); color: var(--texto); background: var(--fondo); line-height: 1.45; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primario); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--secundario) 70%, white); outline-offset: 2px; }
.solo-lector { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .65em 1.2em; border-radius: 12px;
	border: 1.5px solid var(--borde); background: var(--superficie); cursor: pointer; font-weight: 600; text-decoration: none;
	color: var(--texto); transition: transform .08s, filter .15s, background .15s; min-height: 44px; }
.btn:hover { filter: brightness(.97); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primario { background: var(--primario); border-color: var(--primario); color: #fff; }
.btn-primario:hover { filter: brightness(1.08); }
.btn-ok { background: var(--acento); border-color: var(--acento); color: #fff; }
.btn-peligro { background: var(--peligro); border-color: var(--peligro); color: #fff; }
.btn-claro { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.35); color: #fff; }
.btn-chico { min-height: 34px; padding: .35em .8em; font-size: .9em; border-radius: 10px; }
.btn-icono { border: 0; background: transparent; cursor: pointer; padding: 8px; border-radius: 10px; font-size: 1.1em; line-height: 1; color: inherit; }
.btn-icono:hover { background: rgba(0,0,0,.06); }

/* ---------- formularios ---------- */
.campo { display: grid; gap: 6px; font-weight: 600; font-size: .95em; }
.campo input, .campo select, .campo textarea, input.ctrl, select.ctrl, textarea.ctrl {
	width: 100%; padding: .7em .85em; border: 1.5px solid var(--borde); border-radius: 12px; background: #fff; font-weight: 400; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .ctrl:focus { border-color: var(--primario); outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--primario) 18%, transparent); }
.campo small { font-weight: 400; color: var(--texto-2); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95em; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--primario); flex: none; }
.rejilla { display: grid; gap: 14px; }
.rejilla-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- tarjetas y etiquetas ---------- */
.tarjeta { background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); padding: 20px; }
.etiqueta { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .8em; font-weight: 700;
	background: #e8eef7; color: #33476a; white-space: nowrap; }
.etiqueta.ok { background: #dcfce7; color: #166534; }
.etiqueta.aviso { background: #fef3c7; color: #92400e; }
.etiqueta.error { background: #fee2e2; color: #991b1b; }
.etiqueta.info { background: #dbeafe; color: #1e40af; }
.etiqueta.gris { background: #eef1f5; color: #5b6576; }
.punto { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #9aa6b8; }
.punto.DISPONIBLE { background: #16a34a; } .punto.EN_CONSULTA { background: #d97706; } .punto.PAUSA { background: #6366f1; } .punto.DESCONECTADO { background: #9aa6b8; }

/* ---------- avatar ---------- */
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center;
	color: #fff; font-weight: 700; font-size: 20px; background: #c9d6e8; }

/* ---------- modal ---------- */
.modal-velo { position: fixed; inset: 0; background: rgba(10, 24, 46, .5); display: grid; place-items: center; padding: 16px; z-index: 1000; }
.modal { background: #fff; border-radius: 18px; width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column;
	box-shadow: 0 30px 70px rgba(0,0,0,.3); }
.modal-ancho { width: min(860px, 100%); }
.modal-cab { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--borde); }
.modal-cab h2 { margin: 0; font-size: 1.15em; }
.modal-cuerpo { padding: 18px 20px; overflow: auto; }
.modal-pie { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--borde); flex-wrap: wrap; }

.vacio { text-align: center; color: var(--texto-2); padding: 28px 12px; }
.cargando { color: var(--texto-2); padding: 20px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
[tabindex="-1"]:focus { outline: none; }
