:root {
    --bg-main: #182022; /* Darker tone of secondary color #29373B */
    --bg-card: rgba(41, 55, 59, 0.75); /* Brand secondary color #29373B with transparency */
    --border-color: rgba(253, 183, 21, 0.08); /* Gold tinted border */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-primary: #FDB715; /* Reboss Primary Gold */
    --accent-primary-glow: rgba(253, 183, 21, 0.15);
    --accent-primary-hover: #df9f0c;
    --accent-success: #10b981; /* Emerald */
    --accent-warning: #f59e0b; /* Amber */
    --accent-danger: #ef4444; /* Rose */
    --font-title: 'PeydaWebFaNum', 'Tahoma', sans-serif;
    --font-body: 'IRANSansXFaNum', 'Tahoma', sans-serif;
    --card-radius: 4px;
    --transition-speed: 0.3s;
}

/* Reset and Core Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 10% 20%, rgba(253, 183, 21, 0.04) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(41, 55, 59, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: 700;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4);
}

/* App Layout */
.app-container {
    max-width: 95%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header styling */
header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.brand-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand h1 {
    font-size: 1.8rem;
    background: linear-gradient(to left, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Tabs Navigation */
.nav-tabs {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}

.nav-tabs::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: var(--font-title);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed) ease;
    white-space: nowrap;
    flex-shrink: 0;
}

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

.tab-btn.active {
    color: var(--text-primary);
    background: var(--accent-primary);
    box-shadow: 0 4px 12px var(--accent-primary-glow);
}

/* Cards & Glassmorphism */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 32px 0 rgba(99, 102, 241, 0.05);
}

.card-title {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 10px;
}

/* Tab Panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* Home / Welcome Screen */
.welcome-box {
    text-align: center;
    padding: 4rem 2rem;
}

.welcome-logo {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    animation: float 4s ease-in-out infinite;
}

.welcome-box h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.welcome-box p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-size: 1.1rem;
}

.welcome-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    font-size: 1rem;
    font-family: var(--font-title);
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-primary-glow);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--accent-success);
    color: #fff;
}

.btn-success:hover {
    background: #0d9488;
    transform: translateY(-2px);
}

/* Wizard / Step-by-Step Generator */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.wizard-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-50%);
    z-index: 1;
}

.wizard-step-node {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #172033;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    font-family: var(--font-title);
    font-weight: bold;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.wizard-step-node.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-primary);
}

.wizard-step-node.completed {
    background: var(--accent-success);
    border-color: var(--accent-success);
    color: #fff;
}

.wizard-step-node .step-label {
    position: absolute;
    top: 55px;
    white-space: nowrap;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: normal;
}

.wizard-step-node.active .step-label {
    color: var(--text-primary);
    font-weight: bold;
}

.wizard-content {
    min-height: 250px;
    margin-bottom: 2rem;
}

.wizard-step-panel {
    display: none;
}

.wizard-step-panel.active {
    display: block;
    animation: slideIn 0.3s ease;
}

.wizard-buttons {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
}

/* Forms controls */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 4px;
    outline: none;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select.form-control {
    background-color: #111827 !important;
    color: var(--text-primary) !important;
    direction: rtl !important;
    text-align: right !important;
    text-align-last: right !important;
    max-width: 380px !important;
    width: 100% !important;
}

select.form-control option {
    background-color: #111827 !important;
    color: var(--text-primary) !important;
    direction: rtl !important;
    text-align: right !important;
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
    background: rgba(255, 255, 255, 0.06);
}

/* Checklist options (target types / communications) */
.checkbox-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.checkbox-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

/* Payment Gateway Option Card Styling */
.gateway-option-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    position: relative;
}

.gateway-option-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(253, 183, 21, 0.3);
}

.gateway-option-card.active {
    background: rgba(253, 183, 21, 0.05);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(253, 183, 21, 0.1);
}

.gateway-radio {
    display: none !important;
}

.custom-radio-btn {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.gateway-option-card.active .custom-radio-btn {
    border-color: var(--accent-primary);
}

.gateway-option-card.active .custom-radio-btn::after {
    content: '';
    width: 8px;
    height: 8px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    display: block;
}

.file-upload-zone:hover {
    background: rgba(253, 183, 21, 0.03) !important;
    border-color: var(--accent-primary) !important;
}


.checkbox-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.4);
}

