@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("../../fonts/inter-latin.woff2?v=20") format("woff2");
}

@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 600 800;
    font-display: swap;
    src: url("../../fonts/manrope-latin.woff2?v=20") format("woff2");
}

:root {
    color-scheme: light;
    --tc-red: #f3153a;
    --tc-red-strong: #d90e32;
    --tc-red-soft: #fff0f3;
    --accent-readable: var(--tc-red);
    --tc-navy: #111827;
    --tc-navy-soft: #1d2738;
    --tc-white: #ffffff;
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-soft: #fafbfc;
    --text: #18202e;
    --text-soft: #687386;
    --line: #e7e9ee;
    --success: #159a68;
    --warning: #df8a16;
    --danger: #d52b43;
    --focus: rgba(243, 21, 58, 0.15);
    --shadow: 0 14px 35px rgba(17, 24, 39, 0.07);
    --sidebar-width: 272px;
    --header-height: 72px;
}
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e1420;
    --surface: #151d2b;
    --surface-soft: #111926;
    --text: #f4f6fa;
    --text-soft: #98a4b8;
    --line: #293347;
    --tc-red-soft: rgba(243, 21, 58, 0.12);
    --accent-readable: #ff5a73;
    --focus: rgba(243, 21, 58, 0.24);
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}
* {
    box-sizing: border-box;
}
html {
    min-height: 100%;
    background: var(--bg);
}
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a {
    color: inherit;
    text-decoration: none;
}
button, input, select, textarea {
    font: inherit;
}
button, a {
    -webkit-tap-highlight-color: transparent;
}
svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}
[hidden] {
    display: none !important;
}
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    transition: grid-template-columns 0.25s ease;
}
.app-shell.is-sidebar-collapsed {
    grid-template-columns: 88px minmax(0, 1fr);
}
.app-sidebar {
    position: sticky;
    z-index: 40;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(180deg, #151e2d 0%, #0d1420 100%);
    color: #dce2eb;
    border-right: 1px solid rgba(255,255,255,.05);
}
.sidebar-brand {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 19px 0 25px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-lockup {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
/* Logo oficial de Telecable (el mismo de los demás sistemas). */
.brand-logo {
    display: block;
    width: 122px;
    height: auto;
}
.product-name {
    margin-top: 7px;
    color: #9da9b9;
    /* Una sola línea en el ancho fijo del menú: más grande no entra. */
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    white-space: nowrap;
}
.sidebar-collapse {
    width: 30px;
    height: 30px;
    flex: none;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 9px;
    background: rgba(255,255,255,.035);
    color: #8996a8;
    cursor: pointer;
}
.sidebar-collapse svg {
    width: 17px;
    transition: transform .25s ease;
}
.app-shell.is-sidebar-collapsed .sidebar-collapse svg {
    transform: rotate(180deg);
}
.app-shell.is-sidebar-collapsed .brand-lockup,
.app-shell.is-sidebar-collapsed .nav-link span,
.app-shell.is-sidebar-collapsed .nav-caption,
.app-shell.is-sidebar-collapsed .user-copy {
    opacity: 0;
    visibility: hidden;
    width: 0;
}
.app-shell.is-sidebar-collapsed .sidebar-brand {
    padding-inline: 28px;
}
.app-shell.is-sidebar-collapsed .sidebar-collapse {
    position: absolute;
    top: 21px;
    left: 29px;
}
.app-shell.is-sidebar-collapsed .nav-link {
    justify-content: center;
    padding-inline: 0;
}
.app-shell.is-sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding-inline: 0;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
    scrollbar-width: thin;
    scrollbar-color: #394456 transparent;
}
.nav-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 19px 13px 8px;
    color: #667386;
    /* "AUDIENCIAS Y COMUNICACIONES" tiene que entrar en una línea con la flecha. */
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.1px;
    white-space: nowrap;
    transition: .2s ease;
    cursor: pointer;
    user-select: none;
    list-style: none;
}
.nav-caption::-webkit-details-marker { display: none; }
.nav-chevron { font-size: 14px; transition: transform .2s ease; }
.nav-section[open] .nav-chevron { transform: rotate(180deg); }
.nav-section-links { overflow: hidden; }
.nav-section:not([open]) .nav-section-links { display: none; }
.app-shell.is-sidebar-collapsed .nav-section-links { display: block; }
.nav-section:first-child .nav-caption {
    margin-top: 2px;
}
.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 45px;
    padding: 10px 13px;
    margin-bottom: 4px;
    border-radius: 10px;
    color: #aab4c2;
    font-size: 13px;
    font-weight: 600;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}
