* { box-sizing: border-box; }

:root {
    color-scheme: light;
    --bg: #eef6f1;
    --bg-2: #f7faf8;
    --surface: #ffffff;
    --surface-2: #f3f8f5;
    --text: #1f2d29;
    --muted: #60736d;
    --line: rgba(18, 140, 126, 0.14);
    --line-strong: rgba(18, 140, 126, 0.22);
    --brand: #25d366;
    --brand-strong: #128c7e;
    --brand-ink: #075e54;
    --brand-soft: rgba(37, 211, 102, 0.12);
    --danger: #c62828;
    --danger-soft: rgba(198, 40, 40, 0.09);
    --warn: #8d6e00;
    --warn-soft: rgba(141, 110, 0, 0.09);
    --ok: #0f8a4d;
    --ok-soft: rgba(15, 138, 77, 0.11);
    --shadow-sm: 0 1px 2px rgba(17, 33, 29, 0.06);
    --shadow-md: 0 10px 30px rgba(17, 33, 29, 0.09);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
}

@font-face {
    font-family: "Material Symbols Outlined";
    src: url("./fonts/MaterialSymbolsOutlined.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 700;
    font-display: swap;
}

html { background: var(--bg); }
body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37, 211, 102, 0.12), transparent 26%),
        radial-gradient(circle at right 20%, rgba(18, 140, 126, 0.08), transparent 24%),
        linear-gradient(180deg, var(--bg), var(--bg-2));
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 70%);
    opacity: 0.4;
}

a {
    color: var(--brand-ink);
    text-decoration: none;
}

main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 20px clamp(16px, 2vw, 28px) 28px;
    position: relative;
    z-index: 1;
}

h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.2;
}

.subtitulo {
    margin: 6px 0 0;
    color: var(--muted);
}

.topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px clamp(16px, 2vw, 28px);
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.marca {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.marca-texto {
    display: grid;
    gap: 2px;
    line-height: 1.05;
}

.marca-version {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.marca-icono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 13px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(243, 248, 245, 0.95));
    box-shadow: 0 8px 18px rgba(18, 140, 126, 0.14);
    overflow: hidden;
}

.marca-icono img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav form {
    margin: 0;
}

.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown summary {
    list-style: none;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease, color 120ms ease, border-color 120ms ease;
}

.nav-dropdown-toggle.nav-link {
    width: auto;
    min-width: 0;
    padding: 0 14px;
    box-shadow: none;
}

.nav-dropdown-toggle img {
    width: 50px;
    height: 50px;
    display: block;
}

.nav-dropdown-toggle .icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    opacity: 0.9;
}

.nav-dropdown-toggle:hover {
    color: var(--text);
    background: rgba(37, 211, 102, 0.08);
    border-color: rgba(37, 211, 102, 0.16);
}

.nav-dropdown[open] .nav-dropdown-toggle {
    color: var(--brand-ink);
    background: rgba(37, 211, 102, 0.14);
    border-color: rgba(37, 211, 102, 0.24);
    box-shadow: 0 8px 20px rgba(17, 33, 29, 0.08);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 250px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
    display: grid;
    gap: 6px;
    z-index: 40;
}

.nav-dropdown-menu::before {
    content: "";
    position: absolute;
    left: 14px;
    top: -6px;
    width: 12px;
    height: 12px;
    background: inherit;
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
    transform: rotate(45deg);
}

.nav-dropdown-menu a {
    min-height: 42px;
    width: 100%;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: flex-start !important;
    text-align: left;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.nav-dropdown-menu a:hover {
    background: rgba(37, 211, 102, 0.08);
    color: var(--text);
}

.nav a,
.nav-link,
.accion,
.secundario,
.boton,
button,
.tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease, color 120ms ease, border-color 120ms ease;
}

.nav a {
    padding: 0 14px;
    color: var(--muted);
    border: 1px solid transparent;
}

.nav-dropdown-toggle .icon {
    width: 18px;
    height: 18px;
}

.nav-link {
    padding: 0 14px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
}

.nav-external img {
    width: 18px;
    height: 18px;
    display: block;
}

