/* CRM Core Premium Theme Layout Stylesheet */

:root {
    --primary-cyan: #00C8E8;
    --primary-cyan-hover: #00A6C0;
    --primary-cyan-alpha: rgba(0, 200, 232, 0.15);
    
    /* Dark Mode Defaults (Active by default) */
    --bg-main: #0F172A;
    --bg-card: #1E293B;
    --bg-input: #0B0F19;
    --border-color: #334155;
    --text-main: #FFFFFF;
    --text-muted: #94A3B8;
    --shadow-main: rgba(0, 0, 0, 0.3);
    
    /* Global System Colors */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-info: #3B82F6;
}

/* Light Mode Overrides */
body.light-mode {
    --bg-main: #F9FAFB;
    --bg-card: #FFFFFF;
    --bg-input: #F3F4F6;
    --border-color: #E5E7EB;
    --text-main: #111827;
    --text-muted: #6B7280;
    --shadow-main: rgba(0, 0, 0, 0.05);
}

/* Global resets & typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

a {
    color: var(--primary-cyan);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Landing Page Styles */
.crm-landing-body {
    background-color: #0B0F19;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.crm-landing-nav {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-accent {
    color: var(--primary-cyan);
    font-weight: 800;
}

.tagline-by {
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
}
.nav-link:hover {
    color: var(--primary-cyan);
    text-decoration: none;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, filter 0.2s ease;
}
.btn:hover {
    transform: translateY(-2px);
}
.btn:active {
    transform: translateY(0);
}

.btn-primary, .nav-btn.btn-primary {
    background-color: var(--primary-cyan);
    color: #0F172A !important;
}
.btn-primary:hover {
    background-color: var(--primary-cyan-hover);
    text-decoration: none;
}

.btn-secondary, .nav-btn.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main) !important;
}
.btn-secondary:hover {
    background: var(--primary-cyan-alpha);
    border-color: var(--primary-cyan);
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

.landing-main-wrapper {
    flex-grow: 1;
}

.landing-hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 50px;
}

.hero-content h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.text-glow {
    color: var(--primary-cyan);
    text-shadow: 0 0 20px var(--primary-cyan-alpha);
}

.hero-desc {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 15px;
}

.hero-badge {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glow-sphere {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary-cyan-alpha) 0%, transparent 70%);
    filter: blur(30px);
}

.floating-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(12px);
    width: 320px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    animation: floatAnimation 6s ease-in-out infinite;
}

@keyframes floatAnimation {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.card-header {
    display: flex;
    gap: 6px;
    margin-bottom: 15px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.dot.red { background-color: var(--color-danger); }
.dot.yellow { background-color: var(--color-warning); }
.dot.green { background-color: var(--color-success); }

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 120px;
    margin-top: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.bar {
    width: 100%;
    background: linear-gradient(to top, var(--primary-cyan), rgba(0, 200, 232, 0.2));
    border-radius: 4px 4px 0 0;
    transition: height 1s ease-out;
}

/* Landing features */
.landing-features {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
}

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

.feature-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 30px;
    transition: hover 0.3s;
}
.feature-card:hover {
    border-color: var(--primary-cyan);
    transform: scale(1.02);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.5;
}

/* Auth Screens */
.auth-section {
    padding: 80px 20px;
}

.auth-container {
    max-width: 700px;
    margin: 0 auto;
}
.auth-container.narrow {
    max-width: 450px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 30px var(--shadow-main);
}

.auth-card h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 30px;
}

.form-group-title {
    font-weight: 700;
    color: var(--primary-cyan);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
}

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

@media(max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 0 3px var(--primary-cyan-alpha);
}

.form-options {
    margin-bottom: 18px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.alert-box {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.alert-box.success {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--color-success);
    color: #34D399;
}
.alert-box.danger {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--color-danger);
    color: #F87171;
}

/* CRM SaaS Console App Layout */
.crm-dashboard-container {
    display: flex;
    min-height: 100vh;
}

.crm-sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

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

.company-badge {
    background-color: var(--bg-input);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 10px;
    color: var(--primary-cyan);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu {
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}
.menu-item:hover {
    background-color: var(--bg-input);
    color: var(--text-main);
    text-decoration: none;
}
.menu-item.active {
    background-color: var(--primary-cyan-alpha);
    color: var(--primary-cyan);
    font-weight: 600;
}

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

.logout-link {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logout-link:hover {
    color: var(--color-danger);
    text-decoration: none;
}

/* Main Workspace Panel */
.crm-main-workspace {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.crm-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.header-left h2 {
    font-size: 1.4rem;
    font-weight: 700;
}

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

/* Toggle Switch Styling */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-label-icon {
    font-size: 1rem;
    color: var(--text-muted);
}

.theme-switch {
    display: inline-block;
    height: 20px;
    position: relative;
    width: 38px;
}

.theme-switch input {
    display:none;
}

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

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

input:checked + .slider {
    background-color: var(--primary-cyan);
}

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

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* User Badge */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary-cyan);
    color: #0F172A;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-meta-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.username-text {
    font-size: 0.9rem;
    font-weight: 600;
}

.role-text {
    font-size: 10px;
    color: var(--text-muted);
}

/* Workspace View Container */
.crm-workspace-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

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

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px var(--shadow-main);
    display: flex;
    flex-direction: column;
}

