/* ═══════════════════════════════════════════════════════════
   CRM Theme: SignalMatrix Dark
   Neon green (#00ff88) + Cyan (#00d4ff) on dark backgrounds
   Matches signalmatrixai.com design language
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variable Overrides ── */
:root {
    --crm-primary: #00ff88;
    --crm-primary-hover: #00e07a;
    --crm-primary-rgb: 0, 255, 136;
    --crm-info: #00d4ff;
    --crm-info-rgb: 0, 212, 255;
    --crm-body-bg: #0f1520;
    --crm-card-bg: #111827;
    --crm-card-bg-alt: #1a2332;
    --crm-text: #e2e8f0;
    --crm-text-muted: #94a3b8;
    --crm-border: rgba(255, 255, 255, 0.06);
    --crm-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --crm-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ── Body ── */
body {
    background: var(--crm-body-bg) !important;
    color: var(--crm-text) !important;
}

/* ── Sidebar ── */
.sidebar {
    background: linear-gradient(180deg, #0a0f1c 0%, #0d1321 50%, #111827 100%) !important;
    border-right: 1px solid rgba(0, 255, 136, 0.08) !important;
}

.sidebar-brand {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}
.sidebar-brand i {
    color: #00ff88 !important;
}
.sidebar-brand span {
    color: #ffffff !important;
}

.sidebar-group-label {
    color: #00ff88 !important;
    opacity: 0.6;
}

.sidebar .nav-link {
    color: #94a3b8 !important;
}
.sidebar .nav-link:hover {
    background: rgba(0, 255, 136, 0.06) !important;
    color: #e2e8f0 !important;
}
.sidebar .nav-link.active {
    background: rgba(0, 255, 136, 0.12) !important;
    color: #00ff88 !important;
}
.sidebar .nav-link.active i {
    color: #00ff88 !important;
}

.sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.06) !important;
}

