/* =====================================================================
   CONDO · Design system responsive (mobile-first)
   Sin dependencias externas: funciona offline como PWA.
   ===================================================================== */
:root {
  --primary: #2563eb;
  --secondary: #0f172a;
  --accent: #22c55e;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0284c7;
  --success: #16a34a;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, .18);
  --topbar-h: 58px;
  --sidebar-w: 248px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111a2e;
  --text: #e6edf7;
  --muted: #94a3b8;
  --border: #22304a;
  --secondary: #e6edf7;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

/*
 * CONTROL DE DESBORDE HORIZONTAL (móvil).
 *
 * Cualquier contenido intratable (URL largas, números, códigos) rompe y se
 * corta; los grids/flex internos no pueden forzar el ancho de su contenedor
 * (min-width: 0 en los hijos de grid). La vista nunca supera el ancho de
 * pantalla: lo que no cabe se desplaza internamente (tablas) o se corta.
 */
html, body { overflow-x: clip; }
.view { overflow-x: clip; }
.card, .stat, .list-item, .modal { min-width: 0; max-width: 100%; }
.view > * { min-width: 0; }
.view .card > *, .view .split > *, .view .cards-grid > * { min-width: 0; }
.rich-content, .rich-preview, td, th, .stat-hint, .badge, .chip, code, pre { overflow-wrap: anywhere; word-break: break-word; }
/* Los SVG/iconos de tamaño fijo no fuerzan el ancho */
svg { max-width: 100%; height: auto; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); }
h2 { font-size: clamp(1.15rem, 1.9vw, 1.35rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
small, .text-sm { font-size: .82rem; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.nowrap { white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--primary); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

/* ------------------------------ Layout ------------------------------ */
.app-shell { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: .5rem;
  padding: 0 .75rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 700; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 30px; width: auto; border-radius: 6px; object-fit: contain; }
.brand-badge {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--secondary)));
  color: #fff; font-weight: 800; font-size: .95rem;
}
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.live-clock {
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: .82rem;
  padding: .3rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary); white-space: nowrap;
}
@media (max-width: 620px) { .live-clock { display: none; } }

.btn-icon {
  position: relative; display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--text); cursor: pointer;
}
.btn-icon:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.btn-icon .badge-count {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700;
  display: grid; place-items: center;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
  background: var(--primary); color: #fff; font-weight: 700; cursor: pointer;
}

.sidebar {
  position: fixed; inset: var(--topbar-h) auto 0 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  padding: .9rem .7rem 2rem; overflow-y: auto; z-index: 35;
  transform: translateX(-100%); transition: transform .22s ease;
}
.sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 34; }
.sidebar-group { margin-bottom: .85rem; }
.sidebar-title {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  font-weight: 700; padding: .35rem .6rem; margin: 0;
}
/* Sección colapsable: el título es un botón con flecha */
.sidebar-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  background: none; border: 0; cursor: pointer; border-radius: 8px; font: inherit;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700;
  padding: .4rem .6rem; text-align: left;
}
.sidebar-toggle:hover { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
.sidebar-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.sidebar-toggle-icon { font-size: .8rem; line-height: 1; opacity: .8; }
.sidebar-group.is-collapsed { margin-bottom: .5rem; }
.sidebar-group.is-collapsed .sidebar-toggle { opacity: .85; }
.sidebar-group-items[hidden] { display: none; }
.sidebar-link {
  display: flex; align-items: center; gap: .65rem; padding: .58rem .65rem; border-radius: 10px;
  color: var(--text); font-weight: 500; font-size: .92rem; margin-bottom: 1px;
}
.sidebar-link:hover { background: color-mix(in srgb, var(--text) 5%, transparent); text-decoration: none; }
.sidebar-link[aria-current="page"] { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-weight: 600; }
.sidebar-link svg { flex: 0 0 20px; }
.sidebar-footer { border-top: 1px solid var(--border); margin-top: .8rem; padding-top: .6rem; }

.main { padding: .9rem .9rem calc(84px + var(--safe-bottom)); min-height: calc(100dvh - var(--topbar-h)); max-width: 100vw; overflow-x: clip; }
.view { max-width: 1320px; margin: 0 auto; width: 100%; }

/* En móvil ninguna rejilla fija anchos: todo apila a una columna */
@media (max-width: 700px) {
  .cards-grid, .split, .split-equal, .split-chat, .roles-layout { grid-template-columns: 1fr !important; }
  .form-grid { grid-template-columns: 1fr !important; }
  .form-grid .span-2, .form-grid .span-all { grid-column: 1 / -1; }
  .chat-layout { grid-template-columns: 1fr !important; }
  /* Los elementos con ancho fijo inline (imagenes, barras) no desbordan */
  .view img, .view video, .view iframe { max-width: 100%; }
}

@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .sidebar-backdrop { display: none !important; }
  .main { margin-left: var(--sidebar-w); padding: 1.4rem 1.6rem 2.4rem; }
  #btn-menu { display: none; }
}