.stat-header {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-trend {
    font-size: 11px;
    color: var(--color-success);
    margin-top: 6px;
}

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

@media(max-width: 900px) {
    .dashboard-split-view {
        grid-template-columns: 1fr;
    }
}

.app-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px var(--shadow-main);
    margin-bottom: 20px;
}

.card-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* SVG Chart details */
.svg-chart-container {
    width: 100%;
    height: 250px;
}

/* Activity history logger styles */
.activity-feed-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.feed-item {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    font-size: 0.9rem;
}

.feed-item-icon {
    font-size: 1.2rem;
}

.feed-item-body {
    display: flex;
    flex-direction: column;
}

.feed-item-desc {
    color: var(--text-main);
}
.feed-item-desc strong {
    color: var(--primary-cyan);
}

.feed-item-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Unified Lists and search filters */
.crm-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 0.5;
}

.search-input-wrapper input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-main);
    outline: none;
}

/* Tables styling */
.crm-table-container {
    overflow-x: auto;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.crm-table th, .crm-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.crm-table th {
    background-color: var(--bg-input);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.crm-table tr:hover td {
    background-color: var(--bg-input);
}

.tags-badge {
    background-color: var(--primary-cyan-alpha);
    color: var(--primary-cyan);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* Kanban Board Layout */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 15px;
    min-height: 500px;
    align-items: flex-start;
}

.kanban-column {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 280px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: 700px;
}

.column-header {
    padding: 15px;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leads-count-pill {
    background-color: var(--bg-input);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.column-cards-container {
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 350px;
}

.kanban-card {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}
.kanban-card:active {
    cursor: grabbing;
}
.kanban-card:hover {
    border-color: var(--primary-cyan);
    box-shadow: 0 4px 8px var(--shadow-main);
}

.kanban-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.kanban-card-company {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.kanban-drag-over {
    border: 2px dashed var(--primary-cyan) !important;
    background-color: var(--primary-cyan-alpha) !important;
}

/* Modals structures */
.crm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.crm-modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    animation: modalSlideUp 0.3s ease-out;
}

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

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

.crm-modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
}
.crm-modal-close-btn:hover {
    color: var(--text-main);
}

.crm-modal-body {
    padding: 24px;
}

/* Automation nodes styling */
.automation-list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.automation-visual-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auto-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auto-card-flow {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.flow-node {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
}
.flow-node.trigger {
    border-color: var(--color-warning);
    color: var(--color-warning);
    font-weight: 600;
}
.flow-node.action {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.flow-arrow {
    color: var(--text-muted);
}

/* Spinner */
.crm-loading-spinner {
    text-align: center;
    padding: 50px 0;
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 500;
}

/* Integrations items */
.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.integration-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
}

.integration-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.integration-icon {
    font-size: 2.2rem;
}

.integration-meta h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.integration-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Mobile responsive collapsing sidebar */
@media(max-width: 768px) {
    .crm-dashboard-container {
        flex-direction: column;
    }
    .crm-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
    }
    .menu-item {
        white-space: nowrap;
    }
    .crm-main-workspace {
        height: auto;
        overflow: visible;
    }
    .crm-header {
        padding: 15px 20px;
    }
}

/* Email Marketing Sub-Portal Styles */
.crm-email-portal {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.crm-sub-navbar {
    display: flex;
    gap: 15px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0px;
    margin-bottom: 25px;
}

.sub-nav-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 18px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: -2px; /* Aligns with bottom border line */
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sub-nav-btn:hover {
    color: var(--text-main);
}
.sub-nav-btn.active {
    color: var(--primary-cyan) !important;
    border-bottom: 2px solid var(--primary-cyan) !important;
}

/* CRM Button Utility Extensions */
.btn-success {
    background-color: var(--color-success) !important;
    color: #FFFFFF !important;
}
.btn-success:hover {
    filter: brightness(0.9);
    text-decoration: none;
}
.btn-danger {
    background-color: var(--color-danger) !important;
    color: #FFFFFF !important;
}
.btn-danger:hover {
    filter: brightness(0.9);
    text-decoration: none;
}
.btn-xs {
    padding: 4px 8px !important;
    font-size: 11px !important;
    border-radius: 4px !important;
}
.btn-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
}

.email-portal-workspace {
    flex-grow: 1;
    overflow-y: auto;
}

/* Split Visual Email Editor Workspace */
.crm-email-editor-workspace {
    display: grid;
    grid-template-columns: 360px 1fr;
    height: calc(100vh - 160px);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.editor-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    border-right: 1px solid var(--border-color);
    background-color: var(--bg-card);
}

.editor-canvas-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-main);
}

.editor-canvas-scroll {
    flex: 1;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

.email-preview-card {
    width: 100%;
    max-width: 600px;
    min-height: 500px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 30px;
    box-sizing: border-box;
}

.add-block-btn {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    padding: 10px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}
.add-block-btn:hover {
    border-color: var(--primary-cyan) !important;
    background-color: var(--primary-cyan-alpha) !important;
    color: var(--primary-cyan) !important;
    transform: translateY(-1px) !important;
}

.editor-block-item {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}
.editor-block-item:hover {
    border-color: var(--primary-cyan);
}

.editor-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 20px 0 10px 0;
}

/* Dynamic Query / Rule Row */
.segment-rule-row {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.segment-rule-row select, .segment-rule-row input {
    height: 32px;
    padding: 4px 8px;
    font-size: 0.85rem;
}