.nav-link svg {
    width: 20px;
    height: 20px;
    flex: none;
}
.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.055);
    transform: translateX(2px);
}
.nav-link.is-active {
    color: #fff;
    background: linear-gradient(90deg, rgba(243,21,58,.2), rgba(243,21,58,.07));
}
.nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--tc-red);
    box-shadow: 0 0 15px rgba(243,21,58,.55);
}
.nav-link.is-active svg {
    color: #ff3658;
}
.sidebar-user {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 15px 22px;
    border-top: 1px solid rgba(255,255,255,.07);
}
.user-initial {
    width: 36px;
    height: 36px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, var(--tc-red), #ff536d);
    font-family: Manrope, sans-serif;
    font-weight: 800;
    text-transform: uppercase;
}
.user-copy {
    min-width: 0;
    transition: .2s ease;
}
.user-copy strong, .user-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-copy strong {
    color: #f8fafc;
    font-size: 13px;
}
.user-copy small {
    margin-top: 3px;
    color: #7e8a9b;
    font-size: 11px;
}
.app-main {
    min-width: 0;
}
.app-header {
    position: sticky;
    z-index: 30;
    top: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}
.header-start, .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-context span, .header-context strong {
    display: block;
}
.header-context span {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
}
.header-context strong {
    margin-top: 3px;
    font-family: Manrope, sans-serif;
    font-size: 13px;
}
.icon-button {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--text-soft);
    background: var(--surface);
    cursor: pointer;
    transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.icon-button:hover {
    color: var(--tc-red);
    border-color: color-mix(in srgb, var(--tc-red) 35%, var(--line));
    transform: translateY(-1px);
}
.icon-button svg {
    width: 20px;
    height: 20px;
}
.menu-button {
    display: none;
}
.system-state {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-right: 8px;
    color: var(--text-soft);
    font-size: 12px;
}
.system-state i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 12%, transparent);
    animation: statusPulse 2.4s infinite;
}
.theme-toggle {
    position: relative;
    overflow: hidden;
}
.theme-toggle svg {
    position: absolute;
    transition: transform .38s cubic-bezier(.2,.8,.2,1), opacity .25s ease;
}
.moon-icon {
    opacity: 0;
    transform: translateY(25px) rotate(45deg);
}
html[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: translateY(-25px) rotate(90deg);
}
html[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: translateY(0) rotate(0);
}
.logout-form {
    margin: 0;
}
.logout-button {
    color: var(--tc-red);
}
.logout-button svg {
    transition: transform .25s ease;
}
.logout-button:hover svg {
    transform: translateX(3px);
}
.logout-button:active svg {
    transform: translateX(8px);
}
.sidebar-overlay {
    display: none;
}
.page-content {
    min-height: calc(100vh - var(--header-height));
}
.page-shell {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 34px;
}
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}
.page-heading h1 {
    margin: 6px 0;
    font-family: Manrope, sans-serif;
    font-size: clamp(25px, 3vw, 34px);
    letter-spacing: -.8px;
}
.page-heading p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}
.eyebrow, .panel-kicker {
    color: var(--accent-readable);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.7px;
}
.eyebrow.light {
    color: #fff;
    opacity: .82;
}
.page-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-soft);
    background: var(--surface);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.page-chip i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
}
.panel {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 15px;
    box-shadow: 0 3px 13px rgba(17,24,39,.025);
}
.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}
.panel-heading h2 {
    margin: 5px 0 0;
    font-family: Manrope, sans-serif;
    font-size: 17px;
    letter-spacing: -.2px;
}
.panel-heading p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}
.step-number {
    color: color-mix(in srgb, var(--text-soft) 35%, transparent);
    font-family: Manrope, sans-serif;
    font-size: 28px;
    font-weight: 800;
}
.two-column-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, .75fr);
    gap: 20px;
    align-items: start;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}
