/* frontend/src/styles/global.css */

/* --- Variables CSS para consistencia --- */
:root {
    --font-primary: 'Poppins', 'Inter', sans-serif;
    --color-primary: #059669; /* emerald-600 */
    --color-primary-dark: #047857; /* emerald-700 */
    --color-primary-light: #d1fae5; /* emerald-100 */
    --color-secondary: #0d9488; /* teal-600 */
    --color-accent: #10b981; /* emerald-500 */
    --color-danger: #ef4444; /* red-500 */
    --color-danger-dark: #dc2626; /* red-600 */
    --color-text-base: #374151; /* gray-700 */
    --color-text-muted: #6b7280; /* gray-500 */
    --color-bg-light: #f0f4f8; /* slate-100 / custom light blue-gray */
    --color-bg-card: #ffffff;
    --border-color-soft: #e2e8f0; /* slate-200 */
    --border-color-medium: #cbd5e1; /* slate-300 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --border-radius-md: 0.5rem; /* rounded-lg */
    --border-radius-lg: 0.75rem; /* rounded-xl */
    --header-height: 64px; /* Altura aproximada del header para cálculos si es necesario */
}

/* --- Estilos Globais Base --- */
body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-light);
    color: var(--color-text-base);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Layout de Página Principal --- */
.page-view {
    display: none; /* Escondido por padrão, JS controla a visibilidade */
    flex-direction: column;
    flex-grow: 1;
}
.page-view.active {
    display: flex;
    animation: fadeInGlobal 0.4s ease-out;
}

@keyframes fadeInGlobal {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Header Principal --- */
.header-main {
    background-image: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000; 
    height: var(--header-height);
}
.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    height: 100%;
}

/* --- Footer Principal --- */
.footer-main {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.875rem; 
    color: var(--color-text-muted);
    background-color: #f8fafc; 
    border-top: 1px solid var(--border-color-soft);
    margin-top: auto;
}

/* --- Container Geral para Conteúdo das Páginas --- */
.page-content-container {
    flex-grow: 1;
    width: 100%;
    max-width: 1280px; 
    margin-left: auto;
    margin-right: auto;
    padding: 1.5rem; 
}
@media (min-width: 768px) { 
    .page-content-container {
        padding: 2rem; 
    }
}

/* --- Inputs e Labels Genéricos --- */
.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color-medium);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    font-size: 0.875rem;
    color: var(--color-text-base);
    background-color: var(--color-bg-card); 
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.input-field::placeholder {
    color: #94a3b8; 
}
.input-field:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); 
}
select.input-field {
    appearance: none; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem; 
}

label {
    display: block;
    font-size: 0.75rem; 
    font-weight: 600; 
    color: #475569; 
    margin-bottom: 0.375rem; 
    text-transform: uppercase;
    letter-spacing: 0.05em; 
}

/* Form description specific style */
#form-description {
    font-size: 1rem; /* Increased font size from 0.875rem */
    font-weight: 600; /* Semibold */
    color: var(--color-text-muted);
    margin-bottom: 1.5rem; /* Add some space below description */
}

/* --- Botões Genéricos --- */
.btn {
    font-weight: 600; /* Semibold */
    padding: 0.75rem 1.5rem; /* Adjusted padding */
    border-radius: var(--border-radius-lg); /* More rounded borders */
    box-shadow: var(--shadow-sm); 
    font-size: 0.9375rem; /* Increased font size from 0.875rem */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
    cursor: pointer;
}
.btn:hover {
     box-shadow: var(--shadow-md); 
     transform: translateY(-1px); 
}
.btn:active {
    transform: translateY(0px);
    box-shadow: var(--shadow-sm);
}
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3); 
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--color-primary-dark);
}
.btn-primary:disabled {
    background-color: #cbd5e1; 
    color: #64748b; 
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background-color: #e2e8f0; 
    color: #334155; 
    border-color: var(--border-color-medium);
}
.btn-secondary:hover {
    background-color: #cbd5e1; 
    border-color: #94a3b8; 
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
}
.btn-danger:hover {
    background-color: var(--color-danger-dark);
}

.btn-edit { 
    background-color: #3b82f6; 
    color: white;
    padding: 0.375rem 0.75rem; 
    font-size: 0.75rem; 
}
.btn-edit:hover {
    background-color: #2563eb; 
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 9999px;
    color: var(--color-text-muted);
    background-color: transparent;
    box-shadow: none;
}
.btn-icon:hover {
    background-color: #f1f5f9; 
    color: var(--color-primary);
}

