/* Professional Email Manager Design */

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --secondary: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --dark: #1F2937;
    --gray: #6B7280;
    --light-gray: #F3F4F6;
    --border: #E5E7EB;
    --white: #FFFFFF;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --toggle-off: #D1D5DB;
    --toggle-on: #10B981;
    
    /* Theme colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F3F4F6;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --card-bg: #FFFFFF;
    --sidebar-bg: #FFFFFF;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #1F2937;
    --bg-secondary: #2D3748;
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --card-bg: #374151;
    --sidebar-bg: #1F2937;
    --border: #4B5563;
    --light-gray: #374151;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

#app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 28px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: var(--gray);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--light-gray);
    color: var(--dark);
}

.nav-item.active {
    background: var(--primary);
    color: var(--white);
}

.nav-item i {
    font-size: 18px;
    width: 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-info:hover {
    background: var(--light-gray);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
}

.top-header {
    background: var(--white);
    padding: 24px 32px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.header-left h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.header-left p {
    color: var(--gray);
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: var(--light-gray);
    color: var(--gray);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--border);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

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

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--light-gray);
    border-color: var(--gray);
}

.btn-success {
    background: var(--secondary);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: fit-content;
}

.btn-warning:hover {
    background: #D97706;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.account-card, .sendas-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.account-card:hover, .sendas-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.account-card h3, .sendas-card h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
}

.account-card p, .sendas-card p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 8px;
}

.account-card strong, .sendas-card strong {
    color: var(--dark);
}

.status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
}

.status.active {
    background: #D1FAE5;
    color: #065F46;
}

.status.inactive {
    background: #FEE2E2;
    color: #991B1B;
}

.account-actions, .sendas-card .btn-danger {
    display: flex;
    gap: 8px;
    /*margin-top: 5px;*/
}

/* Forms */
.compose-container {
    background: var(--white);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.compose-form {
    max-width: 1200px;
}

/* Professional Account Selection Row - Exact Match to Screenshot */
.account-selection-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
    background: transparent;
}

.account-selector-group {
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.selector-header {
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 36px;
}

.selector-title {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    flex: 1;
}

.account-counter {
    font-size: 11px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}


.selector-icons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.selector-icons i {
    font-size: 12px;
    color: #666;
    cursor: pointer;
    padding: 2px;
}

.selector-icons i:hover {
    color: #007bff;
}

/* Filter icons */
.filter-icon {
    font-size: 13px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s;
    border-radius: 3px;
}

.filter-icon:hover {
    color: #007bff;
    background: #f0f0f0;
}

.filter-icon.active {
    color: #007bff;
    background: #e3f2fd;
}

.selector-content {
    padding: 0;
    height: 180px;
    background: var(--white);
    position: relative;
    display: flex;
    flex-direction: column;
}

.selected-item {
    padding: 8px 12px;
    background: #e3f2fd;
    border-bottom: 1px solid #ddd;
}

.item-text {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.accounts-list {
    padding: 8px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar styling */
.accounts-list::-webkit-scrollbar {
    width: 6px;
}

.accounts-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.accounts-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.accounts-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.account-item {
    padding: 6px 8px;
    margin-bottom: 4px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-item:hover {
    background: #e3f2fd;
    border-color: #007bff;
}

.account-item.selected {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.account-item.primary-email {
    border-left: 3px solid #007bff;
    background: #f8f9ff;
}

.clickable-account {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clickable-account:hover {
    background: #f0f8ff !important;
}

.account-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.from-account-item {
    margin-bottom: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.from-account-item:hover {
    background: #f0f8ff !important;
    border-color: #007bff !important;
}

.from-account-item.selected {
    background: #e3f2fd !important;
    border-color: #007bff !important;
}

.account-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #007bff;
    cursor: pointer;
}

.from-account-item:has(.account-checkbox:checked) {
    background: #e3f2fd !important;
    border-color: #007bff !important;
}

.clickable-email {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-email:hover {
    background: #f0f8ff !important;
    border-color: #007bff !important;
}

.from-email-item.selected {
    background: #e3f2fd !important;
    border-color: #007bff !important;
}

.from-email-selectable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.from-email-selectable:hover {
    background: #f0f8ff !important;
    border-color: #007bff !important;
}

.from-email-selectable.selected {
    background: #e3f2fd !important;
    border-color: #007bff !important;
}

.email-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #007bff;
    cursor: pointer;
}

.middle-panel-selectable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.middle-panel-selectable:hover {
    background: #f0f8ff !important;
    border-color: #007bff !important;
}

.middle-panel-selectable.selected {
    background: #e3f2fd !important;
    border-color: #007bff !important;
}

.middle-email-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #007bff;
    cursor: pointer;
}

.clickable-account {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-account:hover {
    background: #f0f8ff !important;
    border-color: #007bff !important;
}

.clickable-account.selected {
    background: #e3f2fd !important;
    border-color: #007bff !important;
}

.clickable-right-email {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-right-email:hover {
    background: #f0f8ff !important;
    border-color: #007bff !important;
}

.clickable-right-email.selected {
    background: #e3f2fd !important;
    border-color: #007bff !important;
}

.hidden-select {
    display: none;
}

.rotation-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 0 12px 8px;
}

.toggle-text {
    font-size: 12px;
    color: var(--gray);
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .account-selection-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .compose-form {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .selector-header {
        padding: 6px 8px;
        min-height: 32px;
    }
    
    .selector-title {
        font-size: 12px;
    }
    
    .selector-icons i {
        font-size: 11px;
    }
    
    .selector-content {
        min-height: 100px;
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Single row layout for bulk inputs */
#bulk-inputs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

#bulk-inputs-row .form-group {
    flex: 1;
    min-width: 180px;
}

/* Responsive: stack into 2 columns on medium screens */
@media (max-width: 1024px) {
    #bulk-inputs-row .form-group {
        flex: 1 1 calc(50% - 8px);
        min-width: 200px;
    }
}

/* Responsive: stack vertically on small screens */
@media (max-width: 640px) {
    #bulk-inputs-row {
        flex-direction: column;
    }
    
    #bulk-inputs-row .form-group {
        flex: 1 1 100%;
        min-width: 100%;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--primary);
}

.input-modern, .select-modern {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.input-modern:focus, .select-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea.input-modern {
    resize: vertical;
    min-height: 120px;
}

.form-group small {
    color: var(--gray);
    font-size: 12px;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.modal.show,
.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.modal-content-modern {
    position: relative;
    background: var(--white);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s;
}

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

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

.modal-header-modern h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header-modern h3 i {
    color: var(--primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: var(--light-gray);
    color: var(--gray);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--border);
    color: var(--dark);
}

.modal-form {
    padding: 32px;
}

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

/* History */
.history-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: all 0.2s;
}

.history-item:hover {
    box-shadow: var(--shadow-lg);
}

.history-item h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 12px;
}

.history-item p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 6px;
}

.history-item .timestamp {
    color: var(--gray);
    font-size: 12px;
    margin-top: 12px;
}

/* Toast */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 8px;
    color: var(--white);
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: #10b981;
    color: white;
}

.toast.error {
    background: #ef4444;
    color: white;
}

.toast.info {
    background: #6366f1;
    color: white;
}

.toast.warning {
    background: #f59e0b;
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--dark);
}

/* Send As Table Styles */
.sendas-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.sendas-table thead {
    background: var(--light-gray);
}

.sendas-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid #e5e7eb;
    font-size: 14px;
}

.sendas-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    color: var(--gray);
    font-size: 14px;
}