/* ---------------------------- Componentes --------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.breadcrumb { font-size: .82rem; color: var(--muted); width: 100%; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1rem;
}
.card + .card { margin-top: 1rem; }
.card-header { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; }
.card-header .actions { margin-left: auto; display: flex; gap: .4rem; flex-wrap: wrap; }
.card-flush { padding: 0; overflow: hidden; }

.cards-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1rem; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-label { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 800; letter-spacing: -.02em; margin: .15rem 0; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: .8rem; color: var(--muted); }
.stat-icon { position: absolute; top: .8rem; right: .8rem; opacity: .85; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; }
.stat.accent-primary .stat-icon { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.stat.accent-success .stat-icon { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.stat.accent-danger .stat-icon { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.stat.accent-warning .stat-icon { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: .5rem .95rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .9rem; cursor: pointer; transition: transform .08s ease, background .15s;
  text-decoration: none !important; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.btn-sm { min-height: 32px; padding: .25rem .6rem; font-size: .8rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-sos {
  background: radial-gradient(circle at 30% 20%, #ff6b6b, #dc2626 60%, #991b1b);
  color: #fff; border: none; font-weight: 800; letter-spacing: .04em;
  box-shadow: 0 8px 24px rgba(220, 38, 38, .45);
  animation: sosPulse 2.2s infinite;
}
@keyframes sosPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(220, 38, 38, .45); }
  50% { box-shadow: 0 8px 40px rgba(220, 38, 38, .75); }
}

.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px;
  font-size: .74rem; font-weight: 700; border: 1px solid transparent;
  background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--muted);
}
.badge-success, .badge-activo, .badge-pagada, .badge-pagado, .badge-aprobada, .badge-confirmada, .badge-resuelto, .badge-operativo { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.badge-danger, .badge-en_mora, .badge-vencido, .badge-rechazada, .badge-rechazado, .badge-activa, .badge-critica, .badge-alta, .badge-urgente { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.badge-warning, .badge-pendiente, .badge-parcial, .badge-programado, .badge-en_proceso, .badge-en_revision, .badge-borrador, .badge-media { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
.badge-info, .badge-abierto, .badge-convocada, .badge-en_curso, .badge-completada { background: color-mix(in srgb, var(--info) 13%, transparent); color: var(--info); }
.badge-primary, .badge-admin { background: color-mix(in srgb, var(--primary) 13%, transparent); color: var(--primary); }
.badge-baja, .badge-cerrado, .badge-archivado, .badge-inactivo, .badge-cancelada, .badge-anulada, .badge-expirada { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); }

.alert {
  display: flex; gap: .7rem; align-items: flex-start; padding: .8rem .95rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); font-size: .9rem;
}
.alert-warning { border-color: color-mix(in srgb, var(--warning) 35%, transparent); background: color-mix(in srgb, var(--warning) 8%, var(--surface)); }
.alert-danger { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.alert-success { border-color: color-mix(in srgb, var(--success) 35%, transparent); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.alert-info { border-color: color-mix(in srgb, var(--info) 30%, transparent); background: color-mix(in srgb, var(--info) 7%, var(--surface)); }

/* Formularios */
.form-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (min-width: 900px) { .form-grid .span-2 { grid-column: span 2; } }
/* Ocupa SIEMPRE todas las columnas (mapas, editores de texto enriquecido) */
.form-grid .span-all { grid-column: 1 / -1 !important; min-width: 0; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field label, .field > .label { font-weight: 600; font-size: .84rem; }
.field .hint { font-size: .76rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: .55rem .7rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); outline: none;
}
.textarea { min-height: 110px; resize: vertical; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.checkbox { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--primary); }
.switch { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--border); transition: background .18s; flex: 0 0 auto; }
.switch .track::after { content: ""; display: block; width: 18px; height: 18px; margin: 3px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--success); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.segmented { display: inline-flex; padding: 3px; background: color-mix(in srgb, var(--text) 6%, transparent); border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: .35rem .8rem; border-radius: 8px; font-weight: 600; font-size: .85rem; cursor: pointer; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Editor de texto enriquecido (Quill) */
.rich-editor-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.rich-editor-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.rich-editor-wrap .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--text) 2.5%, var(--surface)); flex-wrap: wrap; }
.rich-editor-wrap .ql-container.ql-snow { border: 0; font-family: var(--font); font-size: .95rem; min-height: 150px; }
.rich-editor-wrap .ql-editor { min-height: 150px; line-height: 1.6; }
.rich-editor-wrap .ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }
.rich-editor-wrap .ql-snow .ql-stroke { stroke: var(--text); }
.rich-editor-wrap .ql-snow .ql-fill { fill: var(--text); }
.rich-editor-wrap .ql-snow .ql-picker { color: var(--text); }
.rich-editor-wrap .ql-picker-options { background: var(--surface) !important; border-color: var(--border) !important; }
@media (max-width: 640px) {
  .rich-editor-wrap .ql-toolbar.ql-snow .ql-formats { margin-right: 6px; }
  .rich-editor-wrap .ql-snow .ql-picker.ql-font, .rich-editor-wrap .ql-snow .ql-picker.ql-size { width: 78px; }
}
.rich-fallback textarea { min-height: 170px; font-family: var(--font); }
.rich-toolbar-native { display: flex; flex-wrap: wrap; gap: .25rem; padding: .4rem; border-bottom: 1px solid var(--border); }
.rich-toolbar-native button { min-height: 30px; min-width: 32px; border: 1px solid var(--border); background: var(--surface); border-radius: 7px; cursor: pointer; font-size: .8rem; }

