/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    width: 350px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-box h2 {
    color: #2c3e50;
    margin-bottom: 8px;
}

.login-box p {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-box input[type="password"] {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.login-box input[type="password"]:focus {
    outline: none;
    border-color: #3498db;
}

.login-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 10px;
    min-height: 20px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 24px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon {
    font-size: 28px;
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e74c3c;
}

.status-dot.running {
    background: #27ae60;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

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

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #1e8449;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

/* Tabs */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 24px;
    background: white;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
}

.tab:hover {
    background: #ecf0f1;
}

.tab.active {
    background: white;
    color: #3498db;
    font-weight: 600;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
}

/* Tab Content */
.tab-content {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 0 8px 8px 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-content.active {
    display: block;
}

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

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    color: #7f8c8d;
    font-size: 14px;
    margin-top: 5px;
}

.stat-positive { background: #d4edda; }
.stat-positive .stat-number { color: #155724; }

.stat-negative { background: #f8d7da; }
.stat-negative .stat-number { color: #721c24; }

.stat-bounce { background: #e2e3e5; }
.stat-bounce .stat-number { color: #383d41; }

.stat-ooo { background: #fff3cd; }
.stat-ooo .stat-number { color: #856404; }

/* Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.upload-section, .filter-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Stacked toolbar layout */
.toolbar-stacked {
    flex-direction: column;
    align-items: stretch;
}

.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.toolbar-row:not(:last-child) {
    margin-bottom: 10px;
}

select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-pending { background: #e2e3e5; color: #383d41; }
.status-sent { background: #cce5ff; color: #004085; }
.status-interested { background: #d4edda; color: #155724; }
.status-not_interested { background: #f8d7da; color: #721c24; }
.status-bounced { background: #e2e3e5; color: #383d41; }
.status-out_of_office { background: #fff3cd; color: #856404; }
.status-followup_sent { background: #d1ecf1; color: #0c5460; }
.status-other { background: #e2e3e5; color: #383d41; }

/* Template Section */
.template-section {
    margin-bottom: 30px;
}

.template-section h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.help-text {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.editor {
    height: 200px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Quill Editor Overrides */
.ql-container {
    font-family: inherit;
    font-size: 14px;
}

.ql-toolbar {
    border-radius: 4px 4px 0 0;
}

.ql-container {
    border-radius: 0 0 4px 4px;
}

/* Settings Form */
.settings-form {
    max-width: 700px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

/* Status Messages */
#upload-status,
#template-status,
#settings-status {
    margin-left: 10px;
    font-size: 14px;
}

.success { color: #27ae60; }
.error { color: #e74c3c; }

/* Actions Column */
.actions {
    display: flex;
    gap: 5px;
}

/* Chart Section */
.chart-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.chart-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Settings Divider */
.settings-divider {
    margin: 30px 0;
    border: none;
    border-top: 1px solid #eee;
}

/* Form group select */
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* Queue status */
#queue-status {
    margin-left: 10px;
    font-size: 14px;
}

/* Blacklist section */
.blacklist-stats {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.add-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.add-section input[type="text"] {
    width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.add-section select {
    padding: 8px 12px;
}

/* Type badges for blacklist */
.type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.type-email {
    background: #e3f2fd;
    color: #1565c0;
}

.type-domain {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Blacklist upload status */
#blacklist-upload-status {
    margin-left: 10px;
    font-size: 14px;
}

/* Status badge for blacklisted contacts */
.status-blacklisted {
    background: #263238;
    color: white;
}

/* Queue Tab */
.queue-summary {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.queue-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.queue-stats span {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.queue-stats strong {
    color: #2c3e50;
}

.queue-agent-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.queue-agent-status.running {
    background: #d4edda;
    color: #155724;
}

.queue-agent-status.stopped {
    background: #e2e3e5;
    color: #383d41;
}

.queue-type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.queue-type-badge.type-initial {
    background: #cce5ff;
    color: #004085;
}

.queue-type-badge.type-followup {
    background: #d1ecf1;
    color: #0c5460;
}

/* Queue stage badges */
.queue-stage-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.queue-stage-badge.stage-initial {
    background: #cce5ff;
    color: #004085;
}

.queue-stage-badge.stage-followup {
    background: #d1ecf1;
    color: #0c5460;
}

.queue-stage-badge.stage-followup2 {
    background: #d4edda;
    color: #155724;
}

.queue-stage-badge.stage-followup3 {
    background: #fff3cd;
    color: #856404;
}

/* Follow-up 2/3 sections in template editor */
.followup-extra-section .followup-extra-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.followup-extra-section .followup-extra-header h4 {
    margin: 0;
}

.followup-extra-fields {
    border-left: 3px solid #e0e0e0;
    padding-left: 16px;
    margin-top: 12px;
}

/* Queue status badges */
.queue-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.queue-status-badge.status-ready {
    background: #d4edda;
    color: #155724;
}

.queue-status-badge.status-scheduled {
    background: #fff3cd;
    color: #856404;
}

.queue-empty {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Preview Styles */
.preview-contact-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-variation-mode {
    font-size: 14px;
    color: #666;
}

.preview-columns {
    display: flex;
    gap: 20px;
}

.preview-column {
    flex: 1;
    min-width: 0;
}

.preview-column h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-varied-column h4 {
    color: #3498db;
}

.preview-subject {
    margin-bottom: 15px;
}

.preview-subject label,
.preview-body label {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.preview-subject div {
    font-weight: 600;
    color: #2c3e50;
}

.preview-body-content {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #eee;
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
}

.preview-body-content p {
    margin: 0 0 10px 0;
}

.preview-body-content p:last-child {
    margin-bottom: 0;
}

/* Attachments Section */
.attachments-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 13px;
}

.attachment-name {
    color: #2c3e50;
}

.attachment-name.missing {
    color: #e74c3c;
    text-decoration: line-through;
}

.attachment-warning {
    font-size: 11px;
    color: #e74c3c;
    font-style: italic;
}

.no-attachments {
    color: #7f8c8d;
    font-size: 13px;
    font-style: italic;
}

.attachment-upload {
    margin-top: 5px;
}

/* Toggle Switch */
.tracking-toggle {
    margin: 10px 0;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle input[type="checkbox"] {
    width: 40px;
    height: 22px;
    appearance: none;
    background: #ccc;
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle input[type="checkbox"]:checked {
    background: #27ae60;
}

.toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle input[type="checkbox"]:checked::before {
    transform: translateX(18px);
}

.toggle-label {
    font-size: 14px;
    color: #2c3e50;
}

/* Clickable Email Rows */
.emails-table-clickable tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.emails-table-clickable tbody tr:hover {
    background: #e8f4fc;
}

/* Email Detail Modal */
.email-detail-meta {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.email-detail-row {
    display: flex;
    margin-bottom: 8px;
}

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

.email-detail-label {
    font-weight: 600;
    color: #7f8c8d;
    width: 80px;
    flex-shrink: 0;
}

.email-detail-subject {
    margin-bottom: 15px;
}

.email-detail-subject label,
.email-detail-body label {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.email-detail-subject div {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.email-detail-body-content {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #eee;
    max-height: 400px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.email-detail-body-content p {
    margin: 0 0 10px 0;
}

.email-detail-body-content p:last-child {
    margin-bottom: 0;
}

/* List filter and display styles */
.list-name-input {
    width: 150px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.list-name-input::placeholder {
    font-size: 13px;
}

.lists-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-list {
    color: var(--text-muted);
    font-style: italic;
}

.queue-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.queue-summary .filter-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Templates Tab Styles */
.templates-overview-section {
    margin-bottom: 30px;
}

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

.templates-header h3 {
    margin: 0;
    color: #2c3e50;
}

.templates-table {
    margin-bottom: 30px;
}

.default-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #27ae60;
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

/* Template Editor Section */
.template-editor-section {
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    background: #f8f9fa;
}

.template-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.template-editor-header h3 {
    margin: 0;
    color: #2c3e50;
}

.template-editor-section h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 16px;
}

.template-editor-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

/* List Assignments */
.list-assignments-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.list-assignment-item {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    transition: background 0.2s;
}

.list-assignment-item:hover {
    background: #e9ecef;
}

.list-assignment-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.list-assignment-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.list-assignment-checkbox span {
    font-size: 14px;
    color: #2c3e50;
}

/* Signature Section */
.signature-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.signature-section h3 {
    margin-bottom: 10px;
}

#signature-status {
    margin-left: 10px;
    font-size: 14px;
}

/* List Management Styles */
.lists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.lists-header h3 {
    margin: 0;
    color: #2c3e50;
}

.no-limit, .no-template {
    color: #7f8c8d;
    font-style: italic;
}

.limit-reached {
    color: #e74c3c;
    font-weight: 600;
}

.limit-warning {
    color: #f39c12;
    font-weight: 500;
}

.daily-limit-input {
    width: 120px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.daily-limit-input::placeholder {
    font-size: 13px;
}

/* Modal small variant */
.modal-small {
    max-width: 450px;
}

/* Queue blocked status */
.queue-status-badge.status-blocked {
    background: #f8d7da;
    color: #721c24;
}

.row-blocked {
    opacity: 0.7;
    background: #fdf2f2 !important;
}

.row-blocked:hover {
    background: #fbe9e9 !important;
}

/* Campaign group headers in queue */
.campaign-group-header td {
    background: #f0f4ff !important;
    border-top: 2px solid #c5cfe8;
    border-bottom: 1px solid #c5cfe8;
    padding: 8px 12px !important;
}

.campaign-group-header:hover td {
    background: #f0f4ff !important;
}

.campaign-group-label {
    font-weight: 600;
    font-size: 13px;
    color: #3a4a8a;
}

.campaign-group-count {
    margin-left: 10px;
    font-size: 12px;
    color: #6b7280;
    font-weight: normal;
}

/* Disabled button style */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty message in tables */
.empty-message {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 20px !important;
}

/* Search input */
.search-input {
    width: 180px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.search-input::placeholder {
    color: #aaa;
    font-size: 13px;
}

/* Email Server Settings */
.settings-section-title {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

.settings-row {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.settings-column {
    flex: 1;
    min-width: 200px;
}

.settings-column h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

#email-settings-status {
    margin-left: 10px;
    font-size: 14px;
}

@media (max-width: 600px) {
    .settings-row {
        flex-direction: column;
        gap: 20px;
    }
}

/* Email settings actions */
.email-settings-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

/* Connection test results */
.connection-test-results {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #eee;
}

.test-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.test-result:not(:last-child) {
    border-bottom: 1px solid #eee;
}

.test-label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 50px;
}

.test-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.test-status.success {
    background: #d4edda;
    color: #155724;
}

.test-status.error {
    background: #f8d7da;
    color: #721c24;
}

.test-status.testing {
    background: #fff3cd;
    color: #856404;
}

.test-message {
    color: #666;
    font-size: 13px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out;
    max-width: 400px;
    word-wrap: break-word;
}

.toast.toast-success {
    background: #27ae60;
}

.toast.toast-error {
    background: #e74c3c;
}

.toast.toast-info {
    background: #3498db;
}

.toast.toast-warning {
    background: #f39c12;
}

.toast.toast-fade-out {
    animation: toastFadeOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 13px;
}

.pagination button:hover:not(:disabled) {
    background: #f0f0f0;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 13px;
    color: #666;
}


/* ─── AI Hub ──────────────────────────────────────────────────────────────── */

.ai-hub-section {
    margin-bottom: 32px;
}

.ai-hub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ai-hub-header h3 {
    margin: 0;
}

.pitch-form {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 12px;
}

.pitch-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 4px;
}

.pitch-form-row .form-group {
    flex: 1;
    min-width: 0;
}

.pitch-form textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn-generate {
    margin-top: 8px;
    padding: 10px 24px;
    font-size: 15px;
}

.optional-label {
    font-weight: normal;
    color: #888;
    font-size: 12px;
}

.pitch-output {
    margin-top: 24px;
    background: #fff;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
}

.pitch-output h4 {
    margin: 0 0 16px 0;
    color: #2e7d32;
}

.pitch-result .form-group {
    position: relative;
    margin-bottom: 16px;
}

.pitch-result-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fafafa;
}

.pitch-result-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    background: #fafafa;
    font-family: inherit;
}

.copy-btn {
    margin-top: 6px;
}

.content-hub-list {
    margin-top: 12px;
}

.content-category-group {
    margin-bottom: 20px;
}

.content-category-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin: 0 0 8px 0;
}

.content-hub-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.content-hub-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.content-hub-title {
    font-weight: 600;
    font-size: 14px;
}

.content-hub-actions {
    display: flex;
    gap: 6px;
}

.content-hub-preview {
    color: #555;
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}

.modal-medium {
    max-width: 680px;
    width: 95%;
}

.modal-medium textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}


/* ─── Analytics Dashboard ───────────────────────────────────────────────── */

.analytics-section {
    margin-bottom: 28px;
}

.analytics-section h3 {
    margin-bottom: 4px;
}

.analytics-note {
    margin-bottom: 12px;
}

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

@media (max-width: 700px) {
    .analytics-grid { grid-template-columns: repeat(2, 1fr); }
}

.analytics-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.analytics-card-open   { border-top: 3px solid #1976d2; }
.analytics-card-reply  { border-top: 3px solid #7b1fa2; }
.analytics-card-positive { border-top: 3px solid #2e7d32; }

.analytics-number {
    font-size: 32px;
    font-weight: 700;
    color: #222;
    line-height: 1;
    margin-bottom: 4px;
}

.analytics-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.analytics-rate {
    font-size: 12px;
    color: #888;
}

.analytics-badge {
    font-size: 11px;
    font-weight: normal;
}


/* ─── Variable Insertion Bar ────────────────────────────────────────────── */

.variable-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    background: #f0f4ff;
    border: 1px solid #d0d9f5;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.variable-bar-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-right: 4px;
}

.var-btn {
    background: #fff;
    border: 1px solid #b0bef5;
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    font-size: 13px;
    color: #3949ab;
    transition: background 0.15s;
}

.var-btn:hover {
    background: #e8eeff;
}

.var-btn code {
    font-family: monospace;
    font-size: 12px;
}

.variable-bar-hint {
    font-size: 11px;
    color: #888;
    margin-left: 4px;
}

.var-target-hint {
    font-size: 11px;
    font-weight: normal;
    color: #999;
}

/* ─── Campaigns ─────────────────────────────────────────────────────────── */

.campaign-editor {
    margin-top: 24px;
    background: #f9fafb;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
}

.campaign-editor h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 16px;
}

.campaign-editor-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.campaign-status {
    font-size: 13px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
}

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

.campaign-status.paused {
    background: #fef3c7;
    color: #92400e;
}

.campaign-status.draft {
    background: #f3f4f6;
    color: #6b7280;
}

/* Bulk action bar */
.bulk-action-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #1e40af;
}

.bulk-action-bar span {
    font-weight: 600;
    margin-right: 4px;
}

/* Checkbox column */
.col-check {
    width: 36px;
    text-align: center;
}

/* Form control for modal */
.form-control {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}