.sendas-table tbody tr {
    transition: background 0.2s;
}

.sendas-table tbody tr:hover {
    background: var(--light-gray);
}

.sendas-table td strong {
    color: var(--dark);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.view-link {
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* History Filters */
.history-filters {
    display: flex;
    gap: 12px;
}

.history-filters select {
    min-width: 200px;
}

/* Search Bar */
.search-bar-container {
    margin-bottom: 24px;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-bar i.fa-search {
    color: var(--gray);
    margin-right: 12px;
    font-size: 16px;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--dark);
    background: transparent;
}

.search-bar input::placeholder {
    color: var(--gray);
}

.btn-clear {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: var(--light-gray);
    color: var(--dark);
}

/* Accounts Table */
#accounts-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.accounts-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.accounts-table thead {
    background: var(--light-gray);
}

.accounts-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.accounts-table th i {
    margin-right: 8px;
    color: var(--primary);
}

.accounts-table th.text-center {
    text-align: center;
}

.accounts-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    color: var(--gray);
    font-size: 14px;
}

.accounts-table td.text-center {
    text-align: center;
}

.accounts-table tbody tr {
    transition: background 0.2s;
}

.accounts-table tbody tr:hover {
    background: var(--light-gray);
}

.accounts-table td strong {
    color: var(--dark);
    font-weight: 600;
}

.accounts-table .account-email {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.accounts-table .tenant-id {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--gray);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.active i {
    color: #10b981;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.inactive i {
    color: #ef4444;
}

.accounts-table .account-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Send As Accounts Table */
#sendas-accounts-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sendas-accounts-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.sendas-accounts-table thead {
    background: var(--light-gray);
}

.sendas-accounts-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.sendas-accounts-table th i {
    margin-right: 8px;
    color: var(--primary);
}

.sendas-accounts-table th.text-center {
    text-align: center;
}

.sendas-accounts-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    color: var(--gray);
    font-size: 14px;
}

.sendas-accounts-table td.text-center {
    text-align: center;
}

.sendas-accounts-table tbody tr {
    transition: background 0.2s;
}

.sendas-accounts-table tbody tr:hover {
    background: var(--light-gray);
}

.sendas-accounts-table td strong {
    color: var(--dark);
    font-weight: 600;
}

/* Send As Table */
#sendas-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sendas-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.sendas-table thead {
    background: var(--light-gray);
}

.sendas-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.sendas-table th i {
    margin-right: 8px;
    color: var(--primary);
}

.sendas-table th.text-center {
    text-align: center;
}

.sendas-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    color: var(--gray);
    font-size: 14px;
}

.sendas-table td.text-center {
    text-align: center;
}

.sendas-table tbody tr {
    transition: background 0.2s;
}

.sendas-table tbody tr:hover {
    background: var(--light-gray);
}

.sendas-table td strong {
    color: var(--dark);
    font-weight: 600;
}

.sendas-table .sendas-email {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* Send As Modal Styles - Professional Design */
.sendas-modal-content {
    max-width: 1000px;
    width: 95%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.sendas-info-bar {
    display: flex;
    gap: 32px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    margin-bottom: 0;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.sendas-info-bar:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
    border-bottom: 3px solid rgba(255, 255, 255, 0.4);
}

.sendas-info-bar .info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 500;
    font-size: 15px;
}

.sendas-info-bar .info-item i {
    font-size: 18px;
    opacity: 0.9;
}

.sendas-table-wrapper {
    max-height: 500px;
    overflow-y: auto;
    background: white;
    border-radius: 0;
}

.sendas-table-wrapper::-webkit-scrollbar {
    width: 8px;
}

.sendas-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sendas-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.sendas-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.sendas-modal-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.sendas-modal-table thead {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sendas-modal-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    color: #2d3748;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid #e2e8f0;
    background: #f8f9fa;
}

.sendas-modal-table th i {
    margin-right: 8px;
    color: var(--primary);
    font-size: 14px;
}

.sendas-modal-table th.text-center {
    text-align: center;
}

.sendas-modal-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
    font-size: 14px;
    vertical-align: middle;
}

.sendas-modal-table td.text-center {
    text-align: center;
}

.sendas-modal-table tbody tr {
    transition: all 0.3s ease;
    background: white;
    border-left: 3px solid transparent;
}