/* Contenido enriquecido renderizado (seguro, responsive) */
.rich-content { font-size: .95rem; line-height: 1.65; overflow-wrap: anywhere; }
.rich-content > :first-child { margin-top: 0; }
.rich-content > :last-child { margin-bottom: 0; }
.rich-content img { max-width: 100%; height: auto; border-radius: 8px; }
.rich-content ul, .rich-content ol { padding-left: 1.3rem; }
.rich-content blockquote { border-left: 3px solid var(--primary); margin: .6rem 0; padding: .2rem 0 .2rem .8rem; color: var(--muted); }
.rich-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.rich-content td, .rich-content th { border: 1px solid var(--border); padding: .35rem .5rem; }
.rich-content .ql-font-serif { font-family: var(--font-serif); }
.rich-content .ql-font-monospace { font-family: ui-monospace, Consolas, monospace; }
.rich-content .ql-size-small { font-size: .8em; }
.rich-content .ql-size-large { font-size: 1.35em; }
.rich-content .ql-size-huge { font-size: 1.9em; }
.rich-preview { color: var(--muted); font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Tablas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
.table th, .table td { padding: .6rem .65rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: color-mix(in srgb, var(--text) 2.5%, var(--surface)); position: sticky; top: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--primary) 4%, transparent); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .row-actions { display: flex; gap: .3rem; flex-wrap: wrap; }
@media (max-width: 700px) {
  .table.cards-mobile { min-width: 0; }
  .table.cards-mobile thead { display: none; }
  .table.cards-mobile tr { display: block; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .6rem; padding: .35rem .2rem; background: var(--surface); }
  .table.cards-mobile td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem .6rem; }
  .table.cards-mobile td::before { content: attr(data-label); font-weight: 700; color: var(--muted); font-size: .76rem; }
}

/* Listas / timeline */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; gap: .7rem; padding: .65rem 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }

/* Centro de notificaciones: filtros, selección y borrado */
/* Roles y permisos (panel del superadmin) */
.roles-layout { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) { .roles-layout { grid-template-columns: 300px 1fr; } }
.roles-list .list-item { padding: 0; border: 0; }
.role-item {
  width: 100%; display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 10px; padding: .55rem .6rem;
  cursor: pointer; color: inherit; font: inherit;
}
.role-item:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.role-item.is-active { background: color-mix(in srgb, var(--primary) 11%, transparent); border-color: var(--primary); }
.role-item-main { display: flex; flex-direction: column; }
.role-item-badges { display: flex; gap: .3rem; flex-wrap: wrap; }
.roles-toolbar {
  display: flex; gap: .6rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: .6rem 0 .8rem;
}
.roles-table .perm-module td { background: color-mix(in srgb, var(--text) 3%, transparent); }
.perm-module-head { display: flex; gap: .5rem; align-items: center; cursor: pointer; }
.perm-module-head .text-sm { font-weight: 400; }
.perm-row.is-dirty { background: color-mix(in srgb, var(--warning) 8%, transparent); }