.nav a:hover {
    color: var(--text);
    background: rgba(37, 211, 102, 0.08);
    border-color: rgba(37, 211, 102, 0.16);
}

.nav-dropdown[open] .nav-dropdown-menu {
    animation: nav-dropdown-in 140ms ease-out;
}

@keyframes nav-dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-link:hover {
    color: var(--text);
    background: rgba(37, 211, 102, 0.08);
    border-color: rgba(37, 211, 102, 0.16);
    transform: none;
    box-shadow: none;
}

.nav a.is-active {
    color: var(--brand-ink);
    background: rgba(37, 211, 102, 0.14);
    border-color: rgba(37, 211, 102, 0.24);
}

.nav .icon,
.accion .icon,
.secundario .icon,
.boton .icon,
button .icon,
.tab-button .icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.icon,
.material-symbols-outlined {
    font-family: "Material Symbols Outlined";
    font-weight: 400;
    font-size: 18px;
    line-height: 1;
    font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
    font-feature-settings: 'liga' 1;
    font-variant-ligatures: discretionary-ligatures;
    text-rendering: optimizeLegibility;
    font-style: normal;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    font-synthesis: none;
}

.barra {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.panel,
.login-box,
.resultado,
.formulario,
.surface-muted {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.panel {
    overflow: visible;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    justify-content: stretch;
    align-items: start;
}

.app-card {
    min-height: 100%;
}

.app-card {
    padding: 18px;
    display: grid;
    gap: 12px;
}

.app-card-head,
.app-sidebar-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.app-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(37, 211, 102, 0.10);
    color: var(--brand-ink);
}

.app-card h2 {
    margin-bottom: 0;
}

.app-desc {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.app-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.empty-card {
    grid-column: 1 / -1;
}

.app-layout {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    min-height: calc(100vh - 150px);
}

.app-sidebar,
.app-content {
    padding: 18px;
}

.app-sidebar {
    display: grid;
    gap: 16px;
    align-self: start;
}

.app-content {
    min-width: 0;
    overflow: hidden;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--brand-ink);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-form {
    max-width: none;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.app-form-footer {
    align-items: center;
    justify-content: space-between;
}

.app-delete-form {
    margin: 0;
}

.tabs-shell {
    padding: 0;
}

.tabs {
    display: flex;
    gap: 10px;
    padding: 14px 14px 0;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
}

.tabs .tab-button {
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    background: linear-gradient(180deg, #f8fbf9, #eef6f1);
    color: var(--muted);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.8);
}

.tabs .tab-button:hover {
    transform: none;
    background: linear-gradient(180deg, #f2f9f4, #e8f3ec);
    box-shadow: none;
}

.tabs .tab-button.is-active {
    color: var(--brand-ink);
    background: linear-gradient(180deg, #ffffff, #f1fbf5);
    border-color: rgba(37, 211, 102, 0.42);
    border-bottom-color: var(--surface);
    margin-bottom: -1px;
    box-shadow: 0 10px 18px rgba(17, 33, 29, 0.06);
    position: relative;
    z-index: 1;
}

.tabs .tab-button.is-active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: var(--brand);
}

.tab-panel[hidden] {
    display: none !important;
}

.panel-body {
    padding: 18px;
}

.tabs-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.users-toolbar {
    align-items: flex-end;
}

.users-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.search-input {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.search-input input {
    min-width: 220px;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.search-input .icon {
    color: var(--muted);
}

.table-meta {
    margin-bottom: 10px;
}

.table-wrap {
    margin-bottom: 18px;
}

.pagination-shell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.pagina {
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    font-weight: 700;
}

.pagina.is-active {
    background: var(--brand);
    color: #ffffff;
    border-color: transparent;
}

.config-form-shell {
    padding: 18px;
}

.config-form {
    max-width: none;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.state-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.state-summary-card {
    padding: 16px;
    margin-bottom: 14px;
}

.state-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.state-summary-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    padding: 14px;
}

.state-summary-item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.state-summary-item h3,
.state-preview-label {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.state-path,
.state-value,
.state-preview {
    margin: 0;
    word-break: break-word;
}

.state-path {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.state-value {
    font-size: 13px;
    line-height: 1.45;
}

.log-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
    max-width: 420px;
}

.log-text-message {
    color: var(--text);
}

.log-text-response {
    color: var(--brand-ink);
}

.log-detail {
    margin: 4px 0 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-2);
}

.log-detail summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--brand-ink);
    list-style: none;
}

.log-detail summary::-webkit-details-marker {
    display: none;
}

.log-detail[open] summary {
    margin-bottom: 10px;
}

.log-detail pre {
    margin: 0;
    background: #0f1720;
}

.log-detail-cell {
    white-space: nowrap;
    text-align: right;
}

.log-detail-button {
    min-width: 126px;
    white-space: nowrap;
}

.log-detail-pre {
    min-height: 240px;
    max-height: min(70vh, 720px);
    margin: 0;
    overflow: auto;
}

.state-preview {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-2);
}

.state-preview-label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
}

.status-card,
.state-card {
    padding: 16px;
}

.state-grid + .state-summary-card {
    margin-top: 8px;
}

.update-form {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.updates-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(0, 1.5fr);
    gap: 16px;
    align-items: start;
}

.update-dropzone {
    display: grid;
    gap: 10px;
    align-content: start;
    justify-items: center;
    text-align: center;
    padding: 22px;
    border: 1px dashed rgba(18, 140, 126, 0.28);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 248, 245, 0.9));
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.update-dropzone:hover,
.update-dropzone.is-dragover {
    border-color: rgba(37, 211, 102, 0.64);
    background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(235, 248, 239, 0.96));
    box-shadow: 0 12px 24px rgba(17, 33, 29, 0.08);
    transform: translateY(-1px);
}

