/* ==========================================================================
   ZAPFLOW PREMIUM STYLE SYSTEM (VANILLA CSS)
   ========================================================================== */

/* 1. RESET & VARIABLE TOKENS */
:root {
    --bg-main: #090710;
    --bg-sidebar: #0e0a1b;
    --bg-card: rgba(20, 16, 36, 0.65);
    --bg-card-hover: rgba(30, 25, 52, 0.8);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-active: rgba(138, 43, 226, 0.4);
    
    --color-primary: #8a2be2;
    --color-primary-glow: rgba(138, 43, 226, 0.35);
    --color-primary-light: #a855f7;
    --color-secondary: #1f1b2e;
    
    --color-success: #10b981;
    --color-success-glow: rgba(16, 185, 129, 0.2);
    --color-danger: #ef4444;
    --color-danger-glow: rgba(239, 68, 68, 0.2);
    --color-warning: #f59e0b;
    --color-warning-glow: rgba(245, 158, 11, 0.2);
    --color-info: #3b82f6;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-hint: #6b7280;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    --glass-blur: blur(16px);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --input-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.2);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    height: 100vh;
}

/* 2. LAYOUT STRUCTURAL */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* SIDEBAR STYLES */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), #d946ef);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--color-primary-glow);
}

.brand-logo i {
    color: #fff;
    font-size: 20px;
    animation: pulse-glow 2s infinite ease-in-out;
}

.brand h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
}

.brand h2 span {
    background: linear-gradient(135deg, var(--color-primary-light), #d946ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Connection Widget */
.connection-widget {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    transition: var(--transition-smooth);
}

.connection-widget.connected {
    background: rgba(16, 185, 129, 0.04);
    border-color: rgba(16, 185, 129, 0.2);
}

.connection-widget.disconnected {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.2);
}

.connection-widget.connecting, .connection-widget.qrcode {
    background: rgba(245, 158, 11, 0.04);
    border-color: rgba(245, 158, 11, 0.2);
}

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

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-hint);
    display: inline-block;
}

.connected .status-dot {
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
    animation: pulse-green 1.5s infinite;
}

.disconnected .status-dot {
    background-color: var(--color-danger);
    box-shadow: 0 0 8px var(--color-danger);
    animation: pulse-red 1.5s infinite;
}

.connecting .status-dot, .qrcode .status-dot {
    background-color: var(--color-warning);
    box-shadow: 0 0 8px var(--color-warning);
    animation: pulse-amber 1.5s infinite;
}

.status-text {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.2px;
}

.device-info {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Nav Menu Links */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.nav-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.02);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(138, 43, 226, 0.15) 0%, rgba(138, 43, 226, 0.03) 100%);
    border-color: rgba(138, 43, 226, 0.2);
    box-shadow: inset 3px 0 0 var(--color-primary);
}

.nav-link.active i {
    color: var(--color-primary-light);
    filter: drop-shadow(0 0 4px var(--color-primary-glow));
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-hint);
    text-align: center;
}

/* MAIN CONTENT STYLES */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
}

.app-header {
    height: 80px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(14, 10, 27, 0.5);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.header-title h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.header-title p {
    font-size: 12px;
    color: var(--text-muted);
}

.quick-stats {
    display: flex;
    gap: 20px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 10px;
}

.stat-badge i {
    font-size: 16px;
}

.stat-value {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    line-height: 1;
}

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

.text-purple { color: var(--color-primary-light); }
.text-blue { color: var(--color-info); }

/* PANELS WRAPPER */
.tab-panels {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease;
    height: 100%;
}

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

/* 3. CARD & UI COMPONENT LIBRARY */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.glass-card {
    backdrop-filter: var(--glass-blur);
}

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

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

.card-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 24px;
}

