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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f4f8;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

html {
    margin: 0;
    padding: 0;
}

.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    position: relative;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin: 0;
    padding: 0;
    top: 0;
    left: 0;
}

.screen.active {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
}

/* ========== TELA DE LOGIN ========== */
#login-screen.active {
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 1;
    pointer-events: auto;
}

#login-screen {
    background: #f0f4f8;
}

.login-container {
    background: white;
    border-radius: 10px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: #20b2aa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.ecg-logo {
    width: 60px;
    height: 40px;
}

.logo-text {
    color: #20b2aa;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.logo-subtitle {
    color: #666;
    font-size: 11px;
    text-align: center;
    margin-bottom: 30px;
    letter-spacing: 0.5px;
}

.user-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.user-type-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
    touch-action: manipulation;
}

.user-type-btn.active {
    background: #1e90ff;
    color: white;
}

.user-type-btn:not(.active) {
    background: #e0e0e0;
    color: #666;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.login-input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.entrar-btn {
    background: #1e90ff;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 5px;
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
    touch-action: manipulation;
    width: 100%;
}

.login-error {
    background: #ffe0e0;
    color: #ff0000;
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    margin-top: 10px;
    text-align: center;
    border: 1px solid #ff0000;
}

.forgot-password {
    text-align: center;
    color: #666;
    text-decoration: none;
    font-size: 12px;
    margin-top: 10px;
    display: block;
}

.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 25px 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: #ddd;
}

.divider-text {
    color: #999;
    font-size: 12px;
}

.create-account-btn {
    width: 100%;
    background: white;
    color: #1e90ff;
    border: 2px solid #1e90ff;
    padding: 14px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

/* ========== DASHBOARD PACIENTE ========== */
#paciente-dashboard {
    background: #f0f4f8;
    display: block !important;
}

