/* =========================================================================
   Idea: sv4-218 — Estilos compartidos de los paneles de seguridad del
   Monitor de Agendamiento ("Errores de Cliente" y "Registro de Captcha").
   Replican el patrón de grid premium usado en los monitores de IPs (sv4-196).
   Se centralizan aquí para garantizar consistencia visual entre ambos paneles.
   ========================================================================= */

/* ── Contenedor ── */
.seguridad-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Toolbar de filtros ── */
.seguridad-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.seguridad-fechas {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.seguridad-fecha-label {
    font-size: 0.72rem;
    color: #64748b;
    margin-bottom: 0;
    white-space: nowrap;
}

.seguridad-fecha {
    height: 26px;
    width: 138px;
    font-size: 0.72rem;
    padding: 2px 6px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
}

.seguridad-input-col {
    height: 26px;
    width: 140px;
    font-size: 0.72rem;
    border: 1px solid #d1d5db;
    border-radius: 3px;
}

.seguridad-select {
    height: 26px;
    width: 165px;
    font-size: 0.72rem;
    padding: 2px 20px 2px 6px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
}

.seguridad-auto-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
}

.seguridad-btn {
    height: 26px;
    font-size: 0.75rem;
    padding: 0 8px;
}

.seguridad-btn-icon {
    font-size: 0.6rem;
}

/* ── Tarjeta de tabla ── */
.seguridad-table-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.seguridad-card-header {
    background: #fff !important;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 8px 12px !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.seguridad-card-header-icon {
    font-size: 0.78rem;
}

.seguridad-card-titulo {
    font-size: 0.82rem;
    color: #1f2937;
}

.seguridad-badge {
    font-size: 0.62rem;
    padding: 3px 7px;
    border-radius: 3px;
}

.seguridad-badge-evento {
    font-size: 0.62rem;
    padding: 3px 7px;
    border-radius: 3px;
    white-space: nowrap;
}

.seguridad-hint {
    font-size: 0.66rem;
    color: #94a3b8;
}

.seguridad-card-body {
    flex: 1;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.seguridad-table-scroll {
    flex: 1 1 auto;
    min-height: 180px;
    max-height: 52vh;
    overflow: auto;
    border-top: 1px solid #f1f5f9;
}

/* ── Tabla ── */
.seguridad-table {
    font-size: 0.72rem;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.seguridad-thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    font-size: 0.68rem;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e5e7eb;
    padding: 6px 8px;
    white-space: nowrap;
}

.seguridad-th {
    cursor: pointer;
    user-select: none;
}

.seguridad-sort-icon {
    margin-left: 4px;
    font-size: 0.6rem;
    color: #94a3b8;
}

.seguridad-row {
    background: #fff;
}

.seguridad-table.table-hover tbody tr.seguridad-row:hover > * {
    background: #f8fafc !important;
}

.seguridad-td {
    padding: 4px 8px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.seguridad-td-nowrap {
    white-space: nowrap;
}

.seguridad-td-mensaje {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #b91c1c;
}

.seguridad-accion {
    width: 22px;
    height: 22px;
    font-size: 0.72rem;
    text-decoration: none;
    color: #0d6efd;
}

/* ── Detalle expandible ── */
.seguridad-row-detalle > td {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.seguridad-td-detalle {
    padding: 8px 12px;
}

.seguridad-detalle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
}

.seguridad-detalle-campo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.seguridad-detalle-campo-full {
    grid-column: 1 / -1;
}

.seguridad-detalle-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #94a3b8;
    font-weight: 600;
}

.seguridad-detalle-valor {
    font-size: 0.7rem;
    color: #334155;
    word-break: break-all;
}

.seguridad-detalle-stack {
    margin: 0;
    padding: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 0.66rem;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 220px;
    overflow: auto;
}

/* ── Estados vacíos y overlays ── */
.seguridad-empty-cell {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 18px 8px;
}

.seguridad-empty-icon {
    color: #94a3b8;
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.seguridad-empty-titulo {
    font-size: 0.78rem;
    color: #475569;
    font-weight: 600;
}

.seguridad-empty-sub {
    font-size: 0.68rem;
}

.seguridad-link {
    font-size: 0.68rem;
    color: #2563eb;
    text-decoration: underline;
    vertical-align: baseline;
    line-height: 1;
}

.seguridad-vacio-texto {
    font-size: 0.78rem;
}

.seguridad-overlay {
    top: 0;
    left: 0;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 10;
    border-radius: 8px;
}

/* ── Responsive ── */
@media (max-width: 767.98px) {
    .seguridad-detalle-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .seguridad-fecha,
    .seguridad-input-col,
    .seguridad-select {
        width: 100%;
    }
}