.card-body.centrar-flex {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

.card-body.no-padding {
    padding: 0;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #a855f7 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--color-secondary);
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-large {
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 6px;
}

/* 4. UTILITIES & LAYOUTS */
.grid-2col {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
}

.mt-4 { margin-top: 24px; }
.mb-4 { margin-bottom: 24px; }
.mr-3 { margin-right: 16px; }
.mr-2 { margin-right: 8px; }
.ml-1 { margin-left: 4px; }
.no-padding { padding: 0 !important; }
.relative-pos { position: relative; }
.flex-space { display: flex; justify-content: space-between; align-items: center; }
.flex-align { display: flex; align-items: center; }
.height-fit { height: fit-content; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--color-success); }
.text-green { color: var(--color-success); }
.max-w-400 { max-width: 400px; }

/* 5. CONNECTION STATE VIEWS */
.connect-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 450px;
    animation: fadeIn 0.4s ease;
}

.connect-state h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    margin-top: 16px;
    color: #fff;
}

.connect-state p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
}

.status-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.status-icon.pulse-red {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    box-shadow: 0 0 0 0 var(--color-danger-glow);
    animation: pulse-red-icon 2s infinite;
}

.status-icon.pulse-green {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    box-shadow: 0 0 0 0 var(--color-success-glow);
    animation: pulse-green-icon 2s infinite;
}

/* Spinner Loader */
.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-top: 4px solid var(--color-primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* QR Code Display */
.qr-container {
    background-color: #fff;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 4px solid var(--color-primary-light);
    position: relative;
    width: 250px;
    height: 250px;
}

.qr-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(9, 7, 16, 0.9);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    gap: 12px;
}

.qr-overlay i {
    font-size: 28px;
    animation: spin 1.5s linear infinite;
    color: var(--color-primary-light);
}

.connected-device-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.device-icon {
    width: 48px;
    height: 48px;
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.device-details {
    text-align: left;
}

.device-details h4 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.device-details p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* Guidelines */
.info-step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.info-step:last-child {
    margin-bottom: 0;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--color-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary-light);
    font-family: var(--font-heading);
    font-weight: 700;
    flex-shrink: 0;
}

.info-step h4 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.info-step p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 6. AUTOMATION FLOWS LIST SCREEN */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-bar h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.flows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.flow-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.flow-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-active);
    box-shadow: 0 10px 25px rgba(138, 43, 226, 0.15);
    background-color: var(--bg-card-hover);
}

.flow-card.inactive {
    opacity: 0.65;
}

.flow-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.flow-card-title h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.flow-card-title span {
    font-size: 11px;
    color: var(--text-hint);
}

/* Switch Toggle Button */
.switch-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.switch-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.switch-container input {
    display: none;
}

.slider {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 34px;
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background-color: var(--color-success);
    border-color: transparent;
}

input:checked + .slider:before {
    transform: translateX(18px);
    background-color: #fff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.flow-card-body {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.flow-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

.flow-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flow-meta-item i {
    width: 14px;
    text-align: center;
    color: var(--color-primary-light);
}

.flow-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 14px;
}

/* Badge tags */
.badge {
    background-color: var(--color-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-trigger {
    background-color: rgba(138, 43, 226, 0.1);
    border-color: rgba(138, 43, 226, 0.2);
    color: var(--color-primary-light);
}

.no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-hint);
    width: 100%;
    grid-column: 1 / -1;
}

.no-data i {
    font-size: 40px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.03);
}

/* 7. FLOWS EDITOR VIEW */
.grid-layout-editor {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: flex-start;
}

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

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

.form-control {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 13px;
    transition: var(--transition-fast);
    box-shadow: var(--input-shadow);
}

.form-control:focus {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 10px var(--color-primary-glow);
}

.input-help {
    display: block;
    font-size: 11px;
    color: var(--text-hint);
    margin-top: 6px;
    line-height: 1.4;
}

/* Dropdown Menu step creation */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #120e24;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 220px;
    box-shadow: 0px 8px 24px 0px rgba(0,0,0,0.5);
    border-radius: 10px;
    z-index: 100;
    overflow: hidden;
    margin-top: 6px;
    backdrop-filter: blur(10px);
}

