/* =========================================================
   HAVANA Fragrances - PRO AUTOMATION MODULE CSS
   Clean royal aesthetic without UI clutter
   ========================================================= */

:root {
    /* Havana Royal Luxury Palette (Default / Dark) */
    --bg-main: #140404;
    --bg-card: rgba(33, 8, 8, 0.85);
    --bg-input: rgba(22, 5, 5, 0.85);
    --text-primary: #f5ece3;
    --text-secondary: #c9b19d;
    --text-muted: #8e735e;
    --border-color: rgba(163, 125, 86, 0.4);
    
    /* Accents */
    --gold-primary: #d4af37;
    --gold-deep: #a37d56;
    --gold-gradient: linear-gradient(135deg, #e5be5e 0%, #a37d56 50%, #d4af37 100%);
    --whatsapp-green: #25D366;
    --whatsapp-dark: #128C7E;
    --whatsapp-gradient: linear-gradient(135deg, #1fa851 0%, #25d366 100%);
    --debt-red: #ff5252;
    --perfume-purple: #b37af0;
    
    /* Shadows & Glassmorphism */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.65);
    --shadow-glow-gold: 0 4px 20px rgba(212, 175, 55, 0.4);
    --shadow-glow-wa: 0 4px 22px rgba(37, 211, 102, 0.45);

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 14px;
}

/* Light Theme Overrides (Warm Havana Gold & Cream) */
body.light-theme {
    --bg-main: #fcf8f3;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-input: #ffffff;
    --text-primary: #2b0a0a;
    --text-secondary: #5c1617;
    --text-muted: #7e4d3a;
    --border-color: rgba(163, 125, 86, 0.5);
    --shadow-sm: 0 2px 10px rgba(92, 22, 23, 0.08);
    --shadow-md: 0 8px 24px rgba(92, 22, 23, 0.12);
}

/* =========================================================
   SPLASH SCREEN - SHIP WHEEL & GRAIN NOISE ANIMATION
   ========================================================= */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #5c1617 0%, #1a0606 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 1s ease-in-out;
    overflow: hidden;
}

#splash-screen::before {
    content: "";
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.15;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 1;
    animation: grainAnimation 1s steps(10) infinite;
}

@keyframes grainAnimation {
    0%, 100% { background-position: 0 0; }
    10% { background-position: -5% -10%; }
    20% { background-position: -15% 5%; }
    30% { background-position: 7% -25%; }
    40% { background-position: 20% 25%; }
    50% { background-position: -25% 10%; }
    60% { background-position: 15% 5%; }
    70% { background-position: 0% 15%; }
    80% { background-position: 25% 35%; }
    90% { background-position: -10% 10%; }
}

.ship-wheel-logo {
    width: 270px;
    max-width: 60%;
    height: auto;
    z-index: 2;
    animation: helmSteer 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes helmSteer {
    0% { transform: rotate(0deg); }
    15% { transform: rotate(70deg); }
    20% { transform: rotate(50deg); } 
    25% { transform: rotate(55deg); } 
    30% { transform: rotate(55deg); } 
    45% { transform: rotate(-80deg); }
    50% { transform: rotate(-60deg); } 
    55% { transform: rotate(-65deg); } 
    60% { transform: rotate(-65deg); } 
    80% { transform: rotate(15deg); }
    85% { transform: rotate(-10deg); }
    90% { transform: rotate(5deg); }
    100% { transform: rotate(0deg); }
}

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

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: 'Noto Sans Arabic', 'Alexandria', -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden !important;
    transition: background-color 0.3s ease;
    position: relative;
}

/* Fixed Background matching Havana with Theme-dependent Opacity */
.bg-fixed {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -10;
    background-color: var(--bg-main);
    background-image: linear-gradient(rgba(20, 4, 4, 0.94), rgba(20, 4, 4, 0.94)), url('https://i.postimg.cc/Dw127HGG/Gemini-Generated-Image-2h56w02h56w02h56.png');
    background-size: cover;
    background-position: center;
    transition: opacity 0.3s ease;
}

body.light-theme .bg-fixed {
    background-image: linear-gradient(rgba(252, 248, 243, 0.93), rgba(252, 248, 243, 0.93)), url('https://i.postimg.cc/Dw127HGG/Gemini-Generated-Image-2h56w02h56w02h56.png');
}

/* Ambient Lighting Effect */
.ambient-glow {
    position: absolute;
    width: 550px;
    height: 550px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.16;
    pointer-events: none;
    z-index: -5;
}

