:root {
  color-scheme: dark;
  --bg: #07110e;
  --bg-deep: #040a08;
  --surface: #0c1b16;
  --surface-raised: #10251e;
  --surface-soft: rgba(16, 37, 30, .62);
  --line: rgba(182, 222, 207, .14);
  --line-strong: rgba(182, 222, 207, .26);
  --text: #f2f7f4;
  --muted: #a6b8b1;
  --green: #5ee6a8;
  --green-deep: #37cb8e;
  --cyan: #65d9e8;
  --amber: #efbf66;
  --red: #ff8a85;
  --blue: #8bb8ff;
  --shadow: 0 28px 75px rgba(0, 0, 0, .28);
  --radius: 18px;
  --max-width: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 2%, rgba(55, 203, 142, .075), transparent 30rem),
    linear-gradient(rgba(182, 222, 207, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(182, 222, 207, .018) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 52px 52px, 52px 52px, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
::selection { color: #04110c; background: var(--green); }

.shell { width: min(calc(100% - 3rem), var(--max-width)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; top: 1rem; left: 1rem; padding: .7rem 1rem; border-radius: 8px; color: #04110c; background: var(--green); font-weight: 800; transform: translateY(-160%); transition: transform .18s ease; }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; z-index: 50; top: 0; border-bottom: 1px solid var(--line); background: rgba(7, 17, 14, .88); backdrop-filter: blur(18px); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .72rem; color: var(--text); text-decoration: none; font-size: 1.02rem; font-weight: 820; letter-spacing: .08em; }
.brand img { flex: 0 0 auto; }
.brand strong { color: var(--green); font-weight: inherit; }
.header-actions { display: flex; align-items: center; gap: 1.2rem; }
.header-actions > a { padding-block: 1.5rem; color: var(--muted); text-decoration: none; font-size: .87rem; font-weight: 720; }
.header-actions > a:hover, .header-actions > a[aria-current="page"] { color: var(--text); }
.header-actions form { margin: 0; }
.user-chip { display: inline-flex; align-items: center; gap: .65rem; padding-left: 1.2rem; border-left: 1px solid var(--line); color: var(--text); font-size: .83rem; font-weight: 680; }
.user-chip small { display: block; color: var(--muted); font-size: .62rem; font-weight: 620; letter-spacing: .04em; }
.presence-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(94, 230, 168, .1); }
.secure-label { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .78rem; font-weight: 700; }
.secure-label span { color: var(--green); font-size: .58rem; }
.nav-toggle { display: none; width: 44px; height: 44px; padding: 11px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); background: var(--surface); }
.nav-toggle > span[aria-hidden] { display: block; height: 2px; margin: 4px 0; border-radius: 2px; background: currentColor; }

.main-content { padding-top: 3.8rem; padding-bottom: 6rem; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); background: rgba(4, 10, 8, .6); }
.footer-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; font-size: .75rem; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
h1 { margin-bottom: .75rem; font-size: clamp(2.35rem, 5vw, 4.2rem); font-weight: 760; }
h2 { margin-bottom: .45rem; font-size: clamp(1.45rem, 2.3vw, 2rem); }
h3 { margin-bottom: .4rem; }
.eyebrow { margin: 0 0 .55rem; color: var(--green); font-size: .68rem; font-weight: 850; letter-spacing: .17em; text-transform: uppercase; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 3rem; margin-bottom: 2.5rem; }
.page-heading > div > p:last-child { margin-bottom: 0; color: var(--muted); }
.page-heading--compact { margin-bottom: 2.2rem; }
.breadcrumbs { display: flex; align-items: center; gap: .65rem; margin-bottom: 1.6rem; color: var(--muted); font-size: .78rem; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--green); }
.breadcrumbs [aria-current="page"] { max-width: 32ch; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.role-pill, .read-only-label { display: inline-flex; width: fit-content; align-items: center; padding: .42rem .72rem; border: 1px solid var(--line-strong); border-radius: 999px; color: #cbdad5; background: rgba(255, 255, 255, .025); font-size: .69rem; font-weight: 750; letter-spacing: .025em; white-space: nowrap; }

.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .66rem 1rem; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); background: transparent; font-weight: 760; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.button:hover { border-color: rgba(94, 230, 168, .5); background: rgba(94, 230, 168, .07); transform: translateY(-1px); }
.button--primary { border-color: var(--green); color: #04110c; background: var(--green); box-shadow: 0 12px 34px rgba(55, 203, 142, .16); }
.button--primary:hover { color: #04110c; background: #79efba; }
.button--quiet { min-height: 41px; font-size: .78rem; }
.button--small { min-height: 37px; padding: .45rem .75rem; }
.button--full { width: 100%; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; margin-bottom: 1rem; }
.metric-card { min-height: 140px; padding: 1.35rem; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(16, 37, 30, .74), rgba(7, 17, 14, .76)); }
.metric-card span, .metric-card small, .metric-card strong { display: block; }
.metric-card span { color: var(--muted); font-size: .7rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.metric-card strong { margin: .35rem 0 .2rem; font-size: 2.45rem; line-height: 1; }
.metric-card small { color: #71877f; font-size: .68rem; }
.metric-card--good { border-color: rgba(94, 230, 168, .24); }
.metric-card--good strong { color: var(--green); }
.metric-card--warn { border-color: rgba(239, 191, 102, .3); }
.metric-card--warn strong { color: var(--amber); }

.content-panel { margin-top: 1rem; padding: 1.55rem; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(16, 37, 30, .72), rgba(7, 17, 14, .8)); box-shadow: 0 18px 60px rgba(0, 0, 0, .11); }
.panel-toolbar, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-bottom: 1.35rem; }
.panel-toolbar h2, .panel-heading h2 { margin-bottom: 0; }
.filter-form { display: flex; align-items: center; gap: .55rem; }
input, select { min-height: 43px; max-width: 100%; padding: .65rem .82rem; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); outline: none; background: #091611; transition: border-color .18s ease, box-shadow .18s ease; }
input { width: min(300px, 70vw); }
select { min-width: 180px; }
input::placeholder { color: #71877f; }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(101, 217, 232, .11); }

.tenant-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.tenant-card { min-height: 112px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: rgba(255, 255, 255, .014); text-decoration: none; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.tenant-card:hover { border-color: rgba(94, 230, 168, .35); background: rgba(94, 230, 168, .035); transform: translateY(-2px); }
.tenant-icon { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgba(94, 230, 168, .35); border-radius: 12px; color: var(--green); background: rgba(94, 230, 168, .07); font-weight: 850; }
.tenant-copy { min-width: 0; display: grid; }
.tenant-copy small { color: var(--green); font-size: .63rem; font-weight: 750; text-transform: uppercase; }
.tenant-copy strong { overflow: hidden; margin: .16rem 0; text-overflow: ellipsis; white-space: nowrap; }
.tenant-copy > span { color: var(--muted); font-size: .75rem; }
.tenant-arrow, .row-arrow { color: var(--green); transition: transform .2s ease; }
.tenant-card:hover .tenant-arrow, .appliance-row:hover .row-arrow { transform: translateX(3px); }

.appliance-list { border-top: 1px solid var(--line); }
.appliance-row { min-height: 82px; display: grid; grid-template-columns: auto minmax(180px, 1.2fr) minmax(100px, .7fr) minmax(150px, .8fr) auto auto; align-items: center; gap: 1rem; padding: .9rem .5rem; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; transition: background .18s ease; }
.appliance-row:hover { background: rgba(94, 230, 168, .025); }
.appliance-identity, .appliance-meta { min-width: 0; display: grid; }
.appliance-identity small, .appliance-meta small { color: var(--muted); font-size: .64rem; }
.appliance-identity strong, .appliance-meta strong { overflow: hidden; font-size: .85rem; text-overflow: ellipsis; white-space: nowrap; }
.status-orb { width: 9px; height: 9px; border-radius: 50%; background: #71877f; box-shadow: 0 0 0 4px rgba(113, 135, 127, .1); }
.status-orb--healthy { background: var(--green); box-shadow: 0 0 0 4px rgba(94, 230, 168, .1); }
.status-orb--degraded, .status-orb--pending { background: var(--amber); box-shadow: 0 0 0 4px rgba(239, 191, 102, .1); }
.status-orb--offline, .status-orb--blocked { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 138, 133, .1); }

.status { width: fit-content; display: inline-flex; align-items: center; gap: .45rem; padding: .34rem .62rem; border: 1px solid var(--line-strong); border-radius: 999px; color: #ccd9d5; background: rgba(255, 255, 255, .02); font-size: .66rem; font-weight: 780; white-space: nowrap; }
.status > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--healthy { border-color: rgba(94, 230, 168, .25); color: var(--green); background: rgba(94, 230, 168, .05); }
.status--degraded, .status--pending { border-color: rgba(239, 191, 102, .25); color: var(--amber); background: rgba(239, 191, 102, .05); }
.status--offline, .status--blocked { border-color: rgba(255, 138, 133, .24); color: var(--red); background: rgba(255, 138, 133, .04); }
.status--unknown { color: var(--muted); }

.appliance-hero { display: flex; align-items: end; justify-content: space-between; gap: 3rem; margin-bottom: 1.4rem; padding: 1.8rem 0 1rem; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; color: var(--muted); font-size: .75rem; }
.last-contact { min-width: 250px; display: grid; padding: 1rem 1.2rem; border-left: 2px solid var(--green); background: rgba(94, 230, 168, .03); }
.last-contact small, .last-contact time { color: var(--muted); font-size: .67rem; }
.last-contact strong { margin: .12rem 0; }
.detail-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1rem; }
.detail-grid .content-panel { margin-top: 0; }
.health-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1.25rem; }
.health-component { min-height: 85px; display: flex; align-items: center; gap: .8rem; padding: .85rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, .016); }
.health-component div { min-width: 0; display: grid; }
.health-component small { color: var(--muted); font-size: .63rem; }
.health-component strong { font-size: .76rem; }
.definition-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.definition-grid > div { min-width: 0; padding: .85rem .2rem; border-bottom: 1px solid var(--line); }
.definition-grid > div:nth-child(odd) { padding-right: 1rem; }
.definition-grid > div:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--line); }
.definition-grid dt { color: var(--muted); font-size: .64rem; }
.definition-grid dd { margin: .18rem 0 0; font-size: .78rem; font-weight: 680; }
.definition-grid--single { grid-template-columns: 1fr; }
.definition-grid--single > div { padding-inline: .2rem; border-left: 0; }
.mono, code { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
code { color: #bce9d7; font-size: .74rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.safety-note { display: flex; gap: .65rem; margin: 1rem 0 0; color: var(--muted); font-size: .68rem; }
.safety-note span { flex: 0 0 auto; width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--cyan); font-weight: 800; }

.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
.table-scroll:focus-visible { outline-offset: 4px; }
table { width: 100%; border-collapse: collapse; font-size: .77rem; }
th { color: var(--muted); background: rgba(4, 10, 8, .42); font-size: .61rem; font-weight: 760; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
th, td { min-width: 112px; padding: .78rem .85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .015); }
.event-outcome { color: #c8d8d2; font-size: .68rem; font-weight: 730; }
.command-status { display: inline-flex; padding: .28rem .5rem; border-radius: 6px; color: var(--muted); background: rgba(255, 255, 255, .04); font-size: .64rem; font-weight: 760; }
.command-status--succeeded { color: var(--green); background: rgba(94, 230, 168, .07); }
.command-status--failed, .command-status--cancelled { color: var(--red); background: rgba(255, 138, 133, .06); }
.command-status--pending, .command-status--delivered { color: var(--blue); background: rgba(139, 184, 255, .06); }
.command-status--draft { color: var(--amber); background: rgba(239, 191, 102, .06); }

.empty-state { padding: 4rem 1rem; color: var(--muted); text-align: center; }
.empty-state > span { display: block; margin-bottom: .7rem; color: var(--green); font-size: 2rem; }
.empty-state h3 { color: var(--text); }
.empty-state p { max-width: 520px; margin: 0 auto; }
.empty-state--compact { padding: 1.5rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1.2rem; padding-top: 1.4rem; color: var(--muted); font-size: .72rem; }
.pagination a { color: var(--green); font-weight: 750; text-decoration: none; }
.pagination [aria-disabled="true"] { opacity: .45; }
.message-stack { margin-bottom: 1rem; }
.message { padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }

.login-body { background: radial-gradient(circle at 70% 20%, rgba(55, 203, 142, .09), transparent 35rem), var(--bg-deep); }
.login-main { display: grid; align-items: center; padding-top: 4rem; padding-bottom: 5rem; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .68fr); align-items: center; gap: clamp(3rem, 8vw, 8rem); }
.login-intro h1 { max-width: 760px; margin-bottom: 1.4rem; font-size: clamp(3rem, 5.6vw, 5.7rem); }
.login-intro h1 span { color: var(--green); }
.login-intro > p:not(.eyebrow) { max-width: 620px; color: var(--muted); font-size: 1.04rem; }
.trust-list { display: flex; flex-wrap: wrap; gap: 1.3rem; margin: 2rem 0 0; padding: 0; color: #bfd0ca; list-style: none; font-size: .72rem; font-weight: 680; }
.trust-list li { display: flex; align-items: center; gap: .45rem; }
.trust-list li span { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.login-card { position: relative; padding: clamp(1.5rem, 4vw, 2.4rem); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 22px; background: linear-gradient(145deg, rgba(16, 37, 30, .96), rgba(7, 17, 14, .98)); box-shadow: var(--shadow); animation: card-enter .45s ease both; }
.login-card::before { position: absolute; top: 0; right: 0; left: 0; height: 2px; content: ""; background: linear-gradient(90deg, transparent, var(--green), transparent); }
.card-heading { margin-bottom: 1.7rem; }
.card-heading h2 { font-size: 2rem; }
.card-heading > p:last-child { margin: 0; color: var(--muted); font-size: .82rem; }
.auth-form { display: grid; gap: 1.05rem; }
.field-group { display: grid; gap: .38rem; }
.field-group label { color: #d4e0dc; font-size: .72rem; font-weight: 750; }
.field-group input { width: 100%; min-height: 50px; }
.field-group--error input { border-color: var(--red); }
.field-error { margin: 0; color: var(--red); font-size: .7rem; }
.form-alert { margin-bottom: 1rem; padding: .75rem .85rem; border: 1px solid rgba(255, 138, 133, .25); border-radius: 9px; color: #ffd0ce; background: rgba(255, 138, 133, .055); font-size: .72rem; }
.login-help { margin: 1.25rem 0 0; color: #71877f; font-size: .66rem; text-align: center; }
@keyframes card-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1040px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .appliance-row { grid-template-columns: auto 1fr auto auto; }
  .appliance-row .appliance-meta { display: none; }
  .login-layout { grid-template-columns: 1fr 420px; gap: 3rem; }
}

@media (max-width: 820px) {
  .shell { width: min(calc(100% - 2rem), var(--max-width)); }
  .has-js .nav-toggle { display: block; }
  .has-js .header-actions { position: absolute; top: calc(100% + 1px); right: 0; left: 0; display: none; align-items: stretch; padding: 1rem; border-bottom: 1px solid var(--line); background: #07110e; box-shadow: 0 18px 30px rgba(0, 0, 0, .28); }
  .has-js .header-actions--open { display: grid; }
  .has-js .header-actions > a { padding: .65rem; }
  .has-js .user-chip { padding: .65rem; border-left: 0; }
  .has-js .header-actions .button { width: 100%; }
  .page-heading, .appliance-hero { align-items: start; flex-direction: column; gap: 1.3rem; }
  .last-contact { width: 100%; }
  .panel-toolbar--stackable { align-items: stretch; flex-direction: column; }
  .panel-toolbar--stackable .filter-form { align-items: stretch; }
  .tenant-grid { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { text-align: center; }
  .login-intro h1 { font-size: clamp(2.7rem, 10vw, 4.5rem); }
  .login-intro > p:not(.eyebrow) { margin-inline: auto; }
  .trust-list { justify-content: center; }
}

@media (max-width: 620px) {
  .main-content { padding-top: 2.4rem; padding-bottom: 4rem; }
  .footer-inner { align-items: start; flex-direction: column; justify-content: center; gap: .25rem; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 120px; padding: 1rem; }
  .metric-card strong { font-size: 2rem; }
  .content-panel { padding: 1rem; }
  .panel-toolbar, .panel-heading { align-items: flex-start; flex-direction: column; gap: .8rem; }
  .filter-form { width: 100%; align-items: stretch; flex-direction: column; }
  .filter-form div, .filter-form input, .filter-form select, .filter-form button { width: 100%; }
  .appliance-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .appliance-row .status { display: none; }
  .health-grid { grid-template-columns: 1fr; }
  .definition-grid { grid-template-columns: 1fr; }
  .definition-grid > div:nth-child(n) { padding-inline: .2rem; border-left: 0; }
  .pagination { justify-content: space-between; }
  .pagination > span:nth-child(2) { display: none; }
  .login-main { padding-top: 2.5rem; }
  .login-intro h1 { font-size: 2.75rem; }
  .trust-list { display: grid; justify-content: start; max-width: 300px; margin-inline: auto; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .status-orb, .presence-dot, .trust-list li span { border: 1px solid CanvasText; }
  .status, .role-pill, .read-only-label { border: 1px solid CanvasText; }
}

/* ── Formularios de administración ─────────────────────────────────────── */
.content-panel--form { max-width: 62rem; }
.page-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-top: 1.4rem; }
.page-heading h1 { margin: .2rem 0 0; }
fieldset { margin: 0 0 1.5rem; padding: 1.1rem 1.15rem .35rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
legend { padding-inline: .5rem; color: var(--green); font-size: .68rem; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 1rem; }
.field-help { margin: .3rem 0 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.field-help--strong { padding: .7rem .85rem; border-left: 2px solid var(--green); border-radius: 0 8px 8px 0; background: rgba(94, 230, 168, .06); color: var(--text); }
.field-group abbr { margin-left: .2rem; color: var(--green); text-decoration: none; }
.field-group--check { padding-block: .55rem; }
.check-label { display: flex; align-items: flex-start; gap: .6rem; font-size: .8rem; line-height: 1.45; cursor: pointer; }
.check-label input { flex-shrink: 0; width: 18px; height: 18px; margin-top: .1rem; accent-color: var(--green); }
.check-label--standalone { margin-bottom: 1rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }
.form-alert { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.form-alert form { margin: 0; }
.form-alert--good { border-color: rgba(94, 230, 168, .45); background: rgba(94, 230, 168, .09); color: var(--text); }
.form-alert--notice { border-color: rgba(239, 191, 102, .45); background: rgba(239, 191, 102, .08); color: var(--text); }
.requirements-note { margin-bottom: 1.5rem; padding: 1rem 1.15rem; border: 1px solid var(--line); border-left: 2px solid var(--cyan); border-radius: 0 12px 12px 0; background: rgba(101, 217, 232, .05); }
.requirements-note h2 { margin: 0 0 .5rem; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.requirements-note ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: .78rem; line-height: 1.65; }
.requirements-note strong { color: var(--text); }

/* ── Asistente por pasos ───────────────────────────────────────────────── */
.wizard-steps { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.wizard-steps li { display: flex; align-items: center; gap: .5rem; padding: .5rem .85rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .74rem; font-weight: 680; }
.wizard-steps li span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(182, 222, 207, .12); font-size: .66rem; }
.wizard-steps li[aria-current="step"] { border-color: var(--green); color: var(--text); background: rgba(94, 230, 168, .09); }
.wizard-steps li[aria-current="step"] span { background: var(--green); color: #04110c; }
.wizard-steps li.is-done { color: var(--text); }
.wizard-steps li.is-done span { background: rgba(94, 230, 168, .22); color: var(--green); }

/* ── Segundo factor ────────────────────────────────────────────────────── */
.login-layout--narrow { grid-template-columns: minmax(0, 30rem); justify-content: center; }
.login-card--wide { max-width: 34rem; }
.steps-list { margin: 1.2rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: .82rem; line-height: 1.8; }
.qr-frame { display: grid; place-items: center; margin: 0 auto 1.1rem; padding: .9rem; width: fit-content; border-radius: 14px; background: #fff; }
.qr-frame svg { display: block; width: 190px; height: 190px; }
.manual-key { margin-bottom: 1.1rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 10px; }
.manual-key summary { color: var(--muted); font-size: .76rem; cursor: pointer; }
.manual-key p { margin: .6rem 0 0; color: var(--muted); font-size: .74rem; }
.secret-key { display: flex; flex-wrap: wrap; gap: .4rem; }
.secret-key span { padding: .28rem .5rem; border-radius: 6px; background: rgba(182, 222, 207, .1); color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; letter-spacing: .06em; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .5rem; margin: 0 0 1.2rem; padding: 0; list-style: none; }
.recovery-codes li { padding: .55rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84rem; text-align: center; letter-spacing: .04em; }
.reveal-value { padding: .3rem .55rem; border-radius: 6px; background: rgba(94, 230, 168, .12); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem; user-select: all; }

/* ── Tablas ────────────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; margin-top: .8rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.data-table th, .data-table td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table thead th { color: var(--muted); font-size: .64rem; font-weight: 720; letter-spacing: .07em; text-transform: uppercase; }
.data-table tbody th { font-weight: 700; }
.data-table small { display: block; color: var(--muted); font-size: .7rem; font-weight: 500; }
.cell-actions { text-align: right; }
.cell-actions form { display: inline; }
.role-chip { display: inline-block; padding: .2rem .55rem; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .68rem; font-weight: 700; }
.role-chip--owner { border-color: rgba(94, 230, 168, .5); color: var(--green); }
.role-chip--admin { border-color: rgba(101, 217, 232, .5); color: var(--cyan); }
.role-chip--operator { border-color: rgba(139, 184, 255, .5); color: var(--blue); }
.role-chip--viewer { color: var(--muted); }
.detail-grid--split { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }

/* ── Estado del despliegue ─────────────────────────────────────────────── */
.status-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .74rem; font-weight: 740; white-space: nowrap; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill--queued, .status-pill--probing, .status-pill--installing { border-color: rgba(101, 217, 232, .5); color: var(--cyan); }
.status-pill--awaiting_config { border-color: rgba(239, 191, 102, .55); color: var(--amber); }
.status-pill--succeeded { border-color: rgba(94, 230, 168, .55); color: var(--green); }
.status-pill--rejected, .status-pill--failed { border-color: rgba(255, 138, 133, .55); color: var(--red); }
.status-pill--cancelled { color: var(--muted); }
.status-detail { margin: .6rem 0 0; color: var(--muted); font-size: .82rem; }
.finding-list { margin: .8rem 0 0; padding: 0; list-style: none; }
.finding-list li { padding: .8rem .95rem; margin-bottom: .6rem; border: 1px solid var(--line); border-left-width: 2px; border-radius: 0 10px 10px 0; background: var(--surface-soft); }
.finding-list strong { font-size: .82rem; }
.finding-list p { margin: .3rem 0 0; color: var(--muted); font-size: .76rem; line-height: 1.55; }
.finding-list--blocker li { border-left-color: var(--red); }
.finding-list--warning li { border-left-color: var(--amber); }
.finding-fix { color: var(--green) !important; }

/* ── Registro en vivo ──────────────────────────────────────────────────── */
.card-heading--row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .6rem; }
.log-status { margin: 0; color: var(--muted); font-size: .72rem; }
.log-view { max-height: 30rem; overflow-y: auto; margin-top: .8rem; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-deep); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; line-height: 1.6; }
.log-view:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.log-line { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .8rem; margin: 0; padding: .12rem 0; }
.log-phase { color: rgba(166, 184, 177, .55); font-size: .68rem; text-align: right; }
.log-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.log-line--warning .log-message { color: var(--amber); }
.log-line--error .log-message { color: var(--red); }
.log-line--debug .log-message { color: var(--muted); }

@media (max-width: 820px) {
  .detail-grid--split { grid-template-columns: minmax(0, 1fr); }
  .log-line { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .log-phase { text-align: left; }
  .page-heading { align-items: flex-start; }
}

.heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.tenant-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.active-deployments { margin: .8rem 0 0; padding: 0; list-style: none; }
.active-deployments li { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; padding: .7rem .2rem; border-bottom: 1px solid var(--line); }
.active-deployments li:last-child { border-bottom: 0; }
.active-deployments a { font-weight: 700; font-size: .85rem; }
.deployment-target { flex: 1 1 12rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; }