.dropdown-content a {
    color: var(--text-muted);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 12px;
    transition: var(--transition-fast);
}

.dropdown-content a i {
    width: 16px;
    text-align: center;
    color: var(--color-primary-light);
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.dropdown-content.show {
    display: block;
}

/* TIMELINE BUILDER */
.timeline {
    position: relative;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.timeline:before {
    content: '';
    position: absolute;
    left: 4px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(180deg, var(--color-primary) 0%, #d946ef 50%, var(--color-secondary) 100%);
    border-radius: 2px;
}

.timeline-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-hint);
    text-align: center;
}

.timeline-empty i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.15;
}

/* Step cards inside timeline */
.timeline-item {
    position: relative;
    animation: slideIn 0.3s ease;
}

.timeline-marker {
    position: absolute;
    left: -24px;
    top: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--bg-main);
    border: 2px solid var(--color-primary-light);
    z-index: 2;
    box-shadow: 0 0 6px var(--color-primary-light);
    transition: var(--transition-smooth);
}

.timeline-item:hover .timeline-marker {
    background-color: var(--color-primary-light);
    transform: scale(1.2);
}

.step-card {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.step-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.03);
}

.step-header {
    background-color: rgba(0, 0, 0, 0.15);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step-header-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--color-secondary);
    color: var(--color-primary-light);
    font-size: 10px;
    font-weight: 700;
    border: 1px solid var(--border-color);
}

.step-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.btn-icon.delete:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
}

.step-body {
    padding: 16px;
}

.step-body-inline {
    display: flex;
    gap: 16px;
    align-items: center;
}

.step-body-inline .form-group {
    margin-bottom: 0;
    flex-grow: 1;
}

.step-body-inline .form-group.width-small {
    flex-grow: 0;
    width: 120px;
}

/* 8. AUDIO LIBRARY SCREEN */
.grid-layout-audios {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 30px;
    align-items: flex-start;
}

/* Upload Area Zone */
.upload-zone {
    border: 2px dashed rgba(138, 43, 226, 0.3);
    background-color: rgba(138, 43, 226, 0.02);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--color-primary-light);
    background-color: rgba(138, 43, 226, 0.06);
    transform: scale(1.01);
}

.upload-icon {
    font-size: 40px;
    color: var(--color-primary-light);
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 10px var(--color-primary-glow));
    animation: float 3s ease-in-out infinite;
}

.upload-zone h4 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.upload-zone p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-limits {
    font-size: 10px;
    color: var(--text-hint);
}

/* Progress bar uploading */
.upload-progress-wrapper {
    margin-top: 20px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 8px;
}

.upload-progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 8px;
}

.file-name {
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
}

.progress-percent {
    color: var(--color-primary-light);
}

.progress-bar-bg {
    height: 6px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, #d946ef 100%);
    border-radius: 4px;
    transition: width 0.1s ease;
}

/* Audios List container */
.audios-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 550px;
    overflow-y: auto;
    padding-right: 6px;
}

/* Custom Webkit scrollbars for list and terminal */
.audios-list::-webkit-scrollbar, .terminal-body::-webkit-scrollbar, .tab-panels::-webkit-scrollbar {
    width: 6px;
}
.audios-list::-webkit-scrollbar-track, .terminal-body::-webkit-scrollbar-track, .tab-panels::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
}
.audios-list::-webkit-scrollbar-thumb, .terminal-body::-webkit-scrollbar-thumb, .tab-panels::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}
.audios-list::-webkit-scrollbar-thumb:hover, .terminal-body::-webkit-scrollbar-thumb:hover, .tab-panels::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-glow);
}

.audio-item {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-fast);
}

.audio-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(138, 43, 226, 0.2);
}

