body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f5f5f5;
}

.top-bar {
    background-color: #E53935; /* barra horizontal "vermelha" */
    height: 58px;
    display: flex;
    align-items: center;
    /*justify-content: space-between;*/
    padding: 0 16px;
    box-sizing: border-box;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto; /* não estica, mantém tamanho natural */
}

.top-bar-center {
    flex: 1 1 auto;        /* ocupa o espaço restante */
    text-align: center;
}

.top-bar-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 0.03em;
}

.logo-interne {
    height: 38px;
}

.hamburger {
    background: none;
    border: none;
    padding: 6px 4px;          /* antes era 0 – aumenta a área clicável */
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;                  /* espaço um tiquinho maior entre as barras */
}

.hamburger span {
    width: 24px;               /* antes 20px – mais comprido */
    height: 3px;               /* antes 2px – mais grosso */
    background-color: #ffffff;
    display: block;
    border-radius: 2px;        /* cantinhos levemente arredondados, fica mais bonito */
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 1.1rem;    /* antes era menor */
    font-weight: 500;
}

.user-info {
    color: #ffffff;        /* garante que o nome fique branco */
}

.logout-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.3rem;     /* aumenta o tamanho do "Sair" */
    font-weight: 600;      /* um pouco mais forte */
}

.logout-link:hover {
    text-decoration: underline;
}

.logout-icon {
    display: none;
}

.page-content {
    padding: 24px;
}

.privacy-notice {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    width: 100%;
    max-width: 1180px;
    margin: 0 0 18px 0;
    padding: 24px 28px;
    border: 1px solid #e48682;
    border-left: 8px solid #E53935;
    border-radius: 8px;
    background-color: #fff4f2;
    color: #2f1f1f;
    box-shadow: 0 4px 18px rgba(183,28,28,0.12);
}

.privacy-notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background-color: #E53935;
    color: #ffffff;
    font-size: 1.75rem;
}

.privacy-notice h2 {
    margin: 0 0 12px 0;
    color: #b71c1c;
    font-size: 1.75rem;
    line-height: 1.25;
}

.privacy-notice p {
    margin: 0 0 12px 0;
    max-width: 1120px;
    font-size: 1.05rem;
    line-height: 1.55;
}

.privacy-notice p:last-child {
    margin-bottom: 0;
}

.home-notes {
    max-width: 820px;
    margin-left: auto;
    color: #555;
    font-size: 0.68rem;
    line-height: 1.3;
    text-align: right;
}

.home-notes .home-section {
    margin-top: 8px;
}

.home-notes h2 {
    margin: 0 0 3px 0;
    color: #444;
    font-size: 0.78rem;
    line-height: 1.2;
}

.home-notes blockquote,
.home-notes p {
    margin: 0 0 6px 0;
}

.home-notes .quote-author {
    color: #666;
}

/* Menu lateral (hambúrguer) */
.side-menu {
    position: fixed;
    top: 56px; 
    left: -240px;
    width: 240px;
    /* ALTERAÇÕES AQUI: */
    height: calc(100vh - 56px); /* Calcula a altura real: 100% da tela menos a barra de topo */
    overflow-y: auto;           /* Habilita o scroll vertical quando os itens excedem a altura */
    background-color: #ffffff;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    transition: left 0.2s ease-in-out;
    z-index: 1000;
}

/* Estilização opcional da barra de rolagem para ficar mais elegante e fina */
.side-menu::-webkit-scrollbar {
    width: 6px;
}

.side-menu::-webkit-scrollbar-thumb {
    background-color: #cccccc;
    border-radius: 10px;
}

.side-menu.open {
    left: 0;
}

.side-menu ul {
    list-style: none;
    margin: 0;
    padding: 16px 0;
}

.side-menu li {
    margin: 0;
}

.side-menu a {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
}

.side-menu a:hover {
    background-color: #f0f0f0;
}

/* Overlay para escurecer o fundo quando o menu está aberto */
.content-overlay {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out;
    z-index: 999;
}

.content-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Login page layout */
.login-container {
    max-width: 360px;
    margin: 60px auto 0 auto;
    background-color: #ffffff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-container h1 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.4rem;
}