.form-grid.three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.field {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
}
.field.full {
    grid-column: 1 / -1;
}
.field.full-span {
    grid-column: span 2;
}
.field > span {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}
.field > span b {
    color: var(--tc-red);
}
.field > small {
    color: var(--text-soft);
    font-size: 11px;
    text-align: right;
}
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 43px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    outline: none;
    color: var(--text);
    background: var(--surface-soft);
    font-size: 12px;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.field textarea {
    resize: vertical;
    line-height: 1.55;
}
.field input[type="file"] {
    padding: 9px;
}
.field input::file-selector-button {
    margin-right: 10px;
    border: 0;
    border-radius: 7px;
    padding: 7px 10px;
    color: var(--text);
    background: var(--line);
    cursor: pointer;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--tc-red);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--focus);
}
.field input::placeholder, .field textarea::placeholder {
    color: color-mix(in srgb, var(--text-soft) 65%, transparent);
}
.description-expand {
    display: inline-grid;
    place-items: center;
    width: 25px;
    height: 25px;
    margin-left: 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--tc-red);
    background: var(--surface);
    cursor: pointer;
}
.text-detail-dialog {
    width: min(680px, calc(100vw - 32px));
    max-height: min(680px, calc(100vh - 32px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 15px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(0,0,0,.32);
}
.text-detail-dialog::backdrop { background: rgba(6,12,22,.68); backdrop-filter: blur(3px); }
.text-detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}
.text-detail-heading h2 { margin: 0; font: 800 17px Manrope, sans-serif; }
.text-detail-dialog > p {
    margin: 0;
    padding: 20px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    line-height: 1.65;
}
.field .select2-container {
    width: 100% !important;
}
.field .select2-container .select2-selection--single {
    min-height: 43px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
}
.field .select2-container .select2-selection--single .select2-selection__rendered {
    padding: 7px 38px 7px 13px;
    color: var(--text);
    line-height: 27px;
}
.field .select2-container .select2-selection--single .select2-selection__arrow {
    height: 41px;
    right: 8px;
}
.field .select2-container--focus .select2-selection--single,
.field .select2-container--open .select2-selection--single {
    border-color: var(--tc-red);
    box-shadow: 0 0 0 4px var(--focus);
}
.select2-dropdown {
    border-color: var(--line);
    border-radius: 9px;
    color: var(--text);
    background: var(--surface);
    overflow: hidden;
}
.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--line) !important;
    border-radius: 7px;
    color: var(--text);
    background: var(--surface-soft);
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--tc-red);
}
.select2-container--default.select2-container--disabled .select2-selection--single {
    opacity: .6;
    background: var(--surface-muted);
}
.filter-section-title {
    margin: 0 0 14px;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.global-loader {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    background: rgba(4, 10, 22, .38);
    backdrop-filter: blur(2px);
}
.global-loader[hidden] { display: none; }
.global-loader-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .24);
    font-size: 12px;
    font-weight: 700;
}
.global-loader-spinner {
    width: 22px;
    height: 22px;
    flex: none;
    border: 3px solid rgba(243, 21, 58, .2);
    border-top-color: var(--tc-red);
    border-radius: 50%;
    animation: global-loader-spin .75s linear infinite;
}
@keyframes global-loader-spin { to { transform: rotate(360deg); } }
.infrastructure-filter-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 4fr);
    gap: 16px;
    width: 100%;
}
.filter-section {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}
.filter-section-grid {
    display: grid;
    gap: 12px;
    align-items: end;
}
.location-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.topology-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.contracts-filter {
    margin-top: 16px;
}
@media (max-width: 1100px) {
    .infrastructure-filter-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .location-filter-grid, .topology-filter-grid { grid-template-columns: 1fr; }
}

