:root {
    /* TEMA PADRÃO (DARK MODE) */
    --bg-color: #131314;
    --sidebar-bg: #1e1f20;
    --input-bg: #28292a;
    --text-primary: #e3e3e3;
    --text-secondary: #c4c7c5;
    --accent-color: #a8c7fa;
    --user-msg-bg: #28292a;
    --border-color: #444746;
    
    /* VARIÁVEIS DO TEMA ANO NOVO (GOLD) */
    --gold-gradient: linear-gradient(45deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
    --gold-shadow: 0px 0px 5px rgba(255, 215, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0; padding: 0;
    font-family: 'Calibri', 'Candara', 'Segoe UI', Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    height: 100vh; height: 100dvh;
    overflow: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ============================================================
   TELA DE LOGIN - TEMA ANO NOVO (NEW YEAR GOLD)
   ============================================================ */
.login-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    /* Fundo gradiente noturno para destacar o dourado */
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

/* Canvas da animação de fogos (inserido via JS) */
#ny-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1; /* Fica atrás do box de login */
}

/* Box de Login Transformado */
.login-box {
    width: 90%; max-width: 400px; padding: 40px;
    background-color: rgba(10, 10, 10, 0.85); /* Fundo escuro translúcido */
    border-radius: 16px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    
    /* Borda Dourada com Gradiente */
    border: 2px solid transparent;
    border-image: var(--gold-gradient);
    border-image-slice: 1;
    backdrop-filter: blur(5px);
}

/* Textos com efeito Glitter/Ouro */
.login-logo span, 
.login-logo h2,
.login-box h3, /* Títulos de Modais */
.modal-header h3 {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #ffd700; /* Fallback */
    font-weight: 700;
    text-shadow: 0px 0px 2px rgba(191, 149, 63, 0.3);
    letter-spacing: 0.5px;
}

.login-logo span { margin-bottom: 10px; font-size: 3rem; display: block; }
.login-logo h2 { font-size: 1.8rem; margin-bottom: 5px; }

.login-box p { 
    color: #e0c088; /* Dourado pálido */
    font-size: 0.9rem; margin-bottom: 30px; 
}

/* Inputs no tema Gold */
.input-group {
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid #555;
    border-radius: 8px; margin-bottom: 15px;
    display: flex; align-items: center; padding: 0 10px;
    transition: all 0.3s;
}
.input-group:focus-within { 
    border-color: #bf953f; 
    box-shadow: 0 0 10px rgba(191, 149, 63, 0.4);
}
.input-group span { color: #bf953f; } /* Ícone dourado */
.input-group input { 
    background: none; border: none; 
    color: #fcf6ba; /* Texto digitado dourado claro */
    width: 100%; padding: 12px; outline: none; font-size: 1rem; 
}
.input-group input::placeholder { color: #888; }

/* Botão Gold Metálico */
.login-btn {
    width: 100%; padding: 12px;
    background: var(--gold-gradient);
    color: #1a1a1a; font-weight: bold;
    border: none; border-radius: 8px;
    cursor: pointer; font-size: 1rem;
    margin-top: 10px; transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.login-btn:hover { 
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}
.login-btn:disabled { 
    background: #444; color: #888; cursor: not-allowed; opacity: 0.7; box-shadow: none;
}

/* Links (Esqueci senha / Cadastro) */
.auth-options { display: flex; justify-content: space-between; margin-top: 20px; font-size: 0.85rem; }
.auth-options a { 
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none; font-weight: bold;
    transition: 0.2s; 
}
.auth-options a:hover { text-shadow: 0 0 8px #bf953f; }

.login-footer { margin-top: 30px; font-size: 0.75rem; color: #888 !important; opacity: 0.7; margin-bottom: 0 !important; }

/* --- MODAIS (Mantendo consistência com o login) --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9); /* Fundo mais escuro */
    backdrop-filter: blur(5px);
    z-index: 2005;
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px; border-bottom: 1px solid #bf953f; padding-bottom: 15px;
}
.close-modal { background: none; border: none; color: #bf953f; font-size: 1.5rem; cursor: pointer; }

/* --- SIDEBAR & MAIN CONTENT (Estilo Original Preservado) --- */
.sidebar {
    width: 260px; background-color: var(--sidebar-bg);
    display: flex; flex-direction: column; padding: 10px;
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease, width 0.3s ease;
    flex-shrink: 0; z-index: 100;
    height: 100vh; height: 100dvh;
    overflow: hidden;
}
.sidebar.collapsed { width: 72px; }
.sidebar.collapsed .text, .sidebar.collapsed .sidebar-section h3, .sidebar.collapsed .new-chat-btn .text, .sidebar.collapsed .location-info { display: none; }

.sidebar-header { height: 50px; display: flex; align-items: center; padding-left: 10px; }
.icon-btn { background: none; border: none; color: var(--text-secondary); padding: 10px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mobile-menu-btn { display: none; margin-right: 10px; }
.new-chat-container { margin: 20px 0; }
.new-chat-btn { background-color: var(--input-bg); color: var(--text-secondary); border: 1px solid rgba(128,128,128,0.1); border-radius: 20px; padding: 10px 15px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: 0.2s; width: 100%; white-space: nowrap; overflow: hidden; }
.sidebar.collapsed .new-chat-btn { width: 40px; padding: 10px; justify-content: center; border-radius: 50%; }
.sidebar-section { margin-top: 20px; }
.sidebar-tools { flex-shrink: 0; }
.sidebar-conversations { flex: 1 1 0; overflow-y: auto; min-height: 0; }
.sidebar-conversations::-webkit-scrollbar { width: 4px; }
.sidebar-conversations::-webkit-scrollbar-track { background: transparent; }
.sidebar-conversations::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }
.section-title { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 10px; padding-left: 15px; text-transform: uppercase; }
.nav-list { list-style: none; }
.nav-item { display: flex; align-items: center; gap: 15px; padding: 12px 15px; border-radius: 25px; color: var(--text-primary); cursor: pointer; transition: background 0.2s; font-size: 0.95rem; background: none; border: none; width: 100%; text-align: left; }
.nav-item:hover { background-color: rgba(128,128,128,0.1); }
.nav-item.active { background-color: #004a77; color: #c2e7ff; }

.sidebar-footer { flex-shrink: 0; font-size: 0.8rem; color: var(--text-secondary); padding-bottom: 10px; }
.location-info { font-size: 0.7rem; padding: 5px 15px; color: var(--text-secondary); opacity: 0.7; }

.main-content { flex-grow: 1; display: flex; flex-direction: column; position: relative; max-width: 100%; width: 100%; }
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; height: 60px; background-color: var(--bg-color); position: sticky; top: 0; z-index: 10; transition: background-color 0.4s; }
.logo-area { display: flex; align-items: center; }
.app-name { font-size: 1.1rem; color: var(--text-secondary); font-weight: 500; }
.user-area { display: flex; align-items: center; gap: 10px; }
.badge-pro { background-color: #2b2c2e; color: var(--text-secondary); font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; border: 1px solid #444; }
.avatar-placeholder { width: 32px; height: 32px; background-color: #7c4dff; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; font-weight: bold; }

.chat-history { flex-grow: 1; overflow-y: auto; padding: 20px 15px 120px 15px; display: flex; flex-direction: column; align-items: center; width: 100%; }
.welcome-screen { margin-top: 15vh; text-align: center; color: var(--text-secondary); padding: 0 20px; }
.welcome-screen h1 {
    font-weight: 500; font-size: 2.5rem; margin-top: 15px; line-height: 1.2; letter-spacing: -0.02em;
    background: linear-gradient(90deg, #0b57d0 0%, #00e6ff 40%, #a259ff 80%, #ff2e9a 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent;
}

.gemini-icon { position: relative; display: inline-block; }
.gemini-icon #guirlanda { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 140px; height: 140px; pointer-events: none; z-index: 102; filter: drop-shadow(0 8px 12px rgba(0,0,0,0.25)); }
body.xmas-mode .gemini-icon #guirlanda { display: block; }

.message-wrapper { width: 100%; max-width: 90%; margin-bottom: 25px; display: flex; gap: 12px; }
.message-wrapper.user { justify-content: flex-end; }
.avatar-icon { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 0.75rem; }
.avatar-icon.ai { background: linear-gradient(135deg, #4285F4, #DB4437); color: white; }
.avatar-icon.user { background-color: #444; color: #fff; }
.message-content { color: var(--text-primary); line-height: 1.6; font-size: 16px; max-width: 90%; word-wrap: break-word; }
.message-wrapper.user .message-content { background-color: var(--user-msg-bg); padding: 12px 18px; border-radius: 18px 18px 4px 18px; }
.message-content pre { background-color: var(--sidebar-bg); padding: 12px; border-radius: 8px; overflow-x: auto; font-family: 'Calibri', 'Candara', 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 16px; white-space: pre-wrap; margin-top: 5px; border: 1px solid var(--border-color); color: var(--text-primary); }

/* --- Markdown renderizado nas respostas da IA --- */
.ai-markdown { font-size: 16px; line-height: 1.75; color: var(--text-primary); word-wrap: break-word; }
.ai-markdown p { margin-bottom: 0.8em; }
.ai-markdown strong { font-weight: 700; color: #fff; }
.ai-markdown em { font-style: italic; color: var(--text-secondary); }

/* Headings — hierarquia visual clara para scanning rápido */
.ai-markdown h2 {
    font-size: 1.15em; font-weight: 700; line-height: 1.3;
    margin-top: 1.5em; margin-bottom: 0.6em;
    padding: 8px 14px; border-radius: 6px;
    background-color: rgba(66, 133, 244, 0.1);
    border-left: 4px solid #4285F4;
    color: #a8c7fa;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.ai-markdown h3 {
    font-size: 1.05em; font-weight: 600; line-height: 1.3;
    margin-top: 1em; margin-bottom: 0.4em;
    padding-left: 10px;
    border-left: 3px solid var(--border-color);
    color: var(--text-primary);
}
.ai-markdown h4 { font-size: 1em; font-weight: 600; margin-top: 0.8em; margin-bottom: 0.3em; color: var(--text-secondary); }

/* Listas — compactas e escaneáveis */
.ai-markdown ul, .ai-markdown ol { margin: 0.4em 0 0.8em 1.5em; padding: 0; }
.ai-markdown li { margin-bottom: 0.35em; }
.ai-markdown li > ul, .ai-markdown li > ol { margin-top: 0.2em; margin-bottom: 0.2em; }

/* Blockquotes */
.ai-markdown blockquote { border-left: 3px solid var(--accent-color); margin: 0.8em 0; padding: 0.4em 1em; color: var(--text-secondary); background-color: rgba(128,128,128,0.05); border-radius: 0 6px 6px 0; }

/* Code */
.ai-markdown code { background-color: rgba(128,128,128,0.15); padding: 2px 6px; border-radius: 4px; font-family: 'Fira Code', 'Consolas', monospace; font-size: 0.9em; }
.ai-markdown pre { background-color: var(--sidebar-bg); padding: 12px; border-radius: 8px; overflow-x: auto; border: 1px solid var(--border-color); margin: 0.8em 0; }
.ai-markdown pre code { background: none; padding: 0; font-size: 0.9em; }

/* Separadores — divisórias entre seções */
.ai-markdown hr { border: none; border-top: 1px solid rgba(128,128,128,0.3); margin: 1.5em 0; }

/* Tabelas */
.ai-markdown table { border-collapse: collapse; width: 100%; margin: 0.8em 0; }
.ai-markdown th, .ai-markdown td { border: 1px solid var(--border-color); padding: 8px 12px; text-align: left; }
.ai-markdown th { background-color: rgba(128,128,128,0.1); font-weight: 700; }

/* Links */
.ai-markdown a { color: var(--accent-color); text-decoration: none; }
.ai-markdown a:hover { text-decoration: underline; }

/* Light mode overrides */
body.xmas-mode .ai-markdown strong { color: #1a1a1a; }
body.xmas-mode .ai-markdown h2 { background-color: rgba(11, 87, 208, 0.08); border-left-color: #0b57d0; color: #0b57d0; }

.input-container { position: absolute; bottom: 0; left: 0; width: 100%; padding: 15px 15px 20px 15px; background: linear-gradient(to top, var(--bg-color) 75%, transparent); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.prompt-bar { pointer-events: auto; width: 100%; max-width: 90%; background-color: var(--input-bg); border-radius: 28px; padding: 8px 12px; display: flex; align-items: flex-end; gap: 8px; border: 1px solid transparent; transition: background 0.3s; }
.prompt-bar:focus-within { border-color: var(--accent-color); box-shadow: 0 1px 6px rgba(0,0,0,0.1); }
.prompt-bar textarea { background: transparent; border: none; color: var(--text-primary); font-size: 16px; font-family: 'Calibri', 'Candara', BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; flex-grow: 1; outline: none; resize: none; max-height: 120px; padding: 12px 0; line-height: 1.4; }
.icon-btn-bar { background: none; border: none; color: var(--text-secondary); padding: 8px; cursor: pointer; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: color 0.2s; }
.icon-btn-bar:hover { color: var(--accent-color); background-color: rgba(128,128,128,0.1); }
.send-btn { color: var(--text-primary); }
.icon-btn-bar.recording { background-color: rgba(220, 53, 69, 0.2); color: #ff6b6b; animation: pulse 1.5s infinite; border: 1px solid #ff6b6b; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); } }
.anonm-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border-color); border-top-color: var(--accent-color, #4a9eff); border-radius: 50%; animation: anonm-spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes anonm-spin { to { transform: rotate(360deg); } }
.ai-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.ai-disclaimer { font-size: 0.75rem; color: #888; }

.file-list-container { width: 100%; max-width: 90%; background-color: var(--sidebar-bg); border-radius: 12px 12px 0 0; padding: 10px 15px; margin-bottom: -15px; display: flex; gap: 10px; overflow-x: auto; border: 1px solid var(--border-color); border-bottom: none; z-index: 1; pointer-events: auto; }
.file-chip { background-color: rgba(128, 128, 128, 0.1); border: 1px solid var(--border-color); border-radius: 8px; padding: 6px 10px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; max-width: 200px; }
.file-chip .file-name { font-size: 0.8rem; color: var(--accent-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip .remove-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; }
.file-chip .remove-btn:hover { color: #ff6b6b; }

/* OVERLAY MOBILE */
.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 99; opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(2px); }
.sidebar-overlay.active { opacity: 1; visibility: visible; }
@media (max-width: 768px) {
    .sidebar { position: absolute; top: 0; left: 0; height: 100%; width: 280px; transform: translateX(-100%); box-shadow: 2px 0 10px rgba(0,0,0,0.5); }
    .sidebar.mobile-open { transform: translateX(0); }
    #desktop-sidebar-toggle { display: none; }
    .mobile-menu-btn { display: block; }
    .welcome-screen h1 { font-size: 1.8rem; }
    .chat-history { padding-left: 10px; padding-right: 10px; }
    .message-content { max-width: 95%; font-size: 0.9rem; }
}

/* --- NOVOS ESTILOS DPA/LGPD --- */
.legal-scroll-box {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid #bf953f; /* Gold border for legal box in modal */
    border-radius: 8px;
    padding: 15px;
    height: 150px;
    overflow-y: auto;
    text-align: left;
    font-size: 0.75rem;
    color: #e0c088;
    line-height: 1.6;
    margin-bottom: 10px;
    border-left: 3px solid #b38728;
}
.legal-scroll-box strong { color: #fcf6ba; font-weight: 600; }
.legal-scroll-box::-webkit-scrollbar { width: 6px; }
.legal-scroll-box::-webkit-scrollbar-track { background: transparent; }
.legal-scroll-box::-webkit-scrollbar-thumb { background: #bf953f; border-radius: 3px; }

.disclaimer-box {
    display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.7rem; color: var(--text-secondary); background-color: var(--sidebar-bg); padding: 4px 12px; border-radius: 12px; max-width: 90%; pointer-events: auto; border: 1px solid var(--border-color);
}
.disclaimer-box .icon { font-size: 1rem; color: var(--text-secondary); }
.disclaimer-box p { margin: 0; }

/* ============================================================
   LISTA DE CONVERSAS NA SIDEBAR
   ============================================================ */
.conv-list { list-style: none; padding: 0; margin: 0; }
.conv-group-header { font-size: 0.7rem; color: var(--text-secondary); padding: 10px 15px 4px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.7; }
.conv-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 20px; cursor: pointer; transition: background 0.2s; font-size: 0.85rem; color: var(--text-primary); position: relative; }
.conv-item:hover { background-color: rgba(128,128,128,0.1); }
.conv-item.active { background-color: rgba(168,199,250,0.12); }
.conv-icon { font-size: 1rem; color: var(--text-secondary); flex-shrink: 0; }
.conv-title { flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.conv-delete { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 2px; border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s, color 0.2s; flex-shrink: 0; }
.conv-delete span { font-size: 0.9rem; }
.conv-item:hover .conv-delete { opacity: 1; }
.conv-delete:hover { color: #ff6b6b; background-color: rgba(255,107,107,0.1); }
.conv-empty { font-size: 0.8rem; color: var(--text-secondary); padding: 10px 15px; opacity: 0.6; }
.sidebar.collapsed .conv-list, .sidebar.collapsed .sidebar-conversations .section-title { display: none; }

/* ============================================================
   TEMA XMAS (MODO NATAL) - MANTIDO
   ============================================================ */
body.xmas-mode {
    --bg-color: #FFFFFF;          
    --sidebar-bg: #F0F4F9;        
    --input-bg: #F0F4F9;          
    --text-primary: #1F1F1F;      
    --text-secondary: #444746;    
    --accent-color: #0b57d0;      
    --user-msg-bg: #c2e7ff;       
    --border-color: #E0E3E7;      
    position: relative; z-index: 0;
}
body.xmas-mode::before { content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; background-image: url('https://img.freepik.com/vetores-gratis/decoracao-de-natal-realista-3d-floco-de-neve-azul-isolada-em-fundo-transparente-elemento-de-design-para-o-natal_145391-1208.jpg?semt=ais_hybrid&w=740&q=80'); background-repeat: repeat; background-size: 50px 50px; opacity: 0.1; }
body.xmas-mode::after { content: ""; position: fixed; top: -40px; left: 50%; transform: translateX(-50%); width: 400px; height: 400px; z-index: 101; pointer-events: none; background-image: url('https://png.pngtree.com/png-clipart/20230408/ourmid/pngtree-christmas-wreath-holly-decoration-with-poinsettia-png-image_6691156.png'); background-size: contain; background-repeat: no-repeat; background-position: center top; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3)); }
body.xmas-mode .welcome-screen h1 { background: linear-gradient(90deg, #0b57d0 0%, #00e6ff 40%, #a259ff 80%, #ff2e9a 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent; position: relative; z-index: 102; }
.main-content h2, .main-content h3, body.xmas-mode .main-content h2, body.xmas-mode .main-content h3, .main-content .app-name { background: linear-gradient(90deg, #0b57d0 0%, #00e6ff 40%, #a259ff 80%, #ff2e9a 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent; font-weight: 600; }
body.xmas-mode .avatar-icon.ai { background: linear-gradient(135deg, #4285F4, #9C27B0); border: 1px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
body.xmas-mode .nav-item.active, body.xmas-mode .login-btn { background: linear-gradient(135deg, #d3e3fd 0%, #e8f0fe 100%); color: #041e49; font-weight: 600; border: 1px solid #c2e7ff; }
body.xmas-mode .new-chat-btn { background-color: #d3e3fd; color: #041e49; border: none; }
body.xmas-mode .login-box, body.xmas-mode .modal-box { background-color: #ffffff; box-shadow: 0 4px 20px rgba(0,0,0,0.08); border: none; }
body.xmas-mode .input-group, body.xmas-mode .prompt-bar { background-color: #f0f4f9; border: 1px solid transparent; }
body.xmas-mode .input-group input, body.xmas-mode .prompt-bar textarea { color: #1f1f1f; }
body.xmas-mode .prompt-bar:focus-within { background-color: #ffffff; border-color: #c2e7ff; box-shadow: 0 2px 8px rgba(11, 87, 208, 0.15); }
body.xmas-mode .badge-pro { background: linear-gradient(90deg, #1967d2, #8ab4f8); color: white; border: none; }
body.xmas-mode .sidebar-footer button { color: #0b57d0; }
@media (max-width: 768px) { body.xmas-mode::after { width: 250px; height: 250px; top: -20px; } }
.snow-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 140; overflow: hidden; opacity: 0; }
body.xmas-mode .snow-overlay { opacity: 1; }
.snow-flake { position: absolute; top: 0; pointer-events: none; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #c0e8ff 0%, #c0e8ff 80%, #ffffff 100%); box-shadow: 0 1px 3px rgba(140,180,255,0.9), inset 0 0 1px rgba(255,255,255,0.8); filter: blur(0.3px); will-change: transform, opacity; }
@keyframes fall-js { 0% { transform: translateY(0) rotate(0deg) translateX(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: translateY(120vh) rotate(360deg) translateX(30px); opacity: 0; } }

/* ============================================================
   SUGA TRIAGEM — BED MAP (MAPA DE LEITOS)
   ============================================================ */
.bed-map-container {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow-x: auto;
}
.bed-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 5px;
}
.bed-map-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bed-map-title span { font-size: 1rem; }
.bed-map-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background-color: var(--input-bg);
    padding: 2px 8px;
    border-radius: 10px;
}
.bed-map-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 100%;
}
.bed-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 60px;
    max-width: 80px;
    border: 2px solid transparent;
    position: relative;
}
.bed-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.bed-chip.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 12px rgba(168,199,250,0.3);
}
.bed-chip.moving {
    border-color: #a8c7fa;
    box-shadow: 0 0 16px rgba(168,199,250,0.6);
    animation: bed-pulse 1s ease-in-out infinite;
}
@keyframes bed-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}
.bed-chip.drop-target {
    border-color: rgba(168,199,250,0.4);
    border-style: dashed;
    cursor: pointer;
}
.bed-chip-number {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2px;
    text-transform: uppercase;
}
.bed-chip-alias {
    font-size: 0.7rem;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}
.bed-chip-score {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}
.bed-chip-profile {
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    padding: 1px 4px;
    border-radius: 3px;
    margin-top: 3px;
    background-color: rgba(0,0,0,0.2);
}

/* Risco ALTO — vermelho */
.bed-chip.risk-alto {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}
/* Risco MODERADO — laranja */
.bed-chip.risk-moderado {
    background: linear-gradient(135deg, #e67e22, #f39c12);
}
/* Risco BAIXO — verde */
.bed-chip.risk-baixo {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

/* Bed map actions bar */
.bed-map-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}
.bed-map-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.bed-map-btn:hover {
    background-color: var(--input-bg);
    color: var(--accent-color);
    border-color: var(--accent-color);
}
.bed-map-btn span { font-size: 0.9rem; }

/* Patient detail panel (shown when chip selected) */
.patient-detail-panel {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}
.patient-detail-panel .detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.patient-detail-panel .detail-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent-color);
}
.patient-detail-panel .detail-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 700;
    color: #fff;
}
.patient-detail-panel .detail-badge.alto { background-color: #c0392b; }
.patient-detail-panel .detail-badge.moderado { background-color: #e67e22; }
.patient-detail-panel .detail-badge.baixo { background-color: #27ae60; }
.patient-detail-panel .detail-row {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
}
.patient-detail-panel .detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
    flex-shrink: 0;
}
.patient-detail-panel .detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}
.patient-detail-panel .detail-actions button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.patient-detail-panel .detail-actions button:hover {
    background-color: rgba(168,199,250,0.1);
    color: var(--accent-color);
    border-color: var(--accent-color);
}
.patient-detail-panel .detail-actions button.danger:hover {
    color: #e74c3c;
    border-color: #e74c3c;
    background-color: rgba(231,76,60,0.1);
}
.patient-detail-panel .detail-actions button span { font-size: 0.85rem; }

/* Light mode overrides for bed map */
body.xmas-mode .bed-map-container { background-color: #f0f4f9; border-bottom-color: #E0E3E7; }
body.xmas-mode .bed-chip-number { color: rgba(255,255,255,0.9); }
body.xmas-mode .patient-detail-panel { background-color: #fff; border-color: #E0E3E7; }