.checkbox-card input[type="checkbox"],
.checkbox-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.checkbox-card.selected {
    background: var(--accent-primary-glow);
    border-color: var(--accent-primary);
}

.checkbox-card.selected i {
    color: var(--accent-primary);
}

.checkbox-card i {
    font-size: 1.8rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.checkbox-card span {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Keyword suggestions autocomplete */
.suggestion-wrapper {
    position: relative;
}

.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0f1624;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-top: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
}

/* Running/Progress State */
.progress-container {
    text-align: center;
    padding: 3rem 1rem;
}

.loading-spinner {
    width: 65px;
    height: 65px;
    border: 5px solid rgba(255, 255, 255, 0.05);
    border-top: 5px solid var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

.progress-bar-wrapper {
    width: 100%;
    max-width: 500px;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin: 1.5rem auto;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
    width: 0%;
    transition: width 0.4s ease;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    text-align: center;
}

.stat-val {
    font-size: 2rem;
    font-weight: bold;
    font-family: var(--font-title);
    margin-top: 5px;
    background: linear-gradient(135deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card.primary .stat-val {
    background: linear-gradient(135deg, var(--accent-primary), #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card.success .stat-val {
    background: linear-gradient(135deg, var(--accent-success), #6ee7b7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Leads Table list */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

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

th, td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: rgba(255, 255, 255, 0.03);
    font-family: var(--font-title);
    color: var(--text-secondary);
    font-weight: 600;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    gap: 5px;
    white-space: nowrap;
}

.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Score rating visual */
.score-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.score-high {
    background: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
}

.score-med {
    background: var(--accent-warning);
    box-shadow: 0 0 8px var(--accent-warning);
}

.score-low {
    background: var(--accent-danger);
    box-shadow: 0 0 8px var(--accent-danger);
}

/* Source icons list mapping styling */
.source-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    color: #e5e7eb;
    white-space: nowrap;
}

/* Filtering header above tables */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.filter-bar .form-control {
    width: auto;
    min-width: 180px;
    padding: 8px 14px;
    font-size: 0.9rem;
}

/* Plugins management panel list */
.plugin-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.plugin-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.plugin-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.plugin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.plugin-title {
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Switch styling for plugins toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #374151;
    transition: .4s;
    border-radius: 4px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 4px;
}

input:checked + .slider {
    background-color: var(--accent-success);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Keyframes Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Auth Container & Form */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.4s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    animation: float 4s ease-in-out infinite;
    display: inline-block;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    cursor: pointer;
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 600;
    transition: all var(--transition-speed);
    position: relative;
    text-align: center;
}

.auth-tab-btn.active {
    color: var(--text-primary);
}

.auth-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 3px;
}

.auth-form-group {
    margin-bottom: 1.5rem;
}

.auth-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.auth-input-wrapper {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.auth-input {
    width: 100%;
    padding: 12px 40px 12px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-speed);
    text-align: right;
    direction: ltr;
}

.auth-input:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--accent-danger);
    color: #fca5a5;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    display: none;
    text-align: right;
}

.auth-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--accent-success);
    color: #a7f3d0;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    display: none;
    text-align: right;
}

.user-logout-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--accent-danger);
    color: #fca5a5;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-logout-btn:hover {
    background: var(--accent-danger);
    color: #fff;
}

.user-info-badge {
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    white-space: nowrap;
    user-select: none;
}

.user-info-badge:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.header-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* User Management panel specific styles */
.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admin-users-table th, .admin-users-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.admin-users-table th {
    font-family: var(--font-title);
    color: var(--text-secondary);
    font-weight: 600;
}

.admin-users-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.permission-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin: 2px;
}