.form-actions, .filter-actions, .action-group {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}
.form-actions {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn svg {
    width: 17px;
    height: 17px;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn:disabled {
    opacity: .55;
    pointer-events: none;
}
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--tc-red), var(--tc-red-strong));
    box-shadow: 0 8px 18px rgba(243,21,58,.18);
}
.btn-primary:hover {
    box-shadow: 0 11px 24px rgba(243,21,58,.28);
}
.btn-secondary {
    color: var(--text);
    background: var(--surface);
    border-color: var(--line);
}
.btn-secondary:hover, .btn-ghost:hover {
    border-color: color-mix(in srgb, var(--tc-red) 35%, var(--line));
    color: var(--tc-red);
}
.btn-ghost {
    color: var(--text-soft);
    background: var(--surface-soft);
    border-color: var(--line);
}
.btn-danger {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
    border-color: color-mix(in srgb, var(--danger) 22%, var(--line));
}
.text-button, .text-link {
    padding: 0;
    border: 0;
    color: var(--accent-readable);
    background: transparent;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.channel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.channel-card {
    position: relative;
    min-height: 69px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    background: var(--surface-soft);
    transition: border-color .18s, background .18s, transform .18s;
}
.channel-card:hover {
    transform: translateY(-1px);
}
.channel-card:has(input:checked) {
    border-color: color-mix(in srgb, var(--tc-red) 60%, var(--line));
    background: var(--tc-red-soft);
}
.channel-card input {
    position: absolute;
    top: 50%;
    right: 14px;
    width: 20px;
    height: 20px;
    min-height: 0;
    margin: 0;
    padding: 0;
    appearance: none;
    border: 1.5px solid color-mix(in srgb, var(--text-soft) 55%, var(--line));
    border-radius: 6px;
    background: var(--surface);
    transform: translateY(-50%);
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.channel-card input:checked {
    border-color: var(--tc-red);
    background-color: var(--tc-red);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.3' d='m5 10 3 3 7-7'/%3E%3C/svg%3E");
}
.channel-card input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc-red) 24%, transparent);
}
.channel-icon {
    width: 32px;
    height: 32px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--tc-red);
    background: var(--tc-red-soft);
    font-family: Manrope, sans-serif;
    font-size: 13px;
    font-weight: 800;
}
.channel-card strong, .channel-card small {
    display: block;
}
.channel-card strong {
    font-size: 12px;
}
.channel-card small {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 11px;
}
.switch-field {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    cursor: pointer;
}
.switch-field input {
    position: absolute;
    opacity: 0;
}
.switch {
    position: relative;
    width: 38px;
    height: 22px;
    flex: none;
    border-radius: 999px;
    background: #c5cad3;
    transition: .2s;
}
.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,.15);
    transition: .2s;
}
.switch-field input:checked + .switch {
    background: var(--tc-red);
}
.switch-field input:checked + .switch::after {
    transform: translateX(16px);
}
.switch-field b, .switch-field small {
    display: block;
}
.switch-field b {
    font-size: 12px;
}
.switch-field small {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 11px;
}
.table-wrap {
    width: 100%;
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    padding: 11px 13px;
    color: var(--text-soft);
    background: var(--surface-soft);
    border-block: 1px solid var(--line);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .9px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}