.notif-filters {
  display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end;
}
.notif-toolbar {
  display: flex; gap: .6rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: .8rem 1rem; border-bottom: 1px solid var(--border);
}
.notif-toolbar .row-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.notif-list .notif-check { margin-top: .35rem; width: 18px; height: 18px; flex: 0 0 auto; cursor: pointer; }
.notif-list .list-item.is-selected { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.notif-list .list-item.is-unread strong { color: var(--primary); }
.notif-actions { display: flex; gap: .3rem; align-items: center; flex: 0 0 auto; }
.notif-actions .btn-icon { padding: .25rem .4rem; font-size: 1rem; line-height: 1; }
.timeline { position: relative; margin: 0; padding: 0 0 0 1.2rem; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 .9rem .4rem; }
.timeline li::before { content: ""; position: absolute; left: -1.2rem; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }

/* Tabs */
.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tabs button {
  border: 0; background: transparent; padding: .6rem .85rem; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }

/* Chat */
.chat-layout { display: grid; grid-template-columns: 1fr; gap: .9rem; height: calc(100dvh - var(--topbar-h) - 120px); min-height: 460px; }
@media (min-width: 900px) { .chat-layout { grid-template-columns: 300px 1fr; } }
.chat-threads { overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.chat-thread { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: .7rem .8rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.chat-thread[aria-current="true"] { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.chat-panel { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .6rem; }
.chat-bubble { max-width: 82%; padding: .5rem .75rem; border-radius: 14px; background: color-mix(in srgb, var(--text) 6%, transparent); font-size: .9rem; }
.chat-bubble.mine { align-self: flex-end; background: var(--primary); color: #fff; }
.chat-bubble .rich-content { font-size: inherit; }
.chat-compose { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-compose .rich-editor-wrap { flex: 1; }
.chat-compose .ql-editor { min-height: 52px !important; max-height: 140px; }
/* Bandeja del superadmin: compositor con texto enriquecido completo (barra de
   herramientas visible) pero compacto, para que el listado de mensajes
   conserve la mayor parte del alto del panel. */
.inbox-compose .rich-editor-wrap,
.inbox-compose .ql-container.ql-snow { flex: 0 0 auto; }
.inbox-compose .ql-toolbar.ql-snow {
  order: -1;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}
.inbox-compose .ql-toolbar.ql-snow .ql-formats { margin-right: 6px; }
.inbox-compose .ql-container.ql-snow { border-radius: 0 0 10px 10px; }
.inbox-compose .ql-editor { min-height: 44px !important; max-height: 110px; padding: .5rem .7rem !important; }
.inbox-compose .rich-toolbar-native {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  order: -1;
  padding: 4px 6px;
}

/* Mapa / geocerca */
.map-canvas { position: relative; height: 320px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--text) 4%, var(--surface)) 0 12px, var(--surface) 12px 24px); }
.map-canvas .pin { position: absolute; transform: translate(-50%, -100%); font-size: 1.4rem; }
.map-grid-lines { position: absolute; inset: 0; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 40px 40px; opacity: .35; }
.fence-dot { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--primary); background: color-mix(in srgb, var(--primary) 20%, transparent); display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: var(--primary); }

/* Gráficos simples (SVG generado en JS) */
.chart { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: .4rem; }
.chart-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 92px; gap: .5rem; align-items: center; font-size: .82rem; margin-bottom: .35rem; }
.bar-track { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--text) 7%, transparent); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--primary); }

