/* Incidencias embarcados · hoja de estilos (basada en el diseño de Ataria / intranet) */
:root, .theme-light-scope {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e6e8f0;
  --border-strong: #d4d8e4;
  --text: #171a2b;
  --text-2: #4b5168;
  --muted: #7c8299;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-soft: #eef0ff;
  --success: #059669;
  --success-soft: #e7f8f1;
  --warning: #d97706;
  --danger: #dc2626;
  --danger-soft: #fdeeee;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 26, 43, .04), 0 4px 16px rgba(23, 26, 43, .05);
  --shadow-lg: 0 12px 48px rgba(23, 26, 43, .18);
  --sidebar: 280px;
  color-scheme: light;
}
:root[data-theme="dark"], .theme-dark-scope {
  --bg: #0e1020;
  --surface: #161a2e;
  --surface-2: #1b2036;
  --border: #262c46;
  --border-strong: #343b5a;
  --text: #eceefa;
  --text-2: #b4b9d3;
  --muted: #8a90ad;
  --primary: #7c7cff;
  --primary-600: #6b6bf5;
  --primary-soft: #23264a;
  --success: #34d399;
  --success-soft: #11302a;
  --danger: #f87171;
  --danger-soft: #3a1c22;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.ico { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.strike { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.spacer { flex: 1; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: var(--sb-bg, var(--surface)); border-right: 1px solid var(--sb-border, var(--border));
  display: flex; flex-direction: column; padding: 20px 14px; gap: 16px; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--text); }
