:root {
    --whatsapp-green: #25D366;
    --whatsapp-dark: #128C7E;
    --whatsapp-teal: #075E54;
    --bg-primary: #f0f2f5;
    --bg-white: #ffffff;
    --text-primary: #111b21;
    --text-secondary: #667781;
    --border-color: #e9edef;
    --success: #25D366;
    --error: #ea4748;
    --warning: #ffa726;
    --info: #34b7f1;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--whatsapp-teal) 0%, var(--whatsapp-dark) 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse-green 2s infinite;
}

.status-dot.offline {
    background: var(--error);
}

.status-dot.connecting {
    background: var(--warning);
    animation: pulse-yellow 1.5s infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes pulse-yellow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.4rem 0.75rem 0.4rem 0.5rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    color: white;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar i {
    font-size: 1.2rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-position {
    font-size: 0.7rem;
    opacity: 0.85;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin-left: 0.25rem;
}

.logout-btn:hover {
    background: rgba(234, 71, 72, 0.6);
}

/* Main Content */
.app-main {
    padding: 2rem;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--bg-white);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--whatsapp-green);
    color: white;
}

.tab-btn i {
    font-size: 1.2rem;
}

/* Tab Content */
.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header {
    margin-bottom: 2rem;
}

.panel-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.panel-header p {
    color: var(--text-secondary);
}

/* Connection Grid */
.connection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* QR Section */
.qr-section {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.qr-container {
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.qr-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.qr-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.qr-container img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.qr-container .loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Status Section */
.status-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.status-card, .validation-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.status-card h3, .validation-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.status-indicator {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.status-indicator.online {
    background: rgba(37, 211, 102, 0.1);
    color: var(--success);
    font-weight: 600;
}

.status-indicator.offline {
    background: rgba(234, 71, 72, 0.1);
    color: var(--error);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--whatsapp-green);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.checkbox-group label {
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--whatsapp-green);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--whatsapp-dark);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* QR Instructions */
.qr-instructions {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(52, 183, 241, 0.1);
    border-left: 4px solid var(--info);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.qr-instructions i {
    margin-right: 0.5rem;
    color: var(--info);
}

/* Validation Result */
.validation-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.validation-result.success {
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.validation-result.error {
    background: rgba(234, 71, 72, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

/* Message Form */
.message-form-container {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.message-fields {
    animation: fadeIn 0.3s ease;
}

/* Response Display */
.response-display {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    animation: slideIn 0.3s ease;
}

.response-display.success {
    background: rgba(37, 211, 102, 0.1);
    border: 2px solid var(--success);
}

.response-display.error {
    background: rgba(234, 71, 72, 0.1);
    border: 2px solid var(--error);
}

.response-display h4 {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.response-display pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 500px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--info);
}

.toast i {
    font-size: 1.25rem;
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--error); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }

/* Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--whatsapp-green);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .connection-grid {
        grid-template-columns: 1fr;
    }

    .tab-btn span {
        display: none;
    }

    .app-main {
        padding: 1rem;
    }

    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    /* Responsive guest table */
    .guest-table thead {
        display: none;
    }

    .guest-table, .guest-table tbody, .guest-table tr, .guest-table td {
        display: block;
        width: 100%;
    }

    .guest-table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        padding: 1rem;
    }

    .guest-table td {
        text-align: right;
        padding: 0.5rem;
        position: relative;
        padding-left: 50%;
    }

    .guest-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.5rem;
        font-weight: 600;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .logo i {
        font-size: 2rem;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .panel-header h2 {
        font-size: 1.5rem;
    }

    .qr-section, .message-form-container {
        padding: 1.5rem;
    }
}

/* Guest Management Styles */
.guests-container {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.guest-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--whatsapp-green);
}

.guest-table-container {
    overflow-x: auto;
}

.guest-table {
    width: 100%;
    border-collapse: collapse;
}

.guest-table thead {
    background: var(--bg-primary);
}

.guest-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.guest-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.guest-table tbody tr:hover {
    background: rgba(37, 211, 102, 0.05);
}

.guest-table .empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.guest-table .empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.125rem;
}

.status-badge.pending {
    background: rgba(255, 167, 38, 0.15);
    color: var(--warning);
}

.status-badge.sent {
    background: rgba(37, 211, 102, 0.15);
    color: var(--success);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.action-btn.ci {
    background: rgba(52, 183, 241, 0.15);
    color: var(--info);
}

.action-btn.ci:hover {
    background: rgba(52, 183, 241, 0.25);
}

.action-btn.co {
    background: rgba(255, 167, 38, 0.15);
    color: var(--warning);
}

.action-btn.co:hover {
    background: rgba(255, 167, 38, 0.25);
}

.action-btn.confirm {
    background: rgba(37, 211, 102, 0.15);
    color: var(--success);
}

.action-btn.confirm:hover {
    background: rgba(37, 211, 102, 0.25);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Settings Styles */
.settings-container {
    max-width: 900px;
}

.settings-section {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.settings-section textarea {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.template-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--info);
}

.template-preview h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.template-preview pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary);
    max-height: 300px;
    overflow-y: auto;
}

/* ==========================================
   BROADCAST STYLES
   ========================================== */

.broadcast-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.broadcast-section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.queue-actions {
    display: flex;
    gap: 0.5rem;
}

/* Message Editor with Variable Helper */
.message-editor {
    position: relative;
}

.variable-helper {
    position: relative;
    margin-bottom: 0.5rem;
}

.variable-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 400px;
    overflow: hidden;
}

.variable-search {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.variable-search input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.variable-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.variable-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.variable-item:hover {
    background: var(--bg-primary);
}

.variable-code {
    font-family: 'Courier New', monospace;
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--whatsapp-teal);
}

.variable-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Variable Guide */
.variable-guide {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1rem;
}

.variable-guide h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0369a1;
    margin-bottom: 0.75rem;
}