.update-dropzone.has-file {
    border-style: solid;
}

.update-dropzone-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

.update-dropzone-copy .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(37, 211, 102, 0.12);
    color: var(--brand-ink);
}

.update-dropzone-copy strong {
    display: block;
    font-size: 15px;
}

.update-dropzone-copy p {
    margin: 4px 0 0;
}

.update-file-name {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    word-break: break-word;
}

.update-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.update-notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid rgba(141, 110, 0, 0.16);
    border-radius: var(--radius-md);
    background: rgba(141, 110, 0, 0.06);
}

.update-notice .badge {
    flex: 0 0 auto;
}

.backup-shell {
    padding: 18px;
    display: grid;
    gap: 16px;
}

.backup-top {
    margin-bottom: 0;
}

.backup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.backup-actions form {
    margin: 0;
}

.backup-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.status-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.status-card p {
    margin: 0 0 10px;
    color: var(--muted);
    word-break: break-word;
}

.state-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.state-card-head h3 {
    margin: 0;
    font-size: 16px;
}

.field-stack {
    display: grid;
    gap: 14px;
}

.field-stack label {
    display: grid;
}

.secret-field {
    display: grid;
    gap: 8px;
}

.secret-field-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.secret-field input {
    flex: 1 1 auto;
    width: 100%;
}

.secret-field-toggle {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 999px;
}

.switch-row {
    margin-top: 8px;
}

.state-hint {
    color: var(--muted);
    font-size: 13px;
}

.state-actions {
    display: inline-flex;
    gap: 10px;
    align-items: center;
}

.modal {
    border: 0;
    padding: 0;
    background: transparent;
    width: min(720px, calc(100vw - 24px));
    max-width: min(720px, calc(100vw - 24px));
    will-change: transform, opacity;
}

.modal--wide {
    width: min(1040px, calc(100vw - 24px));
    max-width: min(1040px, calc(100vw - 24px));
}

.modal[open] {
    animation: modal-fade-in 180ms ease-out;
}

.modal::backdrop {
    background: rgba(15, 23, 32, 0.44);
    backdrop-filter: blur(2px);
    animation: modal-backdrop-in 180ms ease-out;
}