/* Sidebar user avatar */
.sidebar-footer .user-avatar,
.sidebar .user-avatar {
    background: linear-gradient(135deg, #00ff88, #00d4ff) !important;
    color: #0a0f1c !important;
}

/* ── Header ── */
.crm-header {
    background: linear-gradient(90deg, #111827, #0d1321) !important;
    border-bottom: 1px solid rgba(0, 255, 136, 0.08) !important;
    box-shadow: none !important;
}

.crm-breadcrumb a {
    color: #94a3b8 !important;
}
.crm-breadcrumb .current {
    color: #ffffff !important;
}
.crm-breadcrumb i {
    color: #7a8da3 !important;
}

.crm-search {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.crm-search input {
    color: #e2e8f0 !important;
}
.crm-search input::placeholder {
    color: #7a8da3 !important;
}
.crm-search i {
    color: #7a8da3 !important;
}

.header-icon-btn {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #94a3b8 !important;
    border: none !important;
}
.header-icon-btn:hover {
    background: rgba(0, 255, 136, 0.1) !important;
    color: #00ff88 !important;
}

/* Header avatar */
.crm-header .user-avatar {
    background: linear-gradient(135deg, #00ff88, #00d4ff) !important;
    color: #0a0f1c !important;
}

/* ── Cards ── */
.card {
    background: linear-gradient(135deg, #111827, #1a2332) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: var(--crm-text) !important;
}
.card-header {
    background: rgba(0, 0, 0, 0.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: #fff !important;
}
.card-header .btn-outline-primary {
    color: #00d4ff !important;
    border-color: #00d4ff !important;
}
.card-header .btn-outline-primary:hover {
    background: #00d4ff !important;
    color: #0a0f1c !important;
}
.card-body {
    color: var(--crm-text) !important;
}

/* Stat cards */
.stat-card {
    background: linear-gradient(135deg, #111827, #1a2332) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: var(--crm-text) !important;
    transition: all 0.2s !important;
}
.stat-card:hover {
    border-color: rgba(0, 255, 136, 0.2) !important;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.08) !important;
    transform: translateY(-2px);
}

/* ── Tables ── */
.table {
    color: var(--crm-text) !important;
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--crm-text) !important;
    --bs-table-hover-bg: rgba(0, 255, 136, 0.03) !important;
    --bs-table-hover-color: var(--crm-text) !important;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02) !important;
    --bs-table-striped-color: var(--crm-text) !important;
}
.table thead th {
    background: rgba(0, 0, 0, 0.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: #8b9db5 !important;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    color: var(--crm-text) !important;
}
.table tbody tr:hover {
    background: rgba(0, 255, 136, 0.03) !important;
}
.table a {
    color: #00d4ff !important;
}
.table a:hover {
    color: #00ff88 !important;
}

/* Table variants */
.table-danger, .table-danger > td, .table-danger > th {
    background: rgba(239, 68, 68, 0.08) !important;
    color: var(--crm-text) !important;
}
.table-warning, .table-warning > td, .table-warning > th {
    background: rgba(245, 158, 11, 0.08) !important;
    color: var(--crm-text) !important;
}
.table-success, .table-success > td, .table-success > th {
    background: rgba(16, 185, 129, 0.08) !important;
    color: var(--crm-text) !important;
}

/* ── Forms ── */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #e2e8f0 !important;
}
.form-control:focus, .form-select:focus {
    border-color: rgba(0, 255, 136, 0.4) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 255, 136, 0.1) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: #e2e8f0 !important;
}
.form-control::placeholder {
    color: #7a8da3 !important;
}
.form-label {
    color: #94a3b8 !important;
}
.form-text, .text-muted {
    color: #8b9db5 !important;
}
.form-check-input {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}
.form-check-input:checked {
    background-color: #00ff88 !important;
    border-color: #00ff88 !important;
}

/* Input groups */
.input-group-text {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}

/* ── Buttons ── */
.btn-primary {
    background: linear-gradient(135deg, #00ff88, #00d4ff) !important;
    border: none !important;
    color: #0a0f1c !important;
    font-weight: 600 !important;
}
.btn-primary:hover {
    opacity: 0.9 !important;
    transform: translateY(-1px);
    color: #0a0f1c !important;
}
.btn-outline-primary {
    color: #00d4ff !important;
    border-color: #00d4ff !important;
    background: transparent !important;
}
.btn-outline-primary:hover {
    background: #00d4ff !important;
    color: #0a0f1c !important;
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
}
.btn-outline-secondary {
    color: #94a3b8 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}
.btn-success {
    background: #10b981 !important;
    border-color: #10b981 !important;
}
.btn-warning {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #0a0f1c !important;
}
.btn-danger {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
}
.btn-info {
    background: #00d4ff !important;
    border-color: #00d4ff !important;
    color: #0a0f1c !important;
}
.btn-outline-info {
    color: #00d4ff !important;
    border-color: #00d4ff !important;
}
.btn-outline-info:hover {
    background: #00d4ff !important;
    color: #0a0f1c !important;
}

/* ── Modals ── */
.modal-content {
    background: #1a2332 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--crm-text) !important;
}
.modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
    color: #fff !important;
}
.modal-header .btn-close {
    filter: invert(1) !important;
}
.modal-footer {
    border-top-color: rgba(255, 255, 255, 0.06) !important;
}
.modal-title {
    color: #fff !important;
}

/* ── Dropdowns ── */
.dropdown-menu {
    background: #1a2332 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.dropdown-item {
    color: #e2e8f0 !important;
}
.dropdown-item:hover, .dropdown-item:focus {
    background: rgba(0, 255, 136, 0.08) !important;
    color: #00ff88 !important;
}
.dropdown-divider {
    border-color: rgba(255, 255, 255, 0.06) !important;
}

/* ── Alerts ── */
.alert-info {
    background: rgba(0, 212, 255, 0.1) !important;
    border-color: rgba(0, 212, 255, 0.2) !important;
    color: #00d4ff !important;
}
.alert-success {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
    color: #10b981 !important;
}
.alert-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.2) !important;
    color: #f59e0b !important;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
}
.alert-light {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
}

/* ── Badges ── */
.badge.bg-light {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}
.badge.bg-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* ── Pagination ── */
.page-link {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
}
.page-link:hover {
    background: rgba(0, 255, 136, 0.1) !important;
    color: #00ff88 !important;
}
.page-item.active .page-link {
    background: #00ff88 !important;
    border-color: #00ff88 !important;
    color: #0a0f1c !important;
}

/* ── List Groups ── */
.list-group-item {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--crm-text) !important;
}
.list-group-item:hover {
    background: rgba(0, 255, 136, 0.03) !important;
}

/* ── Nav tabs ── */
.nav-tabs {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}
.nav-tabs .nav-link {
    color: #94a3b8 !important;
}
.nav-tabs .nav-link:hover {
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}
.nav-tabs .nav-link.active {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.1) rgba(255, 255, 255, 0.1) var(--crm-body-bg) !important;
    color: #00ff88 !important;
}