.data-table td {
    padding: 13px;
    border-bottom: 1px solid var(--line);
    color: var(--text-soft);
    vertical-align: middle;
}
.data-table td b {
    color: var(--text);
}
.data-table tbody tr {
    transition: background .15s;
}
.data-table tbody tr:hover {
    background: color-mix(in srgb, var(--tc-red) 2.5%, var(--surface));
}
.data-table .numeric {
    text-align: right;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--success);
    background: color-mix(in srgb, var(--success) 10%, var(--surface));
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}
/* Sin esto, "badge neutral" salía verde, como un estado correcto. */
.badge.neutral {
    color: var(--text-soft);
    background: color-mix(in srgb, var(--text-soft) 10%, var(--surface));
}
.badge.is-fault {
    color: var(--accent-readable);
    background: var(--tc-red-soft);
}
.badge::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}
.empty-state {
    min-height: 180px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    text-align: center;
}
.empty-state > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--tc-red);
    background: var(--tc-red-soft);
    font-weight: 800;
}
.empty-state strong {
    color: var(--text);
    font-size: 13px;
}
.empty-state small {
    color: var(--text-soft);
    font-size: 11px;
}
.muted {
    color: var(--text-soft);
    font-size: 12px;
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 17px;
}
.pagination .icon-button {
    width: 31px;
    height: 31px;
}
.pagination span {
    color: var(--text-soft);
    font-size: 11px;
}
.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 9px;
    font-size: 12px;
}
.alert-error {
    color: #a61f36;
    background: #fff0f3;
    border: 1px solid #ffd0da;
}
html[data-theme="dark"] .alert-error {
    color: #ff93a7;
    background: rgba(243,21,58,.1);
    border-color: rgba(243,21,58,.25);
}
.inline-result {
    margin-top: 20px;
    padding: 12px;
    border-radius: 9px;
    color: var(--success);
    background: color-mix(in srgb, var(--success) 9%, var(--surface));
    font-size: 12px;
    font-weight: 700;
}
.loading-state, .is-loading {
    opacity: .6;
    pointer-events: none;
}
.loader-bars {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.loader-bars i {
    width: 4px;
    height: 18px;
    border-radius: 4px;
    background: var(--tc-red);
    animation: loader 1s ease-in-out infinite;
}
.loader-bars i:nth-child(2) {
    animation-delay: .12s;
}
.loader-bars i:nth-child(3) {
    animation-delay: .24s;
}
.toast-region {
    position: fixed;
    z-index: 100;
    right: 24px;
    bottom: 24px;
    display: grid;
    gap: 9px;
    pointer-events: none;
}
.toast {
    min-width: 280px;
    max-width: 390px;
    display: grid;
    grid-template-columns: 8px 1fr auto;
    align-items: center;
    gap: 11px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: toastIn .3s ease both;
    font-size: 12px;
    pointer-events: auto;
}
.toast::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
}
.toast.is-error::before {
    background: var(--danger);
}
.toast button {
    border: 0;
    color: var(--text-soft);
    background: none;
    cursor: pointer;
}
.error-state {
    min-height: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.error-state h1 {
    margin: 12px 0 8px;
    font-family: Manrope, sans-serif;
}
.error-state p {
    max-width: 500px;
    margin: 0 0 24px;
    color: var(--text-soft);
}
.error-code {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border-radius: 18px;
    color: #fff;
    background: var(--tc-red);
    font-family: Manrope, sans-serif;
    font-size: 28px;
    font-weight: 800;
}
@keyframes statusPulse {
    50% {
        box-shadow: 0 0 0 7px color-mix(in srgb, var(--success) 2%, transparent);
    }
}
@keyframes loader {
    0%,100% {
        transform: scaleY(.55);
        opacity: .45;
    }
    50% {
        transform: scaleY(1.2);
        opacity: 1;
    }
}
@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }
}
@media (max-width: 1120px) {
    .app-shell {
        grid-template-columns: 88px minmax(0, 1fr);
    }
    .brand-lockup, .nav-link span, .nav-caption, .user-copy {
        opacity: 0;
        visibility: hidden;
        width: 0;
    }
    .sidebar-brand {
        padding-inline: 28px;
    }
    .sidebar-collapse {
        position: absolute;
        top: 21px;
        left: 29px;
    }
    .nav-link {
        justify-content: center;
        padding-inline: 0;
    }
    .sidebar-user {
        justify-content: center;
        padding-inline: 0;
    }
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 760px) {
    .app-shell,
    .app-shell.is-sidebar-collapsed {
        display: block;
    }
    .app-sidebar {
        position: fixed;
        left: 0;
        width: min(280px, 86vw);
        transform: translateX(-102%);
        transition: transform .25s ease;
    }
    .app-shell.is-menu-open .app-sidebar {
        transform: translateX(0);
    }
    .app-shell.is-menu-open .sidebar-overlay {
        position: fixed;
        z-index: 35;
        inset: 0;
        display: block;
        border: 0;
        background: rgba(3,8,15,.62);
        backdrop-filter: blur(2px);
    }
    .brand-lockup, .nav-link span, .nav-caption, .user-copy {
        opacity: 1;
        visibility: visible;
        width: auto;
    }
    .sidebar-brand {
        padding: 0 19px 0 25px;
    }
    .sidebar-collapse {
        display: none;
    }
    .nav-link {
        justify-content: flex-start;
        padding-inline: 13px;
    }
    .sidebar-user {
        justify-content: flex-start;
        padding-inline: 22px;
    }
    .menu-button {
        display: inline-grid;
    }
    .app-header {
        padding: 0 15px;
    }
    .system-state span, .header-context span {
        display: none;
    }
    .page-shell {
        padding: 24px 16px;
    }
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .page-heading > .btn {
        width: 100%;
    }
    .form-grid, .form-grid.three-columns, .channel-grid {
        grid-template-columns: 1fr;
    }
    .field.full-span {
        grid-column: 1 / -1;
    }
    .panel {
        padding: 18px;
        border-radius: 13px;
    }
    .form-actions {
        flex-wrap: wrap;
    }
    .form-actions .btn {
        flex: 1;
    }
    .toast-region {
        left: 14px;
        right: 14px;
        bottom: 14px;
    }
    .toast {
        min-width: 0;
        width: 100%;
    }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