.glow-gold {
    top: -100px;
    right: -100px;
    background: radial-gradient(circle, var(--gold-primary), var(--whatsapp-green));
}

.glow-maroon {
    bottom: -150px;
    left: -100px;
    background: radial-gradient(circle, #5c1617, var(--perfume-purple));
}

/* Glassmorphism utility */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

/* =======================================
   TOP NAVBAR & LOGO
   ======================================= */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 36px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.brand-section .logo-box {
    display: flex;
    align-items: center;
    gap: 18px;
}

.havana-navbar-logo {
    height: 130px;
    width: auto;
    max-width: 85%;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.7)) brightness(1.25);
    transition: transform 0.3s ease;
}

body.light-theme .havana-navbar-logo {
    filter: drop-shadow(0 2px 6px rgba(92, 22, 23, 0.35)) brightness(1);
}

.havana-navbar-logo:hover {
    transform: scale(1.05);
}

.logo-divider {
    width: 2px;
    height: 95px;
    background: linear-gradient(to bottom, transparent, var(--gold-primary), transparent);
}

.logo-titles h1 {
    font-size: 21px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-pro {
    font-size: 11px;
    background: var(--gold-gradient);
    color: #1c0606;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

.tagline {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.system-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--whatsapp-green);
    background: rgba(37, 211, 102, 0.12);
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid rgba(37, 211, 102, 0.35);
}

.pulse-indicator {
    width: 9px;
    height: 9px;
    background: var(--whatsapp-green);
    border-radius: 50%;
    position: relative;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Buttons */
button {
    font-family: inherit;
    border: none;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon-theme {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--gold-primary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-theme:hover {
    background: rgba(212, 175, 55, 0.15);
    transform: scale(1.06);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.btn-primary-gold {
    background: var(--gold-gradient);
    color: #160303;
    font-weight: 800;
    font-size: 14px;
    padding: 10px 22px;
    border-radius: 12px;
    box-shadow: var(--shadow-glow-gold);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.6);
    filter: brightness(1.1);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
}

.btn-secondary:hover {
    background: rgba(163, 125, 86, 0.15);
}

.btn-wa-row {
    background: var(--whatsapp-dark);
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    padding: 7px 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(37, 211, 102, 0.4);
}

.btn-wa-row:hover {
    background: var(--whatsapp-green);
    color: #0d1e13;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-wa);
}

/* Minimalist Action Icons in table row (Complete / Delete) */
.btn-mini-tool {
    background: transparent;
    border: none;
    color: #8e735e;
    font-size: 16px;
    padding: 6px 8px;
    margin: 0 2px;
    cursor: pointer;
    transition: var(--transition);
    vertical-align: middle;
}

.btn-mini-tool.complete:hover {
    color: var(--whatsapp-green);
    transform: scale(1.15);
}

.btn-mini-tool.delete:hover {
    color: var(--debt-red);
    transform: scale(1.15);
}

.btn-mini-tool.restore:hover {
    color: var(--gold-primary);
    transform: scale(1.15);
}

.btn-whatsapp-batch-glow {
    background: var(--whatsapp-gradient);
    color: #0b1a11;
    font-weight: 800;
    font-size: 15px;
    padding: 12px 26px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-glow-wa);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: glow-pulse 3s infinite alternate;
}

@keyframes glow-pulse {
    0% { box-shadow: 0 4px 15px rgba(37, 211, 102, 0.35); }
    100% { box-shadow: 0 6px 28px rgba(37, 211, 102, 0.75); }
}

.btn-whatsapp-batch-glow:hover {
    transform: scale(1.03);
    background: #28e06c;
}

/* =======================================
   DASHBOARD CONTAINER & KPI CARDS
   ======================================= */
.dashboard-container {
    max-width: 1440px;
    margin: 24px auto;
    padding: 0 36px;
}

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

.kpi-card {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-primary);
    box-shadow: 0 10px 32px rgba(212, 175, 55, 0.25);
}

.kpi-icon-wrapper {
    font-size: 26px;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
}

body.light-theme .kpi-icon-wrapper { background: rgba(255, 255, 255, 0.8); }

.kpi-icon-wrapper.gold { color: var(--gold-primary); border-color: rgba(212, 175, 55, 0.5); box-shadow: 0 0 15px rgba(212, 175, 55, 0.3); }
.kpi-icon-wrapper.red { color: var(--debt-red); border-color: rgba(255, 82, 82, 0.5); box-shadow: 0 0 15px rgba(255, 82, 82, 0.3); }
.kpi-icon-wrapper.green { color: var(--whatsapp-green); border-color: rgba(37, 211, 102, 0.5); box-shadow: 0 0 15px rgba(37, 211, 102, 0.3); }
.kpi-icon-wrapper.purple { color: var(--perfume-purple); border-color: rgba(179, 122, 240, 0.5); box-shadow: 0 0 15px rgba(179, 122, 240, 0.3); }

.kpi-details { display: flex; flex-direction: column; }
.kpi-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.kpi-value { font-size: 25px; font-weight: 800; color: var(--text-primary); margin: 3px 0; }
.kpi-subtext { font-size: 12px; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 5px; }

.text-gold { color: var(--gold-primary) !important; font-weight: 700; }
.text-green { color: var(--whatsapp-green) !important; font-weight: 700; }
.text-red { color: var(--debt-red) !important; font-weight: 700; }
.text-blue { color: #3498db !important; }

/* =======================================
   MAIN WORKSPACE SPLIT LAYOUT
   ======================================= */
.main-workspace-grid {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 24px;
    align-items: start;
}

/* Left/Center Column: Table Section */
.table-workspace-section {
    padding: 24px;
}

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

.header-titles h2 { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.header-titles p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* Toolbar Section (Search & Tabs) */
.toolbar-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.25);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

body.light-theme .toolbar-section { background: rgba(255, 255, 255, 0.6); }

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-icon { position: absolute; right: 14px; top: 13px; color: var(--gold-primary); font-size: 16px; }

.search-input-wrapper input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0 42px 0 36px;
    height: 44px;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-input-wrapper input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
}

.btn-clear {
    position: absolute;
    left: 12px;
    top: 12px;
    background: transparent;
    color: var(--debt-red);
    font-size: 16px;
}

/* Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-secondary);
    padding: 9px 15px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

body.light-theme .tab-btn { background: rgba(255, 255, 255, 0.8); }

.tab-btn:hover { background: rgba(163, 125, 86, 0.2); }
.tab-btn.active {
    background: var(--gold-gradient);
    color: #140404;
    border-color: var(--gold-primary);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    font-weight: 800;
}

/* Responsive Table */
.table-responsive-wrapper {
    overflow-x: auto;
}

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

.havana-table th {
    background: rgba(92, 22, 23, 0.95);
    color: var(--gold-primary);
    font-size: 13px;
    font-weight: 800;
    text-align: right;
    padding: 14px 12px;
    border-bottom: 2px solid var(--gold-primary);
    white-space: nowrap;
}

.havana-table th:first-child { border-top-right-radius: 10px; }
.havana-table th:last-child { border-top-left-radius: 10px; }

.havana-table td {
    padding: 15px 12px;
    border-bottom: 1px solid rgba(163, 125, 86, 0.25);
    font-size: 14px;
    vertical-align: middle;
}

.havana-table tr:hover td {
    background: rgba(212, 175, 55, 0.08);
}

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

.badge-perfume { background: rgba(212, 175, 55, 0.15); color: var(--gold-primary); border: 1px solid var(--gold-primary); }
.badge-debt { background: rgba(255, 82, 82, 0.15); color: var(--debt-red); border: 1px solid rgba(255, 82, 82, 0.5); }

.status-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-pending { background: rgba(212, 175, 55, 0.15); color: #f39c12; border: 1px solid rgba(243, 156, 18, 0.4); }
.status-sent { background: rgba(37, 211, 102, 0.15); color: var(--whatsapp-green); border: 1px solid rgba(37, 211, 102, 0.5); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
}
.empty-icon-circle { font-size: 54px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; color: var(--text-primary); margin-bottom: 6px; }
.empty-state p { font-size: 14px; color: var(--text-muted); }

/* =======================================
   RIGHT COLUMN: EDITOR & PHONE MOCKUP
   ======================================= */
.sidebar-editor-section {
    padding: 24px;
    position: sticky;
    top: 92px;
}

.editor-header h3 { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.editor-header p { font-size: 12px; color: var(--text-secondary); margin: 5px 0 16px; }

.template-selector-pills { display: flex; gap: 10px; margin-bottom: 16px; }
.btn-select-pill {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-select-pill:hover { background: rgba(212, 175, 55, 0.12); }
.btn-select-pill.active {
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold-primary);
    border-color: var(--gold-primary);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.25);
}

.config-params-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(163, 125, 86, 0.2);
}

.param-input label, .area-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.input-mini, .input-text, .input-select, .textarea-custom {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    transition: var(--transition);
}

.input-mini:focus, .input-text:focus, .input-select:focus, .textarea-custom:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    outline: none;
}

.font-mono { font-family: monospace; font-weight: 800; color: var(--gold-primary); }

.message-area-wrapper { margin-bottom: 20px; }
.variables-hint {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.tag-var {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-primary);
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 2px 7px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 11px;
    cursor: pointer;
    transition: 0.2s;
}
.tag-var:hover { background: var(--gold-primary); color: #140404; }

/* =======================================
   WHATSAPP MOBILE MOCKUP
   ======================================= */
.mobile-preview-container {
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 18px;
}

.preview-header {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.phone-mockup-body {
    border: 4px solid #2e2621;
    border-radius: 24px;
    overflow: hidden;
    background: #0c1317;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.65);
    position: relative;
}

body.light-theme .phone-mockup-body { border-color: #d6cfc8; }

.whatsapp-app-header {
    background: #202c33;
    color: #ffffff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #2a3942;
}

.wa-back-arrow { font-size: 16px; color: #aebac1; cursor: pointer; }

.wa-avatar-logo img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--gold-primary);
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.5);
}

.wa-sender-details { flex-grow: 1; }
.wa-sender-details strong { display: flex; align-items: center; gap: 5px; font-size: 14px; line-height: 1.2; color: #e9edef; }
.wa-sender-details small { font-size: 11px; color: #25d366; font-weight: 600; }

.verified-badge { color: #25d366; font-size: 13px; }

.wa-actions {
    display: flex;
    gap: 14px;
    color: #aebac1;
    font-size: 16px;
}

.whatsapp-chat-canvas {
    padding: 16px;
    min-height: 210px;
    background-color: #0b141a;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0);
    background-size: 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wa-encryption-note {
    background: #182229;
    color: #ffd279;
    font-size: 10px;
    text-align: center;
    padding: 6px 12px;
    border-radius: 8px;
    line-height: 1.4;
}

.wa-bubble-incoming {
    background: #005c4b;
    color: #e9edef;
    padding: 10px 14px;
    border-radius: 14px 0 14px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    max-width: 90%;
    align-self: flex-start;
}

.wa-bubble-text { font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.wa-bubble-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #8696a0;
    margin-top: 4px;
}

.whatsapp-footer-bar {
    background: #202c33;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wa-input-box-mock {
    flex-grow: 1;
    background: #2a3942;
    padding: 8px 14px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #8696a0;
    font-size: 13px;
}

.wa-input-box-mock span { flex-grow: 1; padding: 0 10px; color: #8696a0; text-align: right; }
.wa-mic-btn-mock {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #00a884;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* =======================================
   MODALS & TOASTS
   ======================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: var(--transition);
}

.modal-overlay.hidden { opacity: 0; pointer-events: none; }

.modal-box {
    width: 100%;
    max-width: 550px;
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--gold-primary);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.8);
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-size: 18px; color: var(--gold-primary); font-weight: 800; }
.btn-close { background: transparent; font-size: 24px; color: var(--text-muted); }
.btn-close:hover { color: var(--debt-red); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* Batch modal specific */
.batch-box { text-align: center; max-width: 480px; }
.batch-logo-spin img { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--gold-primary); animation: spin 4s linear infinite; margin-bottom: 14px; }

@keyframes spin { to { transform: rotate(360deg); } }

.batch-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.6; }
.progress-container { width: 100%; height: 12px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.progress-bar { height: 100%; width: 0%; background: var(--gold-gradient); transition: width 0.3s ease; }

.batch-status-text { font-size: 14px; margin-bottom: 12px; font-weight: 600; }
.batch-countdown-ring { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin-bottom: 22px; background: rgba(0, 0, 0, 0.3); padding: 10px 18px; border-radius: 30px; display: inline-block; }

/* Toast */
.toast {
    position: fixed;
    bottom: 25px; left: 25px;
    background: #1c0505; border: 2px solid var(--gold-primary);
    color: #ffffff; padding: 14px 24px; border-radius: 12px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7);
    display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 14px;
    z-index: 20000; transition: all 0.3s ease;
}

.toast.hidden { opacity: 0; transform: translateY(80px); pointer-events: none; }

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* Responsive Design */
@media (max-width: 1100px) {
    .main-workspace-grid { grid-template-columns: 1fr; }
    .sidebar-editor-section { position: relative; top: 0; }
    .top-navbar { padding: 12px 16px; flex-direction: column; gap: 12px; text-align: center; }
}
@media (max-width: 600px) {
    .form-row, .config-params-row { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: 1fr; }
}
