/* =========================================
   COMMAND PALETTE (CTRL+K)
   ========================================= */
.cmd-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10001; /* Acima de tudo, menos do Alert/Matrix */
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
}

.cmd-overlay.active {
    opacity: 1; pointer-events: all;
}

.cmd-modal {
    background: var(--bg-card); /* Usa cor do tema */
    width: 600px; max-width: 90%;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
    display: flex; flex-direction: column;
}

.cmd-overlay.active .cmd-modal { transform: scale(1); }

/* Input de Busca */
.cmd-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}

.cmd-header i { color: var(--text-muted); font-size: 1.2rem; }

.cmd-input {
    background: transparent; border: none;
    color: var(--text-main); font-size: 1.1rem;
    width: 100%; outline: none; font-family: var(--font-body);
}

/* Lista de Comandos */
.cmd-list {
    list-style: none;
    max-height: 300px; overflow-y: auto;
    padding: 10px;
}

.cmd-group-title {
    font-size: 0.75rem; color: var(--text-muted);
    padding: 8px 10px 4px 10px;
    text-transform: uppercase; letter-spacing: 1px;
    font-weight: 600;
}

.cmd-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.1s;
    margin-bottom: 2px;
}

.cmd-item-left { display: flex; align-items: center; gap: 12px; }
.cmd-item i { font-size: 1.1rem; color: var(--text-muted); }

.cmd-shortcut {
    font-size: 0.75rem; background: rgba(255,255,255,0.1);
    padding: 2px 6px; border-radius: 4px;
    color: var(--text-muted); font-family: monospace;
}

/* Estado Selecionado (Hover ou Teclado) */
.cmd-item.selected, .cmd-item:hover {
    background: var(--brand-blue);
    color: white;
}
.cmd-item.selected i, .cmd-item:hover i,
.cmd-item.selected .cmd-shortcut, .cmd-item:hover .cmd-shortcut {
    color: rgba(255,255,255,0.8);
}

/* Rodapé */
.cmd-footer {
    padding: 8px 20px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--border);
    font-size: 0.75rem; color: var(--text-muted);
    display: flex; gap: 15px; justify-content: flex-end;
}
.cmd-key {
    background: rgba(255,255,255,0.1);
    padding: 1px 5px; border-radius: 3px;
    margin-right: 4px;
}

/* Scrollbar fina */
.cmd-list::-webkit-scrollbar { width: 5px; }
.cmd-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }