:root {
    /* Brand Colors */
    --primary: #3470e4;
    --primary-hover: #295cc4;
    --primary-light: #e8effc;
    
    /* Layout Colors */
    --bg-dark: #3867d6; /* Sidebar left */
    --bg-main: #f8fafc; /* Main background */
    --bg-white: #ffffff;
    
    /* Text Colors */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #f1f5f9;
    
    /* UI Colors */
    --border: #e2e8f0;
    --success: #22c55e;
    --success-bg: #e8f5e9;
    --warning: #f59e0b;
    --warning-bg: #fff8e1;
    --danger: #ef4444;
    --whatsapp: #25d366;
    
    /* Dimensions */
    --sidebar-width: 240px;
    --list-width: 320px;
    --drawer-width: 340px;
    --header-height: 64px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
}

/* Base Components */
button {
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: none;
    background: none;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s;
    font-size: 20px;
}
.icon-btn:hover {
    background-color: var(--bg-main);
    color: var(--primary);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary-circle {
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(52, 112, 228, 0.3);
}
.btn-primary-circle:hover {
    background-color: var(--primary-hover);
    color: white;
}

.btn-outline {
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 20px;
    font-weight: 500;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    color: var(--text-main);
    transition: 0.2s;
}
.btn-outline:hover {
    border-color: var(--text-muted);
}
.btn-outline.btn-danger {
    color: var(--danger);
    border-color: #fca5a5;
}
.btn-outline.btn-danger:hover {
    background: #fef2f2;
}

.badge {
    background: var(--success);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
}

/* Avatares */
.avatar-sm, .avatar-md, .large-avatar {
    position: relative;
    border-radius: 50%;
    flex-shrink: 0;
}
.avatar-sm img, .avatar-md img, .large-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 44px; height: 44px; }
.large-avatar { width: 80px; height: 80px; }

.status-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
}
.status-indicator.online { background-color: var(--success); }

.channel-badge {
    position: absolute;
    bottom: -4px;
    left: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    border: 2px solid white;
}
.channel-badge.whatsapp { background-color: var(--whatsapp); }

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-dark);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s;
}

.brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 24px;
    font-weight: 700;
    gap: 8px;
}
.brand i { font-size: 28px; }

.menu {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s;
}
.menu a i { font-size: 20px; }
.menu a:hover:not(.disabled) {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}
.menu a.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}
.menu a.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: line-through;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sidebar-footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-footer a:hover { color: white; }
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
}
.user-profile:hover { background-color: rgba(255,255,255,0.1); }
.user-profile span { flex: 1; font-weight: 500; font-size: 14px; }


/* --- Main Content Area --- */
.main-content {
    flex: 1;
    display: flex;
    background-color: var(--bg-white);
    position: relative;
    overflow: hidden;
}

/* --- Panel 1: Lista de Conversas --- */
.conversations-panel {
    width: var(--list-width);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: white;
}

.conversations-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
}
.conversations-header h2 { font-size: 18px; font-weight: 600; }
.header-actions { display: flex; gap: 4px; }

.search-bar {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}
.search-bar > i { color: var(--text-muted); cursor: pointer; }
.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.search-input-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
}
.search-input-wrapper input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 20px;
    outline: none;
    font-family: 'Inter';
    transition: 0.2s;
}
.search-input-wrapper input:focus { border-color: var(--primary); }

.tabs {
    display: flex;
    padding: 12px 20px;
    gap: 8px;
    background-color: white;
    border-bottom: 1px solid var(--border);
}
.tabs button {
    flex: 1;
    padding: 8px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tabs button.active {
    background-color: var(--primary);
    color: white;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}
.conversation-item {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bg-main);
    cursor: pointer;
    transition: background 0.2s;
}
.conversation-item:hover { background-color: var(--bg-main); }
.conversation-item.active { background-color: var(--primary-light); }

.conversation-info {
    flex: 1;
    overflow: hidden;
}
.conv-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}
.conv-header .name { font-weight: 600; font-size: 15px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-header .time { font-size: 12px; color: var(--text-muted); }

.conv-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.preview-text {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}
.preview-text i { color: var(--primary); font-size: 14px; }

.tag-pill {
    font-size: 11px;
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 12px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* --- Panel 2: Área de Chat --- */
#app {
    display: flex;
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-main);
    overflow: hidden;
}

.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* =========================================
   LOGIN VIEW
