/* Paiffer Diagnósticos - Tema moderno */
:root {
    --paiffer-primary: #1a4d7c;
    --paiffer-primary-dark: #0f3558;
    --paiffer-primary-light: #2d6a9f;
    --paiffer-accent: #4a9e3f;
    --paiffer-accent-light: #e8f5e6;
    --paiffer-bg: #f0f4f8;
    --paiffer-surface: #ffffff;
    --paiffer-text: #2c3e50;
    --paiffer-text-muted: #5a6a7a;
    --paiffer-border: #d0dce8;
    --paiffer-shadow: 0 2px 12px rgba(26, 77, 124, 0.10);
    --paiffer-radius: 8px;
    --paiffer-font: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-size: 13px;
    font-family: var(--paiffer-font);
    margin: 0;
    padding: 0;
    background: var(--paiffer-bg);
    color: var(--paiffer-text);
    line-height: 1.5;
    min-height: 100vh;
}

.cbody {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
#divHeader {
    width: 100%;
    background-color: #ffffff !important;
    background-image: none !important;
    border-bottom: 3px solid var(--paiffer-accent);
    box-shadow: var(--paiffer-shadow);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    min-height: auto;
    height: auto;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
}

.header-brand img {
    height: 72px;
    width: auto;
    display: block;
}

.header-contact {
    text-align: right;
    font-size: 0.82rem;
    color: var(--paiffer-primary-light);
    line-height: 1.6;
}

.header-contact a {
    color: var(--paiffer-primary-light);
    text-decoration: none;
}

.header-contact a:hover {
    text-decoration: underline;
}

#divConvenio {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--paiffer-primary);
    background: var(--paiffer-accent-light);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #c5e0c0;
}

#divConvenio a {
    color: var(--paiffer-primary-dark);
    text-decoration: none;
    margin-left: 8px;
}

#divConvenio a:hover {
    text-decoration: underline;
}

/* Navigation */
#divMenu {
    width: 100%;
    background: linear-gradient(135deg, var(--paiffer-primary-dark) 0%, var(--paiffer-primary) 100%);
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    padding: 0;
    height: auto;
    min-height: 42px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#divMenu div {
    height: auto;
    float: none;
    width: auto;
    border-right: 1px solid rgba(255,255,255,0.12);
    text-align: center;
    padding: 0;
    flex: 0 1 auto;
}

#divMenu div:last-child {
    border-right: none;
}

#divMenu a {
    display: block;
    padding: 11px 14px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s ease;
}

#divMenu a:hover,
#divMenu a:focus {
    background: rgba(255,255,255,0.15);
}

#divMenu a b {
    font-weight: 700;
}

/* Content area */
#divConteudo {
    float: none;
    width: 100%;
    flex: 1;
    min-height: 400px;
    padding: 20px 24px 32px;
    background: var(--paiffer-surface);
    margin: 16px;
    border-radius: var(--paiffer-radius);
    box-shadow: var(--paiffer-shadow);
}

/* Footer */
#divFooter {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    text-align: center;
    color: var(--paiffer-text-muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--paiffer-border);
    background: var(--paiffer-surface);
    position: relative;
    left: auto;
    bottom: auto;
    clear: both;
    height: auto;
}

/* Form elements */
.input,
input[type="text"],
input[type="password"],
select,
textarea {
    border: 1px solid var(--paiffer-border);
    border-radius: 4px;
    padding: 6px 10px;
    font-family: var(--paiffer-font);
    font-size: 0.85rem;
    color: var(--paiffer-text);
    background: var(--paiffer-surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus,
input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--paiffer-primary-light);
    box-shadow: 0 0 0 3px rgba(45, 106, 159, 0.15);
}

input[type="submit"],
input[type="button"],
button,
.aspNetButton {
    background: var(--paiffer-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 7px 16px;
    font-family: var(--paiffer-font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

input[type="submit"]:hover,
input[type="button"]:hover,
button:hover {
    background: var(--paiffer-primary-dark);
}

/* Typography helpers */
.titulo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--paiffer-accent);
    border-bottom: 2px solid var(--paiffer-accent-light);
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.separador {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--paiffer-accent);
    text-align: center;
    margin: 16px 0;
}

.separadorpontilhado {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: right;
    color: var(--paiffer-primary-light);
    border-bottom: 1px dashed var(--paiffer-border);
    padding-bottom: 4px;
}

.texto {
    font-size: 0.85rem;
    padding: 12px;
    background-color: var(--paiffer-surface);
    text-align: justify;
    border-radius: var(--paiffer-radius);
    border: 1px solid var(--paiffer-border);
}

h2, h3 {
    color: var(--paiffer-primary);
}

/* Grid / tables — listagens compactas */
.divGrid {
    overflow: auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 600px;
    border: 1px solid var(--paiffer-border);
    border-radius: var(--paiffer-radius);
    font-size: 12px;
}

.divGrid table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    font-size: 12px;
}