.variable-guide p {
    color: #0c4a6e;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.variable-guide code {
    background: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.guide-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: white;
    padding: 1rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid #0284c7;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    background: #0284c7;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.875rem;
}

.step-content strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.step-content p {
    margin: 0;
    font-size: 0.875rem;
}

.csv-example {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}

.csv-example h4 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.example-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.example-table th,
.example-table td {
    padding: 0.5rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.example-table th {
    background: var(--bg-primary);
    font-weight: 600;
    color: var(--text-primary);
}

.example-table td {
    background: white;
}

.example-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    font-style: italic;
}

/* CSV Upload Area */
.csv-upload-area {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    background: var(--bg-primary);
    transition: all 0.3s;
    cursor: pointer;
}

.csv-upload-area:hover {
    border-color: var(--whatsapp-green);
    background: #f0fdf4;
}

.csv-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-hint {
    pointer-events: none;
}

.upload-hint i {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.upload-hint p {
    color: var(--text-secondary);
    margin: 0;
}

.csv-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* CSV Preview Table */
.csv-preview-table {
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.csv-preview-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.csv-preview-table th,
.csv-preview-table td {
    padding: 0.5rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.csv-preview-table th {
    background: var(--whatsapp-green);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.csv-preview-table tbody tr:nth-child(even) {
    background: var(--bg-primary);
}

.preview-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success);
    font-weight: 600;
    margin: 0;
}

.preview-info i {
    font-size: 1.25rem;
}

/* Preview Header */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.preview-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: white;
}

.badge-success {
    background: white;
    color: #059669;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Detected Variables */
.detected-variables {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.detected-variables h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem 0;
    color: #92400e;
}

.variable-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.variable-tag {
    background: white;
    border: 1px solid #f59e0b;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #92400e;
    font-weight: 600;
}

/* Message Preview Section */
.message-preview-section {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.message-preview-section h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.message-previews {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-preview-item {
    background: var(--bg-primary);
    border-left: 4px solid var(--whatsapp-green);
    padding: 1rem;
    border-radius: var(--radius-sm);
}

.preview-recipient {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.preview-message {
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.csv-preview-table h5 {
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
}

/* Template Preview Modal */
.template-preview-modal {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    margin-top: 1rem;
}

.template-preview-modal h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.preview-content {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.6;
}

/* Queue Stats */
.queue-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 2px solid transparent;
}

.stat-card.stat-pending {
    border-color: var(--warning);
    background: #fff3e0;
}

.stat-card.stat-sending {
    border-color: var(--info);
    background: #e1f5fe;
}

.stat-card.stat-sent {
    border-color: var(--success);
    background: #e8f5e9;
}

.stat-card.stat-failed {
    border-color: var(--error);
    background: #ffebee;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Template Cards */
.templates-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.template-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--success);
    transition: all 0.2s;
    gap: 0.75rem;
}

.template-card.inactive {
    border-left-color: var(--text-secondary);
    opacity: 0.7;
}

.template-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.template-info h4 {
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.template-category {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--whatsapp-green);
    color: white;
    font-size: 0.75rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.template-preview-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap;
    line-height: 1.4;
}

.template-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: auto;
}

/* Blast Cards */
.blasts-list {
    display: grid;
    gap: 1rem;
}

.blast-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    transition: all 0.2s;
}

.blast-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--whatsapp-green);
}

.blast-info h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.blast-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.blast-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.blast-progress {
    margin-top: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--whatsapp-green), var(--whatsapp-dark));
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.blast-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #e8f5e9;
    color: var(--success);
}