.login-container label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 12px;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.login-container button {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: none;
    background-color: #E53935;  /* mesma cor da barra */
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.login-container button:hover {
    background-color: #d32f2f;  /* um tom ligeiramente mais escuro no hover */
}

.error-message {
    color: #c62828;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

/* Tabela de consulta de pacientes */
.atendimentos-scroll{
  max-height: 220px;   /*  420 shows ~10 rows but I changed to 220px in order to show 5 rows */
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 6px;
}

/* optional: keep header visible while scrolling */
.atendimentos-scroll thead th{
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

/* ===== Migração Neri – Administração de Views ===== */

.content-container {
    padding: 1rem 2rem;
}

/* Tabela de listagem de views */
.table-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.table-list th,
.table-list td {
    border: 1px solid #ddd;
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
}

.table-list th {
    background-color: #f5f5f5;
    text-align: left;
}

/* Botões padrão */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Botão principal – combinando com a barra vermelha */
.btn-primary {
    background-color: #E53935;        /* mesma cor da top-bar */
    color: #ffffff;
    border: 1px solid #b71c1c;
}

.btn-primary:hover {
    background-color: #d32f2f;
}

/* Botão secundário (Voltar, Editar etc.) */
.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

/* Formulário de edição/criação de views */
.form-group {
    margin-bottom: 0.8rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
}

/* Área dos botões no formulário */
.form-actions {
    margin-top: 1rem;
}

/* Título de seção no menu hamburguer */
.menu-section {
    margin-top: 0.8rem;
    font-weight: 700;
    padding: 0.4rem 0.6rem;
    opacity: 0.85;
}

/* Cadastro: fonte maior + rótulos em negrito */
.cadastro-body { font-size: 1.05rem; }
.cadastro-ident .patient-code { font-weight: 700; font-size: 1.05rem; }
.cadastro-ident .patient-name { font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.cadastro-table td.label { font-weight: 700 !important; }

/* Painel MV (cadastro) */
.mv-title{
    font-weight: 700;
    font-size: 0.95rem; /* mesmo "peso" visual do conteúdo */
}

.mv-body{
    font-size: 0.95rem;
}

.mv-key{
    font-weight: 700;
    color: #444;
}

.mv-val{
    color: #111;
}

.mv-strong{
    font-weight: 700;
}

.mv-name{
    font-weight: 800;
    letter-spacing: 0.2px;
}

.mv-block{
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.mv-row{
    display: grid;
    grid-template-columns: 160px 1fr; /* um pouco mais largo p/ caber "Telefone Comercial:" */
    gap: 6px;                         /* era 10px */
    padding: 3px 0;                   /* era 6px 0 */
    border-bottom: 1px solid #eee;
}

.mv-row-last{
    border-bottom: none;
}

.mv-section{
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.mv-truncate{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Título (header) do w2ui grid (não é o cabeçalho das colunas) */
.w2ui-grid .w2ui-grid-header{
    text-align: center;
    font-weight: 800;
}

@media (max-width: 700px) {
    .top-bar {
        height: 50px;
        min-height: 50px;
        padding: 6px 8px;
        gap: 6px;
        overflow: hidden;
        flex-wrap: nowrap;
    }

    .top-bar-left,
    .top-bar-right {
        gap: 6px;
    }

    .top-bar-center {
        min-width: 0;
        text-align: center;
    }

    .top-bar-title {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.88rem;
        line-height: 1.1;
        letter-spacing: 0;
    }

    .logo-interne {
        height: 28px;
    }

    .user-info {
        display: none;
    }

    .logout-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        font-size: 1.25rem;
        text-decoration: none;
    }

    .logout-text {
        display: none;
    }

    .logout-icon {
        display: inline-block;
    }

    .page-content {
        padding: 16px 14px;
    }

    .privacy-notice {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 18px 16px;
        margin-bottom: 18px;
    }

    .privacy-notice-icon {
        width: 42px;
        height: 42px;
        font-size: 1.35rem;
    }

    .privacy-notice h2 {
        font-size: 1.35rem;
    }

    .privacy-notice p {
        font-size: 0.95rem;
    }

    .home-notes {
        max-width: none;
        font-size: 0.56rem;
        line-height: 1.18;
        text-align: right;
    }

    .home-notes h2 {
        font-size: 0.66rem;
    }

    .home-notes .quote-author {
        font-size: 0.62rem;
        line-height: 1.22;
    }
}


@media (max-width: 420px) {
    .top-bar-title {
        font-size: 0.78rem;
    }

    .logo-interne {
        height: 24px;
    }

    .hamburger span {
        width: 22px;
    }
}