.divGrid th,
.divGrid td {
    font-size: 12px;
    padding: 2px 3px !important;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.divGrid th {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

table {
    border-collapse: collapse;
}

/* GridView ASP.NET styling */
#divGrid {
    height: auto;
    max-height: 500px;
    width: 100%;
    overflow: auto;
    border: 1px solid var(--paiffer-border);
    border-radius: var(--paiffer-radius);
    font-size: 14px;
}

#divGrid table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    font-size: 14px;
}

#divGrid table.grid-listagem {
    table-layout: auto;
}

#divGrid th,
#divGrid td {
    font-size: 14px;
    padding: 2px 3px !important;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* Paciente: quebra de linha (compartilhado) */
#divGrid td.col-paciente {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
}

#divGrid th.col-paciente {
    white-space: nowrap;
}

/* conresultados: colunas 1-5 compactas e centralizadas */
#divGrid table.grid-listagem-resultados th:nth-child(1),
#divGrid table.grid-listagem-resultados td:nth-child(1),
#divGrid table.grid-listagem-resultados th:nth-child(2),
#divGrid table.grid-listagem-resultados td:nth-child(2),
#divGrid table.grid-listagem-resultados th:nth-child(3),
#divGrid table.grid-listagem-resultados td:nth-child(3) {
    width: 22px;
    max-width: 26px;
    text-align: center;
    padding: 1px 1px !important;
}

#divGrid table.grid-listagem-resultados th:nth-child(4),
#divGrid table.grid-listagem-resultados td:nth-child(4) {
    width: 1%;
    text-align: left;
}

#divGrid table.grid-listagem-resultados th:nth-child(5),
#divGrid table.grid-listagem-resultados td:nth-child(5) {
    width: 28px;
    max-width: 32px;
    text-align: center;
}

#divGrid table.grid-listagem-resultados th:nth-child(6),
#divGrid table.grid-listagem-resultados td:nth-child(6) {
    width: 1%;
    text-align: left;
}

#divGrid table.grid-listagem-resultados th.col-paciente,
#divGrid table.grid-listagem-resultados td.col-paciente {
    width: auto;
    min-width: 140px;
    max-width: 28%;
    text-align: left;
}

#divGrid table.grid-listagem-resultados th:nth-child(n+8),
#divGrid table.grid-listagem-resultados td:nth-child(n+8) {
    width: 1%;
    text-align: center;
}

/* conexames: mesmo padrão visual de conresultados */
#divGrid table.grid-listagem-conexames th:nth-child(1),
#divGrid table.grid-listagem-conexames td:nth-child(1) {
    width: 40px;
    max-width: 44px;
    text-align: center;
    padding: 1px 2px !important;
}

#divGrid table.grid-listagem-conexames th:nth-child(2),
#divGrid table.grid-listagem-conexames td:nth-child(2),
#divGrid table.grid-listagem-conexames th:nth-child(3),
#divGrid table.grid-listagem-conexames td:nth-child(3) {
    width: 1%;
    text-align: left;
}

#divGrid table.grid-listagem-conexames th.col-paciente,
#divGrid table.grid-listagem-conexames td.col-paciente {
    width: auto;
    min-width: 110px;
    max-width: 22%;
    text-align: left;
}

#divGrid table.grid-listagem-conexames th:nth-child(5),
#divGrid table.grid-listagem-conexames td:nth-child(5) {
    width: 1%;
    text-align: center;
}

#divGrid table.grid-listagem-conexames th:nth-child(6),
#divGrid table.grid-listagem-conexames td:nth-child(6),
#divGrid table.grid-listagem-conexames th:nth-child(7),
#divGrid table.grid-listagem-conexames td:nth-child(7),
#divGrid table.grid-listagem-conexames th:nth-child(8),
#divGrid table.grid-listagem-conexames td:nth-child(8) {
    width: 1%;
    text-align: center;
}

#divGrid table.grid-listagem-conexames th:nth-child(9),
#divGrid table.grid-listagem-conexames td:nth-child(9),
#divGrid table.grid-listagem-conexames th:nth-child(10),
#divGrid table.grid-listagem-conexames td:nth-child(10) {
    width: 28px;
    max-width: 32px;
    text-align: center;
}