.sendas-modal-table tbody tr:hover {
    background: linear-gradient(90deg, #f7fafc 0%, #edf2f7 100%);
    border-left: 3px solid var(--primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.sendas-modal-table tbody tr:nth-child(even) {
    background: #fafbfc;
    border-left: 3px solid transparent;
}

.sendas-modal-table tbody tr:nth-child(even):hover {
    background: linear-gradient(90deg, #f7fafc 0%, #edf2f7 100%);
    border-left: 3px solid var(--primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.user-name {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-name span {
    font-weight: 600;
    color: #2d3748;
    font-size: 15px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    border: 3px solid white;
}

.sendas-email {
    color: var(--primary) !important;
    font-weight: 500 !important;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px !important;
}

/* Modal Header Improvements */
.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 24px 28px;
    border-bottom: none;
}

.modal-header h3 {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.modal-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-top: 4px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Modal Footer */
.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px 24px;
    border-top: 2px solid #e2e8f0;
    background: #f8f9fa;
}

.modal-footer .btn-secondary {
    background: white;
    color: var(--dark);
    border: 2px solid var(--border);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.modal-footer .btn-secondary:hover {
    background: var(--light-gray);
    border-color: var(--gray);
    transform: translateY(-1px);
}

.modal-footer .btn-primary {
    
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.modal-footer .btn-primary:active {
    transform: translateY(0);
}

.modal-footer button i {
    font-size: 14px;
}

/* Lists Table */
#lists-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.lists-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.lists-table thead {
    background: var(--light-gray);
}

.lists-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.lists-table th i {
    margin-right: 8px;
    color: var(--primary);
}

.lists-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    color: var(--gray);
    font-size: 14px;
}

.lists-table tbody tr {
    transition: background 0.2s;
}

.lists-table tbody tr:hover {
    background: var(--light-gray);
}

.lists-table td strong {
    color: var(--dark);
    font-weight: 600;
}

.list-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

/* Edit List Modal */
.edit-list-modal-content {
    max-width: 800px !important;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.modal-subtitle {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: var(--gray);
    font-weight: 400;
}

.contacts-info-bar {
    display: flex;
    gap: 24px;
    padding: 16px;
    background: var(--light-gray);
    border-radius: 8px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
    font-size: 14px;
}

.info-item i {
    color: #ffffff;
}

.info-item strong {
    color: #ffffff;
    font-size: 16px;
}

.bulk-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.bulk-actions .btn-danger {
    animation: slideIn 0.3s ease-out;
}

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

.contacts-table-wrapper {
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

/* Edit Contacts Table */
.edit-contacts-table {
    width: 100%;
    border-collapse: collapse;
}

.edit-contacts-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.edit-contacts-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.edit-contacts-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.edit-contacts-table th i {
    margin-right: 6px;
    color: var(--primary);
}

.edit-contacts-table th.text-center {
    text-align: center;
}

.edit-contacts-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    color: var(--gray);
    font-size: 14px;
}

.edit-contacts-table td.text-center {
    text-align: center;
}

.contact-row {
    transition: all 0.2s;
}

.contact-row:hover {
    background: #f8f9fa;
}

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

.contact-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.contact-email {
    color: var(--gray);
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.btn-remove {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-remove:hover {
    background: #fecaca;
    transform: scale(1.05);
}

.btn-remove i {
    pointer-events: none;
}

/* History Filters */
.history-filters-container {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group label i {
    margin-right: 6px;
}

.custom-date-range {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 8px;
}

/* History Table */
.history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.history-table thead {
    background: var(--light-gray);
}

.history-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid #e5e7eb;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    color: var(--gray);
    font-size: 14px;
}

.history-table tbody tr {
    transition: background 0.2s;
}

.history-table tbody tr:hover {
    background: var(--light-gray);
}

.history-table td strong {
    color: var(--dark);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.history-container {
    margin-top: 24px;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-card.total {
    border-left: 4px solid var(--primary);
}

.stat-card.success {
    border-left: 4px solid #10b981;
}

.stat-card.failed {
    border-left: 4px solid #ef4444;
}

.stat-card.rate {
    border-left: 4px solid #f59e0b;
}

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

.stat-card.total .stat-icon {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.stat-card.success .stat-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-card.failed .stat-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-card.rate .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-info h3 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
}

.stat-info p {
    margin: 4px 0 0 0;
    color: var(--gray);
    font-size: 14px;
}

/* Account Stats Section */
.account-stats-section {
    margin-top: 32px;
}

.account-stats-section h3 {
    margin-bottom: 20px;
    color: var(--dark);
}

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

.account-stat-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.account-stat-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.account-stat-card h4 {
    margin: 0 0 16px 0;
    color: var(--dark);
    font-size: 18px;
}

.account-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.account-stat-row:last-of-type {
    border-bottom: none;
    margin-bottom: 12px;
}

.stat-label {
    color: var(--gray);
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    color: var(--dark);
}

.success-text {
    color: #10b981;
}

.failed-text {
    color: #ef4444;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width 0.3s;
}

/* Live Progress Section */
#live-progress-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

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

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

#live-progress-section h3 {
    margin: 0;
    color: var(--dark);
    font-size: 20px;
}

.progress-controls {
    display: flex;
    gap: 8px;
}

.progress-controls button {
    padding: 8px 16px;
    font-size: 14px;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--light-gray);
    border-radius: 8px;
}

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

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.progress-bar-container {
    width: 100%;
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.3s ease;
    width: 0%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.live-progress-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

.progress-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
    animation: slideIn 0.3s ease;
}

.progress-item:last-child {
    border-bottom: none;
}

.progress-item:hover {
    background: var(--light-gray);
}

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

.progress-item-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.progress-item-icon.sending {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.progress-item-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.progress-item-icon.failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.progress-item-details {
    flex: 1;
}

.progress-item-email {
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.progress-item-subject {
    font-size: 12px;
    color: var(--gray);
    margin-top: 2px;
}

.progress-item-status {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.progress-item-status.sending {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.progress-item-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.progress-item-status.failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.progress-item-error {
    font-size: 11px;
    color: #ef4444;
    margin-top: 4px;
    font-style: italic;
}

/* Mode Button Bar */
.mode-button-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    padding: 8px;
    background: var(--light-gray);
    border-radius: 12px;
}

.mode-btn {
    flex: 1;
    padding: 16px 24px;
    border: 2px solid transparent;
    background: white;
    color: var(--gray);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mode-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.mode-btn i {
    font-size: 18px;
}

/* Responsive - Old styles (kept for compatibility) */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    /* Responsive Tables */
    .accounts-table th,
    .accounts-table td,
    .lists-table th,
    .lists-table td {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .accounts-table .btn-sm,
    .lists-table .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .account-actions,
    .list-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .tenant-id {
        font-size: 11px;
    }
    
    /* Hide less important columns on small screens */
    .accounts-table th:nth-child(3),
    .accounts-table td:nth-child(3) {
        display: none;
    }
    
    /* Search bar responsive */
    .search-bar input {
        font-size: 14px;
    }
    
    /* Section header responsive */
    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .section-header button {
        width: 100%;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .accounts-table,
    .lists-table {
        min-width: 600px;
    }
    
    .btn-sm {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .btn-sm i {
        margin-right: 4px;
    }
}

/* Toggle Switch Styles */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--toggle-off);
    transition: 0.3s;
    border-radius: 26px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--toggle-on);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
    cursor: pointer;
    user-select: none;
    flex: 1;
}

.toggle-label small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--gray);
    margin-top: 2px;
}

/* Bulk Email Change Button */
.bulk-email-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4) !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
    white-space: nowrap !important;
    min-width: fit-content !important;
    font-size: 14px !important;
}

.bulk-email-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6) !important;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%) !important;
}

.bulk-email-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.4) !important;
}

.bulk-email-btn i {
    margin-right: 8px;
}

/* Bulk Domain Change Button */
.bulk-domain-btn {
    background: linear-gradient(#10b981) !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4) !important;
    cursor: pointer;
    white-space: nowrap !important;
    min-width: fit-content !important;
    font-size: 14px !important;
}

.bulk-domain-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6) !important;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
}

.bulk-domain-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4) !important;
}

.bulk-domain-btn i {
    margin-right: 8px;
}