.header {
    background: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    font-size: 28px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-title {
    color: #1e3a8a;
    font-size: 18px;
    font-weight: bold;
}

.header-subtitle {
    color: #666;
    font-size: 12px;
}

.header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.seguro-link {
    color: #22c55e;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

.sair-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.welcome-banner {
    background: #1e90ff;
    color: white;
    padding: 30px 20px;
}

.welcome-banner h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: white;
    border: none;
    padding: 0;
}

.user-email {
    font-size: 14px;
    margin-bottom: 5px;
}

.banner-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

.critical-alert {
    background: #ffe0e0;
    border: 2px solid #ff4444;
    border-radius: 5px;
    margin: 20px;
    padding: 20px;
    display: flex;
    gap: 15px;
}

.alert-icon {
    font-size: 24px;
    font-weight: bold;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    color: #ff0000;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.alert-notification {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.alert-list {
    margin-left: 20px;
    color: #333;
    line-height: 1.8;
}

.tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #ddd;
    padding: 0 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tab-btn.active {
    color: #1e90ff;
    border-bottom-color: #1e90ff;
    font-weight: bold;
}

.tab-content {
    display: none;
    padding: 20px;
}

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

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.exam-list, .document-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.exam-item, .document-item {
    background: white;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-info, .document-info {
    flex: 1;
}

.exam-name, .document-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.exam-date, .document-date {
    color: #666;
    font-size: 12px;
}

.download-btn {
    background: #1e90ff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

/* EVOLUÇÃO TAB */
.evolution-section {
    background: white;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.evolution-section h3 {
    margin-bottom: 20px;
    color: #333;
    border: none;
    padding: 0;
}

#evolution-chart {
    width: 100%;
    height: 300px;
}

.ai-monitoring {
    background: white;
    border: 2px solid #8b5cf6;
    border-radius: 5px;
    padding: 20px;
    display: flex;
    gap: 15px;
}

.ai-icon {
    font-size: 16px;
    font-weight: bold;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #8b5cf6;
    color: white;
    border-radius: 50%;
    flex-shrink: 0;
}

.ai-title {
    font-weight: bold;
    color: #8b5cf6;
    margin-bottom: 10px;
}

.ai-text {
    color: #333;
    line-height: 1.6;
}

/* ========== DASHBOARD PROFISSIONAL ========== */
#profissional-dashboard {
    background: #f0f4f8;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 100vh;
    overflow-y: auto;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.prof-header {
    background: #1e3a8a;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
    margin: 0;
}

.prof-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prof-header-logo {
    font-size: 28px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prof-header-title {
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.prof-header-subtitle {
    color: #ffa500;
    font-size: 12px;
}

.prof-header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.seguro-link-prof {
    background: #22c55e;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

.sair-link-prof {
    color: white;
    text-decoration: none;
    font-size: 14px;
}

.prof-banner {
    background: #ffa500;
    color: white;
    padding: 30px 20px;
    margin: 0;
    position: relative;
}

.prof-banner h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: white;
    border: none;
    padding: 0;
}

.prof-email {
    font-size: 14px;
    margin-bottom: 5px;
}

.prof-role {
    font-size: 13px;
    opacity: 0.9;
}

.prof-critical-alert {
    background: white;
    border: 2px solid #ff4444;
    border-top: 4px solid #ff4444;
    border-radius: 5px;
    margin: 20px;
    padding: 20px;
    position: relative;
    z-index: 5;
}

.prof-alert-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.prof-alert-icon {
    font-size: 20px;
    font-weight: bold;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ff0000;
    color: white;
    border-radius: 50%;
}

.prof-alert-title {
    color: #ff0000;
    font-size: 16px;
    font-weight: bold;
}

.prof-alert-patient {
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.prof-alert-section {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
}

.prof-alert-subtitle {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.prof-alert-list {
    margin-left: 20px;
    color: #333;
    line-height: 1.8;
    margin-bottom: 10px;
}

.prof-ai-badge {
    color: #666;
    font-size: 12px;
    margin-top: 10px;
}

.prof-tabs {
    display: flex;
    background: white;
    padding: 0 20px;
    border-bottom: 1px solid #e0e0e0;
}

.prof-tab-btn {
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 5px;
}

.prof-tab-btn.active {
    color: #1e90ff;
    border-bottom-color: #1e90ff;
    font-weight: bold;
}

.prof-tab-content {
    display: none;
    padding: 20px;
    background: #f0f4f8;
    min-height: calc(100vh - 450px);
}

.upload-status {
    margin-top: 15px;
    font-size: 14px;
    color: #22c55e;
    font-weight: bold;
    min-height: 20px;
}

.upload-status.error {
    color: #ff4444;
}

.prof-tab-content.active {
    display: block;
}

.section-header-prof {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.patient-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.patient-item {
    background: white;
    padding: 15px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.patient-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.patient-visit {
    color: #666;
    font-size: 12px;
}

.patient-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.patient-status.critical {
    background: #ff0000;
}

.patient-status.normal {
    background: #22c55e;
}

.patient-status.attention {
    background: #fbbf24;
}

.upload-area {
    background: #2d3748;
    border: 2px dashed #4a5568;
    border-radius: 5px;
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    border-color: #ffa500;
    background: #3a4758;
}

.upload-area.dragover {
    border-color: #22c55e;
    background: #2d4a3d;
}

.upload-icon {
    font-size: 50px;
    color: #666;
    margin-bottom: 15px;
    display: block;
}

.upload-text {
    color: white;
    font-weight: bold;
    margin-bottom: 5px;
}

.upload-hint {
    color: #999;
    font-size: 12px;
}

.prof-document-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.prof-document-item {
    background: #2d3748;
    padding: 15px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prof-document-info {
    flex: 1;
}

.prof-document-name {
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

.prof-document-date {
    color: #999;
    font-size: 12px;
}

.prof-download-btn {
    background: #ffa500;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.prof-evolution-section {
    background: #2d3748;
    padding: 20px;
    border-radius: 5px;
}

.prof-evolution-section h3 {
    color: white;
    margin-bottom: 20px;
    border: none;
    padding: 0;
}

#prof-evolution-chart {
    width: 100%;
    height: 300px;
}

/* ========== NOVO DASHBOARD PROFISSIONAL ========== */
.prof-header-new {
    background: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.prof-header-left-new {
    display: flex;
    align-items: center;
    gap: 15px;
}

.prof-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #1e90ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.prof-header-text-new {
    display: flex;
    flex-direction: column;
}

.prof-welcome {
    color: #666;
    font-size: 14px;
}

.prof-name-new {
    color: #333;
    font-size: 18px;
    font-weight: bold;
}

.prof-header-right-new {
    display: flex;
    align-items: center;
}

.sair-link-prof-new {
    color: #666;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    padding: 5px 10px;
}

.prof-search-container {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.prof-search-wrapper {
    position: relative;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 18px;
}

.prof-search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.prof-search-input:focus {
    outline: none;
    border-color: #1e90ff;
}

.prof-critical-alert-new {
    background: #ffe0e0;
    border-left: 4px solid #ff4444;
    margin: 20px;
    padding: 15px 20px;
    border-radius: 5px;
}

.prof-alert-count {
    color: #ff0000;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
}

.prof-alert-message {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    font-size: 14px;
}

.prof-alert-icon-new {
    font-size: 18px;
}

.patient-item-clickable {
    background: white;
    padding: 15px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.patient-item-clickable:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.patient-status-wrapper {
    display: flex;
    align-items: center;
}

.patient-status-alert {
    color: #ff4444;
    font-size: 14px;
    font-weight: bold;
}

/* ========== TELA DE HISTÓRICO DE EXAMES ========== */
#paciente-exames-screen {
    background: #f0f4f8;
    min-height: 100vh;
    position: relative;
    z-index: 1000;
}

#paciente-exames-screen.active {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.exam-header {
    background: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.back-button {
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.2s;
}

.back-button:hover {
    background: #f0f0f0;
}

.patient-exam-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 0;
    border: none;
    padding: 0;
}

.exam-content-wrapper {
    padding: 30px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.exam-history-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    border: none;
    padding: 0;
}

.exam-history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.exam-history-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.exam-history-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.exam-history-item.altered {
    background: #fff5f5;
    border-left: 4px solid #ff4444;
}

.exam-history-info {
    flex: 1;
}

.exam-history-name {
    font-weight: bold;
    color: #333;
    font-size: 16px;
    margin-bottom: 5px;
}

.exam-history-date {
    color: #666;
    font-size: 14px;
}

.exam-history-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.exam-status-icon {
    font-size: 18px;
}

.exam-status-text {
    color: #ff4444;
    font-weight: bold;
    font-size: 14px;
}

/* ========== TELA DE DETALHES DO EXAME ========== */
#exame-detalhes-screen {
    background: #f0f4f8;
    min-height: 100vh;
    overflow-y: auto;
    scroll-behavior: auto;
    scroll-padding-top: 0;
}

#exame-detalhes-screen:focus {
    outline: none;
}

#exame-detalhes-screen .exam-detail-header {
    scroll-margin-top: 0;
}

.exam-detail-header {
    background: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.exam-detail-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 0;
    border: none;
    padding: 0;
}

.exam-detail-content {
    padding: 30px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.exam-result-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 800px;
}

.exam-result-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.exam-result-label {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.exam-result-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.exam-result-value.critical {
    color: #ff4444;
}

.exam-result-reference {
    font-size: 14px;
    color: #666;
}

.conduct-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.conduct-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    border: none;
    padding: 0;
}

.conduct-list {
    margin-left: 20px;
    color: #333;
    line-height: 1.8;
}

.conduct-list li {
    margin-bottom: 8px;
}

.my-conduct-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.conduct-textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: vertical;
    margin-bottom: 15px;
}

.conduct-textarea:focus {
    outline: none;
    border-color: #1e90ff;
}

.save-conduct-btn {
    background: #1e90ff;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.save-conduct-btn:hover {
    background: #1873cc;
}

.case-study-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.case-study-content {
    color: #333;
    line-height: 1.8;
    font-size: 14px;
}

.case-study-content h5 {
    font-size: 16px;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #1e90ff;
}

.case-study-content p {
    margin-bottom: 12px;
    text-align: justify;
}

.case-study-content ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.case-study-content li {
    margin-bottom: 8px;
}

.patient-alert-section {
    margin-bottom: 25px;
}

.patient-alert-critical,
.patient-alert-attention {
    background: #ffe0e0;
    border: 2px solid #ff4444;
    border-radius: 5px;
    margin-bottom: 15px;
    padding: 20px;
    display: flex;
    gap: 15px;
}

.patient-alert-attention {
    background: #fff4e0;
    border-color: #fbbf24;
}

.patient-alert-section .alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ff4444;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    flex-shrink: 0;
}

.patient-alert-section .alert-content {
    flex: 1;
}

.patient-alert-section .alert-title {
    font-weight: bold;
    font-size: 16px;
    color: #ff0000;
    margin-bottom: 5px;
}

.patient-alert-section .alert-notification {
    font-size: 14px;
    color: #666;
}