/* ── Nav pills ── */
.nav-pills .nav-link {
    color: #94a3b8 !important;
}
.nav-pills .nav-link.active {
    background: rgba(0, 255, 136, 0.15) !important;
    color: #00ff88 !important;
}

/* ── Progress bars ── */
.progress {
    background: rgba(255, 255, 255, 0.06) !important;
}

/* ── Misc Bootstrap overrides ── */
.bg-white {
    background: #111827 !important;
}
.bg-light {
    background: rgba(255, 255, 255, 0.03) !important;
}
.border {
    border-color: rgba(255, 255, 255, 0.06) !important;
}
.border-bottom {
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}
.border-top {
    border-top-color: rgba(255, 255, 255, 0.06) !important;
}
.text-dark {
    color: #e2e8f0 !important;
}
.text-body {
    color: #e2e8f0 !important;
}
hr {
    border-color: rgba(255, 255, 255, 0.06) !important;
    opacity: 1 !important;
}

/* Headings */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: #ffffff !important;
}

/* Links */
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.list-group-item) {
    color: #00d4ff;
}
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.list-group-item):hover {
    color: #00ff88;
}

/* Tooltips */
.tooltip-inner {
    background: #1a2332 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Toasts */
.toast {
    background: #1a2332 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
}

/* Accordion */
.accordion-item {
    background: #111827 !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}
.accordion-button {
    background: #111827 !important;
    color: #e2e8f0 !important;
}
.accordion-button:not(.collapsed) {
    background: rgba(0, 255, 136, 0.06) !important;
    color: #00ff88 !important;
}

/* ── Sidebar brand link ── */
.sidebar-brand-link {
    color: #00ff88 !important;
    font-size: 10px;
    opacity: 0.7;
    text-decoration: none;
}
.sidebar-brand-link:hover {
    opacity: 1;
    text-decoration: underline !important;
    color: #00ff88 !important;
}

/* ── Scrollbar (dark) ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0f1520; }
::-webkit-scrollbar-thumb { background: #2a3441; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a4451; }

/* ── Select option backgrounds ── */
select option {
    background: #1a2332 !important;
    color: #e2e8f0 !important;
}

/* ── Date inputs, small selects readability ── */
.form-control[type="date"],
.form-select[style*="font-size"] {
    color: #cbd5e1 !important;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
}

/* ── Pipeline Kanban cards (dark override) ── */
.pipeline-column {
    background: #1a2332 !important;
}
.lead-card {
    background: #111827 !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.lead-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}
.lead-card strong {
    color: #ffffff !important;
}
.lead-card .text-muted,
.lead-card small.text-muted {
    color: #94a3b8 !important;
}