.sidebar .brand { color: var(--sb-text, var(--text)); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--on-brand, #fff);
  background: linear-gradient(135deg, var(--brand-from, #6366f1), var(--brand, #4f46e5) 55%, var(--secondary, #7c3aed));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand, #4f46e5) 35%, transparent);
}
.brand-name { font-weight: 800; font-size: 15px; line-height: 1.2; }
.new-btn { margin: 4px 0; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--sb-text-2, var(--text-2)); font-weight: 600; font-size: 14px; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--sb-hover, var(--surface-2)); color: var(--sb-text, var(--text)); }
.nav a.active { background: var(--sb-active-bg, var(--primary-soft)); color: var(--sb-active-text, var(--primary)); }
.nav-label {
  display: flex; align-items: center; gap: 6px; margin: 18px 12px 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sb-muted, var(--muted));
}
.sidebar-foot { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--sb-border, var(--border)); padding-top: 14px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; border-radius: 10px; color: var(--sb-text, var(--text)); }
.me:hover { background: var(--sb-hover, var(--surface-2)); }
.sidebar .me-text small { color: var(--sb-muted, var(--muted)); }
.sidebar .new-btn { outline: 1px solid var(--sb-btn-ring, transparent); outline-offset: -1px; }
.sidebar .icon-btn { color: var(--sb-text-2, var(--text-2)); }
.sidebar .icon-btn:hover { background: var(--sb-hover, var(--surface-2)); color: var(--sb-text, var(--text)); }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text strong, .me-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text strong { font-size: 13.5px; }
.me-text small { color: var(--muted); font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 32px 36px 60px; max-width: 1380px; width: 100%; margin: 0 auto; }
/* Barra superior: dónde estás, campana, tema y menú de la persona */
.topbar {
  display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 25; height: 60px; padding: 0 36px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .menu-btn { display: none; }
.crumbs { flex: 1; min-width: 0; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 13.5px; color: var(--muted); }
.crumbs li { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
.crumbs li span { overflow: hidden; text-overflow: ellipsis; }
.crumbs li .ico { flex: none; opacity: .6; }
.crumbs li[aria-current] { color: var(--text); font-weight: 700; }
.topbar-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.umenu { position: relative; margin-left: 6px; }
.umenu-btn {
  display: flex; align-items: center; gap: 9px; max-width: 260px; padding: 4px 10px 4px 4px; border: 1px solid transparent; border-radius: 99px;
  background: transparent; color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.umenu-btn:hover, .umenu-btn[aria-expanded="true"] { background: var(--surface); border-color: var(--border); }
.umenu-btn > .ico { color: var(--muted); flex: none; }
.umenu-btn .me-text small { font-size: 11.5px; }
.umenu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: 270px; z-index: 60; padding: 6px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); animation: np-in .14s ease-out;
}
.umenu-pop[hidden] { display: none; }
.umenu-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.umenu-head .me-text small { line-height: 1.35; }
.umenu-pop a, .umenu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; text-decoration: none; }
.umenu-pop a:hover, .umenu-pop button:hover { background: var(--surface-2); color: var(--text); }
.umenu-pop form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--border); }
.umenu-out:hover { color: var(--danger) !important; }
.scrim { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .muted { margin-top: 4px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.head-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.back:hover { color: var(--text); }

/* ---------- Componentes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 720px; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.small-title { font-size: 13px; display: flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .06em; }
.step { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 800; }
.link { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 13px; }
.count { background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: 0 10px; font-size: 13px; font-weight: 700; color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary, #fff); box-shadow: 0 4px 12px color-mix(in srgb, var(--brand, #4f46e5) 25%, transparent); }
.btn-primary:hover { background: var(--primary-600); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { filter: brightness(.97); }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.danger-text { color: var(--danger) !important; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-ok, .badge-free { background: var(--success-soft); color: var(--success); }
.badge-busy { background: #fff1e6; color: #c2410c; }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-off { background: var(--danger-soft); color: var(--danger); }
.badge-admin { background: var(--secondary-soft, var(--primary-soft)); color: var(--secondary-ink, var(--primary)); }
.badge-live { background: #fff1e6; color: #c2410c; }
.badge-live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
[data-theme="dark"] .badge-busy, [data-theme="dark"] .badge-live { background: #3b2416; color: #fdba74; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 11.5px; font-weight: 700; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px 0 9px; border-radius: 99px;
  background: color-mix(in srgb, var(--c) 12%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--text));
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: color-mix(in srgb, var(--c) 85%, var(--text));
  font-weight: 800; font-size: 13px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border);
}
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.room-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex-shrink: 0; }

.alert {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px;
  font-weight: 600; font-size: 14px; border: 1px solid transparent;
}
.alert span { flex: 1; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--primary-soft); color: var(--primary); }
.alert-x { border: 0; background: none; color: inherit; cursor: pointer; opacity: .6; padding: 2px; }
.alert-x:hover { opacity: 1; }
.alert.hide { opacity: 0; transform: translateY(-6px); transition: .3s; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty.small { padding: 24px 10px; }
.empty .ico { color: var(--border-strong); }
.empty-row { text-align: center; color: var(--muted); padding: 40px !important; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], input[type=tel], input[type=search], input:not([type]), select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c8299' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--text-2); }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
legend { font-weight: 800; font-size: 14px; margin-bottom: 12px; padding: 0; }
.hint { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.form-actions.stack { flex-direction: column; align-items: stretch; margin-top: 18px; }
.cap-hint { font-size: 12px; color: var(--muted); }
.cap-hint.warn { color: var(--danger); font-weight: 700; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar.filters { justify-content: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.toolbar.filters select, .toolbar.filters input { width: auto; height: 38px; }
.toolbar.filters .search-box { flex: 1; min-width: 200px; }
.toolbar.filters .list-count { flex: 1 1 100%; margin: 0; }
.mini-field { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.inline-form { display: flex; gap: 8px; }
.inline-form select, .inline-form input { width: auto; height: 38px; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box .ico { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 36px; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.seg a { padding: 7px 14px; border-radius: 8px; font-weight: 700; font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
.seg a.on { background: var(--primary); color: var(--on-primary, #fff); }
.seg.sm a { padding: 5px 12px; font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 14px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 8px; align-items: center; }
.tabs a span { background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: 0 8px; font-size: 12px; }
.tabs a.on { color: var(--primary); border-color: var(--primary); }
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav .range { margin-left: 10px; font-size: 17px; }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat strong small { font-size: 15px; color: var(--muted); font-weight: 700; }
.stat span:not(.stat-ico) { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-ico.i1 { background: #e7f8f1; color: #059669; }
.stat-ico.i2 { background: var(--stat2-bg, #eef0ff); color: var(--stat2-fg, #4f46e5); }
.stat-ico.i3 { background: #fff4e5; color: #d97706; }
.stat-ico.i4 { background: #fdeef7; color: #db2777; }
[data-theme="dark"] .stat-ico.i1 { background: #11302a; color: #34d399; }
[data-theme="dark"] .stat-ico.i2 { background: var(--stat2-bg, #23264a); color: var(--stat2-fg, #a5b4fc); }
[data-theme="dark"] .stat-ico.i3 { background: #35260f; color: #fbbf24; }
[data-theme="dark"] .stat-ico.i4 { background: #3a1730; color: #f472b6; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.dash-side { display: flex; flex-direction: column; gap: 18px; }
.dash-side .card + .card { margin-top: 0; }

.rooms-today { display: flex; flex-direction: column; gap: 6px; }
.room-row { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.room-row:last-of-type { border-bottom: 0; }
.room-info { display: flex; align-items: center; gap: 10px; }
.room-info > div { flex: 1; min-width: 0; }
.room-info strong { display: block; font-size: 14.5px; }
.room-info small { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 4px; }
.room-info .room-dot { width: 12px; height: 34px; border-radius: 4px; }
.timeline { position: relative; height: 42px; background: repeating-linear-gradient(90deg, var(--surface-2) 0 calc(100% / 12 - 1px), var(--border) calc(100% / 12 - 1px) calc(100% / 12)); border-radius: 10px; border: 1px solid var(--border); overflow: hidden; }
.tl-block {
  position: absolute; top: 4px; bottom: 4px; border-radius: 7px; padding: 0 8px; display: flex; align-items: center; overflow: hidden;
  background: color-mix(in srgb, var(--c) 20%, var(--surface)); border-left: 3px solid var(--c);
  color: color-mix(in srgb, var(--c) 70%, var(--text)); font-size: 12px; font-weight: 700; transition: filter .15s;
}
.tl-block span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-block.mine { background: var(--c); color: #fff; }
.tl-block:hover { filter: brightness(.95); z-index: 2; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 3; }
.tl-now::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.tl-add { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--surface); color: var(--primary); border: 1px solid var(--border); opacity: 0; transition: opacity .15s; z-index: 4; }
.room-row:hover .tl-add { opacity: 1; }
.tl-scale { position: relative; height: 18px; margin-left: 296px; font-size: 11px; color: var(--muted); font-weight: 600; }
.tl-scale span { position: absolute; transform: translateX(-50%); }
.tl-scale span:first-child { transform: none; }
.tl-scale span:last-child { transform: translateX(-100%); }

.agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.agenda-day { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 2px; }
.agenda-day:first-child { margin-top: 0; }
.agenda-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); position: relative; transition: border-color .15s, transform .15s; }
.agenda-item::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.agenda-item:hover { border-color: var(--border-strong); transform: translateX(2px); }
.agenda-time { display: flex; flex-direction: column; font-weight: 800; font-size: 14px; min-width: 46px; }
.agenda-time small { font-weight: 600; color: var(--muted); font-size: 12px; }
.agenda-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.agenda-body strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-body small { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 150px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); }
.bar-track { flex: 1; width: 100%; max-width: 30px; background: var(--surface-2); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; border: 1px solid var(--border); }
.bar-fill { width: 100%; background: linear-gradient(180deg, #818cf8, var(--primary)); border-radius: 6px; transition: height .4s; }
.bar b { font-size: 11.5px; }
.bar small { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.bar:hover .bar-fill { filter: brightness(1.1); }

/* ---------- Tablas de administración ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.inactive td { opacity: .55; }
.table .actions { text-align: right; }
.table .actions form { display: inline; }
.person { display: flex; align-items: center; gap: 10px; }
.person > span:last-child { display: flex; flex-direction: column; }
.person small { color: var(--muted); font-size: 12.5px; }
.strong-link { font-weight: 700; color: var(--text); }
.strong-link:hover { color: var(--primary); }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }
.usage { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.usage small { color: var(--muted); font-size: 12px; }

.room-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.room-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border-top: 4px solid var(--c); display: flex; flex-direction: column; gap: 14px; }
.room-card.inactive { opacity: .6; }
.room-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.room-card-top p { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.room-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.room-card-stats div { background: var(--surface-2); border-radius: 10px; padding: 10px; text-align: center; }
.room-card-stats strong { display: block; font-size: 20px; font-weight: 800; }
.room-card-stats small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.meter { display: block; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.meter span { display: block; height: 100%; background: var(--c, var(--primary)); border-radius: 99px; }
.equip { color: var(--text-2); }
.room-card-actions { display: flex; gap: 8px; margin-top: auto; }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal-scrim { position: fixed; inset: 0; background: rgba(15, 17, 35, .5); backdrop-filter: blur(3px); animation: fade .2s; }
.modal { position: relative; width: 100%; max-width: 680px; box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
.modal.narrow { max-width: 480px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { position: relative; cursor: pointer; }
.swatch input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: block; width: 30px; height: 30px; border-radius: 9px; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); transition: box-shadow .15s; }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--c); }
.swatch.custom input[type=color] { width: 34px; height: 34px; border: 1px dashed var(--border-strong); border-radius: 9px; padding: 2px; background: var(--surface); cursor: pointer; }
.swatch.custom:has(input[type=radio]:checked) input[type=color] { border: 2px solid var(--primary); }

/* ---------- Perfil ---------- */
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.profile-head h2 { font-size: 20px; }
.profile-head .chip { margin-top: 8px; }

/* ---------- Acceso e instalador ---------- */
body.bare { background: radial-gradient(1200px 600px at 10% -10%, #e0e7ff 0, transparent 60%), radial-gradient(900px 600px at 110% 110%, #fce7f3 0, transparent 55%), var(--bg); }
[data-theme="dark"] body.bare { background: radial-gradient(1200px 600px at 10% -10%, #1e1b4b 0, transparent 60%), radial-gradient(900px 600px at 110% 110%, #3b0d2e 0, transparent 55%), var(--bg); }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 60px; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 34px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 18px; }
.auth-card.wide { max-width: 720px; }
.auth-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 4px; }
.auth-brand .brand-mark { width: 48px; height: 48px; border-radius: 14px; }
.auth-brand h1 { font-size: 22px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.checks .ok { color: var(--success); }
.checks .ko { color: var(--danger); }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .dash-grid, .booking, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 17, 35, .45); z-index: 30; }
  .topbar { height: 56px; padding: 0 10px; gap: 6px; background: var(--surface); }
  .topbar .menu-btn { display: inline-grid; }
  .crumbs li:not([aria-current]) { display: none; }
  .crumbs li[aria-current] .ico { display: none; }
  .crumbs ol { font-size: 15.5px; }
  .crumbs li[aria-current] { font-weight: 800; }
  .umenu { margin-left: 2px; }
  .umenu-btn { padding: 2px; }
  .umenu-btn .me-text, .umenu-btn > .ico { display: none; }
  .content { padding: 20px 16px 48px; }
  h1 { font-size: 23px; }
  .room-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .tl-scale { margin-left: 0; }
  .tl-add { opacity: 1; }
  .auth-art { display: none; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .facts { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .stats { gap: 10px; }
  .stat { padding: 14px; gap: 10px; }
  .stat-ico { width: 38px; height: 38px; }
  .stat strong { font-size: 22px; }
  .card { padding: 18px; }
  .page-head > .btn { display: none; }
  .res-card { flex-wrap: wrap; }
  .res-side { width: 100%; justify-content: flex-start; padding-left: 68px; }
  .date-nav .range { font-size: 15px; width: 100%; margin: 6px 0 0; }
  .date-nav { flex-wrap: wrap; }
  .auth-card { padding: 24px; }
  .toolbar.filters > * { flex: 1 1 100%; }
  .toolbar.filters select, .toolbar.filters input { width: 100%; }
}

/* ---------- Selector de tema claro / oscuro ---------- */
.theme-toggle .ico-sun { display: none; }
[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
.theme-toggle svg { transition: transform .35s ease; }
.theme-toggle:hover svg { transform: rotate(-20deg); }
.theme-float { position: fixed; top: 16px; right: 16px; z-index: 30; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .3s ease, border-color .3s ease, color .3s ease, fill .3s ease !important;
}

/* ---------- Marca: logotipo e icono (Ajustes → General) ---------- */
.brand-mark.has-img { background: #fff; box-shadow: 0 0 0 1px var(--border); overflow: hidden; }
.brand-mark.has-img img { width: 84%; height: 84%; object-fit: contain; }
.brand.has-logo { flex-direction: column; align-items: flex-start; gap: 6px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; color: var(--on-brand, #fff);
  background: linear-gradient(135deg, var(--brand-from, #6366f1), var(--brand, #4f46e5) 55%, var(--secondary, #7c3aed));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand, #4f46e5) 35%, transparent); }
.brand-name { font-weight: 800; font-size: 15px; line-height: 1.2; }
.brand-logo { display: block; max-width: 100%; max-height: 44px; object-fit: contain; object-position: left center; }
.auth-brand.with-logo { flex-direction: column; align-items: flex-start; gap: 12px; }
.auth-logo { display: block; max-width: 260px; max-height: 64px; object-fit: contain; }
/* Logotipos con letras oscuras: en modo oscuro (o barra lateral oscura) se ponen sobre una placa clara */
[data-theme="dark"] .brand-logo, [data-theme="dark"] .auth-logo { background: #fff; padding: 6px 10px; border-radius: 10px; }
.sidebar .brand-logo { background: var(--sb-logo-bg, transparent); padding: var(--sb-logo-pad, 0); border-radius: 10px; }
.auth-brand.big-logo { align-items: center; text-align: center; gap: 14px; }
.auth-brand.big-logo .auth-logo { width: 100%; max-width: 350px; height: auto; max-height: 175px; margin: 0 auto; object-position: center; }
[data-theme="dark"] .auth-brand.big-logo .auth-logo { padding: 10px 14px; border-radius: 14px; }
/* ---------- Menú lateral: grupos desplegables por área ---------- */
.nav-group { display: flex; flex-direction: column; }
.nav-group-head {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent;
  font: inherit; font-weight: 700; font-size: 14px; color: var(--sb-text, var(--text)); cursor: pointer; text-align: left; transition: background .15s;
}
.nav-group-head:hover { background: var(--sb-hover, var(--surface-2)); }
.nav-group-head > span:first-of-type { flex: 1; min-width: 0; }
.nav-group-head .ico:first-child { color: var(--sb-muted, var(--muted)); }
.nav-group.has-active > .nav-group-head .ico:first-child { color: var(--sb-active-text, var(--primary)); }
.nav-group-head .ico:last-child { color: var(--sb-muted, var(--muted)); transition: transform .22s ease; }
.nav-group.open > .nav-group-head .ico:last-child { transform: rotate(90deg); }
.nav-count { font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center;
  background: var(--sb-hover, var(--surface-2)); color: var(--sb-muted, var(--muted)); transition: opacity .15s; }
.nav-group.open .nav-count { opacity: 0; }
.nav-group-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.nav-group.open > .nav-group-items { grid-template-rows: 1fr; }
.nav-group-items > div { overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding-left: 16px; margin-left: 20px; border-left: 1.5px solid var(--sb-border, var(--border)); }
.nav-group.open > .nav-group-items > div { padding-top: 2px; padding-bottom: 6px; }
.nav-group-items a { padding: 8px 10px; font-size: 13.5px; gap: 10px; }
.nav-sep { height: 1px; background: var(--sb-border, var(--border)); margin: 8px 10px; }
.no-anim .nav-group-items, .no-anim .nav-group-head .ico:last-child { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .nav-group-items, .nav-group-head .ico:last-child { transition: none; } }

.sidebar .brand-logo.logo-l { display: var(--sb-logo-l, block); }
.sidebar .brand-logo.logo-d { display: var(--sb-logo-d, none); }

/* Menú lateral: cada opción en una sola línea (si algo no cabe, se corta con «…» y el nombre entero sale al pasar el ratón) */
.nav a > span, .nav-group-head > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav-group-head > span { flex: 1; }

/* ---------- Notificaciones: campana y desplegable ---------- */
.bell { position: relative; }
.bell-count {
  position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: var(--text-2); color: var(--surface); font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface); pointer-events: none;
}
.sidebar .bell-count { box-shadow: 0 0 0 2px var(--sb-bg, var(--surface)); background: var(--sb-text-2, var(--text-2)); color: var(--sb-bg, var(--surface)); }
.bell-count.hot, .sidebar .bell-count.hot { background: var(--danger); color: #fff; }
.bell-count[hidden] { display: none; }
.notif-pop {
  position: fixed; z-index: 90; width: 380px; max-width: calc(100vw - 20px); max-height: min(560px, calc(100vh - 20px));
  display: flex; flex-direction: column; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; animation: np-in .14s ease-out;
}
.notif-pop[hidden] { display: none; }
.notif-pop.sheet { left: 10px !important; right: 10px !important; width: auto; max-height: calc(100vh - 80px); }
@keyframes np-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.np-loading { height: 160px; background: linear-gradient(90deg, transparent, var(--surface-2), transparent) 0 0 / 200% 100%; animation: np-sh 1s linear infinite; }
@keyframes np-sh { to { background-position: -200% 0; } }
.np-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px 16px; }
.np-head strong { font-size: 15px; }
.icon-btn.sm { width: 30px; height: 30px; }
.np-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--border); }
.np-tabs button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 6px; border: 0; background: none;
  font: inherit; font-weight: 700; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
}
.np-tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.np-n { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 11.5px; font-weight: 800; line-height: 17px; text-align: center; }
.np-n.hot, .tabs a span.np-n.hot { background: var(--danger); border-color: var(--danger); color: #fff; }
.np-pane { overflow-y: auto; flex: 1; min-height: 0; }
.np-list { list-style: none; margin: 0; padding: 6px; }
.np-item { display: flex; align-items: flex-start; gap: 11px; padding: 10px; border-radius: 10px; color: var(--text); text-decoration: none; position: relative; }
.np-item:hover { background: var(--surface-2); }
.np-item > .ico:last-child { color: var(--muted); align-self: center; flex: none; }
.np-ico { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--k, var(--primary)); background: color-mix(in srgb, var(--k, var(--primary)) 14%, transparent); }
.np-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.np-body strong { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.np-item.unread .np-body strong, .np-item.todo .np-body strong { font-weight: 750; }
.np-body small { color: var(--text-2); font-size: 12.5px; line-height: 1.35; }
.np-body time { color: var(--muted); font-size: 11.5px; }
.np-item:not(.unread) .np-ico { filter: saturate(.6); opacity: .8; }
.np-dot { position: absolute; top: 14px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.np-item.unread { padding-right: 24px; }
.np-item.tone-warn .np-ico { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--warning) 60%, transparent); }
.np-item.tone-danger .np-ico { color: var(--danger); background: var(--danger-soft); }
.np-item.tone-danger .np-body small { color: var(--danger); }
.np-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; color: var(--muted); text-align: center; }
/* ---------- Administración → Resumen ---------- */
.ad-section { margin-bottom: 30px; }
.ad-h { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text-2); margin: 0 0 12px; text-transform: none; }
.ad-h .ico { color: var(--muted); }
.ad-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ad-tile { display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; min-width: 0; }
.ad-tile.link { transition: border-color .15s, box-shadow .15s, transform .15s; }
.ad-tile.link:hover { border-color: var(--border-strong); box-shadow: 0 6px 18px -10px rgba(20, 24, 50, .25); transform: translateY(-1px); }
.ad-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.ad-ico.t-green { background: var(--success-soft); color: var(--success); }
.ad-ico.t-blue { background: color-mix(in srgb, #0284c7 13%, var(--surface)); color: #0284c7; }
.ad-ico.t-indigo { background: var(--primary-soft); color: var(--primary); }
.ad-ico.t-amber { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); color: var(--warning); }
.ad-ico.t-red { background: var(--danger-soft); color: var(--danger); }
.ad-ico.t-rose { background: color-mix(in srgb, #db2777 12%, var(--surface)); color: #db2777; }
.ad-tv { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ad-tv strong { font-size: 26px; line-height: 1.1; font-weight: 750; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.ad-tv strong small { font-size: 15px; font-weight: 600; margin-left: 1px; color: var(--text-2); }
.ad-tv > span { font-size: 13px; color: var(--text-2); font-weight: 600; margin-top: 2px; }
.ad-tv > small { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ad-meter { height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin-top: 7px; }
.ad-meter span { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.ad-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 14px; }
.ad-card { margin: 0; }
.ad-card + .ad-card { margin-top: 0; }
.ad-section > .ad-card { margin-top: 0; }
.ad-card .card-head h3 { font-size: 14px; margin: 0; }
/* Columnas: una serie, un color; la de hoy, más intensa; fines de semana, más claros */
.ad-chart { padding-top: 6px; }
.ad-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 150px; border-bottom: 1px solid var(--border-strong);
  background: linear-gradient(to top, transparent calc(50% - .5px), var(--border) calc(50% - .5px), var(--border) calc(50% + .5px), transparent calc(50% + .5px)) ; }
.ad-plot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; border-top: 1px dashed var(--border); }
.ad-max { position: absolute; top: -8px; left: 0; font-size: 11px; color: var(--muted); background: var(--surface); padding-right: 4px; line-height: 16px; z-index: 1; }
.ad-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; outline: none; cursor: default; min-width: 0; }
.ad-col i { display: block; width: 100%; max-width: 26px; margin: 0 auto; background: color-mix(in srgb, var(--primary) 72%, var(--surface)); border-radius: 4px 4px 0 0; transition: background .15s; }
.ad-col.we i { background: color-mix(in srgb, var(--primary) 38%, var(--surface)); }
.ad-col.today i { background: var(--primary); }
.ad-col:hover i, .ad-col:focus-visible i { background: var(--primary-600); }
.ad-col:hover, .ad-col:focus-visible { background: color-mix(in srgb, var(--primary) 6%, transparent); border-radius: 4px 4px 0 0; }
.ad-x { display: flex; gap: 2px; margin-top: 6px; }
.ad-x span { flex: 1; min-width: 0; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: visible; }
/* Barras horizontales */
.ad-hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ad-hbars li { display: grid; grid-template-columns: minmax(0, 11em) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.ad-hb-name { display: flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.ad-hb-bar { position: relative; height: 12px; display: block; }
.ad-hb-bar i { display: block; height: 100%; background: color-mix(in srgb, var(--primary) 72%, var(--surface)); border-radius: 0 4px 4px 0; }
.ad-hb-bar:hover i { background: var(--primary-600); }
.ad-hb-val { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; min-width: 3.2em; text-align: right; }
/* Personas conectadas y listas */
.ad-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ad-people li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.ad-people li::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); margin-left: auto; box-shadow: 0 0 0 3px var(--success-soft); }
.ad-list { list-style: none; margin: 0; padding: 0; }
.ad-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.ad-list li:first-child { border-top: 0; }
.ad-list a { display: flex; flex-direction: column; min-width: 0; color: inherit; text-decoration: none; }
.ad-list a:hover strong { color: var(--primary); }
.ad-list strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Tooltip de las marcas */

.ad-col[data-tip]:hover::after, .ad-col[data-tip]:focus-visible::after, .ad-hb-bar[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5;
  background: var(--text); color: var(--surface); font-size: 12px; font-weight: 500; line-height: 1.3; padding: 5px 9px; border-radius: 7px; white-space: nowrap; pointer-events: none;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35); }
.ad-col[data-tip]:hover::after, .ad-col[data-tip]:focus-visible::after { bottom: auto; top: -30px; }
.ad-plot .ad-col:first-child[data-tip]:hover::after, .ad-plot .ad-col:nth-child(2)[data-tip]:hover::after, .ad-plot .ad-col:nth-child(3)[data-tip]:hover::after { left: 0; transform: none; }
.ad-plot .ad-col:last-child[data-tip]:hover::after, .ad-plot .ad-col:nth-last-child(2)[data-tip]:hover::after { left: auto; right: 0; transform: none; }
@media (max-width: 900px) { .ad-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .ad-tiles { grid-template-columns: 1fr 1fr; gap: 10px; } .ad-tile { padding: 12px; flex-direction: column; gap: 8px; } .ad-tv strong { font-size: 22px; } .ad-plot { height: 120px; } }
/* Documentos más descargados */
.ad-section > .ad-grid + .ad-card { margin-top: 14px; }
.ad-tiles + .ad-card { margin-top: 0; }
.seg.seg-sm { padding: 2px; border-radius: 9px; }
.seg.seg-sm a { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.ad-top { list-style: none; margin: 0; padding: 0; }
.ad-top li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--border); }
.ad-top li:first-child { border-top: 0; padding-top: 2px; }
.ad-rank { width: 22px; height: 22px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--text-2); margin-top: 1px; }
.ad-top-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ad-top-line { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 1px; min-width: 0; }
.ad-top-line a { color: inherit; text-decoration: none; min-width: 0; }
.ad-top-line a:hover strong { color: var(--primary); }
.ad-top-line strong { font-size: 13.5px; }
.ad-top-line small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0; }
.ad-top .ad-hb-bar { height: 8px; }
.ad-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ad-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px 2px 7px; }
.ad-chip .room-dot { width: 7px; height: 7px; border-radius: 50%; }
.ad-chip b { color: var(--text); font-variant-numeric: tabular-nums; }
.ad-chip.more { color: var(--muted); }
.ad-top-val { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; min-width: 4.5em; }
.ad-top-val strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.ad-top-val small { font-size: 11.5px; color: var(--muted); }
.ad-note { margin: 14px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.ad-hb-bar[data-tip]:hover::after { bottom: auto; top: -32px; }
.ad-card .card-head { flex-wrap: wrap; row-gap: 8px; }


/* ===== Copiado de Ataria: ajustes, ventanas propias, subidas e idioma ===== */
[data-theme="dark"] .badge-warn { background: #35260f; color: #fbbf24; }

.uploader { display: flex; align-items: center; gap: 16px; }
.uploader-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.uploader-body .btn { cursor: pointer; }
.uploader-preview { display: grid; place-items: center; color: var(--muted); transition: opacity .2s; }
.uploader-preview.logo { width: 120px; height: 72px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: #fff; overflow: hidden; }
.uploader-preview.logo img { max-width: 90%; max-height: 85%; object-fit: contain; }
.link-btn { color: var(--primary); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
/* ---------- Ajustes (v1.5) ---------- */
.h-ico { display: flex; align-items: center; gap: 8px; }
.h-ico .ico { color: var(--primary); }
.smtp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 96px 150px; gap: 8px; }
.presets { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.field > span .presets { font-weight: 500; }
.ph {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; transition: border-color .15s, color .15s, background .15s;
}
.presets .ph { font-family: inherit; font-size: 11.5px; }
.ph:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.ph-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.help { border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; background: var(--surface-2); font-size: 13.5px; }
.help > summary { cursor: pointer; padding: 9px 0; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; list-style: none; }
.help > summary::-webkit-details-marker { display: none; }
.help[open] { padding-bottom: 12px; }
.help[open] > summary { color: var(--text-2); }
.help-list { margin: 0 0 10px; padding-left: 18px; color: var(--text-2); display: grid; gap: 4px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 2px 0 8px; }
.mini-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 6px; }
.mini-table td { padding: 5px 6px; border-top: 1px solid var(--border); vertical-align: top; }
.mini-table code { white-space: nowrap; }
.test-box { border-top: 1px dashed var(--border); padding-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.inline-field { display: flex; gap: 8px; }
.inline-field input { flex: 1; min-width: 0; }
.inline-field .btn { flex: none; }
.test-result { margin: 6px 0 0; }
.subjects { gap: 0; }
.subject-item { padding: 16px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; transition: opacity .2s; }
.subject-item:first-of-type { border-top: 0; padding-top: 8px; }
.subject-item.off > :not(.subject-head) { opacity: .45; }
.subject-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.subject-head .check { color: var(--text); }
.link-btn { border: 0; background: none; padding: 2px 4px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.link-btn:hover { color: var(--primary); }
.subject-item input[data-subject] { font-family: inherit; }
.subject-preview { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.subject-preview b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-preview.warn b { color: var(--warning); }
.subject-preview.warn::after { content: "⚠"; color: var(--warning); }
@media (max-width: 640px) {
  .smtp-grid { grid-template-columns: minmax(0, 1fr) 90px; }
  .smtp-grid select { grid-column: 1 / -1; }
  .presets { margin-left: 0; }
  .field > span:has(.presets) { flex-wrap: wrap; }
  .mini-table td:last-child, .mini-table th:last-child { display: none; }
}
.subject-item .ph-row { display: none; }
.subject-item:focus-within .ph-row { display: flex; animation: ph-in .15s ease; }
@keyframes ph-in { from { opacity: 0; transform: translateY(-3px); } }
.subject-preview > span { white-space: nowrap; flex: none; }
@media (max-width: 640px) { .subject-preview b { white-space: normal; } }

/* ---------- Idioma (v1.6) ---------- */
.lang-switch { display: flex; justify-content: center; gap: 4px; margin-top: -6px; }
.lang-switch a { padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.lang-switch a:hover { color: var(--text); background: var(--surface-2); }
.lang-switch a.on { color: var(--primary); background: var(--primary-soft); }
.subject-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 2px 8px; align-items: center; }
.subject-row .subject-preview { grid-column: 2; }
.lang-tag { display: grid; place-items: center; height: 26px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
/* ---------- Fondo de la pantalla de acceso por empresa (v1.7) ---------- */
body.bare.has-bg { background: var(--bg); }
/* La foto va difuminada y algo apagada para que no compita con el acceso */
body.bare.has-bg::before {
  content: ""; position: fixed; inset: -40px; z-index: 0; pointer-events: none;
  background: var(--login-bg) center / cover no-repeat;
  filter: blur(var(--login-blur, 7px)) saturate(.75) brightness(1.04);
}
body.bare.has-bg::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--bg) 30%, transparent), color-mix(in srgb, var(--bg) 18%, transparent) 45%, color-mix(in srgb, var(--bg) 45%, transparent)),
    radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, #e0e7ff 35%, transparent) 0, transparent 60%);
}
[data-theme="dark"] body.bare.has-bg::before { filter: blur(var(--login-blur, 7px)) saturate(.65) brightness(.7); }
[data-theme="dark"] body.bare.has-bg::after {
  background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 45%, transparent), color-mix(in srgb, var(--bg) 30%, transparent) 45%, color-mix(in srgb, var(--bg) 60%, transparent));
}
body.bare.has-bg .theme-float { z-index: 31; }
body.bare.has-bg .auth-wrap { position: relative; z-index: 1; }
body.bare.has-bg .art-card { background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-color: color-mix(in srgb, var(--border) 60%, transparent); }
body.bare.has-bg .auth-card { box-shadow: 0 24px 70px rgba(0, 0, 0, .28); }

/* Ficha de empresa: vista previa del fondo con la silueta de la pantalla de acceso */
.bg-frame { position: relative; flex: none; width: 176px; height: 99px; border-radius: 12px; overflow: hidden; border: 1.5px dashed var(--border-strong); background: var(--surface-2); }
.uploader-preview.bg { width: 100%; height: 100%; }
.uploader-preview.bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-mini { position: absolute; inset: 0; pointer-events: none; }
.bg-mini i { position: absolute; left: 12%; width: 26%; height: 11%; border-radius: 3px; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.bg-mini i:first-child { top: 30%; } .bg-mini i:nth-child(2) { top: 50%; left: 18%; }
.bg-mini b { position: absolute; right: 14%; top: 22%; width: 26%; height: 56%; border-radius: 5px; background: rgba(255, 255, 255, .96); box-shadow: 0 3px 10px rgba(0, 0, 0, .25); }
.bg-uploader .uploader-body small.muted { max-width: 300px; }
/* ---------- Ventana de confirmación de cancelación / eliminación (v1.9) ---------- */
.cmodal {
  width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; padding: 28px 26px 22px; border: 0; border-radius: 20px;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(10, 12, 30, .35); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.cmodal:not([open]) { display: none; }
.cmodal[open] { animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
.cmodal::backdrop { background: rgba(15, 17, 35, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.cm-icon {
  width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 4px;
  background: var(--danger-soft); color: var(--danger); box-shadow: 0 0 0 8px color-mix(in srgb, var(--danger-soft) 55%, transparent);
}
.cmodal-cancel .cm-icon { animation: cm-shake .5s .15s ease; }
@keyframes cm-shake { 25% { transform: rotate(-8deg); } 50% { transform: rotate(6deg); } 75% { transform: rotate(-3deg); } }
.cmodal h2 { font-size: 19px; }
.cm-text { color: var(--muted); font-size: 14px; margin-top: -4px; }
.cm-res {
  width: 100%; text-align: left; margin: 6px 0 2px; padding: 14px 16px 14px 18px; border-radius: 14px; position: relative;
  background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; overflow: hidden;
}
.cm-res::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.cm-res strong { font-size: 15.5px; }
.cm-res span { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.cm-res .ico { color: var(--muted); }
.cm-notify { align-self: flex-start; font-size: 13.5px; margin-top: 2px; }
.cm-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.cm-actions .btn { justify-content: center; }
/* ---------- Ventanas propias para el resto de confirmaciones (v1.11) ---------- */
.cmodal-logout .cm-icon, .cmodal-send .cm-icon { background: var(--primary-soft); color: var(--primary); box-shadow: 0 0 0 8px color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.cmodal-warning .cm-icon { background: #fff4e5; color: #d97706; box-shadow: 0 0 0 8px rgba(255, 244, 229, .55); }
[data-theme="dark"] .cmodal-warning .cm-icon { background: #35260f; color: #fbbf24; box-shadow: 0 0 0 8px rgba(53, 38, 15, .5); }
.cmodal-logout[open] .cm-icon svg { animation: cm-slide .5s .15s ease; }
@keyframes cm-slide { 40% { transform: translateX(-4px); } }
.cmodal-delete[open] .cm-icon svg { animation: cm-shake .5s .15s ease; }
/* ---------- Ajustes: pestañas laterales agrupadas ---------- */
.settings-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 2px; }
.sn-group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 12px 6px; }
.sn-group:first-child { margin-top: 0; }
.settings-nav a { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; color: var(--text-2); border: 1px solid transparent; transition: background .15s, border-color .15s; }
.settings-nav a:hover { background: var(--surface); }
.settings-nav a.on { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); color: var(--text); }
.sn-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); color: var(--muted); transition: background .15s, color .15s; }
.settings-nav a.on .sn-ico { background: var(--primary-soft); color: var(--primary); }
.sn-text { display: flex; flex-direction: column; min-width: 0; }
.sn-text strong { font-size: 14px; }
.sn-text small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.settings-panel { min-width: 0; max-width: 860px; }
.settings-panel > .card + .card { margin-top: 20px; }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .sn-group, .sn-text small { display: none; }
  .settings-nav a { flex-shrink: 0; align-items: center; padding: 6px 12px 6px 6px; border-color: var(--border); background: var(--surface); }
  .sn-ico { width: 28px; height: 28px; }
}

/* Tema y colores */
.theme-form { gap: 22px; }
.tf-block { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tf-block legend, .tf-label { font-weight: 700; font-size: 14px; padding: 0; margin-bottom: 10px; }
.tf-label { margin-bottom: 0; }
.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mode-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.mode-card:hover { border-color: var(--border-strong); }
.mode-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.mc-art { height: 54px; border-radius: 9px; display: flex; overflow: hidden; border: 1px solid var(--border); }
.mc-art i { flex: 1; position: relative; }
.mc-art i::before, .mc-art i::after { content: ""; position: absolute; left: 10px; height: 6px; border-radius: 3px; }
.mc-art i::before { top: 12px; width: 50%; } .mc-art i::after { top: 24px; width: 32%; background: var(--primary); }
.mode-light .mc-art i { background: #f4f5fa; } .mode-light .mc-art i::before { background: #d4d8e4; }
.mode-dark .mc-art i { background: #0e1020; } .mode-dark .mc-art i::before { background: #343b5a; }
.mode-auto .mc-art i:first-child { background: #f4f5fa; } .mode-auto .mc-art i:first-child::before { background: #d4d8e4; }
.mode-auto .mc-art i:last-child { background: #0e1020; } .mode-auto .mc-art i:last-child::before { background: #343b5a; }
.mc-text { display: flex; flex-direction: column; line-height: 1.3; }
.mc-text strong { font-size: 14px; } .mc-text small { font-size: 12px; color: var(--muted); }
.presets-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.preset { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px 0 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.preset:hover { border-color: var(--border-strong); background: var(--surface-2); }
.preset.on { border-color: var(--primary); color: var(--text); box-shadow: 0 0 0 2px var(--primary-soft); }
.preset .sw { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(var(--a) 0 50%, var(--b) 50% 75%, var(--c) 75%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.color-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 104px auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.color-row input[type="color"] { width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: none; cursor: pointer; overflow: hidden; }
.color-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 11px; }
.color-row input[type="color"]::-moz-color-swatch { border: 0; border-radius: 11px; }
.cr-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.cr-text small { font-size: 12.5px; }
.color-row .hex { height: 38px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; text-transform: lowercase; text-align: center; padding: 0 8px; }
.color-row .hex:invalid { border-color: var(--danger); }
.color-row [data-color-reset][hidden] { display: inline; visibility: hidden; }
.contrast-hint { margin: 0; }
.theme-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tp { margin: 0; display: flex; flex-direction: column; gap: 6px; background: none; color: var(--text); }
.tp figcaption { font-size: 12px; color: var(--muted); text-align: center; }
.tp-app { display: flex; height: 172px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); box-shadow: var(--shadow); }
.tp-side { width: 34%; background: var(--sb-bg, var(--surface)); border-right: 1px solid var(--sb-border, var(--border)); padding: 10px 8px; display: flex; flex-direction: column; gap: 5px; }
.tp-side i { display: block; height: 5px; border-radius: 3px; background: currentColor; opacity: .55; }
.tp-brand { display: flex; align-items: center; gap: 6px; color: var(--sb-text, var(--text)); margin-bottom: 3px; }
.tp-brand .brand-mark { width: 20px; height: 20px; border-radius: 6px; box-shadow: none; flex-shrink: 0; }
.tp-brand i { flex: 1; opacity: .8; }
.tp-new { height: 16px; border-radius: 5px; background: var(--primary); color: var(--on-primary, #fff); display: grid; place-items: center; margin-bottom: 3px; outline: 1px solid var(--sb-btn-ring, transparent); outline-offset: -1px; }
.tp-nav { padding: 5px 6px; border-radius: 5px; color: var(--sb-text-2, var(--text-2)); }
.tp-nav i { width: 70%; }
.tp-nav.on { background: var(--sb-active-bg, var(--primary-soft)); color: var(--sb-active-text, var(--primary)); }
.tp-nav.on i { opacity: 1; }
.tp-label { padding: 6px 6px 0; color: var(--sb-muted, var(--muted)); } .tp-label i { width: 45%; height: 3px; }
.tp-main { flex: 1; padding: 12px; min-width: 0; display: flex; }
.tp-card { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tp-card strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-card small { font-size: 11px; color: var(--muted); }
.tp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 auto; font-size: 11px; }
.tp-row .badge { height: 20px; font-size: 10.5px; }
.tp-row .chip-btn { height: 20px; padding: 0 8px; font-size: 10.5px; pointer-events: none; }
.tp-row a { color: var(--primary); font-weight: 700; }
.tp-card .btn { align-self: flex-start; height: 26px; font-size: 11.5px; padding: 0 10px; pointer-events: none; }
@media (max-width: 640px) {
  .mode-cards { grid-template-columns: minmax(0, 1fr); }
  .mode-card { flex-direction: row; align-items: center; }
  .mc-art { width: 76px; height: 44px; flex-shrink: 0; }
  .color-row { grid-template-columns: 40px minmax(0, 1fr) 92px; }
  .color-row [data-color-reset] { grid-column: 3; justify-self: end; }
  .theme-previews { grid-template-columns: minmax(0, 1fr); }
}

/* Tema y colores → Mis paletas */
.cmodal-palette .cm-icon { background: var(--primary-soft); color: var(--primary); box-shadow: 0 0 0 8px color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.presets-label { min-width: 84px; }
.mine-row { padding-top: 2px; }
.my-presets { display: contents; }
.preset-wrap { display: inline-flex; align-items: center; position: relative; }
.preset.mine { padding-right: 28px; }
.preset-del { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.preset-del:hover { background: var(--danger-soft); color: var(--danger); }
.preset.add { border-style: dashed; color: var(--primary); padding: 0 12px 0 9px; gap: 5px; }
.preset.add:hover { border-color: var(--primary); background: var(--primary-soft); }
.my-msg { font-size: 12.5px; font-weight: 600; color: var(--success); opacity: 0; }
.my-msg.show { animation: my-msg 3.2s ease forwards; }
@keyframes my-msg { 0% { opacity: 0; transform: translateY(3px); } 10%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.cm-preset { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cm-preset .sw { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(var(--a) 0 50%, var(--b) 50% 75%, var(--c) 75%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.cm-field { width: 100%; text-align: left; margin-top: 4px; }
.cm-note { width: 100%; text-align: left; font-size: 12.5px; color: var(--warning); margin-top: -4px; }
.cm-note.err { color: var(--danger); }

[data-theme="dark"] .sidebar .brand-logo { background: #fff; padding: 6px 10px; }
.uploader-preview.brand-prev { width: 180px; height: 64px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: #fff; overflow: hidden; }
.uploader-preview.brand-prev img { max-width: 92%; max-height: 80%; object-fit: contain; }
.uploader-preview.icon-prev { width: 64px; height: 64px; border: 1.5px dashed var(--border-strong); border-radius: 16px; background: #fff; overflow: hidden; }
.uploader-preview.icon-prev img { width: 84%; height: 84%; object-fit: contain; }
.uploader-preview.login-logo-prev { width: 140px; height: 70px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: #fff; overflow: hidden; }
.uploader-preview.login-logo-prev img { width: 92%; height: 88%; object-fit: contain; }
/* ---------- Logotipo en modo oscuro ---------- */
.sidebar .brand-logo { filter: var(--sb-logo-filter, none); }
.logo-dark-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.logo-dark-opt { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); }
.logo-dark-opt input { position: absolute; opacity: 0; pointer-events: none; }
.logo-dark-opt:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.logo-dark-opt:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.ldo-prev { height: 64px; border-radius: 9px; background: #171a2b; display: grid; place-items: center; padding: 10px; }
.ldo-prev img { max-width: 100%; max-height: 40px; object-fit: contain; }
.ldo-plate img { background: #fff; padding: 5px 8px; border-radius: 7px; }
.ldo-white img { filter: brightness(0) invert(1); }
.ldo-text { display: flex; flex-direction: column; gap: 2px; }
.ldo-text strong { font-size: 14px; }
.ldo-text small { font-size: 12px; color: var(--muted); line-height: 1.35; }
@media (max-width: 760px) { .logo-dark-opts { grid-template-columns: 1fr; } }
.logo-dark-opts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .logo-dark-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .logo-dark-opts { grid-template-columns: 1fr; } }
.ldo-empty { color: rgba(255, 255, 255, .55); }
.ldo-upload { margin-top: 12px; }
.ldo-upload[hidden] { display: none; }
.ldo-darkprev { background: #171a2b !important; }
.logo-d { display: none; }

/* Galería de fondos de la pantalla de acceso */
.bg-gallery { display: grid; gap: 6px; margin-top: 10px; }
.bg-gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bg-opt { position: relative; display: grid; gap: 4px; cursor: pointer; font-size: .78rem; text-align: center; color: var(--text-2, inherit); }
.bg-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.bg-opt img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 2px solid var(--border); transition: border-color .15s, box-shadow .15s; }
.bg-opt:hover img { border-color: var(--border-strong); }
.bg-opt input:checked + img { border-color: var(--primary, #0a8a5a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #0a8a5a) 25%, transparent); }
.bg-opt input:checked ~ span { font-weight: 600; }
.bg-opt input:focus-visible + img { outline: 2px solid var(--primary, #0a8a5a); outline-offset: 2px; }
@media (max-width: 520px) { .bg-gallery-grid { grid-template-columns: 1fr 1fr; } }
.bg-gallery-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bg-gallery-add small { min-width: 0; overflow-wrap: anywhere; }
.bg-tools { display: flex; align-items: center; justify-content: center; gap: 6px 10px; flex-wrap: wrap; }
.bg-tools .btn { padding: 3px 8px; font-size: .74rem; }

.blur-field { display: grid; gap: 6px; margin-top: 12px; }
.blur-row { display: flex; align-items: center; gap: 12px; }
.blur-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--primary); }
.blur-row output { min-width: 48px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bg-frame .uploader-preview.bg img { transition: filter .15s; }
.chip-btn small { font-weight: 600; color: var(--muted); font-size: 11.5px; }
.chip-btn:hover { border-color: var(--border-strong); }
.chip-btn.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary, #fff); }
.chip-btn.on small { color: rgba(255, 255, 255, .8); }
.chip-btn { display: inline-flex; align-items: baseline; gap: 5px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s, color .15s; align-items: center; }

/* ---------- Tarjetas decorativas y Bizi en la pantalla de acceso ---------- */
@keyframes float { 50% { transform: translateY(-8px); } }
.auth-art { position: relative; width: 340px; height: 440px; }
.art-card { position: absolute; width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px 14px 22px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; animation: float 6s ease-in-out infinite; }
.art-card > div { display: flex; flex-direction: column; min-width: 0; }
.art-ico { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center; font-style: normal; background: color-mix(in srgb, var(--k) 14%, var(--surface)); color: var(--k); }
.art-card span { position: absolute; left: 0; top: 14px; bottom: 14px; width: 5px; border-radius: 0 5px 5px 0; }
.art-card b { font-size: 14px; }
.art-card small { color: var(--muted); }
.art-card.c1 { top: 10px; left: 0; --k: var(--brand, #16a34a); } .art-card.c1 span { background: var(--k); }
.art-card.c2 { top: 120px; left: 60px; animation-delay: -2s; --k: #2563eb; } .art-card.c2 span { background: var(--k); }
.art-card.c3 { top: 230px; left: 20px; animation-delay: -4s; --k: #10b981; } .art-card.c3 span { background: var(--k); }
.art-card.c4 { top: 340px; left: 70px; animation-delay: -1s; --k: #f59e0b; } .art-card.c4 span { background: var(--k); }
.art-card { min-height: 88px; }
.auth-art.with-bizi { height: 750px; }
.auth-art.with-bizi .art-card.c1 { top: 0; } .auth-art.with-bizi .art-card.c2 { top: 104px; } .auth-art.with-bizi .art-card.c3 { top: 208px; } .auth-art.with-bizi .art-card.c4 { top: 312px; }
.auth-art .art-card { z-index: 2; }
.bizi.bizi-sit { position: absolute; left: 4px; bottom: 0; width: 320px; margin-bottom: 16px; z-index: 1; pointer-events: none; }
.bizi-sit-fig { position: relative; filter: drop-shadow(0 12px 14px rgba(1, 62, 39, .22)); transform-origin: 50% 100%; animation: bz-breathe 4.2s ease-in-out infinite; }
.bizi-sit-main { display: block; width: 100%; height: auto; }
.bizi-lid { position: absolute; left: 23.08%; top: 34.2%; width: 40.97%; height: 24.89%; opacity: 0; animation: bz-lid 5.2s ease-in-out 1.2s infinite; }
@keyframes bz-lid { 0%, 93%, 100% { opacity: 0; } 94.5%, 97% { opacity: 1; } }
@keyframes bz-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012, 1.018); } }

/* Foto de perfil: el avatar con imagen, el botón de cambiarla y el formulario de Mi perfil */
.avatar.has-img { padding: 0; overflow: hidden; background: var(--surface-2); }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-edit { position: relative; display: block; cursor: pointer; border-radius: 50%; }
.avatar-edit .avatar.xl { width: 88px; height: 88px; font-size: 28px; }
.avatar-edit-badge { position: absolute; right: 0; bottom: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--on-primary, #fff); display: grid; place-items: center; border: 3px solid var(--surface); transition: transform .15s; }
.avatar-edit:hover .avatar-edit-badge { transform: scale(1.1); }
.avatar-edit:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; }
.photo-form { display: grid; justify-items: start; gap: 6px; flex: none; }
.photo-remove { font-size: 12.5px; }