.audio-item-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background-color: rgba(138, 43, 226, 0.1);
    color: var(--color-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.audio-item-details {
    flex-grow: 1;
    overflow: hidden;
}

.audio-item-details h4 {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.audio-item-details p {
    font-size: 10px;
    color: var(--text-hint);
}

.audio-item-player {
    display: flex;
    align-items: center;
}

/* Beautiful audio component wrapper */
audio {
    height: 32px;
    width: 220px;
    border-radius: 8px;
    background-color: rgba(0,0,0,0.4);
}

/* 9. REAL-TIME LOGS TERMINAL */
.terminal-card {
    height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

.terminal-card .card-body {
    flex-grow: 1;
    overflow: hidden;
}

.terminal-body {
    background-color: #050308;
    color: #f3f4f6;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.8);
}

.log-line {
    display: flex;
    gap: 10px;
    line-height: 1.5;
    animation: fadeIn 0.1s ease;
}

.log-time {
    color: var(--text-hint);
    flex-shrink: 0;
}

.log-tag {
    font-weight: bold;
    flex-shrink: 0;
    font-size: 11px;
}

.log-msg {
    color: #e5e7eb;
    word-break: break-all;
}

/* Color schemes for log types */
.tag-system { color: #ec4899; }
.log-line.SUCCESS .log-tag { color: var(--color-success); }
.log-line.SUCCESS .log-msg { color: #a7f3d0; }
.log-line.INFO .log-tag { color: var(--color-info); }
.log-line.INFO .log-msg { color: #dbeafe; }
.log-line.WARNING .log-tag { color: var(--color-warning); }
.log-line.WARNING .log-msg { color: #fef3c7; }
.log-line.ERROR .log-tag { color: var(--color-danger); }
.log-line.ERROR .log-msg { color: #fee2e2; }

/* Pulse animation on Live Log Badge */
.console-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-success);
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 12px;
}

.pulse-green-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-success);
    animation: pulse-green 1.5s infinite;
}

/* 10. TOAST SYSTEM */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    background-color: #120e24;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border-left: 4px solid var(--color-primary-light);
    border-radius: 8px;
    padding: 14px 20px;
    color: #fff;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
}

.toast.success { border-left-color: var(--color-success); }
.toast.danger { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }

.toast i {
    font-size: 16px;
    flex-shrink: 0;
}

.toast.success i { color: var(--color-success); }
.toast.danger i { color: var(--color-danger); }
.toast.warning i { color: var(--color-warning); }

/* 11. KEYFRAME ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 4px var(--color-primary-glow)); }
    50% { filter: drop-shadow(0 0 10px var(--color-primary-light)); }
}

@keyframes pulse-green {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-red {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes pulse-amber {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes pulse-red-icon {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes pulse-green-icon {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* DRAG & DROP FOR TIMELINE CARDS */
.drag-handle {
    cursor: grab;
    transition: var(--transition-fast);
}
.drag-handle:active {
    cursor: grabbing;
}
.drag-handle:hover {
    color: var(--color-primary-light) !important;
}

.timeline-item.dragging {
    opacity: 0.35;
    transform: scale(0.98);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.timeline-item.drag-over {
    border-top: 3px solid var(--color-primary-light);
    margin-top: -3px; /* Evita que o layout pule ao adicionar a borda */
}

/* ==========================================================================
   7. CHAT SIMULATOR STYLES (WHATSAPP PREMIUM FEEL)
   ========================================================================== */
.phone-simulator-card {
    height: 600px;
    display: flex;
    flex-direction: column;
    background: #0b141a !important; /* WhatsApp Dark Mode Background */
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 0 !important;
}

.phone-header {
    background: #202c33;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.phone-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.phone-avatar {
    width: 38px;
    height: 38px;
    background-color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 0 10px var(--color-primary-glow);
}

.phone-username {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    margin: 0;
}

.phone-status {
    font-size: 11px;
    color: var(--color-success);
    display: block;
}

.phone-status.typing {
    animation: pulse-opacity 1s infinite alternate;
}

.phone-actions {
    display: flex;
    gap: 18px;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
}

.phone-actions i:hover {
    color: #fff;
}

.phone-chat-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #0b141a;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
    background-size: 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-system-msg {
    align-self: center;
    background-color: #182229;
    color: #ffd279;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 8px;
    text-align: center;
    max-width: 85%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.sim-message {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    word-break: break-word;
}

.sim-message.sent {
    align-self: flex-end;
    background-color: #005c4b; /* WhatsApp Green Sent Bubble */
    color: #e9edef;
    border-top-right-radius: 0;
}

.sim-message.received {
    align-self: flex-start;
    background-color: #202c33; /* WhatsApp Gray Received Bubble */
    color: #e9edef;
    border-top-left-radius: 0;
}

.sim-message-time {
    display: block;
    font-size: 9.5px;
    color: rgba(255,255,255,0.4);
    text-align: right;
    margin-top: 4px;
}

.phone-footer {
    background-color: #202c33;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.phone-input {
    flex-grow: 1;
    background-color: #2a3942;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 13.5px;
}

.phone-input::placeholder {
    color: #8696a0;
}

.btn-send-sim {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--color-primary);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 10px var(--color-primary-glow);
    transition: var(--transition-fast);
}

.btn-send-sim:hover {
    transform: scale(1.05);
    background-color: var(--color-primary-light);
}

/* Audio simulated bubble style */
.sim-audio-bubble {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    min-width: 250px;
}

.sim-audio-icon {
    font-size: 24px;
    color: #53bdeb; /* Blue wave color on WA */
}

.sim-audio-player {
    outline: none;
    height: 32px;
    width: 100%;
}

.sim-media-image {
    max-width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 6px;
    display: block;
}

.sim-media-video {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    margin-bottom: 6px;
    display: block;
}

/* Typing bubble style */
.typing-bubble {
    align-self: flex-start;
    background-color: #202c33;
    padding: 10px 16px;
    border-radius: 12px;
    border-top-left-radius: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dot-anim {
    width: 6px;
    height: 6px;
    background-color: #8696a0;
    border-radius: 50%;
    animation: typing-dots 1s infinite alternate;
}

.dot-anim:nth-child(2) { animation-delay: 0.2s; }
.dot-anim:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dots {
    0% { transform: translateY(0); opacity: 0.4; }
    100% { transform: translateY(-4px); opacity: 1; }
}

@keyframes pulse-opacity {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* ==========================================================================
   8. VISUAL NODE EDITOR STYLES (n8n & TYPEBOT GLOW)
   ========================================================================== */
#drawflow {
    background-color: #080512;
    background-image: radial-gradient(rgba(138, 43, 226, 0.15) 1.5px, transparent 0);
    background-size: 24px 24px;
    width: 100%;
    height: 100%;
    position: relative;
    user-select: none;
}

/* Customizing Connection Paths (n8n curves) */
.drawflow .connection .main-path {
    stroke: var(--color-primary-light);
    stroke-width: 3px;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px var(--color-primary-glow));
    transition: stroke 0.2s, stroke-width 0.2s;
}

.drawflow .connection .main-path:hover {
    stroke: #d946ef;
    stroke-width: 4px;
    filter: drop-shadow(0 0 8px rgba(217, 70, 239, 0.6));
}

/* Customizing Ports / Points */
.drawflow .point {
    background-color: #1a162b;
    border: 2px solid var(--color-primary-light);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: transform 0.2s, background-color 0.2s;
    top: -3px; /* Centralizar com a borda lateral */
}

.drawflow .point:hover {
    transform: scale(1.3);
    background-color: var(--color-primary-light);
    box-shadow: 0 0 8px var(--color-primary-glow);
}

/* Node Container Styles */
.drawflow .drawflow-node {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: auto !important;
}

.canvas-node-card {
    background: rgba(20, 16, 36, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    backdrop-filter: var(--glass-blur);
    width: 220px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.drawflow .drawflow-node.selected .canvas-node-card {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 20px var(--color-primary-glow);
}

/* Node Header Styles */
.canvas-node-card .node-header {
    padding: 10px 14px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.8px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.canvas-node-card.trigger-node {
    border-color: rgba(138, 43, 226, 0.4);
}

.canvas-node-card.trigger-node .node-header {
    background: #8a2be2;
    box-shadow: 0 2px 10px rgba(138, 43, 226, 0.3);
}

/* Node Body Styles */
.canvas-node-card .node-body {
    padding: 12px 14px;
    background: rgba(10, 8, 20, 0.6);
}

.canvas-node-card .node-body label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.canvas-node-card .node-body .form-control {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    width: 100%;
}

.canvas-node-card .node-body .form-control:focus {
    border-color: var(--color-primary-light);
    background-color: rgba(255, 255, 255, 0.06);
}

.canvas-node-card .node-body select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 28px;
}

.canvas-node-card .node-body .input-help {
    font-size: 9.5px;
    color: var(--text-hint);
    display: block;
    margin-top: 4px;
    line-height: 1.3;
}

/* Customizing Drawflow default UI buttons */
.drawflow-delete {
    background: var(--color-danger) !important;
    border: 2px solid #fff !important;
    color: #fff !important;
    font-size: 12px !important;
    line-height: 18px !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    box-shadow: 0 0 10px var(--color-danger-glow) !important;
    transition: transform 0.2s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.drawflow-delete:hover {
    transform: scale(1.2) !important;
}

/* Disable visual grids from timeline since it's a 2D canvas now */
.grid-layout-editor {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    height: calc(100vh - 120px);
    overflow: hidden;
}

.grid-layout-editor > .card {
    height: 100% !important;
    margin-bottom: 0 !important;
}

/* PREMIUM CONTEXT MENU FOR DRAWFLOW */
.glass-context-menu {
    background: rgba(13, 8, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(138, 43, 226, 0.4);
    border-radius: 10px;
    padding: 6px 0;
    width: 190px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(138, 43, 226, 0.2);
    display: none;
    flex-direction: column;
}

.glass-context-menu-item {
    padding: 10px 16px;
    color: #cbd5e1;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.glass-context-menu-item i {
    width: 14px;
    text-align: center;
    font-size: 13px;
}

.glass-context-menu-item:hover {
    background: rgba(138, 43, 226, 0.25);
    color: #fff;
    padding-left: 20px;
}

.glass-context-menu-item.danger {
    color: #f87171;
}

.glass-context-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding-left: 20px;
}

/* 12. PREMIUM GLASSMORIAL HISTORY DIALOG */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.modal-backdrop .modal-card {
    width: min(480px, 92vw);
    background: rgba(18, 12, 38, 0.95);
    border: 1px solid rgba(138, 43, 226, 0.35);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(138, 43, 226, 0.15);
    border-radius: 16px;
    overflow: hidden;
    animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header .modal-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-fast);
}

.modal-close-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.modal-body {
    padding: 24px;
}

.triggered-contacts-list {
    max-height: 220px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.triggered-contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-family: 'Consolas', monospace;
    font-size: 13px;
    color: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s;
}

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

.triggered-contact-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.triggered-contact-item .contact-phone {
    font-weight: 500;
    color: #fff;
}

.triggered-contact-item .btn-delete-single-history {
    background: transparent;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    font-size: 13px;
    opacity: 0.7;
    transition: var(--transition-fast);
}

.triggered-contact-item .btn-delete-single-history:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* 13. FULL SCREEN N8N FLOW EDITOR */
.app-container.editing-mode .sidebar {
    display: none !important;
}

.app-container.editing-mode .main-content {
    padding: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    width: 100vw !important;
}

.app-container.editing-mode .tab-panels {
    padding: 0 !important;
    overflow: hidden !important;
    height: 100vh !important;
}

.app-container.editing-mode .app-header {
    display: none !important;
}

.app-container.editing-mode #panel-flows {
    height: 100vh !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
}

.app-container.editing-mode #flow-editor-view {
    height: 100vh !important;
    width: 100vw !important;
    display: flex !important;
    flex-direction: column !important;
}

.app-container.editing-mode #flow-editor-view .action-bar {
    height: 60px !important;
    padding: 0 24px !important;
    margin-bottom: 0 !important;
    background: rgba(10, 8, 24, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    z-index: 1000 !important;
}

.app-container.editing-mode .grid-layout-editor {
    height: calc(100vh - 60px) !important;
    grid-template-columns: 320px 1fr !important;
    gap: 0 !important;
    width: 100vw !important;
}

.app-container.editing-mode .grid-layout-editor > .card.glass-card:first-child {
    background: rgba(14, 10, 32, 0.95) !important;
    border: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 0 !important;
    padding: 24px !important;
    height: 100% !important;
    overflow-y: auto !important;
    box-shadow: none !important;
}

.app-container.editing-mode .grid-layout-editor > .card.glass-card:last-child {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.app-container.editing-mode .grid-layout-editor > .card.glass-card:last-child .card-header {
    background: rgba(15, 11, 35, 0.5) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 12px 24px !important;
}
/* 10. KANBAN BOARD STYLES */
.kanban-board {
    display: flex;
    gap: 24px;
    height: calc(100vh - 200px);
    overflow-x: auto;
    padding-bottom: 20px;
}

.kanban-column {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-width: 320px;
    max-width: 350px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.kanban-col-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px 12px 0 0;
}

.kanban-col-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.kanban-col-body {
    padding: 16px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 14px;
    transition: var(--transition-fast);
}

.kanban-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.kanban-card-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    font-size: 13px;
}

.kanban-card-info {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

/* ==========================================================================
   11. RESPONSIVE DESIGN (MOBILE APP MODE)
   ========================================================================== */

@media (max-width: 900px) {
    /* 1. Reset estrutural */
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .app-container {
        display: block !important;
        width: 100%;
        height: auto;
    }

    /* 2. Menu Inferior Estilo App */
    .sidebar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 65px !important;
        z-index: 9999 !important;
        background: #0f0f13 !important;
        border-top: 1px solid rgba(255,255,255,0.1) !important;
        border-right: none !important;
        display: flex !important;
        flex-direction: row !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    }

    .sidebar-header, .sidebar-footer, .nav-divider, #btn-logout {
        display: none !important;
    }

    .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        justify-content: space-around !important;
        align-items: center !important;
    }

    .nav-link {
        flex: 1;
        height: 100%;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 4px !important;
        border-radius: 0 !important;
        font-size: 10px !important;
        background: transparent !important;
    }

    .nav-link i {
        font-size: 20px !important;
        margin: 0 !important;
    }

    .nav-link.active {
        background: rgba(124, 77, 255, 0.1) !important;
        color: var(--accent-color) !important;
    }

    /* 3. Conteúdo Principal */
    .main-content {
        width: 100% !important;
        padding: 15px !important;
        padding-bottom: 80px !important; /* Espaço para o menu inferior */
        box-sizing: border-box;
    }

    .header-content {
        flex-direction: column !important;
        text-align: center;
        gap: 15px !important;
    }

    .header-right {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100% !important;
    }

    .stats-card {
        flex: 1;
        min-width: 120px;
        padding: 10px !important;
    }

    /* 4. Grades e Cards */
    .connection-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px;
    }

    .card {
        width: 100% !important;
        margin: 0 !important;
    }

    /* 5. Editor de Fluxo (Simplificado no Mobile) */
    .app-container.editing-mode .grid-layout-editor {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    .app-container.editing-mode .grid-layout-editor > .card:first-child {
        display: none !important; /* Esconde lista de blocos */
    }

    #drawflow {
        height: 60vh !important;
    }
}