========================================= */
.login-view {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    font-family: 'Inter', sans-serif;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box .brand {
    color: var(--primary);
    font-size: 32px;
    justify-content: center;
    margin-bottom: 20px;
}

.login-box h2 {
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-box p {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 30px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.login-form .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-form .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: var(--transition-fast);
}

.login-form .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.login-form .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    justify-content: center;
    margin-top: 10px;
}

.error-msg {
    background-color: #fee2e2;
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================================
   SIDEBAR
========================================= */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    position: relative;
}

.no-chat-selected {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.placeholder-graphics {
    margin-bottom: 32px;
    position: relative;
    width: 280px;
    height: 140px;
}
.mock-message {
    width: 200px;
    height: 48px;
    border-radius: 12px;
    background: white;
    position: absolute;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.mock-left { top: 0; left: 0; }
.mock-right { bottom: 0; right: 0; background: var(--bg-white); }
.no-chat-selected h2 { font-weight: 600; font-size: 20px; color: var(--text-main); }

.chat-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}
.contact-brief {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.contact-brief h3 { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.chat-actions { display: flex; gap: 4px; }

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 24px 24px;
}

.date-separator {
    text-align: center;
    margin: 16px 0;
    position: relative;
}
.date-separator span {
    background: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.message-wrapper { display: flex; gap: 8px; margin-bottom: 8px; }
.msg-in { justify-content: flex-start; }
.msg-out { justify-content: flex-end; }
.msg-system { justify-content: center; }

.system-text {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.message-bubble {
    max-width: 65%;
    padding: 12px 16px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.msg-in .message-bubble {
    background: white;
    border-top-left-radius: 4px;
}
.msg-out .message-bubble {
    background: var(--success-bg);
    border-top-right-radius: 4px;
}
.msg-note .message-bubble {
    background: var(--warning-bg);
    border: 1px dashed #fcd34d;
}

.message-text { font-size: 15px; line-height: 1.5; color: var(--text-main); word-wrap: break-word; }
.message-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}
.message-meta i { font-size: 14px; color: var(--primary); }

.avatar-xs {
    width: 24px;
    height: 24px;
    align-self: flex-end;
}
.avatar-xs img { width: 100%; height: 100%; border-radius: 50%; }

/* Área de Input */
.input-area {
    background: white;
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    margin: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.05);
    transition: background 0.3s;
}
.input-area.is-note { background: #fffdf5; border-color: #fef08a; }

.input-toolbar-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.toggle-switch input { display: none; }
.slider {
    width: 36px;
    height: 20px;
    background-color: var(--border);
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
}
.slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .slider { background-color: var(--primary); }
.toggle-switch input:checked + .slider::before { transform: translateX(16px); }
.toggle-switch .label { font-size: 14px; font-weight: 500; }

.compose-tabs {
    display: flex;
    background: var(--bg-main);
    border-radius: 20px;
    padding: 2px;
}
.compose-tabs button {
    padding: 6px 16px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.compose-tabs button.active {
    background: var(--primary);
    color: white;
}
.input-area.is-note .compose-tabs button.active {
    background: var(--warning);
}

.input-area textarea {
    width: 100%;
    border: none;
    resize: none;
    height: 60px;
    outline: none;
    font-family: 'Inter';
    font-size: 15px;
    background: transparent;
}

.input-toolbar-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.left-actions { display: flex; gap: 4px; }
.send-btn, .mic-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.2s;
}
.send-btn:hover, .mic-btn:hover { transform: scale(1.05); }


/* --- Panel 3: Gaveta Direita --- */
.details-drawer {
    width: var(--drawer-width);
    background: white;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: absolute;
    right: -100%;
    top: 0;
    height: 100%;
    transition: right 0.3s ease;
    z-index: 10;
    box-shadow: -10px 0 30px rgba(0,0,0,0.05);
}
.details-drawer.open { right: 0; }

.drawer-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.close-drawer {
    position: absolute;
    top: 16px;
    left: 16px;
}
.edit-btn {
    position: absolute;
    top: 16px;
    right: 16px;
}
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 16px;
}
.profile-header h2 { font-size: 18px; font-weight: 600; margin-top: 12px; }
.profile-header p { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.profile-header .lid { font-size: 12px; color: #94a3b8; }

.drawer-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}
.drawer-tabs button {
    flex: 1;
    padding: 16px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
}
.drawer-tabs button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
.section { margin-bottom: 24px; }
.section h4 { font-size: 13px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 12px; }
.add-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px dashed var(--text-muted);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
}
.section.expandable {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
}
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--primary);
}
.section-header .caret { margin-left: auto; color: var(--text-muted); }

.info-fields {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}
.field {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.field:last-child { border-bottom: none; }
.field label { color: var(--text-muted); }
.field .value { font-weight: 500; display: flex; align-items: center; gap: 4px; }
.field .action { color: var(--primary); cursor: pointer; }

.drawer-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* --- Agentes de IA View --- */
.bg-light { background-color: var(--bg-main); }
.ai-agents-view {
    flex-direction: column;
    overflow-y: auto;
}
.ai-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    flex-shrink: 0;
}
.breadcrumb { font-size: 14px; color: var(--text-muted); }
.breadcrumb .brand-text { font-weight: 700; color: var(--primary); }
.breadcrumb .current { color: var(--text-main); font-weight: 500; }
.credits-info { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.btn-outline-small {
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    background: white;
}

.ai-content-wrapper { padding: 32px; max-width: 1200px; margin: 0 auto; width: 100%; }
.ai-title-section h1 { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.ai-title-section p { color: var(--text-muted); line-height: 1.6; max-width: 800px; margin-bottom: 32px; }

.banner-blue {
    background: var(--primary-light);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    margin-bottom: 32px;
}
.banner-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.banner-text h4 { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--primary); }
.banner-text p { color: var(--text-main); margin-bottom: 16px; font-size: 14px; }
.close-banner { position: absolute; top: 16px; right: 16px; }

.ai-list-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    overflow: hidden;
}
.list-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.list-header .search-input-wrapper { max-width: 300px; }
.agents-count { font-size: 14px; color: var(--text-muted); }
.agents-count a { color: var(--primary); text-decoration: none; font-weight: 500; margin-left: 8px; }

.agents-table {
    width: 100%;
    border-collapse: collapse;
}
.agents-table th, .agents-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.agents-table th { font-weight: 500; color: var(--text-muted); font-size: 13px; }
.agents-table th i { margin-right: 4px; }
.agent-name-cell { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.badge-expert {
    background: #e9d8fd;
    color: #6b46c1;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}
.status-active {
    border: 1px solid var(--success);
    color: var(--success);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}
.actions-cell { display: flex; align-items: center; gap: 12px; }
.icon-text-btn { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-muted); font-weight: 500; }
.icon-text-btn:hover { color: var(--primary); }

/* Wizard */
.wizard-wrapper { display: flex; justify-content: center; }
.wizard-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 900px;
    padding: 40px;
    position: relative;
}
.close-wizard { position: absolute; top: 24px; right: 24px; }
.wizard-header { margin-bottom: 40px; display: flex; align-items: center; gap: 12px; }
.wizard-header h2 { font-size: 24px; font-weight: 700; }

.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
}
.step { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-muted); }
.step.active { color: var(--primary); }
.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}
.step.active .step-circle { background: var(--primary); color: white; }
.step span { font-size: 12px; font-weight: 500; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 16px; margin-bottom: 24px; }