/* Cores de status conexames (code-behind aplica CssClass na linha) */
#divGrid table.grid-listagem-conexames tr.row-liberado td {
    background-color: #90EE90 !important;
}

#divGrid table.grid-listagem-conexames tr.row-processo td {
    background-color: #FFFFE0 !important;
}

#divGrid th {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

#divGrid img {
    height: 16px;
    width: auto;
    vertical-align: middle;
}

#divGrid input[type="checkbox"] {
    transform: scale(0.85);
    margin: 0;
}

#divGrid a {
    font-size: 13px;
}

table.grid-listagem,
table.grid-listagem th,
table.grid-listagem td {
    font-size: 14px;
    padding: 2px 3px !important;
}

table.grid-listagem th {
    font-size: 13px !important;
}

#divSuperior,
#divSuperior label,
#divSuperior select,
#divSuperior input {
    font-size: 10px;
}

#divResultado h2 {
    font-size: 0.95rem;
    margin: 4px 0 8px;
}

#divMenuPesquisa {
    float: left;
    width: 220px;
    min-height: 400px;
    padding: 16px;
    background: var(--paiffer-bg);
    border-radius: var(--paiffer-radius);
    border: 1px solid var(--paiffer-border);
    margin-right: 16px;
}

#divResultado {
    float: left;
    width: calc(100% - 252px);
    min-height: 400px;
}

#divSuperior {
    width: 100%;
    float: left;
    min-height: 36px;
    vertical-align: middle;
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--paiffer-border);
}

#divDireita {
    float: left;
    width: 200px;
    height: 400px;
}

#divPastas {
    width: 98%;
    height: 130px;
    overflow-y: auto;
    background: var(--paiffer-surface);
    border: 1px solid var(--paiffer-border);
    border-radius: 4px;
    padding: 4px;
}

#divNovaPasta {
    border: 1px solid var(--paiffer-border);
    background-color: var(--paiffer-surface);
    width: 320px;
    margin-left: -160px;
    left: 50%;
    top: 300px;
    position: absolute;
    display: none;
    padding: 16px;
    border-radius: var(--paiffer-radius);
    box-shadow: var(--paiffer-shadow);
    z-index: 100;
}

.aPasta {
    text-decoration: none;
    font-weight: 600;
    color: var(--paiffer-primary);
    font-size: 0.82rem;
}

.aPasta:hover {
    text-decoration: underline;
}

.divItemPasta {
    height: 24px;
    width: 100%;
}

.divItemPasta img {
    vertical-align: bottom;
}

.divForm {
    padding: 8px 0;
}

.divForm table td {
    padding: 4px 8px;
    vertical-align: top;
}

.style1 {
    text-align: right;
    font-weight: 600;
    color: var(--paiffer-text-muted);
    white-space: nowrap;
}

/* ASP.NET GridView */
.HeaderStyle,
table th[style*="507CD1"],
#divGrid table th,
.divGrid table th {
    background-color: var(--paiffer-primary) !important;
    color: #ffffff !important;
    font-size: 13px !important;
    padding: 3px 2px !important;
}

.FooterStyle,
.PagerStyle {
    background-color: var(--paiffer-primary-dark) !important;
    color: #ffffff !important;
}

.SelectedRowStyle {
    background-color: var(--paiffer-accent-light) !important;
}

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 40px 20px;
}

.login-card {
    background: var(--paiffer-surface);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(26, 77, 124, 0.18);
    padding: 40px 48px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    border-top: 4px solid var(--paiffer-accent);
}

.login-card h2 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: var(--paiffer-primary);
}

.login-card .login-subtitle {
    color: var(--paiffer-text-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.login-field {
    text-align: left;
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--paiffer-text-muted);
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
}

.login-card .btn-login {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--paiffer-primary) 0%, var(--paiffer-primary-dark) 100%);
}

.login-card .btn-login:hover {
    background: linear-gradient(135deg, var(--paiffer-primary-dark) 0%, #0a2844 100%);
}

.login-logo {
    margin-bottom: 24px;
}

.login-logo img {
    height: 90px;
    width: auto;
    max-width: 100%;
}

/* Responsive */
@media (max-width: 900px) {
    #divMenu {
        flex-direction: column;
    }

    #divMenu div {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    #divMenuPesquisa,
    #divResultado {
        float: none;
        width: 100%;
    }

    #divMenuPesquisa {
        margin-right: 0;
        margin-bottom: 16px;
    }

    #divConteudo {
        margin: 8px;
        padding: 16px;
    }

    .header-contact {
        text-align: left;
        width: 100%;
    }
}