/* --- Cards --- */
.card {
    background-color: var(--color-bg-card);
    padding: 1.5rem; 
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

/* --- Estilos para Sidebars de Admin e Médico --- */
.admin-sidebar, .medico-sidebar {
    width: 16rem; 
    background-color: var(--color-bg-card);
    padding: 1.5rem 1rem; 
    box-shadow: var(--shadow-lg);
}
.sidebar-button {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem; 
    border-radius: var(--border-radius-md);
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, transform 0.1s ease;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500; 
    color: var(--color-text-base);
}
.sidebar-button:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
    transform: translateX(2px);
}
.sidebar-button i {
    margin-right: 0.75rem; 
    width: 1.25rem; 
    text-align: center;
    color: var(--color-text-muted);
    transition: color 0.2s ease-in-out;
}
.sidebar-button:hover i {
    color: var(--color-primary-dark);
}

.admin-sidebar-button.active, .medico-sidebar-button.active {
    background-color: var(--color-primary);
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.admin-sidebar-button.active i, .medico-sidebar-button.active i {
    color: white;
}

/* --- Estilos para Subpáginas (SPA-like behavior) --- */
.admin-subpage, .medico-subpage {
    display: none; 
}
.admin-subpage.active, .medico-subpage.active {
    display: block; 
    animation: fadeInContent 0.4s ease-out; 
}
@keyframes fadeInContent { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}


/* --- Modal --- */
.modal {
    position: fixed;
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.65); 
    display: none; 
    align-items: center; 
    justify-content: center; 
}
.modal.hidden { 
    display: none !important;
}
.modal:not(.hidden) {
    display: flex;
    animation: fadeInModal 0.3s ease-out;
}

.modal-content {
    background-color: var(--color-bg-card);
    margin: auto; 
    padding: 2rem; 
    border: none; 
    width: 90%;
    max-width: 700px; 
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: slideInModal 0.3s ease-out;
}
@keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInModal { 
    from { opacity: 0; transform: translateY(-30px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.close-modal-button {
    color: var(--color-text-muted);
    position: absolute;
    top: 1rem; 
    right: 1rem; 
    font-size: 1.75rem; 
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}
.close-modal-button:hover, .close-modal-button:focus {
    color: var(--color-text-base);
}


/* --- Estilos Específicos da Página de Agendamento Público --- */
.scheduling-wrapper {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-height));
    background-color: var(--color-bg-light);
}

.clinic-details-panel {
    background-color: var(--color-bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.scheduling-panel {
    background-color: var(--color-bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    flex: 1;
}

.step-view { 
    display: none; 
} 

.step-view.active { 
    display: block; 
    animation: fadeInStep 0.4s ease-out; 
} 

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

/* Calendário */
.calendar-grid { 
    display: grid; 
    grid-template-columns: repeat(7, minmax(0, 1fr)); 
    gap: 0.25rem; 
}

.calendar-day-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day {
    border: 2px solid transparent; 
    border-radius: 9999px;
    height: 2.75rem; 
    width: 2.75rem; 
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}
.calendar-day:hover:not(.disabled):not(.selected-date) {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}
.calendar-day.disabled {
    color: var(--border-color-medium); 
    cursor: not-allowed;
    background-color: #f8fafc; 
}
.calendar-day.selected-date {
    background-color: var(--color-primary);
    color: white;
    font-weight: 600;
    border-color: var(--color-primary-dark);
}
.calendar-day.selected-date:hover {
    background-color: var(--color-primary-dark);
}
.calendar-day.today:not(.selected-date) { 
    border-color: var(--color-accent);
    color: var(--color-accent);
    font-weight: 600;
}
.calendar-header {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 600; 
    padding-bottom: 0.75rem; 
    text-align: center;
}

/* Slots de Horário */
.time-slot-list-wrapper {
    border: 1px solid var(--border-color-soft);
    border-radius: var(--border-radius-md);
    padding: 0.5rem;
}
.time-slot-list { max-height: 320px; overflow-y: auto; padding-right: 0.25rem; }
.time-slot {
    width: 100%;
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
    font-weight: 600;
    padding: 0.75rem 1rem; 
    margin: 0.375rem 0; 
    border-radius: var(--border-radius-md);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-align: center;
    font-size: 0.875rem;
}
.time-slot:hover:not(.selected-time):not(:disabled) {
    background-color: var(--color-accent);
    color: white;
}
.time-slot.selected-time {
    background-color: var(--color-primary-dark); 
    color: white;
    border-color: var(--color-primary-dark);
}
.time-slot:disabled {
    background-color: #f1f5f9; 
    color: #94a3b8; 
    border-color: var(--border-color-soft);
    cursor: not-allowed;
}

.time-slot-list::-webkit-scrollbar { width: 5px; }
.time-slot-list::-webkit-scrollbar-track { background: transparent; }
.time-slot-list::-webkit-scrollbar-thumb { background: var(--border-color-medium); border-radius: 10px;}
.time-slot-list::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* Metric Cards (Dashboard) */
.metric-card {
    background-color: var(--color-bg-card);
    padding: 1.5rem; 
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}
.metric-card h4 {
    font-size: 2.25rem; 
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}
.metric-card p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Patient Card (Lista de Pacientes) */
.patient-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.patient-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* --- Login Page Specifics --- */
#login-page .input-field { 
    padding: 0.875rem 1.25rem; 
    font-size: 1rem; 
}
#login-page .btn-primary {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

/* Ajustes para o modal de PDF no prontuário */
#pdf-modal .modal-content {
    max-height: 85vh; 
    display: flex;
    flex-direction: column;
}
#pdf-modal #pdf-iframe {
    flex-grow: 1; 
    border: 1px solid var(--border-color-soft);
    border-radius: var(--border-radius-md);
}

/* Estilo para o botão de voltar no header do prontuário */
#back-to-medico-dashboard {
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
}
#back-to-medico-dashboard:hover {
    background-color: rgba(255,255,255,0.15);
}

