/* ===== PORTAL DO PACIENTE - CSS ===== */

/* --- Reset & Base --- */
.portal-paciente {
    font-family: 'Inter', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Navbar --- */
.portal-navbar {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.portal-navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.portal-navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.portal-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.portal-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.portal-brand-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.portal-brand-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
}

/* Menu Toggle (mobile) */
.portal-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 1.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.portal-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Nav Links */
.portal-nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.portal-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

.portal-nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.portal-nav-link i {
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

.portal-nav-link--logout {
    color: rgba(255, 255, 255, 0.6);
    margin-left: 0.5rem;
}

.portal-nav-link--logout:hover {
    color: #ffcdd2;
    background: rgba(244, 67, 54, 0.2);
}

/* --- Dashboard Cards --- */
.portal-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 0;
    width: 100%;
}

.portal-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.portal-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.portal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.portal-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.portal-card-icon--blue {
    background: #e3f2fd;
    color: #1565c0;
}

.portal-card-icon--green {
    background: #e8f5e9;
    color: #2e7d32;
}

.portal-card-icon--purple {
    background: #f3e5f5;
    color: #7b1fa2;
}

.portal-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.portal-card-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-card-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* --- Content Area --- */
.portal-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    width: 100%;
    flex: 1;
}

#adianti_content {
    min-height: 400px;
}

#adianti_div_content {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    min-height: 300px;
}

/* --- Footer --- */
.portal-footer {
    text-align: center;
    padding: 1rem;
    color: #9ca3af;
    font-size: 0.75rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    margin-top: auto;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .portal-menu-toggle {
        display: block;
    }

    .portal-nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #0d47a1;
        flex-direction: column;
        padding: 0.5rem;
        gap: 0.25rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .portal-nav-links.open {
        display: flex;
    }

    .portal-nav-link {
        width: 100%;
        padding: 0.75rem 1rem;
        border-radius: 8px;
    }

    .portal-nav-link--logout {
        margin-left: 0;
        margin-top: 0.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 0.75rem;
    }

    .portal-navbar {
        position: relative;
    }

    .portal-cards {
        grid-template-columns: 1fr;
    }

    .portal-brand-subtitle {
        display: none;
    }

    #adianti_div_content {
        padding: 1rem;
        border-radius: 8px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .portal-nav-link span {
        display: none;
    }

    .portal-nav-link {
        padding: 0.5rem 0.75rem;
    }

    .portal-nav-link i {
        font-size: 1.1rem;
    }
}

/* --- Print --- */
@media print {
    .portal-navbar,
    .portal-dashboard,
    .portal-footer {
        display: none;
    }

    #adianti_div_content {
        box-shadow: none;
        padding: 0;
    }

    .portal-paciente {
        background: #fff;
    }
}

/* --- Overrides para forms Adianti dentro do portal --- */
.portal-paciente .form-container {
    margin: 0;
}

.portal-paciente .panel {
    border: none;
    box-shadow: none;
}

.portal-paciente .panel-heading {
    background: transparent;
    border-bottom: 2px solid #e5e7eb;
    padding: 0.75rem 0;
}

.portal-paciente .panel-heading .panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a2e;
}

.portal-paciente .btn-primary {
    background: #1a73e8;
    border-color: #1a73e8;
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
}

.portal-paciente .btn-primary:hover {
    background: #1565c0;
    border-color: #1565c0;
}
