/* Clínica NOE v2 · estilos del módulo admin (consultorios del super admin + Ajustes) */

/* ---------- Comunes ---------- */
.adm-wrap { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.adm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kpi-icon.warn { background: var(--warn-bg); color: var(--warn); }
.kpi-icon.ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Lista de consultorios ---------- */
.adm-kpis { margin-bottom: 24px; }
.adm-kpi-text { font-size: clamp(1.5rem, 2.6vw, 1.9rem); }
.adm-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.adm-card.is-suspended { background: linear-gradient(var(--alert-bg), var(--surface) 70%); }
.adm-card-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.adm-card-icon { width: 48px; height: 48px; border-radius: 15px; flex: none; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); }
[data-theme="dark"] .adm-card-icon { color: var(--brand-400); }
.adm-card.is-suspended .adm-card-icon { background: var(--alert-bg); color: var(--alert); }
.adm-card-name { font-weight: 800; font-size: 1.05rem; }

/* ---------- Detalle de consultorio ---------- */
.adm-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.adm-aside { --gap: 20px; min-width: 0; }
.adm-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adm-metrics > div { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
@media (max-width: 1100px) { .adm-layout { grid-template-columns: 1fr; } }

/* ---------- Credencial temporal ---------- */
.cred-box { border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); padding: 6px 16px; }
.cred-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; }
.cred-row + .cred-row { border-top: 1px solid var(--border); }
.cred-label { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cred-value { font-weight: 800; font-size: 1.05rem; overflow-wrap: anywhere; user-select: all; }
.cred-url { font-weight: 600; font-size: .88rem; color: var(--text-2); }
.cred-pass { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.3rem; letter-spacing: .04em; color: var(--brand-700); }
[data-theme="dark"] .cred-pass { color: var(--brand-400); }
.cred-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
.cred-actions .btn { width: 100%; }

/* ---------- Ajustes · Consultorio ---------- */
.set-account .form-section + .form-section { margin-top: 18px; }
.set-asset { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.set-asset-preview { position: relative; height: 150px; border-radius: var(--radius); border: 1.5px dashed var(--border-strong); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; padding: 12px; }
.set-asset-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.set-asset-preview.is-signature { background: #fff; }
.set-asset-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.set-asset-spinner { display: none; position: absolute; color: var(--brand-500); }
.set-asset.is-busy .set-asset-spinner { display: block; }
.set-asset.is-busy img { opacity: .35; }
.set-file-btn { cursor: pointer; min-height: 44px; }
.set-file-btn:focus-within { box-shadow: var(--ring); }
.set-asset .btn-sm { min-height: 44px; }

.set-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.set-var { border: 0; cursor: pointer; height: 36px; font-family: inherit; }
.set-var:hover { filter: brightness(.96); }
.set-var:focus-visible { box-shadow: var(--ring); }
.set-wa-preview { margin-top: 16px; }
.set-wa-bubble {
  max-width: 520px; padding: 12px 14px; border-radius: 16px 16px 16px 4px;
  background: #dcf8c6; color: #10261a; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; box-shadow: var(--shadow-xs);
}
[data-theme="dark"] .set-wa-bubble { background: #144d37; color: #e7fbe9; }

.set-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.set-steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); }
.set-step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); font-weight: 800; font-size: .85rem; }
.set-copy-row { display: flex; gap: 10px; min-width: 0; }
.set-copy-row .input { flex: 1; min-width: 0; font-size: .9rem; }
@media (max-width: 520px) { .set-copy-row { flex-direction: column; } }

.set-switch-row { display: flex; align-items: center; gap: 14px; padding: 14px 0 0; margin-top: 16px; border-top: 1px solid var(--border); cursor: pointer; min-height: 44px; }
.form-grid > .set-switch-row { margin-top: 0; }

/* ---------- Ajustes · Equipo ---------- */
.set-member { flex-wrap: wrap; align-items: flex-start; }
.set-member.is-inactive .avatar { filter: grayscale(1); opacity: .6; }
.set-member .list-item-main { flex: 1 1 240px; }
.set-member-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.set-member-actions .btn { min-height: 44px; }
@media (max-width: 600px) { .set-member-actions { width: 100%; margin-left: 62px; } }

.set-perms-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 24px 0 12px; padding-top: 18px; border-top: 1px solid var(--border); }
.set-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.set-presets .btn { min-height: 40px; }
.set-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.set-perm { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; transition: border-color var(--dur), background var(--dur); }
.set-perm .switch { margin-top: 2px; }
.set-perm:has(input:checked) { border-color: var(--brand-200); background: var(--brand-50); }
[data-theme="dark"] .set-perm:has(input:checked) { border-color: var(--border-strong); background: var(--surface-3); }
.set-perm:focus-within { box-shadow: var(--ring); }