/* QR / pases */
.qr-card { text-align: center; }
.qr-card svg, .qr-card img { width: min(240px, 70vw); height: auto; border-radius: 12px; background: #fff; padding: 8px; border: 1px solid var(--border); }

/* Toast y modales */
.toast-host { position: fixed; z-index: 90; right: .8rem; left: .8rem; bottom: calc(1rem + var(--safe-bottom)); display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
@media (min-width: 700px) { .toast-host { left: auto; width: 360px; } }
.toast {
  pointer-events: auto; background: var(--secondary); color: #fff; padding: .7rem .9rem; border-radius: 12px;
  box-shadow: var(--shadow-lg); font-size: .9rem; display: flex; gap: .6rem; align-items: flex-start;
  animation: toastIn .2s ease;
}
.toast.success { background: #14532d; } .toast.danger { background: #7f1d1d; } .toast.warning { background: #78350f; } .toast.sos { background: var(--danger); font-weight: 700; }
/* Datos para pagar (QR + banco) dentro del modal de pago: dos columnas que
   se apilan en pantallas estrechas, sin desbordar el ancho del modal. */
.pay-details-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: .6rem; align-items: start; }
@media (max-width: 720px) { .pay-details-grid { grid-template-columns: 1fr; } }
.pay-details-grid .rich-content { font-size: .9rem; }
.pay-details-grid .rich-content img { max-width: 100%; height: auto; border-radius: 8px; }

/* «Recordar acceso» en el login */
.remember-row {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0 0 .9rem;
  cursor: pointer; font-size: .9rem; user-select: none;
}
.remember-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.remember-row .hint { flex-basis: 100%; margin-left: 26px; font-size: .78rem; color: var(--muted); }

/* Botón «Instalar app / notificaciones» del topbar */
#btn-install { position: relative; }
.install-dot {
  position: absolute; top: 4px; right: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px var(--surface);
}
.install-modal p { margin: .35rem 0; }

/* Contador de pendientes en el menú lateral */
.sidebar-badge {
  margin-left: auto; min-width: 20px; padding: 0 .35rem; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700;
  line-height: 20px; text-align: center;
}
.sidebar-link { display: flex; align-items: center; gap: .5rem; }

/* Selector de geocerca (mapa real con Leaflet + OpenStreetMap) */
.geo-picker { display: flex; flex-direction: column; gap: .3rem; min-width: 0; width: 100%; }
.geo-picker-foot { display: flex; gap: .5rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
/*
 * El mapa se opera con el dedo/mouse: el gesto debe quedar para la geocerca y
 * NO debe mover el modal ni la página (contain + overscroll-behavior + grab).
 */
.geo-canvas {
  position: relative; height: 340px; width: 100%; border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; background: #eef2f7; cursor: grab; outline: none;
  z-index: 0;
}
@media (max-width: 600px) { .geo-canvas { height: 280px; } }
/* Leaflet dentro del modal: fondo blanco y tipografía del sistema */
.geo-canvas .leaflet-container { font: inherit; background: #eef2f7; width: 100%; height: 100%; }
.geo-canvas .leaflet-control-attribution { font-size: .66rem; background: rgba(255,255,255,.82); }
.geo-canvas .leaflet-bar a { color: var(--text); }
/* Ficha de contactos del residente (registro de accesos) */
.house-contacts {
  border: 1px solid var(--border); border-radius: 12px; padding: .6rem .8rem;
  background: color-mix(in srgb, var(--primary) 4%, transparent);
}
.house-contacts-head { display: flex; gap: .5rem; align-items: baseline; justify-content: space-between; flex-wrap: wrap; margin-bottom: .3rem; }
.house-contacts .list-item { padding: .4rem 0; }
.house-contacts .list-item:last-child { border-bottom: 0; }

/* Formularios con secciones numeradas (empleados, visitas…) */
.emp-form { display: flex; flex-direction: column; gap: .9rem; }
.form-section {
  border: 1px solid var(--border); border-radius: 12px; padding: .7rem .9rem .9rem; margin: 0; min-width: 0;
  background: color-mix(in srgb, var(--text) 2%, var(--surface));
}
.form-section > legend {
  padding: 0 .4rem; font-size: .82rem; font-weight: 700; color: var(--primary);
}
.form-section .form-grid { gap: .7rem; }

/* Registro de visita en portería: residentes + visitas libres */
.house-panel { display: flex; flex-direction: column; gap: .6rem; }
.free-visits { border: 1px solid var(--border); border-radius: 12px; padding: .6rem .8rem; }
.free-visits .list-item { padding: .4rem 0; }
.free-visits .list-item.is-selected { background: color-mix(in srgb, var(--success) 10%, transparent); border-radius: 8px; }
.chip-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Lector de QR (portería) */
.qr-inline { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.qr-manual { display: flex; gap: .4rem; flex-wrap: wrap; flex: 1; min-width: 240px; }
.qr-manual .input { flex: 1; min-width: 180px; }
.qr-scanner { display: flex; flex-direction: column; gap: .6rem; }
.qr-view {
  position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 55vh; background: #0f172a;
  border-radius: 12px; overflow: hidden; display: grid; place-items: center;
}
.qr-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-frame {
  position: absolute; inset: 18%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, .35); pointer-events: none;
}
.qr-frame::after {
  content: ""; position: absolute; left: 8%; right: 8%; top: 50%; height: 2px;
  background: rgba(34, 197, 94, .85); animation: qrScan 2s ease-in-out infinite;
}
@keyframes qrScan { 0%, 100% { transform: translateY(-40%); } 50% { transform: translateY(40%); } }
.qr-status {
  position: absolute; left: .5rem; right: .5rem; bottom: .5rem; text-align: center;
  color: #fff; font-size: .8rem; background: rgba(15, 23, 42, .6); border-radius: 8px; padding: .25rem .4rem;
}
.qr-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.qr-actions label.btn { cursor: pointer; }

/* Modal de confirmación de marcado (jornada / ronda) */
.mark-modal { display: flex; flex-direction: column; gap: .7rem; }
.mark-map { width: 100%; border-radius: 12px; overflow: hidden; }
.mark-map .geo-canvas { height: 300px; }
.mark-info { display: flex; flex-direction: column; gap: .25rem; }
.mark-status { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.mark-info .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }

/* Mapa de consulta (zonas + marcaciones) */
.geo-canvas-view { cursor: default; }
.shift-info {
  display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: .6rem 0 .9rem; padding: .6rem .7rem; border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}
.shift-info .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
.geo-point {
  display: block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 5px rgba(15, 23, 42, .45);
}
.geo-point--round { background: #0ea5e9; }
.geo-point--shift-in { background: #22c55e; }
.geo-point--shift-out { background: #f97316; }
.geo-point--round.is-invalid,
.geo-point--shift-in.is-invalid,
.geo-point--shift-out.is-invalid { background: #ef4444; }
.geo-legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); align-items: center; }
.geo-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.geo-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Pin de la geocerca */
.geo-pin-dot {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary, #2563eb); border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(15, 23, 42, .45);
}
.geo-canvas:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.geo-canvas.is-dragging { cursor: grabbing; }


/* Captura de foto (cámara en móvil / galería) */
.photo-field { border: 1px dashed var(--border); border-radius: 12px; padding: .6rem .7rem; display: flex; flex-direction: column; gap: .4rem; }
.photo-field-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.photo-field-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.photo-field-preview { text-align: center; }
.photo-field-actions .btn { cursor: pointer; }

/* KPI del dashboard clicable (abre el modal de detalle) */
.kpi-clickable {
  cursor: pointer; border-radius: var(--radius); transition: transform .12s, box-shadow .12s;
  outline: none;
}
.kpi-clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.kpi-clickable:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent); }
.kpi-clickable .stat { height: 100%; }

/* Gráfico de ingresos/egresos del dashboard: columnas clicables */
.cashflow-chart { display: flex; gap: .5rem; align-items: flex-end; height: 200px; padding: .4rem .2rem 0; }
.cashflow-col {
  flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column;
  justify-content: flex-end; border-radius: 10px; padding: .3rem .25rem; transition: background .15s;
}
.cashflow-col:hover, .cashflow-col:focus-visible {
  background: color-mix(in srgb, var(--primary) 8%, transparent); outline: none;
}
.cashflow-col.is-current { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.cashflow-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; min-height: 0; }
.cashflow-bar { width: 38%; max-width: 26px; border-radius: 5px 5px 0 0; min-height: 2px; }
.cashflow-bar.income { background: var(--success); }
.cashflow-bar.expense { background: var(--danger); }
.cashflow-month { text-align: center; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .3rem; }
.cashflow-values { display: flex; flex-direction: column; align-items: center; line-height: 1.15; font-size: .68rem; }

/* Selección de meses a pagar: chip activo resaltado */
.chip.chip-selected {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}
.chip:not(.chip-selected) { opacity: .65; }

/* Aviso de mensaje nuevo: visible en cualquier pantalla */
.toast.message { background: var(--primary); color: #fff; border-left: 4px solid var(--accent, #22c55e); }
.toast.message strong { display: block; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-host { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: .8rem; background: rgba(15, 23, 42, .55); }
.modal {
  width: min(680px, 100%); max-height: calc(100dvh - 2rem); overflow-y: auto; background: var(--surface);
  border-radius: 18px; box-shadow: var(--shadow-lg); padding: 1.1rem; animation: toastIn .18s ease;
  /* El modal no puede desplazarse ni rebotar con el gesto: así, arrastrar dentro
     de un widget (p. ej. el mapa de geocercas) nunca arrastra el diálogo. */
  overscroll-behavior: contain;
}
.modal-lg { width: min(920px, 100%); }
.modal-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-head .btn-icon { margin-left: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }

/* Skeletons / vacíos */
.skeleton { background: linear-gradient(90deg, color-mix(in srgb, var(--text) 6%, transparent) 25%, color-mix(in srgb, var(--text) 3%, transparent) 37%, color-mix(in srgb, var(--text) 6%, transparent) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
.skeleton-title { height: 26px; width: 46%; margin-bottom: 1rem; }
.skeleton-card { height: 96px; } .skeleton-table { height: 260px; margin-top: 1rem; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty .icon { font-size: 2rem; display: block; margin-bottom: .4rem; }

/* Navegación inferior (móvil) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 38;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
}
.bottom-nav a, .bottom-nav button {
  flex: 1; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: .1rem;
  padding: .45rem .2rem .4rem; font-size: .68rem; font-weight: 600; color: var(--muted); cursor: pointer; text-decoration: none !important;
}
.bottom-nav [aria-current="page"], .bottom-nav .active { color: var(--primary); }
/* Guardia: «Ver SOS» (navegación) y «Crear SOS» (acción de emergencia) */
.bottom-nav a, .bottom-nav button { text-align: center; line-height: 1.1; }
.bottom-nav .bottom-nav-sos-create { color: var(--danger); font-weight: 700; }
.bottom-nav .bottom-nav-sos-create:active { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.bottom-nav .bottom-nav-sos-view { position: relative; }
@media (max-width: 400px) {
  /* Con 6 botones el texto se reduce un poco para que no se corte */
  .bottom-nav a, .bottom-nav button { font-size: .62rem; padding-left: .1rem; padding-right: .1rem; }
}
@media (min-width: 1024px) { .bottom-nav { display: none; } .main { padding-bottom: 2.4rem; } }

/* Páginas especiales */
.login-root { display: block; }
.login-page { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 980px) { .login-page { grid-template-columns: 1.05fr 1fr; } }
.login-hero {
  background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--primary) 60%, transparent), transparent),
              linear-gradient(160deg, var(--secondary), color-mix(in srgb, var(--secondary) 70%, var(--primary)));
  color: #fff; padding: 2.4rem; display: flex; flex-direction: column; justify-content: space-between;
}
.login-hero h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); color: #fff; }
.login-hero .features { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .55rem; font-size: .92rem; opacity: .95; }
.login-hero .features li::before { content: "✔"; margin-right: .5rem; color: var(--accent); font-weight: 800; }
.login-box { display: grid; place-items: center; padding: 1.4rem; }
.login-form { width: min(400px, 100%); }
.error-page { min-height: 80dvh; display: grid; place-items: center; padding: 1rem; }
.error-page .card { max-width: 460px; text-align: center; }

.kpi-inline { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.avatar-initials { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); font-weight: 700; flex: 0 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { padding: .25rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--text) 6%, transparent); font-size: .78rem; font-weight: 600; }
.suspended-card { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 5%, var(--surface)); }
.split { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .split { grid-template-columns: 2fr 1fr; } .split-equal { grid-template-columns: 1fr 1fr; }
  /* Bandeja de mensajes: el panel de la conversación (derecha) es más ancho */
  .split-chat { grid-template-columns: minmax(240px, 1fr) minmax(0, 2.4fr); } }
.sticky-actions { position: sticky; bottom: calc(.6rem + var(--safe-bottom)); background: var(--surface); padding: .6rem; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; gap: .5rem; justify-content: flex-end; }

@media print {
  .topbar, .sidebar, .bottom-nav, .toast-host, .page-head .actions, .btn { display: none !important; }
  .main { margin: 0; padding: 0; }
  .card { box-shadow: none; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