/* --- Tooltip Styles --- */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-container .tooltip-text {
    visibility: hidden;
    width: 320px;
    background-color: #334155; /* slate-700 */
    color: #fff;
    text-align: left;
    border-radius: var(--border-radius-md);
    padding: 1rem;
    position: absolute;
    z-index: 10;
    bottom: 125%; 
    left: 50%;
    margin-left: -160px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    line-height: 1.5;
    box-shadow: var(--shadow-lg);
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

.tooltip-container .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #334155 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-text strong {
    color: var(--color-accent);
    font-weight: 600;
}

.tooltip-text code {
    background-color: #475569; /* slate-600 */
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
}

.tooltip-text em {
    color: var(--border-color-medium); /* slate-300 */
    display: block;
    margin-top: 0.5rem;
    border-top: 1px solid #475569;
    padding-top: 0.5rem;
}

/* --- Dynamic Form Styles --- */
.form-question-group {
    background-color: var(--color-bg-card);
    padding: 1.5rem; /* 24px */
    border-radius: var(--border-radius-lg); /* 0.75rem, 12px */
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem; /* 32px */
    transition: all 0.3s ease-in-out;
}

#dynamic-form .form-question-group:last-child {
    margin-bottom: 0;
}

.form-label {
    font-size: 1.125rem; /* 18px */
    font-weight: 600; /* semibold */
    color: var(--color-text-base);
    margin-bottom: 0.75rem; /* 12px */
    display: block;
}

.form-input-wrapper {
    margin-top: 0.25rem; /* 4px */
}

.form-check-label,
.form-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem 1rem; /* 12px 16px */
    border: 1px solid var(--border-color-medium);
    border-radius: var(--border-radius-md);
    margin-bottom: 0.5rem; /* 8px */
    transition: all 0.15s ease-in-out;
    background-color: var(--color-bg-card);
}

.form-check-label:hover,
.form-radio-label:hover {
    background-color: #f8fafc; /* slate-50 */
    border-color: #94a3b8; /* slate-400 */
}

.form-check-label:has(input:checked),
.form-radio-label:has(input:checked) {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2); /* emerald-600 with opacity */
    color: var(--color-primary-dark);
    font-weight: 500;
}

.form-radio,
.form-checkbox {
    height: 1.25rem; /* 20px */
    width: 1.25rem; /* 20px */
    color: var(--color-primary);
    border-color: var(--border-color-medium);
    margin-right: 0.75rem; /* 12px */
}

.form-radio:focus,
.form-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
    border-color: var(--color-accent);
}

.form-checkbox {
    border-radius: 0.25rem; /* 4px */
}

.form-radio {
    border-radius: 50%;
}

.error-message {
    color: var(--color-danger);
    font-size: 0.875rem; /* 14px */
    margin-top: 0.5rem; /* 8px */
    font-weight: 500;
}

#form-navigation-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem; /* 32px */
    padding-top: 1.5rem; /* 24px */
    border-top: 1px solid var(--border-color-soft);
}

#question-counter {
    font-size: 0.875rem; /* 14px */
    color: var(--color-text-muted);
}

#btn-prev-question,
#btn-next-question,
#btn-submit-form {
    padding: 0.75rem 1.5rem; /* 12px 24px */
    font-size: 0.9375rem; /* 15px */
}

/* --- Estilos para contenido médico formateado por IA en Quill.js --- */

