/* Vigicom Cloud — sistema de diseño según DESIGN.md
 * Tema único oscuro. Dos zonas cromáticas:
 *   - Chrome (sidebar + topbar): morado institucional --primary
 *   - Contenido: grises oscuros, con --primary solo como acento
 */

:root {
    --bg:        #1a1a1a;
    --surface:   #242526;
    --border:    #383838;
    --row-hover: #2d2e2f;
    --primary:   #5e45a5;
    --primary-h: #4a3784;
    --danger:    #e62a2a;
    --success:   #22c55e;
    --warn:      #f59e0b;
    --info:      #3b82f6;
    --purple:    #8b5cf6;
    --text:      #f0f0f0;
    --muted:     #9ca0a4;
    --radius:    10px;
    --shadow:    0 1px 4px rgba(0,0,0,.45);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.65);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 3. Layout principal ===== */
.layout  { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--primary);
           border-right: 1px solid rgba(0,0,0,.25);
           display: flex; flex-direction: column; flex-shrink: 0; }
.main    { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar  { background: var(--primary); border-bottom: 1px solid rgba(0,0,0,.25);
           padding: 0 24px; height: 60px;
           display: flex; align-items: center; justify-content: space-between;
           box-shadow: var(--shadow); }
.content { flex: 1; padding: 24px; overflow-y: auto; }

/* ===== 4. Sidebar ===== */
.sidebar-logo  { height: 60px; padding: 0 20px; border-bottom: 1px solid rgba(0,0,0,.2);
                 display: flex; align-items: center; justify-content: center; }
.sidebar-logo-mark { display: block; width: auto; height: 36px;
                     max-width: 100%; object-fit: contain; }

.sidebar-nav   { padding: 8px 0 12px; flex: 1; }
.sidebar-footer{ padding: 10px 20px; font-size: .75rem; color: rgba(255,255,255,.7);
                 border-top: 1px solid rgba(0,0,0,.2); text-align: center;
                 letter-spacing: .03em; font-family: monospace; }

.nav-item { display: flex; align-items: center; gap: 10px;
            padding: 10px 20px; font-size: .9rem; color: rgba(255,255,255,.85);
            cursor: pointer; border-left: 3px solid transparent;
            transition: background .15s, color .15s; text-decoration: none; }
.nav-item:hover  { background: rgba(0,0,0,.18); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(0,0,0,.28); color: #fff;
                   border-left-color: #fff; font-weight: 600; }
.nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }

.nav-group-wrap                       { display: block; }
.nav-group-toggle                     { width: 100%; background: none; border: none;
                                        text-align: left; cursor: pointer;
                                        font-family: inherit; color: rgba(255,255,255,.85); }
.nav-group-label                      { flex: 1; }
.nav-group-arrow                      { margin-left: auto; font-size: 1rem; font-weight: 700;
                                        line-height: 1; color: rgba(255,255,255,.7);
                                        transition: transform .2s; }
.nav-group-wrap.open .nav-group-arrow { transform: rotate(45deg); }
.nav-sub                              { display: none; background: rgba(0,0,0,.18);
                                        border-top: 1px solid rgba(0,0,0,.2);
                                        border-bottom: 1px solid rgba(0,0,0,.2); }
.nav-group-wrap.open .nav-sub         { display: block; }
.nav-sub-item                         { padding-left: 44px; font-size: .85rem; }
.nav-sub-item.active                  { background: rgba(0,0,0,.32); }

/* ===== 5. Topbar ===== */
.topbar-title    { font-size: 1rem; font-weight: 600; flex: 1; color: #fff; }
.topbar-user     { display: flex; align-items: center; gap: 10px; flex-shrink: 0;
                   position: relative; }
.topbar-username { background: none; border: none; cursor: pointer;
                   font-size: .85rem; color: rgba(255,255,255,.85);
                   display: flex; align-items: center; gap: 4px;
                   padding: 6px 10px; border-radius: 8px;
                   transition: background .15s, color .15s; font-family: inherit; }
.topbar-username:hover { background: rgba(0,0,0,.18); color: #fff; }

.topbar .btn-ghost       { color: rgba(255,255,255,.85);
                           border-color: rgba(0,0,0,.25);
                           background: transparent; }
.topbar .btn-ghost:hover { background: rgba(0,0,0,.18); color: #fff; }
.topbar .hamburger       { color: #fff; }

.user-dropdown   { display: none; position: absolute; right: 0; top: calc(100% + 6px);
                   background: var(--surface); border: 1px solid var(--border);
                   border-radius: 10px; box-shadow: var(--shadow-lg);
                   min-width: 160px; overflow: hidden; z-index: 200; }
.user-dropdown.open { display: block; }
.user-dropdown a    { display: block; padding: 10px 14px; color: var(--text);
                      font-size: .85rem; transition: background .15s; }
.user-dropdown a:hover { background: var(--bg); text-decoration: none; color: var(--primary); }

/* ===== 6. Botones ===== */
.btn { padding: 8px 16px; border-radius: var(--radius); border: none;
       font-size: .88rem; font-weight: 600; cursor: pointer;
       display: inline-flex; align-items: center; gap: 6px;
       transition: background .15s, transform .1s; font-family: inherit;
       text-decoration: none; }
.btn:hover         { text-decoration: none; }
.btn:active        { transform: scale(.97); }
.btn-primary       { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-danger        { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #c91515; }
.btn-secondary     { background: var(--surface); color: var(--text);
                     border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-ghost         { background: transparent; color: var(--muted);
                     border: 1px solid var(--border); }
.btn-ghost:hover   { background: var(--bg); color: var(--text); }
.btn-sm            { padding: 5px 12px; font-size: .8rem; }
.btn-icon-sm       { background: none; border: none; cursor: pointer;
                     padding: 4px 8px; border-radius: 6px; font-size: .85rem;
                     color: var(--muted); font-family: inherit; }
.btn-icon-sm:hover { background: var(--bg); color: var(--text); }

/* ===== 7. Inputs ===== */
input[type=text], input[type=number], input[type=url], input[type=tel],
input[type=email], input[type=date], input[type=time], input[type=datetime-local],
input[type=password], input[type=search], select, textarea {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 8px 12px; font-size: .88rem; background: var(--surface);
    color: var(--text); outline: none; transition: border .15s; font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(94,69,165,.25);
}
input:disabled, select:disabled, textarea:disabled,
input[readonly], textarea[readonly] {
    color: var(--muted); background: var(--bg); cursor: not-allowed; opacity: .75;
}
textarea { resize: vertical; min-height: 60px; }

.field-error   { margin-top: 4px; font-size: .78rem; color: var(--danger); }
.input-invalid { border-color: var(--danger) !important;
                 box-shadow: 0 0 0 2px rgba(239,68,68,.18); }

/* ===== 8. Formularios ===== */
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3  { grid-template-columns: repeat(3, 1fr); }
.form-row-4  { grid-template-columns: repeat(4, 1fr); }
.form-group  { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
    font-size: .8rem; font-weight: 600; color: var(--muted);
}
.form-group input,
.form-group select,
.form-group textarea { width: 100%; }

/* ===== 9. Toolbar ===== */
.toolbar       { display: flex; align-items: center; gap: 12px;
                 flex-wrap: wrap; margin-bottom: 20px; }
.toolbar-left  { display: flex; align-items: center; gap: 10px;
                 flex: 1; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 10px; }

.search-wrap        { position: relative; display: inline-flex; align-items: center; }
.search-wrap .search-input { width: 240px; padding-right: 28px; }
.search-clear       { position: absolute; right: 6px; background: none; border: none;
                      cursor: pointer; color: var(--muted); font-size: 1.1rem;
                      padding: 2px 4px; border-radius: 50%; transition: color .15s; }
.search-clear:hover { color: var(--text); }

.filter-chip        { padding: 6px 12px; border-radius: 20px;
                      border: 1.5px solid var(--border);
                      font-size: .8rem; font-weight: 600; cursor: pointer;
                      white-space: nowrap; background: var(--surface);
                      color: var(--muted); transition: all .15s; font-family: inherit; }
.filter-chip:hover  { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== 10. Tablas ===== */
.table-card { background: var(--surface); border: 1px solid var(--border);
              border-radius: var(--radius); box-shadow: var(--shadow);
              overflow-x: auto; overflow-y: hidden; }

table       { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead tr    { background: var(--bg); }
th          { padding: 10px 14px; text-align: left;
              font-size: .75rem; text-transform: uppercase; letter-spacing: .05em;
              color: var(--muted); font-weight: 600;
              border-bottom: 1px solid var(--border); white-space: nowrap; }
td          { padding: 10px 14px; border-bottom: 1px solid var(--border);
              vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--row-hover); }

.actions     { display: flex; gap: 4px; }
.table-empty { text-align: center; padding: 48px 24px; color: var(--muted); }

.td-img      { width: 44px; height: 44px; object-fit: cover;
               border-radius: 8px; border: 1px solid var(--border); }
.td-nombre   { font-weight: 600; }
.td-id       { color: var(--muted); font-size: .8rem; }

/* ===== 11. Badges ===== */
.badge         { display: inline-block; padding: 2px 10px;
                 border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge-info    { background: rgba(59,130,246,.18); color: #93c5fd; }
.badge-success { background: rgba(34,197,94,.18);  color: #86efac; }
.badge-danger  { background: rgba(230,42,42,.2);   color: #f5a8a8; }
.badge-warn    { background: rgba(245,158,11,.18); color: #fcd34d; }
.badge-muted   { background: rgba(255,255,255,.08); color: var(--muted); }

/* ===== 12. Stat cards ===== */
.stats-bar  { display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card  { background: var(--surface); border: 1px solid var(--border);
              border-radius: var(--radius); padding: 14px 20px;
              display: flex; flex-direction: column; gap: 2px;
              flex: 1; min-width: 120px; }
.stat-label { font-size: .75rem; color: var(--muted);
              text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-value.green  { color: var(--success); }
.stat-value.orange { color: var(--primary); }
.stat-value.red    { color: var(--danger); }

.dash-link { cursor: pointer; transition: opacity .15s; text-decoration: none;
             color: inherit; }
.dash-link:hover { opacity: .75; text-decoration: none; }
.stat-card.dash-link:hover { background: var(--bg); }

/* ===== 13. Dashboard grid ===== */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 4px; }
@media (max-width: 768px) { .dash-grid { grid-template-columns: 1fr; } }

.dash-table-header { padding: 14px 20px 10px;
                     font-weight: 600; font-size: .95rem;
                     border-bottom: 1px solid var(--border);
                     display: flex; align-items: center; justify-content: space-between; }
.dash-ver-mas      { font-size: .78rem; font-weight: 500; color: var(--primary); }

/* ===== 14. Modales ===== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45);
                  display: flex; align-items: center; justify-content: center;
                  z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal          { background: var(--surface); border-radius: 14px;
                  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
                  box-shadow: var(--shadow-lg);
                  transform: scale(.96) translateY(12px); transition: transform .2s; margin: 16px; }
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal-header   { padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
                  display: flex; align-items: center; justify-content: space-between; }
.modal-title    { font-size: 1rem; font-weight: 700;
                  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.modal-subtitle { font-size: .8rem; font-weight: 500; color: var(--muted); }
.modal-body     { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer   { padding: 16px 24px; border-top: 1px solid var(--border);
                  display: flex; gap: 10px; justify-content: flex-end; }
.modal.modal-wide { max-width: 760px; }
.modal.modal-xl   { max-width: 1520px; }

/* ===== 15. Confirm dialog ===== */
.confirm-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5);
                    display: flex; align-items: center; justify-content: center;
                    z-index: 150; opacity: 0; pointer-events: none; transition: opacity .15s; }
.confirm-backdrop.open { opacity: 1; pointer-events: all; }
.confirm-box     { background: var(--surface); border-radius: 14px;
                   padding: 28px 28px 20px; max-width: 380px;
                   width: calc(100% - 32px); box-shadow: var(--shadow-lg);
                   transform: scale(.95); transition: transform .15s; }
.confirm-backdrop.open .confirm-box { transform: scale(1); }
.confirm-title   { font-weight: 700; margin-bottom: 8px; }
.confirm-msg     { font-size: .88rem; color: var(--muted); margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== 16. Toasts ===== */
.toast { position: fixed; bottom: 24px; left: 50%;
         transform: translateX(-50%) translateY(16px);
         background: #0d0d0d; color: var(--text);
         border: 1px solid var(--border);
         padding: 10px 20px; border-radius: 99px;
         font-size: .88rem; opacity: 0; pointer-events: none;
         transition: opacity .2s, transform .2s;
         z-index: 200; white-space: nowrap;
         box-shadow: var(--shadow-lg); }
.toast.show  { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ===== 17. Toggle switches ===== */
.toggle-switch { display: flex; align-items: center; gap: 12px;
                 cursor: pointer; user-select: none; }
.toggle-switch input { display: none; }
.toggle-track  { width: 44px; height: 24px; border-radius: 12px;
                 background: var(--border); position: relative;
                 transition: background .2s; }
.toggle-switch input:checked + .toggle-track { background: var(--primary); }
.toggle-thumb  { position: absolute; top: 3px; left: 3px;
                 width: 18px; height: 18px; border-radius: 50%;
                 background: #fff; transition: transform .2s;
                 box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.toggle-switch input:checked + .toggle-track .toggle-thumb { transform: translateX(20px); }
.toggle-label  { font-size: .9rem; color: var(--text); }

/* ===== 18. Spinner ===== */
.spin { display: inline-block; width: 28px; height: 28px;
        border: 3px solid var(--border); border-top-color: var(--primary);
        border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 19. Responsive ===== */
.hamburger        { display: none; background: none; border: none; cursor: pointer;
                    font-size: 1.4rem; color: var(--text);
                    padding: 4px 8px; margin-right: 8px; line-height: 1; }
.sidebar-overlay  { display: none; position: fixed; inset: 0;
                    background: rgba(0,0,0,.45); z-index: 199; }
.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {
    .hamburger { display: inline-flex; align-items: center; }
    .sidebar   { position: fixed; top: 0; left: 0; height: 100vh; z-index: 200;
                 transform: translateX(-100%); transition: transform .25s; }
    .sidebar.open { transform: translateX(0); }
    .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
}

/* ===== 21. Action menu (dropdown en modal) ===== */
.action-menu          { position: relative; display: inline-block; }
.action-menu-dropdown { display: none; position: absolute; left: 0; top: calc(100% + 6px);
                        background: var(--surface); border: 1px solid var(--border);
                        border-radius: 10px; box-shadow: var(--shadow-lg);
                        min-width: 220px; overflow: hidden; z-index: 110; }
.action-menu.open .action-menu-dropdown { display: block; }
.action-menu-up .action-menu-dropdown   { top: auto; bottom: calc(100% + 6px); }

.action-menu-item     { display: flex; align-items: center; gap: 10px; width: 100%;
                        padding: 10px 16px; font-size: .85rem; color: var(--text);
                        background: none; border: none; cursor: pointer;
                        text-align: left; font-family: inherit;
                        transition: background .15s, color .15s; }
.action-menu-item:hover        { background: var(--bg); color: var(--primary); }
.action-menu-item.danger:hover { background: var(--bg); color: var(--danger); }
.action-menu-item i            { width: 16px; text-align: center; color: var(--muted); }
.action-menu-item:hover i      { color: inherit; }
.action-menu-divider           { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== 22. Data list (consulta) ===== */
.data-list  { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
              gap: 12px; }
.data-row   { background: color-mix(in srgb, var(--surface) 90%, #000);
              border: none;
              border-radius: 10px; padding: 12px 14px;
              display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.data-row.data-row-full { grid-column: 1 / -1; }
.data-label { font-size: .75rem; font-weight: 600;
              text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.data-value { font-size: .9rem; color: var(--text);
              word-break: break-word; white-space: pre-wrap; }
.data-value.muted { color: var(--muted); font-style: italic; }
.data-value code  { font-family: monospace; font-size: .85rem;
                    background: var(--surface); border: 1px solid var(--border);
                    border-radius: 6px; padding: 2px 8px; }

@media (max-width: 600px) {
    .data-list { grid-template-columns: 1fr; }
}

/* ===== 23. JSON editor ===== */
.json-editor {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .82rem;
    line-height: 1.5;
    min-height: 360px;
    max-height: 60vh;
    white-space: pre;
    overflow: auto;
    tab-size: 2;
}

/* ===== 24. Tile grid ===== */
.tile-grid  { display: grid;
              grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
              gap: 16px; }
.tile-card  { background: var(--surface); border: 1px solid var(--border);
              border-radius: var(--radius); padding: 20px;
              display: flex; flex-direction: column; gap: 6px;
              text-align: left; cursor: pointer; text-decoration: none;
              color: var(--text); font-family: inherit;
              transition: border-color .15s, background .15s, transform .1s; }
.tile-card:hover  { border-color: var(--primary); background: var(--row-hover);
                    text-decoration: none; }
.tile-card:active { transform: scale(.98); }
.tile-icon  { font-size: 1.6rem; line-height: 1; margin-bottom: 4px; }
.tile-title { font-weight: 600; font-size: .95rem; color: var(--text); }
.tile-desc  { font-size: .8rem; color: var(--muted); }

/* ===== Página: header de sección ===== */
.page-header   { display: flex; align-items: flex-end; justify-content: space-between;
                 gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-header h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em; }
.page-header p  { margin-top: 4px; color: var(--muted); font-size: .88rem; }
.page-actions   { display: flex; gap: 10px; }

/* ===== Login (pantalla aislada, sin chrome) ===== */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 28px;
}
.login-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; margin: -28px -28px 20px;
    background: var(--primary);
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid rgba(0,0,0,.2);
}
.login-brand img { height: 32px; width: auto; display: block; }
.login-brand-title { color: #fff; font-weight: 700; font-size: 1rem; }
.login-brand-sub   { color: rgba(255,255,255,.75); font-size: .78rem; }
.login-card h1 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.login-card .lead { color: var(--muted); font-size: .85rem; margin-bottom: 18px; }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 10px 16px; }
.login-foot {
    margin-top: 18px; text-align: center; color: var(--muted); font-size: .75rem;
    letter-spacing: .03em; font-family: monospace;
}

.alert {
    border-radius: var(--radius); padding: 10px 12px; font-size: .85rem;
    margin-bottom: 14px; border: 1px solid transparent;
}
.alert-error { background: rgba(230,42,42,.12); color: #f5a8a8; border-color: rgba(230,42,42,.3); }
.alert-warn  { background: rgba(245,158,11,.12); color: #fcd34d; border-color: rgba(245,158,11,.3); }
.alert-info  { background: rgba(59,130,246,.12); color: #93c5fd; border-color: rgba(59,130,246,.3); }
.alert-success { background: rgba(34,197,94,.12); color: #86efac; border-color: rgba(34,197,94,.3); }

/* ===== Monitor de señales en tiempo real (modal) =====
 * Modal accesible desde la toolbar del listado de Señales. El cuerpo es
 * un panel tipo terminal/consola: fondo negro, font monoespaciada, una
 * línea por señal con auto-scroll al pie (estilo `tail -f`).
 */
.dash-live-status { display: inline-flex; align-items: center; gap: 6px;
                    font-size: .72rem; color: var(--muted);
                    text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }

.live-dot { width: 8px; height: 8px; border-radius: 50%;
            background: var(--success);
            box-shadow: 0 0 0 0 rgba(34,197,94,.6);
            animation: live-pulse 1.4s infinite; }
.live-paused .live-dot { background: var(--muted); animation: none; box-shadow: none; }

@keyframes live-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(34,197,94,.55); }
    70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0);   }
    100% { box-shadow: 0 0 0 0   rgba(34,197,94,0);   }
}

/* Compound selector — sube la especificidad sobre .modal { max-width: 520px }
   de la sección 14. */
.modal.signals-monitor-modal { max-width: 1000px; }
.signals-monitor-modal .modal-body { padding: 0; background: #0a0a0a; }
.signals-monitor-modal .modal-title { display: inline-flex; align-items: center; gap: 14px; }
.signals-monitor-controls { display: inline-flex; align-items: center; gap: 6px; }

.signals-monitor-console {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .8rem; line-height: 1.55;
    color: #d4d4d4; background: #0a0a0a;
    padding: 14px 18px;
    height: 65vh;
    overflow-y: auto; overflow-x: auto;
    scroll-behavior: smooth;
}
.signals-monitor-console::-webkit-scrollbar       { width: 10px; height: 10px; }
.signals-monitor-console::-webkit-scrollbar-track { background: #0a0a0a; }
.signals-monitor-console::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 5px; }
.signals-monitor-console::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

.signals-monitor-empty { color: #6b7280; font-style: italic; }
.signals-monitor-caret {
    display: inline-block; width: 8px; height: 14px; margin-left: 4px;
    background: #d4d4d4; vertical-align: middle;
    animation: monitor-caret-blink 1s steps(1) infinite;
}
@keyframes monitor-caret-blink {
    0%, 50%   { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.log-line { display: flex; align-items: baseline; gap: 10px;
            padding: 1px 6px; border-radius: 4px;
            white-space: nowrap; }
.log-line:hover { background: #1a1a1a; }
.log-line.is-new { animation: monitor-line-flash 1.2s ease-out; }
@keyframes monitor-line-flash {
    0%   { background: rgba(34,197,94,.22); }
    100% { background: transparent; }
}

.log-sep         { color: #3a3a3a; }
.log-ts          { color: #6b7280; }
.log-id          { color: #93c5fd; font-weight: 600; min-width: 64px; }
.log-arrow       { font-weight: 700; letter-spacing: .05em; }
.log-in          { color: #34d399; }   /* E entrante  → verde */
.log-out         { color: #fbbf24; }   /* S saliente  → ámbar */
.log-muted       { color: #6b7280; }
.log-prio        { font-weight: 600; min-width: 28px; text-align: center; }
.log-prio-high   { color: #f87171; }   /* prioridad alta */
.log-prio-mid    { color: #fbbf24; }   /* prioridad media */
.log-prio-low    { color: #9ca3af; }   /* prioridad baja / sin definir */
.log-prop        { color: #67e8f9; min-width: 110px; }
.log-msg         { color: #d4d4d4; flex: 1; overflow: hidden;
                   text-overflow: ellipsis; min-width: 0; }
.log-pending     { color: #fbbf24; font-weight: 600; }
.log-processed   { color: #6b7280; }

.signals-monitor-footer-info {
    margin-right: auto;
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .8rem; color: var(--muted);
}

/* ===== Utilidades ===== */
.flex          { display: flex; }
.items-center  { align-items: center; }
.gap-2         { gap: 8px; }
.gap-3         { gap: 12px; }
.justify-between { justify-content: space-between; }
.text-muted    { color: var(--muted); }
.text-sm       { font-size: .8rem; }
.mt-1          { margin-top: 4px; }
.mt-2          { margin-top: 8px; }
.mt-4          { margin-top: 16px; }