.status-badge.inactive {
    background: #f5f5f5;
    color: var(--text-secondary);
}

.blast-status-draft {
    background: #e0e0e0;
    color: #616161;
}

.blast-status-scheduled {
    background: #fff3e0;
    color: #f57c00;
}

.blast-status-processing {
    background: #e1f5fe;
    color: #0288d1;
}

.blast-status-completed {
    background: #e8f5e9;
    color: var(--success);
}

.blast-status-cancelled {
    background: #ffebee;
    color: var(--error);
}

.queue-status-pending {
    background: #fff3e0;
    color: #f57c00;
}

.queue-status-sending {
    background: #e1f5fe;
    color: #0288d1;
}

.queue-status-sent {
    background: #e8f5e9;
    color: var(--success);
}

.queue-status-failed {
    background: #ffebee;
    color: var(--error);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-large {
    max-width: 800px;
}

.modal-xlarge {
    max-width: 1000px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h3 {
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--error);
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Form Styles */
.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.csv-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--info);
}

.csv-preview h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.csv-preview pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary);
    max-height: 200px;
    overflow-y: auto;
}

/* Queue Table */
.queue-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.queue-filter select {
    flex: 1;
    max-width: 200px;
}

.queue-table-container {
    overflow-x: auto;
}

.queue-table {
    width: 100%;
    border-collapse: collapse;
}

.queue-table thead {
    background: var(--bg-primary);
}

.queue-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.queue-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.queue-table tbody tr:hover {
    background: var(--bg-primary);
}

.error-text {
    color: var(--error);
    font-size: 0.875rem;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty and Loading States */
.empty-state,
.loading-state,
.error-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.loading-state {
    color: var(--info);
}

.error-state {
    color: var(--error);
}

/* Button Variants */
.btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #1ea952;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.2s;
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn-icon.btn-danger:hover {
    background: #ffebee;
    color: var(--error);
}

/* Responsive */
@media (max-width: 768px) {
    .templates-list {
        grid-template-columns: 1fr;
    }

    .blast-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .blast-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .queue-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        max-height: 95vh;
    }
}

/* AI Generator Section */
.ai-generator-section {
    margin: 1.5rem 0;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: white;
}

.ai-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.ai-header:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f91 100%);
}

.ai-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
}