.modal-card {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    transform-origin: center 18%;
    animation: modal-card-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card--frame {
    height: min(86vh, 860px);
    grid-template-rows: auto minmax(0, 1fr);
}

.account-frame {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-card-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.table-wrap {
    overflow-x: auto;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(18, 140, 126, 0.09);
    text-align: left;
    vertical-align: middle;
}

th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tr:last-child td {
    border-bottom: 0;
}

.mono {
    font-family: Consolas, "SFMono-Regular", Menlo, monospace;
    font-size: 12px;
}

.truncate {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acciones {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
    min-width: 260px;
}

.acciones-compactas {
    min-width: 0;
}

.acciones form {
    margin: 0;
}

.boton,
button {
    border: 0;
    padding: 0 16px;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(180deg, var(--brand), var(--brand-strong));
    box-shadow: 0 8px 20px rgba(18, 140, 126, 0.18);
}

.boton:hover,
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(18, 140, 126, 0.22);
}

button.nav-link,
button.nav-link:hover {
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    border: 1px solid transparent;
    transform: none;
}

.accion,
.secundario {
    padding: 0 14px;
    color: var(--brand-ink);
    background: rgba(37, 211, 102, 0.08);
    border: 1px solid rgba(37, 211, 102, 0.14);
}

.accion:hover,
.secundario:hover {
    background: rgba(37, 211, 102, 0.14);
}

.link-danger {
    padding: 0 14px;
    color: var(--danger);
    background: rgba(198, 40, 40, 0.07);
    border: 1px solid rgba(198, 40, 40, 0.12);
}

.icon-only {
    width: 42px;
    min-width: 42px;
    padding: 0;
}

.link-danger:hover {
    background: rgba(198, 40, 40, 0.12);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.badge.ok {
    background: var(--ok-soft);
    color: var(--ok);
}

.badge.off {
    background: rgba(96, 115, 109, 0.10);
    color: var(--muted);
}

.badge.neutral {
    background: rgba(18, 140, 126, 0.10);
    color: var(--brand-ink);
}

.badge.warn {
    background: var(--warn-soft);
    color: var(--warn);
}

.formulario {
    max-width: 880px;
    padding: 20px;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.full {
    grid-column: 1 / -1;
}

label {
    display: block;
    color: #263632;
    font-size: 13px;
    font-weight: 700;
}

input,
textarea,
select {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 12px 13px;
    border: 1px solid rgba(18, 140, 126, 0.18);
    border-radius: 12px;
    color: var(--text);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

input::placeholder,
textarea::placeholder {
    color: #8a9a96;
}

input:focus,
textarea:focus,
select:focus {
    outline: 0;
    border-color: rgba(37, 211, 102, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.14);
}

input[readonly],
textarea[readonly] {
    background: #f7fbf8;
    color: #5f6f6a;
    cursor: default;
}

input.is-editable,
textarea.is-editable {
    background: #ffffff;
    color: var(--text);
}

select {
    appearance: none;
    padding-right: 42px;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.search-input select {
    width: auto;
    min-width: 148px;
    margin-top: 0;
    padding: 0 34px 0 0;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input[type="password"] {
    letter-spacing: 0.04em;
}

.state-card input,
.state-card textarea {
    margin-top: 6px;
    font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.switch input {
    width: auto;
    margin: 0;
    box-shadow: none;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 18px;
    margin-top: 18px;
    border-top: 1px solid var(--line);
}

.form-footer.compact {
    padding-top: 14px;
    margin-top: 14px;
}

.form-footer.right {
    justify-content: flex-end;
}

.error {
    max-width: 880px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--danger-soft);
    color: var(--danger);
    padding: 12px 14px;
    border: 1px solid rgba(198, 40, 40, 0.16);
    border-radius: 12px;
}

.error.success {
    background: var(--ok-soft);
    color: var(--ok);
    border-color: rgba(15, 138, 77, 0.16);
}

pre {
    white-space: pre-wrap;
    overflow: auto;
    background: #0f1720;
    color: #d7e3ef;
    padding: 14px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.5;
}

.resultado {
    max-width: 880px;
    margin-top: 18px;
    padding: 18px;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 28px;
}

.login {
    display: grid;
    min-height: 100vh;
    place-items: center;
}

body.embed-view {
    background: #f7faf8;
}

body.embed-view .topbar {
    display: none;
}

body.login {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 20% 20%, #ecfff1 0, #e2fae8 28%, #d8f4df 52%, #edf9f1 100%);
}

body.login::before,
body.login::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(18px);
    opacity: 0.55;
    animation: login-orbit 18s ease-in-out infinite alternate;
}

body.login::before {
    width: 34vw;
    height: 34vw;
    left: -8vw;
    top: -10vw;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.34), rgba(37, 211, 102, 0.02) 72%);
}

body.login::after {
    width: 30vw;
    height: 30vw;
    right: -6vw;
    bottom: -8vw;
    background: radial-gradient(circle, rgba(18, 140, 126, 0.28), rgba(18, 140, 126, 0.02) 72%);
    animation-delay: -9s;
}

body.login main::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        conic-gradient(from 25deg at 18% 28%, rgba(37, 211, 102, 0.20) 0 14%, transparent 14% 30%, rgba(18, 140, 126, 0.16) 30% 44%, transparent 44% 62%, rgba(37, 211, 102, 0.12) 62% 78%, transparent 78% 100%),
        conic-gradient(from 210deg at 74% 30%, rgba(18, 140, 126, 0.14) 0 18%, transparent 18% 39%, rgba(37, 211, 102, 0.16) 39% 55%, transparent 55% 74%, rgba(18, 140, 126, 0.12) 74% 100%);
    mix-blend-mode: screen;
    opacity: 0.75;
    animation: login-sectors 22s linear infinite, login-shift 17s ease-in-out infinite alternate;
}

@keyframes login-orbit {
    from {
        transform: translate3d(0, 0, 0) scale(0.96);
    }
    to {
        transform: translate3d(3vw, 2vw, 0) scale(1.08);
    }
}

@keyframes login-sectors {
    0% {
        filter: hue-rotate(0deg) saturate(1.05);
    }
    50% {
        filter: hue-rotate(10deg) saturate(1.15);
    }
    100% {
        filter: hue-rotate(-6deg) saturate(1.08);
    }
}

@keyframes login-shift {
    0% {
        transform: translate3d(-2vw, -1vw, 0) rotate(-1deg) scale(1);
    }
    50% {
        transform: translate3d(2vw, 1vw, 0) rotate(1.5deg) scale(1.04);
    }
    100% {
        transform: translate3d(-1vw, 2vw, 0) rotate(-0.5deg) scale(1.02);
    }
}

body.embed-view main {
    padding: 16px;
}

.login-box {
    width: min(420px, calc(100vw - 32px));
    padding: 28px;
    box-shadow: var(--shadow-md);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.login-brand h1 {
    font-size: 22px;
}

.login-brand .marca-icono {
    width: 44px;
    height: 44px;
    border-radius: 14px;
}

.login form {
    display: grid;
    gap: 14px;
}

.login button {
    width: 100%;
}

.icon {
    display: inline-block;
    text-align: center;
}

button .icon,
.boton .icon,
.accion .icon,
.secundario .icon,
.link-danger .icon {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

@media (hover: hover) {
    .nav a:hover,
    .accion:hover,
    .secundario:hover,
    .link-danger:hover {
        transform: translateY(-1px);
    }
}

@media (max-width: 760px) {
    .topbar {
        min-height: auto;
        padding: 14px 16px;
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }

    main {
        padding: 16px 14px 24px;
    }

    .barra {
        flex-direction: column;
    }

    .grid-form {
        grid-template-columns: 1fr;
    }

    .form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tabs-top,
    .state-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .updates-grid {
        grid-template-columns: 1fr;
    }

    .state-summary-grid {
        grid-template-columns: 1fr;
    }

    .state-grid {
        margin-bottom: 20px;
    }

    .users-toolbar-actions,
    .search-form,
    .pagination-shell,
    .pagination,
    .modal-head {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input input {
        min-width: 0;
        width: 100%;
    }

    .app-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    table {
        min-width: 820px;
    }

    .acciones {
        flex-wrap: wrap;
        justify-content: flex-start;
        min-width: 0;
    }

    .pagina {
        width: 100%;
    }
}

@media (min-width: 1400px) {
    .app-layout {
        grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
    }

    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}