.wizard-body h3 { font-size: 18px; margin-bottom: 24px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; color: var(--text-muted); }

.custom-select {
    position: relative;
    max-width: 400px;
}
.select-trigger {
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
}
.custom-select.open .select-trigger { border-color: var(--primary); }
.select-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 20;
}
.select-search {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.select-search input { border: none; outline: none; width: 100%; font-family: 'Inter'; }
.options-list { list-style: none; max-height: 250px; overflow-y: auto; }
.options-list li { padding: 12px 16px; cursor: pointer; font-size: 14px; }
.options-list li:hover { background: var(--bg-main); color: var(--primary); }

.wizard-footer { margin-top: 48px; display: flex; justify-content: flex-end; }

/* =========================================
   RESPONSIVIDADE MOBILE
========================================= */
@media (max-width: 1000px) {
    /* Esconde a barra lateral (Sidebar) no mobile, deixando fluida ou escondida no modo chat */
    .sidebar {
        position: absolute;
        transform: translateX(-100%);
        z-index: 100;
        transition: transform 0.3s ease;
    }
    
    /* Se precisarmos de um botão hamburger, poderíamos colocar aqui. 
       Para o MVP de Chat, ao menos as colunas principais devem se adaptar: */

    /* A lista de conversas deve sumir quando um contato estiver selecionado? 
       No design de chat mobile, ou você vê a lista ou vê o chat. 
       Isso requeriria uma classe no CSS gerenciada pelo JS, mas no mínimo vamos ajeitar os layouts Flex. */
       
    .conversations-panel {
        min-width: 100%;
        max-width: 100%;
    }

    /* A Gaveta de Detalhes (Drawer) vira Modal fullscreen */
    .details-drawer {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        z-index: 999;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: none;
    }

    .details-drawer.open {
        transform: translateX(0);
    }
    
    /* Área de Chat escondida no mobile se não houver contato, ou ocupando 100% se houver */
    /* Para não quebrar o layout todo apenas com CSS (já que precisa de JS para alternar),
       vamos colocar display: flex em flex-direction: column e ver o que acontece.
       Idealmente, uma classe .mobile-chat-active na .chat-area resolveria.
    */
    .main-content {
        position: relative;
    }
    
    .chat-area {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 50;
        background: white;
        transform: translateX(100%);
        transition: transform 0.3s;
    }
    
    /* Truque: se o chat-header aparecer (ou seja, se tiver contato selecionado), move a chat-area para a tela */
    .chat-area:has(.chat-header) {
        transform: translateX(0);
    }
}