.ai-header p {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

.ai-toggle-icon {
    transition: transform 0.3s ease;
}

.ai-generator-content {
    padding: 1.5rem;
    background: #f9fafb;
}

/* Quick Templates */
.ai-quick-templates {
    margin-bottom: 1.5rem;
}

.ai-quick-templates h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quick-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.quick-template-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.quick-template-btn i {
    font-size: 1.5rem;
    color: #667eea;
}

.quick-template-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.quick-template-btn:active {
    transform: translateY(0);
}

/* AI Form */
.ai-form {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid #e5e7eb;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .quick-templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* AI Generated Message Indicator */
textarea.ai-generated {
    border-color: #667eea;
    background: #f0f4ff;
    animation: fadeInHighlight 1s ease;
}

@keyframes fadeInHighlight {
    from {
        background: #e0e7ff;
    }
    to {
        background: #f0f4ff;
    }
}

/* Loading state for generate button */
#generateAiBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Template Requirements Box */
.template-requirements {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.template-requirements h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem 0;
    color: #92400e;
}

.required-variables-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.required-var-tag {
    background: white;
    border: 2px solid #f59e0b;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #92400e;
    font-weight: 600;
}

.required-var-tag.met {
    border-color: #10b981;
    background: #f0fdf4;
    color: #065f46;
}

/* Validation Result */
.validation-result {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.validation-result.success {
    background: #f0fdf4;
    border: 2px solid #10b981;
    color: #065f46;
}

.validation-result.error {
    background: #fef2f2;
    border: 2px solid #ef4444;
    color: #991b1b;
}

.validation-result h5 {
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.validation-result ul {
    margin: 0.5rem 0 0 1.5rem;
    font-size: 0.875rem;
}

/* ==================== NEW BLAST WIZARD ==================== */

/* Step Indicator */
.blast-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.blast-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.step.active .step-number,
.step.completed .step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
}

.step-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.step.active .step-label {
    color: #667eea;
    font-weight: 600;
}

/* Mode Selector Cards */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.mode-card {
    cursor: pointer;
}

.mode-card input[type="radio"] {
    display: none;
}

.mode-card-content {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
}

.mode-card input[type="radio"]:checked + .mode-card-content {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #fff 100%);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.mode-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.mode-card-content h5 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: #111b21;
}

.mode-card-content p {
    margin: 0 0 1rem 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.mode-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.mode-features li {
    padding: 0.25rem 0;
    font-size: 0.875rem;
    color: #059669;
}

.mode-features li i {
    margin-right: 0.5rem;
}

/* AI Generator Card */
.ai-generator-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-top: 1rem;
    overflow: hidden;
}

.ai-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.ai-card-header h5 {
    margin: 0;
    font-size: 1rem;
}

.ai-card-header p {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

.ai-card-body {
    padding: 1.5rem;
    background: #fafafa;
}

/* Quick Prompts */
.quick-prompts {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.quick-prompt-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #667eea;
    background: white;
    border-radius: 20px;
    color: #667eea;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-prompt-btn:hover {
    background: #667eea;
    color: white;
}

/* CSV Upload Card */
.csv-upload-card {
    text-align: center;
    padding: 1rem;
}

.csv-upload-area {
    border: 3px dashed #d1d5db;
    border-radius: 12px;
    padding: 3rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.csv-upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.csv-upload-area i {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.csv-upload-area h5 {
    margin: 0 0 0.5rem 0;
    color: #374151;
}

.csv-upload-area p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* CSV Info */
.csv-info {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.csv-stat {
    flex: 1;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.csv-stat i {
    font-size: 1.5rem;
    color: #059669;
    margin-bottom: 0.5rem;
}

.csv-stat span {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111b21;
}

.csv-stat small {
    color: #6b7280;
}

/* Detected Variables */
.detected-variables {
    margin: 1rem 0;
    padding: 1rem;
    background: #fef3c7;
    border-radius: 8px;
}

.detected-variables h6 {
    margin: 0 0 0.5rem 0;
    color: #92400e;
}

.variable-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.variable-tags .var-tag {
    background: white;
    border: 1px solid #f59e0b;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #92400e;
    font-weight: 600;
}

/* Message Preview */
.message-preview-section {
    margin: 1rem 0;
}

.message-preview-section h6 {
    margin: 0 0 0.5rem 0;
    color: #374151;
}

.message-preview-item {
    background: white;
    border-left: 3px solid #25D366;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.preview-recipient {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.preview-message {
    white-space: pre-wrap;
    font-size: 0.875rem;
    color: #111b21;
}

/* Review Card */
.review-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
}

.review-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.review-header i {
    font-size: 3rem;
    color: #059669;
    margin-bottom: 0.5rem;
}

.review-header h4 {
    margin: 0;
    color: #111b21;
}

.review-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.review-item label {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.review-item span {
    font-size: 1rem;
    color: #111b21;
}

.review-message {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    white-space: pre-wrap;
    font-size: 0.875rem;
    line-height: 1.6;
    border: 1px solid #e5e7eb;
}

/* Step Actions */
.step-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.step-actions .btn {
    flex: 1;
}

/* Char Count */
.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Template Preview */
.template-preview {
    margin-top: 1rem;
}

.template-preview h5 {
    margin: 0 0 0.5rem 0;
    color: #374151;
}

.preview-box {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 1rem;
    white-space: pre-wrap;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #111b21;
}

@media (max-width: 768px) {
    .mode-selector {
        grid-template-columns: 1fr;
    }
    
    .blast-steps {
        font-size: 0.75rem;
    }
    
    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.875rem;
    }
}

/* ============================================
   MEDIA UPLOAD & PICKER
   ============================================ */

.media-attach-area {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.media-upload-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.media-or-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0 0.25rem;
}

.media-preview {
    text-align: center;
}

.media-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}

.media-upload-bar {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.media-card {
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.1s;
    background: var(--bg-secondary);
}

.media-card:hover {
    border-color: var(--primary);
    transform: scale(1.02);
}

.media-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.media-card-info {
    padding: 0.4rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.media-card-name {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.template-media-thumb {
    margin: 0.25rem 0;
}

.template-media-thumb img {
    max-width: 80px;
    max-height: 50px;
    border-radius: 4px;
    border: 1px solid var(--border);
    object-fit: cover;
}

/* ============================================
   BLAST WIZARD LAYOUT
   ============================================ */

.blast-content-layout {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.blast-content-left {
    flex: 0 0 260px;
    min-width: 220px;
}

.blast-content-right {
    flex: 1;
    min-width: 0;
}

.blast-section-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.blast-section-divider::before,
.blast-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.template-detail-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.template-detail-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.template-detail-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.template-detail-cat {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary-dark);
    text-transform: capitalize;
}

.template-detail-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.template-detail-media {
    margin: 0.5rem 0;
}

.template-detail-media img {
    max-width: 100%;
    max-height: 100px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.template-detail-vars {
    margin-top: 0.5rem;
}

.template-detail-vars h6 {
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
    color: var(--text-muted);
}

.template-detail-vars .var-tag {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 6px;
    margin: 2px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .blast-content-layout {
        flex-direction: column;
    }

    .blast-content-left {
        flex: none;
        width: 100%;
    }
}