/* Action Buttons in Table */
.sendas-modal-table .btn-edit,
.sendas-modal-table .btn-secondary,
.sendas-modal-table .btn-warning,
.sendas-modal-table .btn-remove {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.sendas-modal-table .btn-edit {
    background: #3b82f6;
    color: white;
}

.sendas-modal-table .btn-edit:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.sendas-modal-table .btn-secondary {
    background: #8b5cf6;
    color: white;
}

.sendas-modal-table .btn-secondary:hover {
    background: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.sendas-modal-table .btn-warning {
    background: #f59e0b;
    color: white;
}

.sendas-modal-table .btn-warning:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.sendas-modal-table .btn-remove {
    background: #ef4444;
    color: white;
}

.sendas-modal-table .btn-remove:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Tablets and small laptops (max-width: 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-header .logo span,
    .sidebar-nav .nav-item span {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Tablets portrait (max-width: 768px) */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -250px;
        width: 250px;
        z-index: 1000;
        transition: left 0.3s ease;
        height: 100vh;
        overflow-y: auto;
        background: var(--white);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    /* Ensure nav items are visible on mobile */
    .nav-item {
        color: var(--dark) !important;
    }
    
    .nav-item.active {
        background: var(--primary) !important;
        color: var(--white) !important;
    }
    
    .nav-item span {
        display: inline !important;
        color: inherit;
    }
    
    .sidebar-header .logo span {
        display: inline !important;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }
    
    .header {
        padding: 15px;
        padding-left: 60px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Dashboard responsive */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .account-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .account-stat-card {
        padding: 16px;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 20px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer button {
        width: 100%;
        margin: 0 !important;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100% !important;
    }
    
    table {
        font-size: 12px;
    }
    
    .sendas-modal-table {
        overflow-x: auto;
        display: block;
    }
    
    .bulk-email-btn,
    .bulk-domain-btn,
    .btn-warning {
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
}

/* Mobile phones (max-width: 480px) */
@media (max-width: 480px) {
    .header {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .btn, button {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .card {
        padding: 15px;
    }
    
    .card h3 {
        font-size: 16px;
    }
    
    .modal-content {
        width: 100%;
        margin: 10px;
        padding: 15px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 15px;
    }
    
    input, select, textarea {
        font-size: 14px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .bulk-email-btn,
    .bulk-domain-btn,
    .btn-warning {
        font-size: 11px !important;
        padding: 6px 10px !important;
    }
    
    table th,
    table td {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .checkbox-cell {
        width: 30px;
    }
}

/* Mobile hamburger menu button - hidden by default */
.mobile-menu-toggle {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* Mobile hamburger menu button - show on mobile */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background: var(--primary);
        color: white;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    .mobile-menu-toggle i {
        font-size: 18px;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 85vh;
    }
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    z-index: 9999;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle i {
    transition: transform 0.3s ease;
}

/* Dark mode adjustments for cards and modals */
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .account-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .account-stat-card,
[data-theme="dark"] .history-filters-container,
[data-theme="dark"] #live-progress-section {
    background: var(--card-bg) !important;
    color: var(--text-primary);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--bg-secondary) !important;
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] table,
[data-theme="dark"] .sendas-table,
[data-theme="dark"] .accounts-table,
[data-theme="dark"] .accounts-table tbody tr,
[data-theme="dark"] .lists-table,
[data-theme="dark"] .campaigns-table,
[data-theme="dark"] .history-table,
[data-theme="dark"] .sendas-modal-table {
    background: var(--card-bg) !important;
    color: var(--text-primary);
}

[data-theme="dark"] .sendas-table-wrapper,
[data-theme="dark"] .contacts-list,
[data-theme="dark"] .progress-list,
[data-theme="dark"] #lists-grid {
    background: transparent !important;
}

[data-theme="dark"] tbody tr,
[data-theme="dark"] .sendas-modal-table tbody tr,
[data-theme="dark"] .lists-table tbody tr {
    background: var(--card-bg) !important;
}

[data-theme="dark"] tbody tr:hover,
[data-theme="dark"] .lists-table tbody tr:hover {
    background: var(--light-gray) !important;
}

[data-theme="dark"] thead,
[data-theme="dark"] .lists-table thead {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] thead tr,
[data-theme="dark"] .lists-table thead tr {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] th,
[data-theme="dark"] .lists-table th {
    color: var(--text-primary) !important;
    background: transparent !important;
}

[data-theme="dark"] tr[style*="background: #f8f9fa"],
[data-theme="dark"] tr[style*="background:#f8f9fa"] {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] td {
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .nav-item {
    color: var(--text-secondary);
}

[data-theme="dark"] .nav-item:hover {
    background: var(--light-gray);
    color: var(--text-primary);
}

[data-theme="dark"] .nav-item.active {
    background: var(--primary);
    color: var(--white);
}

[data-theme="dark"] .header {
    background: var(--sidebar-bg);
    color: var(--text-primary);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-primary);
}

[data-theme="dark"] .search-bar {
    background: var(--card-bg) !important;
    color: var(--text-primary);
}

[data-theme="dark"] .autocomplete-list {
    background: var(--card-bg) !important;
    border-color: var(--border);
}

[data-theme="dark"] .mode-btn {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .mode-btn.active {
    background: var(--primary);
    color: var(--white);
}

[data-theme="dark"] .modal-footer .btn-secondary {
    background: var(--card-bg) !important;
    color: var(--text-primary);
    border-color: var(--border);
}

/* Compose Email Dark Mode */
[data-theme="dark"] .compose-container {
    background: var(--card-bg);
}

[data-theme="dark"] .form-group label {
    color: var(--text-primary);
}

[data-theme="dark"] .compose-header h2 {
    color: var(--text-primary);
}

[data-theme="dark"] .editor-toolbar {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .editor-content {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .attachment-item {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .account-panel,
[data-theme="dark"] .email-panel,
[data-theme="dark"] .panel {
    background: var(--card-bg) !important;
    color: var(--text-primary);
}

[data-theme="dark"] .panel-header {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .account-item,
[data-theme="dark"] .email-item {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .account-item:hover,
[data-theme="dark"] .email-item:hover {
    background: var(--light-gray) !important;
}

[data-theme="dark"] .account-item:hover *,
[data-theme="dark"] .email-item:hover * {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .account-selection-row {
    background: transparent;
}

[data-theme="dark"] .account-selector-group {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .selector-header {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .selector-title,
[data-theme="dark"] .account-counter,
[data-theme="dark"] #from-accounts-counter,
[data-theme="dark"] #available-emails-counter,
[data-theme="dark"] #principal-accounts-counter {
    color: var(--text-primary) !important;
    background: transparent !important;
}

[data-theme="dark"] .selector-content {
    background: var(--card-bg);
}

[data-theme="dark"] .accounts-list {
    background: var(--card-bg);
}

[data-theme="dark"] .from-account-item,
[data-theme="dark"] .clickable-account {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .from-account-item:hover,
[data-theme="dark"] .clickable-account:hover {
    background: var(--light-gray) !important;
}

[data-theme="dark"] .from-account-item:hover *,
[data-theme="dark"] .clickable-account:hover * {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .from-account-item.selected,
[data-theme="dark"] .clickable-account.selected,
[data-theme="dark"] .account-item.selected,
[data-theme="dark"] .from-account-item.active,
[data-theme="dark"] .clickable-account.active,
[data-theme="dark"] .account-item.active {
    background: var(--primary) !important;
    color: var(--white) !important;
}

[data-theme="dark"] .from-account-item.selected div,
[data-theme="dark"] .clickable-account.selected div,
[data-theme="dark"] .account-item.selected div {
    color: var(--white) !important;
}

/* Override inline styles in account items */
[data-theme="dark"] .account-item [style*="color: #666"],
[data-theme="dark"] .account-item [style*="color:#666"],
[data-theme="dark"] .accounts-list [style*="color: #666"],
[data-theme="dark"] .accounts-list [style*="color:#666"] {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .account-item [style*="font-weight: 500"],
[data-theme="dark"] .account-item div,
[data-theme="dark"] .from-account-item div {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .selector-content [style*="padding: 20px"],
[data-theme="dark"] .accounts-list [style*="text-align: center"] {
    color: var(--text-secondary) !important;
}

/* Toggle switches dark mode */
[data-theme="dark"] .toggle-slider {
    background-color: var(--border);
}

[data-theme="dark"] .toggle-label {
    color: var(--text-primary);
}

[data-theme="dark"] .toggle-label small {
    color: var(--text-secondary);
}

[data-theme="dark"] .toggle-text {
    color: var(--text-secondary);
}

/* Accounts page dark mode */
[data-theme="dark"] .accounts-table td strong,
[data-theme="dark"] .accounts-table .account-name {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .accounts-table .account-email,
[data-theme="dark"] .accounts-table .tenant-id {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .account-actions .btn-sm,
[data-theme="dark"] .accounts-table .btn-sm {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

[data-theme="dark"] .account-actions .btn-sm:hover,
[data-theme="dark"] .accounts-table .btn-sm:hover {
    background: var(--primary-dark);
}

[data-theme="dark"] .btn-icon {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
    padding: 8px;
    border-radius: 6px;
}

[data-theme="dark"] .btn-icon:hover {
    color: white;
    background: var(--primary);
}

[data-theme="dark"] .status-badge {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

[data-theme="dark"] .status-badge.active {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border-color: #4ade80;
}

[data-theme="dark"] .status-badge.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: #f87171;
}

/* Send As Users page dark mode */
[data-theme="dark"] .sendas-table td strong,
[data-theme="dark"] .sendas-table .account-name,
[data-theme="dark"] .sendas-accounts-table td strong,
[data-theme="dark"] .sendas-accounts-table .account-name {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sendas-table .sendas-email,
[data-theme="dark"] .sendas-accounts-table .account-email {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .sendas-table tbody tr,
[data-theme="dark"] .sendas-accounts-table tbody tr {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .sendas-table tbody tr:hover,
[data-theme="dark"] .sendas-accounts-table tbody tr:hover {
    background: var(--light-gray) !important;
}

[data-theme="dark"] .sendas-accounts-table {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .sendas-accounts-table thead {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .sendas-accounts-table th {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sendas-accounts-table td {
    color: var(--text-primary) !important;
    border-color: var(--border);
}

/* All modals dark mode */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .modal-content-modern {
    background: var(--card-bg) !important;
    color: var(--text-primary);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-header-modern {
    background: var(--bg-secondary) !important;
    border-color: var(--border);
}

[data-theme="dark"] .modal-header h3,
[data-theme="dark"] .modal-header-modern h3,
[data-theme="dark"] .modal-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-subtitle {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .modal-body {
    background: var(--card-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-footer {
    background: var(--bg-secondary) !important;
    border-color: var(--border);
}

[data-theme="dark"] .modal-close {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-close:hover {
    background: var(--light-gray);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-form label {
    color: var(--text-primary);
}

[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
}

/* Edit List Modal dark mode */
[data-theme="dark"] #edit-modal .modal-content,
[data-theme="dark"] #view-modal .modal-content {
    background: var(--card-bg) !important;
}

[data-theme="dark"] #edit-modal .modal-header,
[data-theme="dark"] #view-modal .modal-header {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] #edit-modal h3,
[data-theme="dark"] #view-modal h3,
[data-theme="dark"] #edit-modal h4,
[data-theme="dark"] #view-modal h4 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] #edit-modal p,
[data-theme="dark"] #view-modal p,
[data-theme="dark"] #edit-modal span,
[data-theme="dark"] #view-modal span {
    color: var(--text-primary) !important;
}

[data-theme="dark"] #edit-modal .modal-body,
[data-theme="dark"] #view-modal .modal-body {
    background: var(--card-bg);
    color: var(--text-primary);
}

[data-theme="dark"] #edit-modal table,
[data-theme="dark"] #view-modal table {
    background: var(--card-bg) !important;
}

[data-theme="dark"] #edit-modal td,
[data-theme="dark"] #view-modal td,
[data-theme="dark"] #edit-modal th,
[data-theme="dark"] #view-modal th {
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] #edit-modal .count,
[data-theme="dark"] #view-modal .count,
[data-theme="dark"] #edit-modal strong,
[data-theme="dark"] #view-modal strong {
    color: var(--text-primary) !important;
}

[data-theme="dark"] #edit-modal button,
[data-theme="dark"] #view-modal button {
    opacity: 1 !important;
}

/* Contacts info bar dark mode */
[data-theme="dark"] .contacts-info-bar {
    background: var(--bg-secondary) !important;
    color: var(--text-primary);
}

[data-theme="dark"] .contacts-info-bar .info-item {
    color: var(--text-primary);
}

[data-theme="dark"] .contacts-info-bar .info-item i {
    color: var(--primary-light);
}

[data-theme="dark"] .contacts-info-bar .info-item span,
[data-theme="dark"] .contacts-info-bar .info-item strong,
[data-theme="dark"] #contacts-count,
[data-theme="dark"] #selection-info,
[data-theme="dark"] #selected-count {
    color: var(--text-primary) !important;
}

/* Remove button dark mode */
[data-theme="dark"] .btn-remove {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border: 1px solid #f87171 !important;
}

[data-theme="dark"] .btn-remove:hover {
    background: rgba(239, 68, 68, 0.3) !important;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Mode buttons dark mode */
[data-theme="dark"] .mode-btn {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #818cf8 !important;
    border: 2px solid rgba(129, 140, 248, 0.3) !important;
}

[data-theme="dark"] .mode-btn:hover {
    background: rgba(99, 102, 241, 0.25) !important;
    border-color: rgba(129, 140, 248, 0.5) !important;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3) !important;
}

[data-theme="dark"] .mode-btn.active {
    background: rgba(99, 102, 241, 0.5) !important;
    color: white !important;
    border: 2px solid #818cf8 !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3), 0 4px 12px rgba(99, 102, 241, 0.5) !important;
    font-weight: 600 !important;
}

/* Manage Providers and Upload List buttons dark mode */
[data-theme="dark"] #manage-providers-btn,
[data-theme="dark"] .btn-secondary[style*="padding"] {
    background: rgba(107, 114, 128, 0.2) !important;
    color: #9ca3af !important;
    border: 1px solid #9ca3af !important;
}

[data-theme="dark"] #manage-providers-btn:hover,
[data-theme="dark"] .btn-secondary[style*="padding"]:hover {
    background: rgba(107, 114, 128, 0.3) !important;
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3) !important;
}

[data-theme="dark"] #upload-list-btn,
[data-theme="dark"] .btn-primary[style*="padding"] {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #818cf8 !important;
    border: 1px solid #818cf8 !important;
}

[data-theme="dark"] #upload-list-btn:hover,
[data-theme="dark"] .btn-primary[style*="padding"]:hover {
    background: rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3) !important;
}

/* Badge/Tag spans dark mode */
[data-theme="dark"] span[style*="background: #e3f2fd"],
[data-theme="dark"] span[style*="background:#e3f2fd"] {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
}

/* Form action buttons dark mode */
[data-theme="dark"] .form-actions .btn-secondary,
[data-theme="dark"] #clear-form-btn {
    background: rgba(107, 114, 128, 0.2) !important;
    color: #9ca3af !important;
    border: 1px solid #9ca3af !important;
}

[data-theme="dark"] .form-actions .btn-secondary:hover,
[data-theme="dark"] #clear-form-btn:hover {
    background: rgba(107, 114, 128, 0.3) !important;
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3) !important;
}

[data-theme="dark"] .form-actions .btn-primary {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #818cf8 !important;
    border: 1px solid #818cf8 !important;
}

[data-theme="dark"] .form-actions .btn-primary:hover {
    background: rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3) !important;
}

/* Campaigns page cards dark mode */
[data-theme="dark"] .campaign-card,
[data-theme="dark"] .campaign-item,
[data-theme="dark"] .campaign-stats-card,
[data-theme="dark"] div[style*="background: white"],
[data-theme="dark"] div[style*="background: #fff"],
[data-theme="dark"] div[style*="background: #ffffff"],
[data-theme="dark"] div[style*="background:#fff"],
[data-theme="dark"] div[style*="background:#ffffff"] {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .campaign-card *,
[data-theme="dark"] .campaign-item *,
[data-theme="dark"] .campaign-stats-card * {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .campaign-card h3,
[data-theme="dark"] .campaign-card h4,
[data-theme="dark"] .campaign-item h3,
[data-theme="dark"] .campaign-item h4 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .campaign-card p,
[data-theme="dark"] .campaign-item p {
    color: var(--text-secondary) !important;
}

/* All inline styled buttons dark mode - Override all background colors */
[data-theme="dark"] button[style*="background: #4caf50"],
[data-theme="dark"] button[style*="background:#4caf50"] {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
    border: 1px solid #4ade80 !important;
}

[data-theme="dark"] button[style*="background: #4caf50"]:hover,
[data-theme="dark"] button[style*="background:#4caf50"]:hover {
    background: rgba(34, 197, 94, 0.3) !important;
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3) !important;
}

[data-theme="dark"] button[style*="background: #3b82f6"],
[data-theme="dark"] button[style*="background:#3b82f6"],
[data-theme="dark"] button[style*="background: #2196f3"],
[data-theme="dark"] button[style*="background:#2196f3"] {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
    border: 1px solid #60a5fa !important;
}

[data-theme="dark"] button[style*="background: #3b82f6"]:hover,
[data-theme="dark"] button[style*="background:#3b82f6"]:hover,
[data-theme="dark"] button[style*="background: #2196f3"]:hover,
[data-theme="dark"] button[style*="background:#2196f3"]:hover {
    background: rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3) !important;
}

[data-theme="dark"] button[style*="background: #ef4444"],
[data-theme="dark"] button[style*="background:#ef4444"],
[data-theme="dark"] button[style*="background: #f44336"],
[data-theme="dark"] button[style*="background:#f44336"] {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border: 1px solid #f87171 !important;
}

[data-theme="dark"] button[style*="background: #ef4444"]:hover,
[data-theme="dark"] button[style*="background:#ef4444"]:hover,
[data-theme="dark"] button[style*="background: #f44336"]:hover,
[data-theme="dark"] button[style*="background:#f44336"]:hover {
    background: rgba(239, 68, 68, 0.3) !important;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] button[style*="background: #6366f1"],
[data-theme="dark"] button[style*="background:#6366f1"],
[data-theme="dark"] button[style*="background: #4f46e5"],
[data-theme="dark"] button[style*="background:#4f46e5"] {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #818cf8 !important;
    border: 1px solid #818cf8 !important;
}

[data-theme="dark"] button[style*="background: #6366f1"]:hover,
[data-theme="dark"] button[style*="background:#6366f1"]:hover,
[data-theme="dark"] button[style*="background: #4f46e5"]:hover,
[data-theme="dark"] button[style*="background:#4f46e5"]:hover {
    background: rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3) !important;
}

[data-theme="dark"] button[style*="background: #10b981"],
[data-theme="dark"] button[style*="background:#10b981"] {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border: 1px solid #34d399 !important;
}

[data-theme="dark"] button[style*="background: #10b981"]:hover,
[data-theme="dark"] button[style*="background:#10b981"]:hover {
    background: rgba(16, 185, 129, 0.3) !important;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] button[style*="background: #f59e0b"],
[data-theme="dark"] button[style*="background:#f59e0b"],
[data-theme="dark"] button[style*="background: #ff9800"],
[data-theme="dark"] button[style*="background:#ff9800"] {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border: 1px solid #fbbf24 !important;
}

[data-theme="dark"] button[style*="background: #f59e0b"]:hover,
[data-theme="dark"] button[style*="background:#f59e0b"]:hover,
[data-theme="dark"] button[style*="background: #ff9800"]:hover,
[data-theme="dark"] button[style*="background:#ff9800"]:hover {
    background: rgba(245, 158, 11, 0.3) !important;
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3) !important;
}

[data-theme="dark"] .modal-form p,
[data-theme="dark"] .modal-body p,
[data-theme="dark"] .modal-content p,
[data-theme="dark"] .sendas-card h4,
[data-theme="dark"] .sendas-card p {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sendas-card {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .sendas-card strong {
    color: var(--text-primary);
}

[data-theme="dark"] .sendas-modal-table,
[data-theme="dark"] .sendas-modal-table tbody,
[data-theme="dark"] .sendas-modal-table tr,
[data-theme="dark"] .sendas-modal-table td {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sendas-modal-table td span,
[data-theme="dark"] .sendas-modal-table td div,
[data-theme="dark"] .sendas-modal-table td label {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sendas-modal-table thead {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .sendas-modal-table th {
    color: var(--text-primary) !important;
}

/* Comprehensive dark mode for all remaining elements */
[data-theme="dark"] .empty-state {
    background: var(--card-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .empty-state h3 {
    color: var(--text-primary);
}

[data-theme="dark"] .empty-state p {
    color: var(--text-secondary);
}

[data-theme="dark"] .progress-bar {
    background: var(--bg-secondary);
}

[data-theme="dark"] .progress-fill {
    background: var(--primary);
}

[data-theme="dark"] .timestamp {
    color: var(--text-secondary);
}

[data-theme="dark"] .form-group label {
    color: var(--text-primary);
}

[data-theme="dark"] .input-modern,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] textarea {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .input-modern::placeholder,
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] input[style*="background"],
[data-theme="dark"] textarea[style*="background"] {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .account-selector,
[data-theme="dark"] .email-selector {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .stats-grid {
    background: transparent;
}

[data-theme="dark"] .chart-card {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .activity-item {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .activity-item:hover {
    background: var(--light-gray);
}

[data-theme="dark"] .activity-icon {
    background: var(--bg-secondary);
}

[data-theme="dark"] .activity-details h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .activity-details p {
    color: var(--text-secondary);
}

[data-theme="dark"] .badge {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

[data-theme="dark"] .badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

[data-theme="dark"] .badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

[data-theme="dark"] .badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

[data-theme="dark"] .alert {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border-color: #4ade80;
}

[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: #f87171;
}

[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border-color: #fbbf24;
}

[data-theme="dark"] .alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-color: #60a5fa;
}

[data-theme="dark"] .dropdown {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-primary);
}

[data-theme="dark"] .dropdown-item:hover {
    background: var(--light-gray);
}

[data-theme="dark"] .tooltip {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

[data-theme="dark"] .pagination {
    background: transparent;
}

[data-theme="dark"] .pagination button {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .pagination button:hover {
    background: var(--light-gray);
}

[data-theme="dark"] .pagination button.active {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .search-box {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .filter-group {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .filter-group label {
    color: var(--text-primary);
}

[data-theme="dark"] hr {
    border-color: var(--border);
}

[data-theme="dark"] code {
    background: var(--bg-secondary);
    color: var(--primary-light);
}

[data-theme="dark"] pre {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] blockquote {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-left-color: var(--primary);
}

/* FAB menu items dark mode */
[data-theme="dark"] .fab-menu-item span {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .fab-menu-item:hover span {
    background: var(--light-gray) !important;
}

/* Email Lists, Accounts, and Send As Users page action buttons dark mode - Override inline styles */
[data-theme="dark"] .lists-table button[style*="background"],
[data-theme="dark"] .lists-table .btn-success,
[data-theme="dark"] .lists-table button[style*="#10b981"],
[data-theme="dark"] .accounts-table button[style*="background"],
[data-theme="dark"] .accounts-table .btn-success,
[data-theme="dark"] .accounts-table button[style*="#10b981"],
[data-theme="dark"] .sendas-accounts-table button[style*="background"],
[data-theme="dark"] .sendas-accounts-table .btn-success,
[data-theme="dark"] .sendas-accounts-table button[style*="#10b981"],
[data-theme="dark"] .sendas-table button[style*="background"],
[data-theme="dark"] .sendas-table .btn-success,
[data-theme="dark"] .sendas-table button[style*="#10b981"] {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
    border: 1px solid #4ade80 !important;
}

[data-theme="dark"] .lists-table button[style*="background"]:hover,
[data-theme="dark"] .lists-table .btn-success:hover,
[data-theme="dark"] .lists-table button[style*="#10b981"]:hover,
[data-theme="dark"] .accounts-table button[style*="background"]:hover,
[data-theme="dark"] .accounts-table .btn-success:hover,
[data-theme="dark"] .accounts-table button[style*="#10b981"]:hover,
[data-theme="dark"] .sendas-accounts-table button[style*="background"]:hover,
[data-theme="dark"] .sendas-accounts-table .btn-success:hover,
[data-theme="dark"] .sendas-accounts-table button[style*="#10b981"]:hover,
[data-theme="dark"] .sendas-table button[style*="background"]:hover,
[data-theme="dark"] .sendas-table .btn-success:hover,
[data-theme="dark"] .sendas-table button[style*="#10b981"]:hover {
    background: rgba(34, 197, 94, 0.3) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3) !important;
}

[data-theme="dark"] .lists-table .btn-primary,
[data-theme="dark"] .lists-table button[style*="#3b82f6"],
[data-theme="dark"] .accounts-table .btn-primary,
[data-theme="dark"] .accounts-table button[style*="#3b82f6"],
[data-theme="dark"] .sendas-accounts-table .btn-primary,
[data-theme="dark"] .sendas-accounts-table button[style*="#3b82f6"],
[data-theme="dark"] .sendas-table .btn-primary,
[data-theme="dark"] .sendas-table button[style*="#3b82f6"] {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
    border: 1px solid #60a5fa !important;
}

[data-theme="dark"] .lists-table .btn-primary:hover,
[data-theme="dark"] .lists-table button[style*="#3b82f6"]:hover,
[data-theme="dark"] .accounts-table .btn-primary:hover,
[data-theme="dark"] .accounts-table button[style*="#3b82f6"]:hover,
[data-theme="dark"] .sendas-accounts-table .btn-primary:hover,
[data-theme="dark"] .sendas-accounts-table button[style*="#3b82f6"]:hover,
[data-theme="dark"] .sendas-table .btn-primary:hover,
[data-theme="dark"] .sendas-table button[style*="#3b82f6"]:hover {
    background: rgba(59, 130, 246, 0.3) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3) !important;
}

[data-theme="dark"] .lists-table .btn-danger,
[data-theme="dark"] .lists-table button[style*="#ef4444"],
[data-theme="dark"] .lists-table button[style*="#f44336"],
[data-theme="dark"] .lists-table button[onclick*="deleteList"],
[data-theme="dark"] .accounts-table .btn-danger,
[data-theme="dark"] .accounts-table button[style*="#ef4444"],
[data-theme="dark"] .accounts-table button[style*="#f44336"],
[data-theme="dark"] .sendas-accounts-table .btn-danger,
[data-theme="dark"] .sendas-accounts-table button[style*="#ef4444"],
[data-theme="dark"] .sendas-accounts-table button[style*="#f44336"],
[data-theme="dark"] .sendas-table .btn-danger,
[data-theme="dark"] .sendas-table button[style*="#ef4444"],
[data-theme="dark"] .sendas-table button[style*="#f44336"] {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border: 1px solid #f87171 !important;
}

[data-theme="dark"] .lists-table .btn-danger:hover,
[data-theme="dark"] .lists-table button[style*="#ef4444"]:hover,
[data-theme="dark"] .lists-table button[style*="#f44336"]:hover,
[data-theme="dark"] .lists-table button[onclick*="deleteList"]:hover,
[data-theme="dark"] .accounts-table .btn-danger:hover,
[data-theme="dark"] .accounts-table button[style*="#ef4444"]:hover,
[data-theme="dark"] .accounts-table button[style*="#f44336"]:hover,
[data-theme="dark"] .sendas-accounts-table .btn-danger:hover,
[data-theme="dark"] .sendas-accounts-table button[style*="#ef4444"]:hover,
[data-theme="dark"] .sendas-accounts-table button[style*="#f44336"]:hover,
[data-theme="dark"] .sendas-table .btn-danger:hover,
[data-theme="dark"] .sendas-table button[style*="#ef4444"]:hover,
[data-theme="dark"] .sendas-table button[style*="#f44336"]:hover {
    background: rgba(239, 68, 68, 0.3) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] .main-content {
    background: var(--bg-secondary);
}

[data-theme="dark"] .top-header {
    background: var(--card-bg) !important;
    color: var(--text-primary);
}

[data-theme="dark"] .logo {
    color: var(--white) !important;
}

[data-theme="dark"] .logo i {
    color: var(--white) !important;
}

[data-theme="dark"] .header-left h1,
[data-theme="dark"] .header-left p {
    color: var(--text-primary);
}

[data-theme="dark"] .stat-value {
    color: var(--text-primary);
}

[data-theme="dark"] .stat-label {
    color: var(--text-secondary);
}

[data-theme="dark"] label {
    color: var(--text-primary);
}

[data-theme="dark"] .form-group label {
    color: var(--text-primary);
}

[data-theme="dark"] p {
    color: var(--text-secondary);
}

/* Dashboard specific dark mode overrides */
[data-theme="dark"] .dashboard-container {
    background: var(--bg-secondary);
}

[data-theme="dark"] .dashboard-header {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .dashboard-title h1,
[data-theme="dark"] .dashboard-title p {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .time-display {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .stat-card-header,
[data-theme="dark"] .stat-card-title,
[data-theme="dark"] .stat-card-value,
[data-theme="dark"] .stat-card-subtitle {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .chart-card {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .chart-card-header,
[data-theme="dark"] .chart-card-title,
[data-theme="dark"] .chart-card-subtitle {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .activity-list {
    background: transparent !important;
}

/* Override all inline white backgrounds in dark mode */
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:white"] {
    background: var(--card-bg) !important;
}

[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f1f5f9"],
[data-theme="dark"] [style*="background:#f1f5f9"] {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] [style*="color: #0f172a"],
[data-theme="dark"] [style*="color:#0f172a"] {
    color: var(--text-primary) !important;
}

[data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] [style*="color:#64748b"] {
    color: var(--text-secondary) !important;
}

/* Range buttons dark mode */
[data-theme="dark"] .range-btn,
[data-theme="dark"] .filter-btn {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .range-btn.active,
[data-theme="dark"] .filter-btn.active {
    background: var(--primary) !important;
    color: white !important;
}

/* Date inputs dark mode */
[data-theme="dark"] input[type="date"] {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

/* JavaScript-applied dark mode classes for inline styles */
.dark-override {
    background: var(--card-bg) !important;
}

.dark-bg-secondary {
    background: var(--bg-secondary) !important;
}

.dark-text-primary {
    color: var(--text-primary) !important;
}

.dark-text-secondary {
    color: var(--text-secondary) !important;
}

/* Dashboard Base Styles */
.dashboard-container {
    padding: 20px;
}

.dashboard-header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.dashboard-title h1 {
    color: var(--dark);
    margin-bottom: 5px;
}

.dashboard-title p {
    color: var(--gray);
}

.time-display {
    color: var(--gray);
}

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

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.activity-list {
    margin-top: 20px;
}

/* Dark Mode for Dashboard */
[data-theme="dark"] .dashboard-container {
    background: var(--bg-secondary);
}

[data-theme="dark"] .dashboard-header {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .dashboard-title h1 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dashboard-title p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .time-display {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .time-display span {
    color: var(--text-primary) !important;
}

/* Mobile theme toggle positioning */
@media (max-width: 768px) {
    .theme-toggle {
        bottom: 80px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* ===== Dynamic Placeholders Section ===== */
.placeholders-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--light-gray);
    border-radius: 8px;
    border: 1px solid var(--border);
}

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

.section-header-inline h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header-inline h4 i {
    color: var(--primary);
}

.btn-add-placeholder {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-add-placeholder:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-add-placeholder:active {
    transform: translateY(0);
}

.placeholders-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.placeholder-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    position: relative;
}

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

.placeholder-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.placeholder-tag {
    background: #3B82F6;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.2s;
}

.placeholder-tag:hover {
    background: #2563EB;
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

.placeholder-tag:active {
    transform: scale(0.98);
}

.btn-remove-placeholder {
    padding: 4px 8px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove-placeholder:hover {
    background: #DC2626;
    transform: translateY(-1px);
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.placeholder-textarea-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.placeholder-textarea-wrapper label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.placeholder-textarea {
    width: 100%;
    min-height: 120px;
    max-height: 200px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    resize: vertical;
    transition: border-color 0.2s;
}

.placeholder-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

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

.placeholder-index-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.placeholder-index-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.placeholder-index-input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.placeholder-index-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-reset-index {
    padding: 4px 10px;
    background: var(--warning);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-reset-index:hover {
    background: #D97706;
    transform: translateY(-1px);
}

.placeholder-info {
    font-size: 11px;
    color: #6B7280;
    background: #F3F4F6;
    padding: 6px 8px;
    border-radius: 4px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

[data-theme="dark"] .placeholder-info {
    background: #374151;
    color: #9CA3AF;
}

/* Empty state */
.placeholders-empty {
    text-align: center;
    padding: 32px;
    color: var(--text-secondary);
    font-size: 14px;
}

.placeholders-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .placeholder-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .placeholder-index-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .placeholder-index-input {
        width: 100%;
    }
}

/* ================================================
   Global Dark Mode Button Styles
   ================================================ */

/* Add Account Button - Dark Mode */
[data-theme="dark"] #add-account-btn,
[data-theme="dark"] .content-header .btn-primary {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #a5b4fc !important;
    border: 1px solid #818cf8 !important;
}

[data-theme="dark"] #add-account-btn:hover,
[data-theme="dark"] .content-header .btn-primary:hover {
    background: rgba(99, 102, 241, 0.35) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4) !important;
    transform: translateY(-1px);
}

/* Test Selected Button - Dark Mode */
[data-theme="dark"] #test-selected-accounts-btn,
[data-theme="dark"] #accounts-grid .btn-success {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #86efac !important;
    border: 1px solid #4ade80 !important;
}

[data-theme="dark"] #test-selected-accounts-btn:hover,
[data-theme="dark"] #accounts-grid .btn-success:hover {
    background: rgba(34, 197, 94, 0.35) !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4) !important;
    transform: translateY(-1px);
}

/* Delete Selected Button - Dark Mode */
[data-theme="dark"] #delete-selected-accounts-btn,
[data-theme="dark"] #delete-selected-lists-btn,
[data-theme="dark"] #accounts-grid .btn-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
    border: 1px solid #f87171 !important;
}

[data-theme="dark"] #delete-selected-accounts-btn:hover,
[data-theme="dark"] #delete-selected-lists-btn:hover,
[data-theme="dark"] #accounts-grid .btn-danger:hover {
    background: rgba(239, 68, 68, 0.35) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
    transform: translateY(-1px);
}

/* Clickable Status Badge */
.status-badge[onclick] {
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-badge[onclick]:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.status-badge.active[onclick]:hover {
    background: #059669;
}

.status-badge.inactive[onclick]:hover {
    background: #dc2626;
}

/* Account Filter Bar - Dark Mode */
[data-theme="dark"] #accounts-status-filter,
[data-theme="dark"] #accounts-search {
    background: var(--bg-secondary) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] #accounts-status-filter option {
    background: var(--card-bg);
    color: var(--text-color);
}

/* Send As Search - Dark Mode */
[data-theme="dark"] #sendas-accounts-search {
    background: var(--bg-secondary) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

/* ================================================
   Notification Bell & Panel
   ================================================ */
.notification-bell-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.notification-bell:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.notification-bell i {
    font-size: 18px;
    color: var(--text-secondary);
}

.notification-bell:hover i {
    color: white;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-badge 2s infinite;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-panel {
    position: absolute;
    top: 54px;
    right: 0;
    width: 360px;
    max-height: 450px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    overflow: hidden;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.notification-header button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.notification-header button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.notification-empty i {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-item.unread {
    background: rgba(99, 102, 241, 0.1);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.notification-icon.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.notification-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.notification-icon.info {
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

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

.notification-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notification-message {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Dark mode adjustments */
[data-theme="dark"] .notification-panel {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .notification-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .notification-item.unread {
    background: rgba(99, 102, 241, 0.15);
}

/* Suppression Warning Banner */
.suppression-banner {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.suppression-banner-content {
    flex: 1;
}

.suppression-banner-title {
    font-weight: 700;
    display: block;
}

.suppression-banner-message {
    margin: 4px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
}

/* Variants */
.suppression-banner.no-file {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.suppression-banner.expired {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

.suppression-banner.safe {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.suppression-banner.success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

/* Dark Mode */
[data-theme="dark"] .suppression-banner.no-file {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .suppression-banner.expired {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .suppression-banner.safe {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .suppression-banner.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.3);
}
