/* NocPABX - Painel Admin */

.admin-badge {
    background: var(--red-primary);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.logo-link { text-decoration: none; }

.admin-layout {
    display: flex;
    min-height: calc(100vh - 57px);
}

/* Sidebar */
.admin-nav {
    width: 180px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 16px 0;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-card);
    color: var(--white);
    border-left-color: var(--red-primary);
}

.nav-icon { font-size: 16px; }

/* Content */
.admin-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.tab-section { display: none; }
.tab-section.active { display: block; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.text-muted { color: var(--text-muted); font-size: 13px; }

/* Buttons */
.btn-primary {
    background: var(--red-primary);
    color: var(--white);
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover { background: var(--red-light); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--red-primary); }

.btn-danger {
    background: transparent;
    color: var(--red-light);
    border: 1px solid var(--red-dark);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover { background: var(--red-dark); }

.btn-success {
    background: var(--green-dark);
    color: var(--green);
    border: 1px solid var(--green-dark);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
}

.btn-warning {
    background: var(--yellow-dark);
    color: var(--yellow);
    border: 1px solid var(--yellow-dark);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
}

/* Tables */
.table-wrapper { overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th {
    background: var(--bg-secondary);
    padding: 10px 14px;
    text-align: left;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.admin-table tr:hover td { background: var(--bg-card-hover); }

.admin-table .mono { font-family: var(--font-mono); }

.actions { display: flex; gap: 6px; }

/* Queue cards */
.queue-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.queue-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.queue-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.queue-id {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--red-light);
}

.queue-name { font-size: 15px; font-weight: 600; }

.queue-card-body { padding: 16px 18px; }

.queue-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.queue-info-item label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 3px;
}

.queue-info-item span {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-primary);
}

.members-section h4 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.members-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.member-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
}

.member-chip button {
    background: none;
    border: none;
    color: var(--red-light);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.add-member-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.add-member-row select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 13px;
    outline: none;
}

/* Realtime */
.realtime-queue {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.realtime-queue-header {
    padding: 12px 18px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 15px;
}

.realtime-agents {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    padding: 16px;
}

.realtime-agent {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.realtime-agent-info .name { font-weight: 600; font-size: 14px; }
.realtime-agent-info .ext { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.realtime-agent-info .status { font-size: 12px; margin-top: 4px; }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    margin: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.modal-body { padding: 20px; }

.form-row {
    margin-bottom: 16px;
}

.form-row label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-row input,
.form-row select {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
}

.form-row input:focus,
.form-row select:focus { border-color: var(--red-primary); }

.form-row small { color: var(--text-muted); font-size: 11px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 14px;
}

.alert-error { background: var(--red-dark); color: var(--red-light); border: 1px solid var(--red-primary); }
.alert-success { background: var(--green-dark); color: var(--green); }
