/* Panqué — capa ligera sobre Bootstrap 4.
   Unifica tipografía, tarjetas, tablas y grids sin pelearse con el framework. */

:root {
    --pq-ink: #333;
    --pq-muted: #555;
    --pq-navy: #1d4f91;
    --pq-line: #ddd;
    --pq-line-soft: #e5e5e5;
    --pq-wash: #f6f7f9;
    --pq-head: #f6f6f6;
    --pq-card: #fff;
    --pq-radius: 6px;
    --pq-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

body {
    color: var(--pq-ink);
    background: var(--pq-wash);
    font-family: Arial, Helvetica, sans-serif;
}

.main-container {
    margin-top: 24px;
    margin-bottom: 40px;
    padding-left: 24px;
    padding-right: 24px;
}

.main-container > h1:first-child,
.main-container > h2:first-child {
    margin-top: 0;
}

.main-container h1 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--pq-navy);
    margin-bottom: 1rem;
}

.main-container h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--pq-navy);
}

.main-container h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--pq-ink);
}

.navbar .form-inline {
    display: none;
}

.footer {
    background: #eef0f3;
    color: #666;
    font-size: 13px;
}

.footer a {
    color: var(--pq-navy);
}

/* Tarjetas: un nombre, varios alias de páginas viejas */
.pq-card,
.pec-card,
.study-details,
.solicitud-card,
.comments-section,
.audio-upload,
.images-section,
.add-images,
.actions,
.form-container,
.biopsia-item,
.panel {
    background: var(--pq-card);
    border: 1px solid var(--pq-line);
    border-radius: var(--pq-radius);
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: var(--pq-shadow);
}

.pq-card h2, .pq-card h3,
.pec-card h2, .pec-card h3,
.study-details h2, .study-details h3,
.solicitud-card h3,
.panel-title {
    margin-top: 0;
}

.pq-meta,
.pec-meta {
    color: var(--pq-muted);
    margin: 0 0 8px 0;
}

.pec-badge {
    display: inline-block;
    background: #eef5ff;
    color: var(--pq-navy);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 13px;
    margin-bottom: 8px;
}

.panel-heading {
    margin: -16px -18px 12px;
    padding: 12px 18px;
    background: var(--pq-head);
    border-bottom: 1px solid var(--pq-line-soft);
    border-radius: var(--pq-radius) var(--pq-radius) 0 0;
}

.panel-body {
    padding: 0;
}

.panel-body.text-center {
    padding: 8px 0;
}

/* Tablas de ficha (PE / PEC) */
.pec-table,
.details-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: var(--pq-card);
}

.pec-table th, .pec-table td,
.details-table th, .details-table td {
    border: 1px solid var(--pq-line-soft);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

.pec-table th,
.details-table th {
    background: var(--pq-head);
    font-weight: 600;
}

.pec-table th,
.details-table th:first-child,
.details-table td:first-child {
    width: 11rem;
    overflow-wrap: anywhere;
}

.pec-table td,
.details-table th:last-child,
.details-table td:last-child {
    width: auto;
}

.pec-block {
    white-space: pre-wrap;
    margin: 0;
    font-family: inherit;
}

.pec-actions {
    margin-top: 14px;
}

.pec-actions a.btn {
    margin: 4px 6px 4px 0;
}

.image-preview img,
.image-container img,
.solicitud-card img,
.pec-images img {
    border: 1px solid #ccc;
    border-radius: 5px;
    max-width: 100%;
}

.pec-images {
    padding-left: 0;
    margin: 0;
}

.pec-images li {
    list-style: none;
    margin: 0 0 14px 0;
}

.biopsias-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.biopsia-item .resultado {
    background: var(--pq-wash);
    padding: 12px 14px;
    border-radius: var(--pq-radius);
    margin-bottom: 10px;
}

.acciones {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Grids web2py */
.web2py_grid {
    background: var(--pq-card);
    border: 1px solid var(--pq-line);
    border-radius: var(--pq-radius);
    padding: 12px 14px 16px;
    box-shadow: var(--pq-shadow);
}

.web2py_grid thead th,
.web2py_grid tfoot td {
    background-color: var(--pq-head);
}

.web2py_paginator {
    background-color: var(--pq-head);
    border-radius: 0 0 var(--pq-radius) var(--pq-radius);
}

/* Formularios SQLFORM */
form table {
    max-width: 100%;
}

td.w2p_fl,
#web2py_user_form td.w2p_fl,
.web2py_grid .web2py_form td.w2p_fl {
    font-weight: 600;
    color: var(--pq-muted);
    width: 220px;
    white-space: normal;
}

#web2py_user_form {
    background: var(--pq-card);
    margin: 0 auto 24px;
    box-shadow: var(--pq-shadow);
    border: 1px solid var(--pq-line);
    border-radius: var(--pq-radius);
    padding: 20px 24px;
}

.comments-section .solicitud-card {
    box-shadow: none;
}

.btn-xs {
    padding: 0.15rem 0.45rem;
    font-size: 0.75rem;
}

.list-group {
    margin-bottom: 18px;
}

.edit-link {
    margin-top: 12px;
}

.pq-links a,
.pq-links .btn {
    margin: 0 8px 8px 0;
}

/* Avisos y flash: sin amarillo chillón (informes, cobranza, toasts). */
.alert-warning {
    --bs-alert-color: #4a453d;
    --bs-alert-bg: #f4eee6;
    --bs-alert-border-color: #d4c4ae;
    --bs-alert-link-color: #4a453d;
    background-color: #f4eee6;
    border-color: #d4c4ae;
    color: #4a453d;
}

div.w2p_flash.alert {
    background-color: #eef0f3;
    border-color: #d0d4da;
    color: #333;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    -webkit-text-fill-color: var(--pq-ink);
    caret-color: var(--pq-ink);
}

