/* Monitor de Queries en Tiempo Real */
.query-monitor {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    border-radius: 8px;
    overflow: hidden;
}

.query-header {
    background: #2d2d2d;
    padding: 12px 16px;
    border-bottom: 1px solid #404040;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.query-header h5 {
    color: #fff;
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.query-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.query-control-btn {
    background: #404040;
    border: none;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.query-control-btn:hover {
    background: #4d4d4d;
}

.query-control-btn.active {
    background: #007acc;
}

.query-stats {
    display: flex;
    gap: 16px;
    padding: 8px 16px;
    background: #252526;
    border-bottom: 1px solid #404040;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-label {
    color: #9cdcfe;
}

.stat-value {
    color: #ce9178;
    font-weight: 500;
}

.stat-badge {
    background: #2d2d2d;
    padding: 2px 6px;
    border-radius: 4px;
    border-left: 2px solid;
}

.query-filters {
    padding: 12px 16px;
    background: #252526;
    border-bottom: 1px solid #404040;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    color: #9cdcfe;
    font-size: 0.875rem;
}

.filter-input {
    background: #3c3c3c;
    border: 1px solid #3c3c3c;
    color: #d4d4d4;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
}

.filter-input:focus {
    outline: none;
    border-color: #007acc;
}

.filter-select {
    background: #3c3c3c;
    border: 1px solid #3c3c3c;
    color: #d4d4d4;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
}

.query-container {
    max-height: 600px;
    overflow-y: auto;
    background: #1e1e1e;
}

.query-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.query-table th {
    background: #2d2d2d;
    color: #9cdcfe;
    font-weight: 500;
    padding: 10px 12px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #404040;
}

.query-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #2d2d2d;
    color: #d4d4d4;
}

.query-table tr:hover {
    background: #2a2d2e;
}

.query-table tr.query-procedure {
    background: #1e2a1e;
    border-left: 3px solid #6a9955;
}

.query-table tr.query-slow {
    background: #2d2a1e;
    border-left: 3px solid #dcdcaa;
}

.query-id {
    color: #569cd6;
    font-weight: 500;
}

.query-time {
    font-family: monospace;
}

.query-time-critical {
    color: #f48771;
    font-weight: bold;
}

.query-time-warning {
    color: #dcdcaa;
}

.query-time-normal {
    color: #6a9955;
}

.query-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-select { background: #569cd6; color: #fff; }
.badge-insert { background: #6a9955; color: #fff; }
.badge-update { background: #dcdcaa; color: #000; }
.badge-delete { background: #f48771; color: #fff; }
.badge-procedure { background: #c586c0; color: #fff; }
.badge-ddl { background: #ce9178; color: #fff; }
.badge-transaction { background: #9cdcfe; color: #000; }

.query-text {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ce9178;
    cursor: pointer;
}

.query-text:hover {
    color: #d4d4d4;
    background: #3c3c3c;
}

.procedure-details {
    background: #1e1e1e;
    border: 1px solid #404040;
    border-radius: 4px;
    padding: 16px;
    margin: 10px 0;
}

.procedure-code {
    background: #2d2d2d;
    padding: 12px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 0.875rem;
    color: #d4d4d4;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

.procedure-params {
    background: #252526;
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
    color: #9cdcfe;
}

/* Modal para ver query completa */
.query-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.query-modal-content {
    background: #1e1e1e;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.query-modal-header {
    background: #2d2d2d;
    padding: 16px;
    border-bottom: 1px solid #404040;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.query-modal-header h6 {
    color: #fff;
    margin: 0;
    font-size: 1rem;
}

.query-modal-body {
    padding: 16px;
    max-height: calc(80vh - 120px);
    overflow-y: auto;
}

.query-modal-body pre {
    background: #2d2d2d;
    padding: 16px;
    border-radius: 4px;
    margin: 0;
    color: #d4d4d4;
    font-family: 'Consolas', monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.query-modal-footer {
    background: #252526;
    padding: 12px 16px;
    border-top: 1px solid #404040;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Animaciones */
@keyframes query-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.query-new {
    animation: query-pulse 1s ease-in-out;
}

/* Scrollbar personalizado */
.query-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.query-container::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.query-container::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
}

.query-container::-webkit-scrollbar-thumb:hover {
    background: #4f4f4f;
}