/* Estilos para texto formateado por IA */
.ql-editor h1, .ql-editor h2, .ql-editor h3 {
    color: var(--color-primary);
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.ql-editor h1 {
    font-size: 1.5em;
    border-bottom: 2px solid var(--color-primary-light);
    padding-bottom: 0.3em;
}

.ql-editor h2 {
    font-size: 1.3em;
}

.ql-editor h3 {
    font-size: 1.1em;
}

.ql-editor hr {
    border: none;
    border-top: 2px solid var(--border-color-medium);
    margin: 1.5em 0;
}

.ql-editor strong {
    color: var(--color-text-base);
    font-weight: 600;
}

.ql-editor em {
    color: var(--color-primary-dark);
    font-style: italic;
}

/* Estilos específicos para conteúdo médico formateado */
.ql-editor p strong:first-child {
    color: var(--color-primary);
}

.ql-editor ul li {
    margin-bottom: 0.25em;
}

.ql-editor ol li {
    margin-bottom: 0.25em;
}

/* Mejores estilos para valores médicos resaltados */
.ql-editor strong[style*="color"] {
    background-color: rgba(16, 185, 129, 0.1);
    padding: 1px 3px;
    border-radius: 3px;
}

.ql-editor em strong {
    background-color: rgba(16, 185, 129, 0.2);
    padding: 2px 4px;
    border-radius: 4px;
}

/* Estilos adicionales para la página de agendamiento */
.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.step-indicator .step {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--border-color-soft);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
}

.step-indicator .step.active {
    background-color: var(--color-primary);
    color: white;
}

.step-indicator .step.completed {
    background-color: var(--color-accent);
    color: white;
}

.step-indicator .connector {
    width: 2rem;
    height: 2px;
    background-color: var(--border-color-soft);
    transition: background-color 0.3s ease;
}

.step-indicator .connector.completed {
    background-color: var(--color-accent);
}

.scheduling-form-section {
    margin-bottom: 1.5rem;
}

.scheduling-form-section h3 {
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.doctor-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.doctor-card {
    border: 2px solid var(--border-color-soft);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--color-bg-card);
}

.doctor-card:hover {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-md);
}

.doctor-card.selected {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.doctor-info h4 {
    color: var(--color-text-base);
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.doctor-info p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-navigation button {
    background: none;
    border: 1px solid var(--border-color-soft);
    border-radius: var(--border-radius-md);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text-base);
}

.calendar-navigation button:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.calendar-navigation h3 {
    color: var(--color-text-base);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.time-section {
    margin-top: 1.5rem;
}

.time-section h4 {
    color: var(--color-text-base);
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.appointment-summary {
    background-color: var(--color-bg-light);
    border: 1px solid var(--border-color-soft);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.appointment-summary h4 {
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color-soft);
}

.summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.summary-label {
    font-weight: 600;
    color: var(--color-text-base);
}

.summary-value {
    color: var(--color-text-muted);
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color-soft);
}

.step-navigation .btn {
    min-width: 120px;
}

/* === Estilos para Análise de IA - Tokens e Custos === */

/* Cards de estatísticas com animação de hover */
.stats-card {
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Animação de loading para números */
.stats-loading {
    position: relative;
}

.stats-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Indicadores de período */
.period-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.8;
}

.period-indicator::before {
    content: '📅';
    font-size: 0.6rem;
}

/* Separadores de seção */
.section-divider {
    margin: 2rem 0;
    padding: 1rem 0;
    border-bottom: 2px solid #f1f5f9;
    position: relative;
}

.section-divider::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    border-radius: 1px;
}

/* Melhorias para os filtros de período */
.period-filter-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    position: relative;
}

.period-filter-container::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg, #3b82f6, #10b981, #f59e0b);
    border-radius: 0.75rem;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.period-filter-container:hover::before {
    opacity: 0.1;
}

/* Estilos para botões de aplicar filtro */
.filter-apply-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.filter-apply-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Indicadores de custo */
.cost-indicator {
    position: relative;
}

.cost-indicator.free::after {
    content: '🎉';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1.2rem;
}

/* Tooltips informativos */
.info-tooltip {
    position: relative;
    cursor: help;
}

.info-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.info-tooltip::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.info-tooltip:hover::after,
.info-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* === Console de Logs de IA === */

#ai-logs-console {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

#ai-logs-content {
    scrollbar-width: thin;
    scrollbar-color: #374151 #1f2937;
}

#ai-logs-content::-webkit-scrollbar {
    width: 8px;
}

#ai-logs-content::-webkit-scrollbar-track {
    background: #1f2937;
}

#ai-logs-content::-webkit-scrollbar-thumb {
    background-color: #374151;
    border-radius: 4px;
}

#ai-logs-content::-webkit-scrollbar-thumb:hover {
    background-color: #4b5563;
}

/* Animación para nuevos logs */
@keyframes fadeInLog {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.log-entry {
    animation: fadeInLog 0.3s ease-out;
}

/* Efectos hover para logs */
#ai-logs-content > div:hover {
    background-color: rgba(55, 65, 81, 0.3);
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}

/* Estados del console */
.console-connecting {
    border-color: #f59e0b !important;
}

.console-active {
    border-color: #10b981 !important;
}

.console-error {
    border-color: #ef4444 !important;
}

/* Botón de limpiar logs */
#clear-logs:hover {
    background-color: #374151;
}