:root {
    --bg-main: #0b0f19;
    --bg-card: #131b2e;
    --bg-card-hover: #1a253f;
    --bg-sidebar: #0f172a;
    --border-color: #202b45;
    --border-highlight: #334155;
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-light: rgba(16, 185, 129, 0.15);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.15);
    --purple: #8b5cf6;
    --purple-light: rgba(139, 92, 246, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --font: 'Cairo', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: var(--font);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

/* App Layout */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 290px;
    height: 100vh;
    background-color: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    z-index: 20;
}

.brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #10b981, #047857);
    color: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.35);
}

.brand-text h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
}

.brand-text h2 span {
    color: var(--primary);
}

.license-badge {
    font-size: 0.72rem;
    color: #fbbf24;
    font-weight: 700;
}

.nav-menu {
    flex: 1;
    min-height: 0;
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
}

.nav-item .icon {
    font-size: 1.15rem;
}

.nav-item:hover {
    background-color: var(--bg-card-hover);
    color: #fff;
    transform: translateX(-3px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.05));
    color: var(--primary);
    border-right: 3px solid var(--primary);
    font-weight: 700;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 14px;
    border-top: 1px solid var(--border-color);
}

.connection-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius);
}

.conn-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.connected { background-color: #10b981; box-shadow: 0 0 10px #10b981; }
.status-dot.connecting { background-color: #f59e0b; box-shadow: 0 0 10px #f59e0b; }
.status-dot.qr_ready { background-color: #3b82f6; box-shadow: 0 0 10px #3b82f6; }
.status-dot.disconnected { background-color: #ef4444; }

.user-phone {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin: 4px 0 10px 0;
    direction: ltr;
    text-align: right;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    min-width: 0;
}

/* Topbar */
.topbar {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 30px;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-title h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
}

.topbar-title p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-select-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
}

.profile-select-wrapper label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

.profile-select-wrapper select {
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

.badge-status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    font-size: 0.82rem;
    font-weight: 700;
}

.badge-status-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

/* Tabs */
.tab-pane {
    display: none;
    padding: 24px 30px 40px;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards & Layout */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

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

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.card-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.card-body {
    padding: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1024px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon.emerald { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.quick-action-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-box:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.quick-action-box .q-icon {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 8px;
}

.quick-action-box h4 {
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 4px;
}

.quick-action-box p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Forms & Inputs */
.form-input, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background-color: #0c1220;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
    outline: none;
}

.form-input:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.input-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.input-label-sm {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.subtext {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ltr-input {
    direction: ltr;
    text-align: left;
}

/* Buttons */
.btn {
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary { background-color: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background-color: var(--primary-hover); }

.btn-success { background-color: #059669; color: #fff; }
.btn-success:hover:not(:disabled) { background-color: #047857; }

.btn-danger { background-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background-color: #dc2626; }

.btn-warning { background-color: var(--warning); color: #111; }
.btn-warning:hover:not(:disabled) { background-color: #d97706; }

.btn-info { background-color: var(--info); color: #fff; }
.btn-info:hover:not(:disabled) { background-color: #2563eb; }

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}
.btn-outline-danger:hover:not(:disabled) {
    background: var(--danger);
    color: #fff;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}

.btn-outline-success {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}
.btn-outline-success:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}

.btn-outline-info {
    background: transparent;
    border: 1px solid var(--info);
    color: var(--info);
}
.btn-outline-info:hover:not(:disabled) {
    background: var(--info);
    color: #fff;
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-xs { padding: 4px 8px; font-size: 0.75rem; border-radius: 4px; }
.btn-block { width: 100%; }

.btn-group-flex {
    display: flex;
    gap: 10px;
}

/* Checkbox and Radios */
.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 8px;
    font-size: 0.88rem;
    color: var(--text-main);
}

.check-row input[type="checkbox"],
.check-row input[type="radio"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Multi-Method Contacts Import Styles */
.contacts-methods-tabs {
    display: flex;
    gap: 8px;
    background: rgba(15, 23, 42, 0.6);
    padding: 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.contacts-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.contacts-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.contacts-tab-btn.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.35);
}
.contacts-method-pane {
    display: none;
}
.contacts-method-pane.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.template-download-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
}
.contacts-tools-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 14px;
}
.contacts-tools-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: flex-end;
}
@media (max-width: 820px) {
    .contacts-tools-grid {
        grid-template-columns: 1fr;
    }
}

/* Dropzone */
.file-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.01);
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-dropzone:hover {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.04);
}

.drop-icon { font-size: 2.2rem; margin-bottom: 6px; }

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    text-align: right;
}

.data-table th {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 10px 14px;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

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

.data-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-info { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

/* Progress bar */
.progress-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.progress-bar-bg {
    background-color: #0c1220;
    height: 10px;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Logs Container */
.logs-container {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

.log-item.success { border-color: rgba(16, 185, 129, 0.3); }
.log-item.failed { border-color: rgba(239, 68, 68, 0.3); }
.log-item.batch_delay { border-color: rgba(245, 158, 11, 0.3); }
.log-item.info { border-color: rgba(59, 130, 246, 0.3); }

/* Accounts / Devices Hub Cards */
.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.account-card:hover {
    border-color: var(--border-highlight);
    transform: translateY(-2px);
}

.account-card.is-connected {
    border-top: 3px solid var(--primary);
}

.account-card.is-disconnected {
    border-top: 3px solid var(--danger);
}

.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.account-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.account-name-phone h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.account-phone-val {
    font-size: 0.82rem;
    color: var(--text-muted);
    direction: ltr;
    display: inline-block;
}

.account-stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 10px 0;
}

.account-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Multi-Account Selector in Campaign */
.account-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.account-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-picker-item:hover {
    background: var(--bg-card-hover);
}

.account-picker-item.selected {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.08);
}

.account-picker-item input[type="checkbox"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

/* Strategy Selector Cards */
.strategy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 10px 0;
}

.strategy-card {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.strategy-card:hover {
    border-color: var(--border-highlight);
}

.strategy-card.active {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.08);
}

.strategy-card .s-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
    display: block;
}

.strategy-card h5 {
    font-size: 0.88rem;
    color: #fff;
    font-weight: 700;
}

.strategy-card p {
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* AI Spam Risk Meter */
.spam-meter-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    margin-top: 14px;
}

.spam-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.spam-score-pill {
    font-size: 1.1rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 9999px;
}

.spam-score-pill.safe { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.spam-score-pill.medium { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.spam-score-pill.high { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.spam-points-list {
    list-style: none;
    font-size: 0.84rem;
    margin-top: 10px;
}

.spam-points-list li {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

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

.modal-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    animation: zoomIn 0.2s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

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

.modal-body {
    padding: 24px;
}

.qr-code-img {
    width: 250px;
    height: 250px;
    border-radius: 12px;
    border: 6px solid #fff;
    margin: 0 auto;
    display: block;
}

.spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utilities */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-emerald { color: #10b981; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }

/* ============================================================
   ENHANCED CLIENT PROFILES SYSTEM
   ============================================================ */

/* Profile Stats Mini Row */
.profiles-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.profile-stat-mini {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.profile-stat-mini:hover {
    border-color: var(--border-highlight);
    transform: translateY(-2px);
}

.psm-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.psm-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.psm-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Profiles Toolbar (Search + Filter) */
.profiles-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.search-box-profiles {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.search-icon-prof {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0.5;
    pointer-events: none;
}

.prof-search-input {
    padding-right: 38px !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

.profiles-filter-tabs {
    display: flex;
    gap: 6px;
}

.prof-filter-btn {
    padding: 6px 14px;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prof-filter-btn:hover {
    border-color: var(--border-highlight);
    color: #fff;
}

.prof-filter-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* Profile Cards (Enhanced) */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: var(--shadow);
    position: relative;
}

.profile-card:hover {
    border-color: var(--border-highlight);
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -5px rgba(0, 0, 0, 0.5);
}

.profile-card-top {
    height: 6px;
    width: 100%;
}

.profile-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 18px 12px;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
}

.profile-card-info {
    flex: 1;
    min-width: 0;
}

.profile-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-card-company {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-status-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.profile-status-badge.active { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.profile-status-badge.paused { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.profile-status-badge.archived { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }

.profile-card-body {
    padding: 0 18px 14px;
}

.profile-card-context {
    font-size: 0.8rem;
    color: var(--text-dim);
    min-height: 40px;
    max-height: 40px;
    overflow: hidden;
    line-height: 1.5;
    margin-bottom: 10px;
}

.profile-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.profile-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.profile-card-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.pcm-item {
    text-align: center;
}

.pcm-val {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.pcm-lbl {
    display: block;
    font-size: 0.68rem;
    color: var(--text-dim);
}

.profile-card-actions {
    display: flex;
    gap: 6px;
}

.profile-card-actions .btn {
    flex: 1;
    font-size: 0.78rem;
    padding: 7px 6px;
}

/* Modal Enhancements for Profiles */
.modal-lg {
    max-width: 680px !important;
}

.profile-modal-top {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.profile-modal-top-info {
    flex: 1;
}

.color-picker-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.color-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.color-dot:hover {
    transform: scale(1.15);
}

.color-dot.active {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
    transform: scale(1.15);
}

.modal-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 14px;
}

.modal-section-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.modal-actions-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Empty State */
.empty-state-box {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.6;
}

.empty-state-box h4 {
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 6px;
}

.empty-state-box p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* Profile Detail View */
.profile-detail-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.profile-detail-avatar {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.profile-detail-info h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
}

.profile-detail-info .detail-company {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.profile-detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.pd-stat {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
}

.pd-stat .val {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
}

.pd-stat .lbl {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.detail-section {
    margin-bottom: 16px;
}

.detail-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-field {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.detail-field .df-label {
    font-size: 0.74rem;
    color: var(--text-dim);
    font-weight: 600;
}

.detail-field .df-value {
    font-size: 0.88rem;
    color: #fff;
    font-weight: 600;
}

.detail-context-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.7;
    white-space: pre-wrap;
}

.detail-accounts-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-account-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.detail-account-item .status-dot {
    flex-shrink: 0;
}

.detail-account-item .da-info {
    flex: 1;
}

.detail-account-item .da-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.detail-account-item .da-phone {
    font-size: 0.78rem;
    color: var(--text-muted);
    direction: ltr;
    display: inline-block;
}

@media (max-width: 768px) {
    .profiles-stats-row { grid-template-columns: repeat(2, 1fr); }
    .profiles-toolbar { flex-direction: column; align-items: stretch; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .modal-lg { max-width: 95% !important; }
    .profile-detail-stats { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-accounts-list { grid-template-columns: 1fr; }
}

/* ============================================================
   CLIENT WORKSPACE / COMMAND CENTER
   ============================================================ */
.client-workspace-header {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius);
    padding: 24px;
}

.cwh-hero-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cwh-avatar {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.cwh-details {
    flex: 1;
}

.cwh-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cwh-title-row h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.cwh-company-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cwh-meta-row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cwh-tags-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Workspace Stats Bar */
.workspace-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.ws-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ws-stat-val {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}

.ws-stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Workspace Sub-tabs */
.cwh-subtabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    overflow-x: auto;
}

.cwh-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cwh-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.cwh-tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.cw-tab-pane {
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .cwh-hero-content { flex-direction: column; align-items: flex-start; }
    .cwh-top-nav { flex-direction: column; gap: 10px; align-items: stretch; }
    .cwh-quick-actions { flex-direction: column; }
    .workspace-stats-bar { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   SIDEBAR GROUP LABELS & DIVIDERS
   ============================================================ */
.nav-group-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    padding: 18px 18px 6px;
    margin-top: 4px;
    position: relative;
}

.nav-group-label::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 14px;
    right: 14px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.nav-group-label:first-child {
    margin-top: 0;
    padding-top: 4px;
}

.nav-group-label:first-child::before {
    display: none;
}

/* ============================================================
   SIDEBAR SHORTCUT BAR (Ctrl+K)
   ============================================================ */
.sidebar-shortcut-bar {
    padding: 8px 14px 4px;
}

.shortcut-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shortcut-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-color: var(--border-highlight);
}

.shortcut-label {
    flex: 1;
    text-align: right;
}

.shortcut-btn kbd {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-dim);
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 0.78rem;
}

.bc-item {
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
}

.bc-item:hover {
    color: var(--primary);
}

.bc-item.bc-current {
    color: var(--text-muted);
    font-weight: 700;
    cursor: default;
}

.bc-item.bc-current:hover {
    color: var(--text-muted);
}

.bc-sep {
    color: var(--text-dim);
    font-size: 0.9rem;
    user-select: none;
}

/* ============================================================
   NOTIFICATION CENTER
   ============================================================ */
.topbar-icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.topbar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: var(--border-highlight);
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-sidebar);
    animation: notifPulse 2s infinite;
}

@keyframes notifPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.notification-center {
    position: absolute;
    top: 100%;
    left: 20px;
    width: 380px;
    max-height: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.notif-header h4 {
    font-size: 0.92rem;
    font-weight: 700;
}

.notif-list {
    overflow-y: auto;
    max-height: 360px;
    padding: 8px;
}

.notif-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.notif-item .ni-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.notif-item .ni-content {
    flex: 1;
}

.notif-item .ni-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.notif-item .ni-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.notif-item .ni-time {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.notif-empty {
    text-align: center;
    padding: 30px 16px;
    color: var(--text-dim);
    font-size: 0.88rem;
}

/* ============================================================
   COMMAND PALETTE (Ctrl+K)
   ============================================================ */
.cmd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    padding-top: 12vh;
    animation: fadeIn 0.15s ease;
}

.cmd-box {
    width: 560px;
    max-height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: 16px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: cmdSlideIn 0.2s ease;
}

@keyframes cmdSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.cmd-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.cmd-search-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.cmd-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
}

.cmd-search-input::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}

.cmd-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    max-height: 380px;
}

.cmd-results .cmd-group-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 12px 6px;
}

.cmd-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.12s ease;
    color: var(--text-main);
}

.cmd-result-item:hover,
.cmd-result-item.cmd-active {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: #fff;
}

.cmd-result-item .cmd-r-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.cmd-result-item .cmd-r-text {
    flex: 1;
}

.cmd-result-item .cmd-r-text strong {
    font-size: 0.9rem;
    display: block;
}

.cmd-result-item .cmd-r-text small {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.cmd-result-item .cmd-r-shortcut {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.cmd-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 0.72rem;
    color: var(--text-dim);
}

.cmd-footer kbd {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.68rem;
    padding: 2px 5px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    margin-left: 3px;
}

.cmd-no-results {
    text-align: center;
    padding: 30px 16px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* ============================================================
   TOOLS SUBTABS (for Toolbox tab)
   ============================================================ */
.tools-subtabs-nav {
    display: flex;
    gap: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.tools-tab-btn {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 600;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.tools-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.tools-tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.35);
}

.tools-tab-pane {
    animation: fadeIn 0.25s ease;
}

/* Topbar relative for notification dropdown */
.topbar {
    position: sticky;
    position: -webkit-sticky;
}

/* ============================================================
   TEMPLATE LIBRARY
   ============================================================ */
.template-filters-bar {
    display: flex;
    gap: 6px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    flex-wrap: nowrap;
}

.tpl-filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tpl-filter-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.tpl-filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.tpl-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    cursor: default;
}

.tpl-card:hover {
    border-color: var(--border-highlight);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.tpl-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.tpl-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.tpl-card-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.tpl-card-badge.cat-promo { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.tpl-card-badge.cat-welcome { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.tpl-card-badge.cat-followup { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.tpl-card-badge.cat-reminder { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.tpl-card-badge.cat-custom { background: rgba(236, 72, 153, 0.15); color: #ec4899; }

.tpl-card-body {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 100px;
    overflow: hidden;
    flex: 1;
    margin-bottom: 12px;
    position: relative;
}

.tpl-card-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, var(--bg-main));
    pointer-events: none;
}

.tpl-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.tpl-card-meta {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.tpl-card-actions {
    display: flex;
    gap: 6px;
}

/* Empty State */
.empty-state-box {
    text-align: center;
    padding: 50px 20px;
}

.empty-state-box .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.empty-state-box h4 {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.empty-state-box p {
    color: var(--text-dim);
    font-size: 0.88rem;
}

/* Form grid and modal utils */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.modal-lg {
    max-width: 620px;
}

.modal-actions-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.tags-toolbar {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================================
   ANALYTICS OVERRIDES
   ============================================================ */
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.stat-icon.purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }

@media (max-width: 768px) {
    .form-grid-2 { grid-template-columns: 1fr; }
    .form-grid-3 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .template-filters-bar { flex-wrap: wrap; }
}

/* Quick Pick Template item */
.quick-tpl-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-tpl-item:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-2px);
}

.quick-tpl-item .qti-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.quick-tpl-item .qti-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
}

.quick-tpl-item .qti-snippet {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-height: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Scheduled badge */
.badge-scheduled {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ============================================================
   UNIFIED INBOX & CONTACT CRM
   ============================================================ */
.inbox-layout {
    display: flex;
    height: calc(100vh - 120px);
    min-height: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Sidebar panel */
.inbox-sidebar-panel {
    width: 360px;
    min-width: 320px;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.4);
}

.inbox-search-header {
    padding: 12px 14px 6px;
}

.inbox-filter-controls {
    display: flex;
    gap: 6px;
    padding: 6px 14px;
}

.inbox-select-xs {
    font-size: 0.78rem;
    padding: 4px 8px;
    height: 32px;
}

.inbox-category-tabs {
    display: flex;
    gap: 6px;
    padding: 6px 14px 10px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.inbox-tab-chip {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.inbox-tab-chip:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.inbox-tab-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.inbox-chat-list {
    flex: 1;
    overflow-y: auto;
}

.inbox-chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.inbox-chat-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.inbox-chat-item.active {
    background: rgba(99, 102, 241, 0.12);
    border-right: 3px solid var(--primary);
}

.inbox-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inbox-item-content {
    flex: 1;
    min-width: 0;
}

.inbox-item-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.inbox-item-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-item-time {
    font-size: 0.7rem;
    color: var(--text-dim);
    flex-shrink: 0;
    margin-right: 4px;
}

.inbox-item-snippet {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.inbox-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.inbox-unread-pill {
    background: #10b981;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
}

.inbox-tag-mini {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

/* Conversation panel */
.inbox-conversation-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(10, 15, 30, 0.6);
}

.inbox-placeholder-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.inbox-placeholder-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.7;
}

.inbox-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.inbox-chat-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.7);
}

.inbox-contact-details {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inbox-contact-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inbox-contact-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.inbox-phone-sub {
    font-size: 0.78rem;
    color: var(--text-dim);
    direction: ltr;
}

.inbox-badges-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 3px;
    flex-wrap: wrap;
}

.inbox-tags-inline {
    display: flex;
    gap: 4px;
}

/* Messages area */
.inbox-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.03), transparent 60%);
}

.inbox-msg-bubble {
    max-width: 68%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.86rem;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}

.inbox-msg-incoming {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-bottom-right-radius: 3px;
}

.inbox-msg-outgoing {
    align-self: flex-end;
    background: #005c4b;
    color: #fff;
    border-bottom-left-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.inbox-msg-time {
    display: block;
    font-size: 0.68rem;
    margin-top: 4px;
    text-align: left;
    opacity: 0.7;
}

/* Composer */
.inbox-composer-footer {
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.85);
    padding: 10px 16px;
}

.inbox-composer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.inbox-input-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.inbox-input-group textarea {
    flex: 1;
    resize: none;
    min-height: 48px;
    font-size: 0.88rem;
}

.inbox-send-action-btn {
    height: 48px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.sidebar-badge {
    background: #10b981;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    margin-right: auto;
}

/* ============================================================
   SUB-NAVIGATION TABS (Automation Hub & Tools)
   ============================================================ */
.sub-nav-tabs {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.sub-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sub-tab-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.sub-tab-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(16, 185, 129, 0.3);
    font-weight: 700;
}

/* ============================================================
   CHATBOT FLOWS GRID & CARDS
   ============================================================ */
.flows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.flow-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.flow-card:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.flow-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.flow-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.4;
}

.flow-card-desc {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
    margin-bottom: 14px;
}

.flow-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}

.flow-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.flow-badge-nodes {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.flow-badge-trigger {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.flow-badge-profile {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.flow-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    margin-top: auto;
}

.flow-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ============================================================
   NODE BUILDER (Inside Flow Editor Modal)
   ============================================================ */
.nodes-list-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.node-builder-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    position: relative;
    border-right: 4px solid var(--primary);
}

.node-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.node-tag-pill {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.node-options-container {
    background: rgba(0, 0, 0, 0.15);
    padding: 10px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.node-option-row {
    display: grid;
    grid-template-columns: 80px 1fr 140px 120px 36px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

/* ============================================================
   WHATSAPP SIMULATOR (Live Tester Modal)
   ============================================================ */
.sim-phone-header {
    background: #075e54;
    color: #fff;
    padding: 12px 16px;
}

.sim-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sim-back-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
}

.sim-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.sim-bot-info {
    flex: 1;
}

.sim-bot-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.sim-bot-status {
    font-size: 0.75rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot-mini {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #25d366;
    display: inline-block;
}

.sim-reset-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.sim-reset-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sim-flow-picker-bar {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.sim-flow-picker-bar select {
    flex: 1;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.sim-chat-area {
    background: #0b141a;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 16px 16px;
    min-height: 340px;
    max-height: 380px;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sim-message-date {
    align-self: center;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
}

.sim-messages-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sim-bubble {
    max-width: 82%;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 0.86rem;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}

.sim-bubble-bot {
    align-self: flex-start;
    background: #202c33;
    color: #e9edef;
    border-bottom-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    white-space: pre-wrap;
}

.sim-bubble-user {
    align-self: flex-end;
    background: #005c4b;
    color: #e9edef;
    border-bottom-right-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.sim-bubble-time {
    display: block;
    text-align: left;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.sim-crm-bar {
    background: #111b21;
    padding: 8px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
}

.sim-crm-label {
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.sim-tags-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sim-tag-pill {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.sim-quick-options {
    background: #111b21;
    padding: 8px 14px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sim-quick-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e9edef;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sim-quick-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.sim-composer {
    background: #202c33;
    padding: 10px 14px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.sim-input {
    flex: 1;
    background: #2a3942;
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    color: #e9edef;
    font-size: 0.88rem;
    outline: none;
}

.sim-input::placeholder {
    color: #8696a0;
}

.sim-send-btn {
    background: #00a884;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.sim-send-btn:hover {
    background: #029071;
}

/* ============================================================
   SMART TRACKED LINKS UI
   ============================================================ */
.short-url-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.82rem;
    direction: ltr;
}

.short-url-badge:hover {
    background: rgba(59, 130, 246, 0.25);
}

.copy-mini-btn {
    background: none;
    border: none;
    color: #60a5fa;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
}

.copy-mini-btn:hover {
    color: #fff;
}

/* ============================================================
   ONLINE WEB HOSTING LOGIN SCREEN
   ============================================================ */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 15, 25, 0.94);
    backdrop-filter: blur(16px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: #131b2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 30px rgba(16, 185, 129, 0.1);
    border-radius: 24px;
    padding: 36px 32px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    animation: loginCardPop 0.3s ease-out;
}

@keyframes loginCardPop {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.alert-danger {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fda4af;
}

/* Strict Auth Gating */
.app-layout.auth-gated {
    display: none !important;
}

/* ============================================================
   ADVANCED MODULES STYLES: WARMUP, SCRAPER, KB, REST API & FUNNEL
   ============================================================ */

/* 1. Account Warmup Engine */
.warmup-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.warmup-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.warmup-acc-card,
.warmup-card {
    background: rgba(19, 27, 46, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.warmup-acc-card:hover,
.warmup-card:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4), 0 0 15px rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
}
.trust-score-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}
.trust-high {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.trust-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.trust-low {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.trust-bar,
.warmup-card .progress-bar {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-top: 8px;
}
.trust-bar-fill,
.warmup-card .progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.warmup-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding-top: 12px;
    margin-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}
.warmup-stat-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 6px 4px;
}
.warmup-stat-box .subtext {
    font-size: 0.7rem;
    color: var(--text-dim);
    display: block;
}
.warmup-stat-box strong {
    font-size: 0.84rem;
    color: var(--text-main);
}
.warmup-settings-bar {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: flex-end;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 20px;
}
@media (max-width: 900px) {
    .warmup-settings-bar {
        grid-template-columns: 1fr;
    }
}

/* 2. Google Maps Scraper */
.scraper-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
}
.rating-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* 3. Knowledge Base Cards */
.kb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.kb-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.2s ease;
}
.kb-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
}
.kb-category-tag {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    display: inline-block;
    margin-bottom: 8px;
}

/* 4. Lead Scoring Badges */
.lead-badge-hot {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(249, 115, 22, 0.2));
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
}
.lead-badge-warm {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fde047;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
}
.lead-badge-cold {
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
}
.lead-badge-complaint {
    background: rgba(225, 29, 72, 0.2);
    border: 1px solid rgba(225, 29, 72, 0.4);
    color: #f43f5e;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
}

/* 5. API Keys & Developer Documentation */
.code-box-dark {
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
    font-family: 'Consolas', 'JetBrains Mono', monospace;
    font-size: 0.84rem;
    line-height: 1.6;
    direction: ltr !important;
    text-align: left !important;
    white-space: pre-wrap !important;
    color: #e2e8f0;
    overflow-x: auto;
}

.notif-options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.notif-option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.notif-option-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(16, 185, 129, 0.3);
}
.notif-option-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}
.notif-option-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}
.notif-option-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}
.notif-option-content strong {
    font-size: 0.88rem;
    color: var(--text-main);
    display: block;
}
.notif-option-content .subtext {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin: 0;
}

.api-keys-table th, .api-keys-table td {
    vertical-align: middle;
}
.api-key-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}
.key-code {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 5px 10px;
    border-radius: 6px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.82rem;
    color: #fbbf24;
    direction: ltr;
    display: inline-block;
    user-select: all;
    letter-spacing: 0.5px;
}
.btn-icon-xs {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.82rem;
    padding: 4px 7px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon-xs:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: var(--primary);
}

.dev-docs-box {
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
}
.dev-terminal-header {
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.terminal-dots {
    display: flex;
    gap: 6px;
}
.terminal-dots span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}
.terminal-dots .dot-red { background: #ef4444; }
.terminal-dots .dot-yellow { background: #f59e0b; }
.terminal-dots .dot-green { background: #10b981; }

.terminal-tabs {
    display: flex;
    gap: 6px;
}
.terminal-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.terminal-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.terminal-tab-btn.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.dev-endpoint-picker {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}
.endpoint-chip {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    transition: all 0.2s;
}
.endpoint-chip.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.4);
}

.dev-code-body {
    position: relative;
    padding: 16px;
    max-height: 280px;
    overflow-y: auto;
}
.dev-code-pre {
    margin: 0;
    padding: 0;
    background: transparent;
    color: #e2e8f0;
    font-family: 'Consolas', 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.84rem;
    line-height: 1.6;
    direction: ltr !important;
    text-align: left !important;
    white-space: pre !important;
    overflow-x: auto;
}

/* 6. Conversion Funnel */
.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
}
.funnel-step {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.funnel-step-bg {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    opacity: 0.12;
    z-index: 1;
    transition: width 0.6s ease;
}
.funnel-step-info {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
}
.funnel-step-metric {
    position: relative;
    z-index: 2;
    text-align: left;
}