.pill-section {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.pill-source {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pill-role-admin {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.pill-role-user {
    background: rgba(156, 163, 175, 0.15);
    color: #d1d5db;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Menu Toggle Button Base Styles */
.menu-toggle-btn {
    display: none; /* Hidden by default on desktop */
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    font-size: 1.2rem;
    transition: all var(--transition-speed) ease;
}

.menu-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-primary-glow);
}

body.light-theme .menu-toggle-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

body.light-theme .menu-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Collapsed Navigation Tabs (Dropdown Menu) */
.nav-tabs.collapsed {
    display: none; /* Toggle controlled by JS */
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    width: 100%;
    background: rgba(11, 15, 25, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    flex-direction: column;
    padding: 15px;
    gap: 8px;
    z-index: 999;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    max-height: 80vh;
    overflow-y: auto;
}

body.light-theme .nav-tabs.collapsed {
    background: rgba(243, 244, 246, 0.98);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.nav-tabs.collapsed.open {
    display: flex;
    animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.nav-tabs.collapsed .tab-btn {
    width: 100%;
    padding: 12px 16px;
    justify-content: flex-start;
    border-radius: 4px;
    background: transparent;
}

.nav-tabs.collapsed .tab-btn.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: none;
}

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

/* Responsive Styles for Header and Layout */
@media (max-width: 1150px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        padding-bottom: 1rem;
    }
    
    .brand {
        justify-content: flex-start;
        margin-bottom: 0;
    }

    .menu-toggle-btn {
        display: flex !important;
    }

    .nav-tabs {
        display: none !important;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        width: 100%;
        background: rgba(11, 15, 25, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--border-color);
        border-radius: var(--card-radius);
        flex-direction: column;
        padding: 15px;
        gap: 8px;
        z-index: 999;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
        max-height: 80vh;
        overflow-y: auto;
    }

    body.light-theme .nav-tabs {
        background: rgba(243, 244, 246, 0.98) !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    }

    .nav-tabs.open {
        display: flex !important;
        animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .nav-tabs .tab-btn {
        width: 100%;
        padding: 12px 16px;
        justify-content: flex-start;
        border-radius: 4px;
        background: transparent;
    }

    .nav-tabs .tab-btn.active {
        background: var(--accent-primary);
        color: #fff;
        box-shadow: none;
    }
}

@media (max-width: 992px) {
    /* When nav tabs are not collapsed yet, wrap them nicely */
    .nav-tabs:not(.collapsed) {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        overflow-x: visible;
        width: 100%;
        max-width: 100%;
    }
    .nav-tabs:not(.collapsed) .tab-btn {
        flex-grow: 1;
        justify-content: center;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 650px) {
    header {
        flex-wrap: wrap;
        gap: 10px;
    }
    .brand {
        width: 100%;
        justify-content: center;
        margin-bottom: 5px;
    }
    .header-user-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    .user-info-badge {
        flex-grow: 1;
        justify-content: center;
    }
    .user-logout-btn {
        flex-grow: 1;
        justify-content: center;
    }
}

/* Light Theme Variables Overrides */
body.light-theme {
    --bg-main: #f3f4f6;
    --bg-card: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --accent-primary-glow: rgba(253, 183, 21, 0.08);
}

/* Light theme overrides for gateway options */
body.light-theme .gateway-option-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .gateway-option-card:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(253, 183, 21, 0.3);
}

body.light-theme .gateway-option-card.active {
    background: rgba(253, 183, 21, 0.05);
    border-color: var(--accent-primary);
}


body.light-theme .form-control {
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #111827;
}

body.light-theme select.form-control {
    background-color: #ffffff !important;
    color: #111827 !important;
}

body.light-theme select.form-control option {
    background-color: #ffffff !important;
    color: #111827 !important;
}

body.light-theme .suggestions-box {
    background: #ffffff;
    border-color: #d1d5db;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

body.light-theme .suggestion-item:hover {
    background: rgba(253, 183, 21, 0.05);
}

body.light-theme #progress-logs {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    color: #1f2937;
}

body.light-theme #user-modal,
body.light-theme #lead-modal,
body.light-theme #edit-task-modal,
body.light-theme #profile-modal {
    background: rgba(0, 0, 0, 0.5) !important;
}

body.light-theme .tab-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .user-info-badge {
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .user-info-badge:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Kanban Board Styles */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 1.5rem;
    align-items: start;
}

.kanban-col {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: background-color 0.3s;
}

body.light-theme .kanban-col {
    background: #f9fafb;
}

.kanban-col-header {
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-family: var(--font-title);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.kanban-col-header.new { background: #3b82f6; }
.kanban-col-header.contacted { background: #f59e0b; }
.kanban-col-header.interested { background: #8b5cf6; }
.kanban-col-header.invoice { background: #ec4899; }
.kanban-col-header.converted { background: #10b981; }
.kanban-col-header.failed { background: #ef4444; }

.kanban-count {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.kanban-cards-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 380px;
    padding-bottom: 20px;
}

.kanban-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

body.light-theme .kanban-card {
    background: #ffffff;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.kanban-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-primary);
    line-height: 1.4;
}

.kanban-card-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.kanban-card-source {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: bold;
}

.kanban-card-score {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

body.light-theme .kanban-card-score {
    background: #f3f4f6;
}

/* Kanban column dragover effect */
.kanban-col.dragover {
    background-color: rgba(99, 102, 241, 0.08) !important;
    border-color: var(--accent-primary) !important;
}

/* Theme Toggle Button Style */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    font-size: 1rem;
    transition: all var(--transition-speed);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
}

body.light-theme .theme-toggle-btn {
    background: rgba(0, 0, 0, 0.03);
}

body.light-theme .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Logo Theme Handling */
.logo-dark-theme {
    display: inline-block;
}
.logo-light-theme {
    display: none;
}
body.light-theme .logo-dark-theme {
    display: none;
}
body.light-theme .logo-light-theme {
    display: inline-block;
}

/* Wizard responsiveness in mobile viewports */
@media (max-width: 768px) {
    .wizard-progress {
        margin-bottom: 2rem;
    }
    .wizard-step-node {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.9rem !important;
    }
    .wizard-step-node .step-label {
        display: none !important;
    }
    
    /* Make dropdowns full-width on mobile */
    select.form-control {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Mobile button sizing and spacing */
    .btn {
        padding: 10px 18px !important;
        font-size: 0.9rem !important;
    }
    
    /* Stack wizard buttons on mobile */
    .wizard-buttons {
        flex-direction: column-reverse !important;
        gap: 12px !important;
        align-items: stretch !important;
    }
    
    .wizard-buttons > div {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }
    
    .wizard-buttons button, .wizard-buttons .btn {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Welcome panel actions */
    .welcome-actions {
        flex-direction: column !important;
        width: 100% !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    .welcome-actions .btn {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Modals & Profile Forms Footers (flex-end) stack buttons */
    form div[style*="justify-content: flex-end"],
    div[style*="justify-content: flex-end"],
    .modal-footer {
        flex-direction: column-reverse !important;
        width: 100% !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    
    form div[style*="justify-content: flex-end"] button,
    form div[style*="justify-content: flex-end"] .btn,
    div[style*="justify-content: flex-end"] button,
    div[style*="justify-content: flex-end"] .btn,
    .modal-footer button,
    .modal-footer .btn {
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Table action buttons (compact and wrapped neatly with gap) */
    .admin-users-table td .btn,
    table td .btn {
        padding: 6px 10px !important;
        font-size: 0.8rem !important;
        display: inline-flex !important;
        width: auto !important;
        margin: 0 !important;
    }
    
    table td div[style*="display: flex"] {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
}

/* Admin Settings Sidebar & Layout */
.admin-settings-container {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    direction: rtl;
    margin-top: 1rem;
}

.admin-settings-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 250px;
    flex-shrink: 0;
}

.admin-settings-content {
    flex: 1;
    min-width: 0;
}

.settings-sidebar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: right;
    cursor: pointer;
    transition: all 0.3s;
}

.settings-sidebar-btn i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.settings-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.settings-sidebar-btn.active {
    background: var(--accent-primary-glow);
    color: var(--accent-primary);
    border: 1px solid rgba(253, 183, 21, 0.2);
    font-weight: bold;
}

.unread-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-danger);
    border-radius: 50%;
    display: inline-block;
}

@media (max-width: 768px) {
    .admin-settings-container {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .admin-settings-sidebar {
        width: 100% !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding: 8px !important;
        gap: 8px !important;
        scrollbar-width: none; /* Firefox */
    }
    .admin-settings-sidebar::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    .settings-sidebar-btn {
        width: auto !important;
        padding: 8px 14px !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
    }
}
